Commit 0d5e319239d49a7f5714f052176a966ca2ab688f

Authored by Rodrigo Souto
1 parent 2366c4a2

Reinclude jquery-timepicker-addon not as a submodule

Showing 112 changed files with 13354 additions and 0 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 112 files displayed.

public/javascripts/jquery-timepicker-addon/.jshintrc 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +{
  2 + "curly": true,
  3 + "eqeqeq": true,
  4 + "immed": true,
  5 + "latedef": true,
  6 + "newcap": true,
  7 + "noarg": true,
  8 + "sub": true,
  9 + "undef": true,
  10 + "unused": true,
  11 + "boss": true,
  12 + "eqnull": true,
  13 + "node": true,
  14 + "es5": true
  15 +}
... ...
public/javascripts/jquery-timepicker-addon/CONTRIBUTING.md 0 → 100644
... ... @@ -0,0 +1,31 @@
  1 +# Contributing
  2 +
  3 +## Important notes
  4 +Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory!
  5 +
  6 +### Code style
  7 +Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already (tabs).**
  8 +
  9 +### PhantomJS
  10 +While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers.
  11 +
  12 +## Modifying the code
  13 +First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.
  14 +
  15 +Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started).
  16 +
  17 +1. Fork and clone the repo.
  18 +1. Run `npm install` to install all dependencies (including Grunt).
  19 +1. Run `grunt` to grunt this project.
  20 +
  21 +Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.
  22 +
  23 +## Submitting pull requests
  24 +
  25 +1. Create a new branch, please don't work in your `master` branch directly. Please pull from the `dev` branch.
  26 +1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail.
  27 +1. Fix stuff.
  28 +1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done.
  29 +1. Open `test/*.html` unit test file(s) in actual browser to ensure tests pass everywhere.
  30 +1. Update the documentation to reflect any changes.
  31 +1. Push to your fork and submit a pull request (back to the `dev` branch).
... ...
public/javascripts/jquery-timepicker-addon/Gruntfile.js 0 → 100644
... ... @@ -0,0 +1,147 @@
  1 +'use strict';
  2 +
  3 +module.exports = function(grunt) {
  4 +
  5 + // Project configuration.
  6 + grunt.initConfig({
  7 + // Metadata.
  8 + pkg: grunt.file.readJSON('jquery-ui-timepicker-addon.json'),
  9 + banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
  10 + //'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
  11 + '<%= pkg.modified %>\n' +
  12 + '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
  13 + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
  14 + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
  15 + // Task configuration.
  16 + clean: {
  17 + files: ['dist']
  18 + },
  19 + copy: {
  20 + dist: {
  21 + files: [
  22 + //{ src: 'src/index.html', dest: 'dist/index.html' },
  23 + { src: 'src/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.css' },
  24 + { src: 'src/jquery-ui-sliderAccess.js', dest: 'dist/jquery-ui-sliderAccess.js' },
  25 + { src: 'src/i18n/jquery-ui-timepicker-*.js', dest: 'dist/i18n/', expand:true, flatten: true }
  26 + ]
  27 + }
  28 + },
  29 + concat: {
  30 + dist: {
  31 + options: {
  32 + banner: '<%= banner %>',
  33 + stripBanners: true
  34 + },
  35 + src: ['src/<%= pkg.name %>.js'],
  36 + dest: 'dist/<%= pkg.name %>.js'
  37 + },
  38 + docs: {
  39 + src: [
  40 + 'src/docs/header.html',
  41 + 'src/docs/intro.html',
  42 + 'src/docs/options.html',
  43 + 'src/docs/formatting.html',
  44 + 'src/docs/i18n.html',
  45 + 'src/docs/examples.html',
  46 + 'src/docs/footer.html'
  47 + ],
  48 + dest: 'dist/index.html'
  49 + }
  50 + },
  51 + uglify: {
  52 + options: {
  53 + banner: '<%= banner %>'
  54 + },
  55 + dist: {
  56 + src: '<%= concat.dist.dest %>',
  57 + dest: 'dist/<%= pkg.name %>.min.js'
  58 + }
  59 + },
  60 + cssmin: {
  61 + options: {
  62 + banner: '<%= banner %>'
  63 + },
  64 + dist: {
  65 + src: 'dist/<%= pkg.name %>.css',
  66 + dest: 'dist/<%= pkg.name %>.min.css'
  67 + }
  68 + },
  69 + replace: {
  70 + dist: {
  71 + options: {
  72 + variables: {
  73 + version: '<%= pkg.version %>',
  74 + timestamp: '<%= pkg.modified %>'
  75 + },
  76 + prefix: '@@'
  77 + },
  78 + files: [
  79 + { src: 'dist/<%= pkg.name %>.js', dest: 'dist/<%= pkg.name %>.js' },
  80 + { src: 'dist/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.css' },
  81 + { src: 'dist/index.html', dest: 'dist/index.html' }
  82 + ]
  83 + }
  84 + },
  85 + jasmine: {
  86 + src: 'src/<%= pkg.name %>.js',
  87 + options: {
  88 + specs: 'test/*_spec.js',
  89 + vendor: [
  90 + 'http://code.jquery.com/jquery-1.10.1.min.js',
  91 + 'http://code.jquery.com/ui/1.10.3/jquery-ui.min.js',
  92 + 'http://github.com/searls/jasmine-fixture/releases/1.0.5/1737/jasmine-fixture.js'
  93 + ]
  94 + }
  95 + },
  96 + jshint: {
  97 + gruntfile: {
  98 + options: {
  99 + jshintrc: '.jshintrc'
  100 + },
  101 + src: 'Gruntfile.js'
  102 + },
  103 + src: {
  104 + options: {
  105 + jshintrc: 'src/.jshintrc'
  106 + },
  107 + src: ['src/**/*.js']
  108 + },
  109 + test: {
  110 + options: {
  111 + jshintrc: 'test/.jshintrc'
  112 + },
  113 + src: ['test/**/*.js']
  114 + }
  115 + },
  116 + watch: {
  117 + gruntfile: {
  118 + files: '<%= jshint.gruntfile.src %>',
  119 + tasks: ['jshint:gruntfile']
  120 + },
  121 + src: {
  122 + files: 'src/**',//'<%= jshint.src.src %>',
  123 + tasks: ['jshint:src', 'jasmine', 'clean', 'copy', 'concat', 'replace', 'uglify', 'cssmin']
  124 + //tasks: ['jshint:src', 'jasmine']
  125 + },
  126 + test: {
  127 + files: '<%= jshint.test.src %>',
  128 + tasks: ['jshint:test', 'jasmine']
  129 + }
  130 + }
  131 + });
  132 +
  133 + // These plugins provide necessary tasks.
  134 + grunt.loadNpmTasks('grunt-contrib-clean');
  135 + grunt.loadNpmTasks('grunt-contrib-concat');
  136 + grunt.loadNpmTasks('grunt-contrib-copy');
  137 + grunt.loadNpmTasks('grunt-replace');
  138 + grunt.loadNpmTasks('grunt-contrib-uglify');
  139 + grunt.loadNpmTasks('grunt-contrib-cssmin');
  140 + grunt.loadNpmTasks('grunt-contrib-jasmine');
  141 + grunt.loadNpmTasks('grunt-contrib-jshint');
  142 + grunt.loadNpmTasks('grunt-contrib-watch');
  143 +
  144 + // Default task.
  145 + grunt.registerTask('default', ['jshint', 'jasmine', 'clean', 'copy', 'concat', 'replace', 'uglify', 'cssmin']);
  146 +
  147 +};
... ...
public/javascripts/jquery-timepicker-addon/LICENSE-MIT 0 → 100644
... ... @@ -0,0 +1,22 @@
  1 +Copyright (c) 2013 Trent Richardson
  2 +
  3 +Permission is hereby granted, free of charge, to any person
  4 +obtaining a copy of this software and associated documentation
  5 +files (the "Software"), to deal in the Software without
  6 +restriction, including without limitation the rights to use,
  7 +copy, modify, merge, publish, distribute, sublicense, and/or sell
  8 +copies of the Software, and to permit persons to whom the
  9 +Software is furnished to do so, subject to the following
  10 +conditions:
  11 +
  12 +The above copyright notice and this permission notice shall be
  13 +included in all copies or substantial portions of the Software.
  14 +
  15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  17 +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  19 +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  20 +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21 +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  22 +OTHER DEALINGS IN THE SOFTWARE.
... ...
public/javascripts/jquery-timepicker-addon/README.md 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +jQuery Timepicker Addon
  2 +=======================
  3 +
  4 +About
  5 +-----
  6 +- Author: [Trent Richardson](http://trentrichardson.com)
  7 +- Documentation: [http://trentrichardson.com/examples/timepicker/](http://trentrichardson.com/examples/timepicker/)
  8 +- Twitter: [@practicalweb](http://twitter.com/practicalweb)
  9 +
  10 +Use
  11 +---
  12 +I recommend getting the eBook [Handling Time](https://sellfy.com/p/8gxZ) as it has a lot of example code to get started. The quick and dirty:
  13 +
  14 +- To use this plugin you must include jQuery (1.6+) and jQuery UI with datepicker (and optionally slider).
  15 +- Include timepicker-addon script located in the `dist` directory.
  16 +- now use timepicker with `$('#selector').datetimepicker()` or `$('#selector').timepicker()`.
  17 +
  18 +There is also a [Bower](http://bower.io/) package named `jqueryui-timepicker-addon`. Beware there are other similar package names that point to forks which may not be current.
  19 +
  20 +Contributing Code - Please Read!
  21 +--------------------------------
  22 +- All code contributions and bug reports are much appreciated.
  23 +- Please be sure to apply your fixes to the "dev" branch.
  24 +- Also note tabs are appreciated over spaces.
  25 +- Please read the [CONTRIBUTING.md][contributingmd] for more on using Grunt to produce builds.
  26 +
  27 +[contributingmd]: CONTRIBUTING.md
0 28 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/bower.json 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +{
  2 + "name": "jqueryui-timepicker-addon",
  3 + "version": "1.4.4",
  4 + "repository": {
  5 + "type": "git",
  6 + "url": "git://github.com/trentrichardson/jQuery-Timepicker-Addon.git"
  7 + },
  8 + "dependencies": {
  9 + "jquery-ui": "~1.9.2"
  10 + }
  11 +}
0 12 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/composer.json 0 → 100644
... ... @@ -0,0 +1,26 @@
  1 +{
  2 + "name": "trentrichardson/jquery-timepicker-addon",
  3 + "description": "Adds a timepicker to jQueryUI Datepicker.",
  4 + "type": "component",
  5 + "homepage": "http://trentrichardson.com/examples/timepicker/",
  6 + "license": [
  7 + "MIT"
  8 + ],
  9 + "require": {
  10 + "robloach/component-installer": "*",
  11 + "components/jqueryui": "~1.10.2"
  12 + },
  13 + "extra": {
  14 + "component": {
  15 + "name": "jquery-timepicker-addon",
  16 + "scripts": [
  17 + "dist/jquery-ui-sliderAccess.js",
  18 + "dist/jquery-ui-timepicker-addon.js",
  19 + "dist/i18n/**"
  20 + ],
  21 + "styles": [
  22 + "dist/jquery-ui-timepicker-addon.css"
  23 + ]
  24 + }
  25 + }
  26 +}
0 27 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-af.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Afrikaans translation for the jQuery Timepicker Addon */
  2 +/* Written by Deon Heyns */
  3 +(function($) {
  4 + $.timepicker.regional['af'] = {
  5 + timeOnlyTitle: 'Kies Tyd',
  6 + timeText: 'Tyd ',
  7 + hourText: 'Ure ',
  8 + minuteText: 'Minute',
  9 + secondText: 'Sekondes',
  10 + millisecText: 'Millisekondes',
  11 + microsecText: 'Mikrosekondes',
  12 + timezoneText: 'Tydsone',
  13 + currentText: 'Huidige Tyd',
  14 + closeText: 'Klaar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['af']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-am.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Armenian translation for the jQuery Timepicker Addon */
  2 +/* Written by Artavazd Avetisyan artavazda@hotmail.com */
  3 +(function($) {
  4 + $.timepicker.regional['am'] = {
  5 + timeOnlyTitle: 'Ընտրեք ժամանակը',
  6 + timeText: 'Ժամանակը',
  7 + hourText: 'Ժամ',
  8 + minuteText: 'Րոպե',
  9 + secondText: 'Վարկյան',
  10 + millisecText: 'Միլիվարկյան',
  11 + microsecText: 'Միկրովարկյան',
  12 + timezoneText: 'Ժամային գոտին',
  13 + currentText: 'Այժմ',
  14 + closeText: 'Փակել',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['am']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-bg.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Bulgarian translation for the jQuery Timepicker Addon */
  2 +/* Written by Plamen Kovandjiev */
  3 +(function($) {
  4 + $.timepicker.regional['bg'] = {
  5 + timeOnlyTitle: 'Изберете време',
  6 + timeText: 'Време',
  7 + hourText: 'Час',
  8 + minuteText: 'Минути',
  9 + secondText: 'Секунди',
  10 + millisecText: 'Милисекунди',
  11 + microsecText: 'Микросекунди',
  12 + timezoneText: 'Часови пояс',
  13 + currentText: 'Сега',
  14 + closeText: 'Затвори',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['bg']);
  21 +})(jQuery);
0 22 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-ca.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Catalan translation for the jQuery Timepicker Addon */
  2 +/* Written by Sergi Faber */
  3 +(function($) {
  4 + $.timepicker.regional['ca'] = {
  5 + timeOnlyTitle: 'Escollir una hora',
  6 + timeText: 'Hora',
  7 + hourText: 'Hores',
  8 + minuteText: 'Minuts',
  9 + secondText: 'Segons',
  10 + millisecText: 'Milisegons',
  11 + microsecText: 'Microsegons',
  12 + timezoneText: 'Fus horari',
  13 + currentText: 'Ara',
  14 + closeText: 'Tancar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ca']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-cs.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Czech translation for the jQuery Timepicker Addon */
  2 +/* Written by Ondřej Vodáček */
  3 +(function($) {
  4 + $.timepicker.regional['cs'] = {
  5 + timeOnlyTitle: 'Vyberte čas',
  6 + timeText: 'Čas',
  7 + hourText: 'Hodiny',
  8 + minuteText: 'Minuty',
  9 + secondText: 'Vteřiny',
  10 + millisecText: 'Milisekundy',
  11 + microsecText: 'Mikrosekundy',
  12 + timezoneText: 'Časové pásmo',
  13 + currentText: 'Nyní',
  14 + closeText: 'Zavřít',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['dop.', 'AM', 'A'],
  17 + pmNames: ['odp.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['cs']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-da.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Danish translation for the jQuery Timepicker Addon */
  2 +/* Written by Lars H. Jensen (http://www.larshj.dk) */
  3 +(function ($) {
  4 + $.timepicker.regional['da'] = {
  5 + timeOnlyTitle: 'Vælg tid',
  6 + timeText: 'Tid',
  7 + hourText: 'Time',
  8 + minuteText: 'Minut',
  9 + secondText: 'Sekund',
  10 + millisecText: 'Millisekund',
  11 + microsecText: 'Mikrosekund',
  12 + timezoneText: 'Tidszone',
  13 + currentText: 'Nu',
  14 + closeText: 'Luk',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['am', 'AM', 'A'],
  17 + pmNames: ['pm', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['da']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-de.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* German translation for the jQuery Timepicker Addon */
  2 +/* Written by Marvin */
  3 +(function($) {
  4 + $.timepicker.regional['de'] = {
  5 + timeOnlyTitle: 'Zeit wählen',
  6 + timeText: 'Zeit',
  7 + hourText: 'Stunde',
  8 + minuteText: 'Minute',
  9 + secondText: 'Sekunde',
  10 + millisecText: 'Millisekunde',
  11 + microsecText: 'Mikrosekunde',
  12 + timezoneText: 'Zeitzone',
  13 + currentText: 'Jetzt',
  14 + closeText: 'Fertig',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['vorm.', 'AM', 'A'],
  17 + pmNames: ['nachm.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['de']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-el.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Hellenic translation for the jQuery Timepicker Addon */
  2 +/* Written by Christos Pontikis */
  3 +(function($) {
  4 + $.timepicker.regional['el'] = {
  5 + timeOnlyTitle: 'Επιλογή ώρας',
  6 + timeText: 'Ώρα',
  7 + hourText: 'Ώρες',
  8 + minuteText: 'Λεπτά',
  9 + secondText: 'Δευτερόλεπτα',
  10 + millisecText: 'μιλιδευτερόλεπτο',
  11 + microsecText: 'Microseconds',
  12 + timezoneText: 'Ζώνη ώρας',
  13 + currentText: 'Τώρα',
  14 + closeText: 'Κλείσιμο',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['π.μ.', 'AM', 'A'],
  17 + pmNames: ['μ.μ.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['el']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-es.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Spanish translation for the jQuery Timepicker Addon */
  2 +/* Written by Ianaré Sévi */
  3 +(function($) {
  4 + $.timepicker.regional['es'] = {
  5 + timeOnlyTitle: 'Elegir una hora',
  6 + timeText: 'Hora',
  7 + hourText: 'Horas',
  8 + minuteText: 'Minutos',
  9 + secondText: 'Segundos',
  10 + millisecText: 'Milisegundos',
  11 + microsecText: 'Microsegundos',
  12 + timezoneText: 'Huso horario',
  13 + currentText: 'Ahora',
  14 + closeText: 'Cerrar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['es']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-et.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Estonian translation for the jQuery Timepicker Addon */
  2 +/* Written by Karl Sutt (karl@sutt.ee) */
  3 +(function($) {
  4 + $.timepicker.regional['et'] = {
  5 + timeOnlyTitle: 'Vali aeg',
  6 + timeText: 'Aeg',
  7 + hourText: 'Tund',
  8 + minuteText: 'Minut',
  9 + secondText: 'Sekund',
  10 + millisecText: 'Millisekundis',
  11 + microsecText: 'Mikrosekundis',
  12 + timezoneText: 'Ajavöönd',
  13 + currentText: 'Praegu',
  14 + closeText: 'Valmis',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['et']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-eu.js 0 → 100644
... ... @@ -0,0 +1,22 @@
  1 +/* Basque trannslation for JQuery Timepicker Addon */
  2 +/* Translated by Xabi Fer */
  3 +/* Fixed by Asier Iturralde Sarasola - iametza interaktiboa */
  4 +(function($) {
  5 + $.timepicker.regional['eu'] = {
  6 + timeOnlyTitle: 'Aukeratu ordua',
  7 + timeText: 'Ordua',
  8 + hourText: 'Orduak',
  9 + minuteText: 'Minutuak',
  10 + secondText: 'Segundoak',
  11 + millisecText: 'Milisegundoak',
  12 + microsecText: 'Mikrosegundoak',
  13 + timezoneText: 'Ordu-eremua',
  14 + currentText: 'Orain',
  15 + closeText: 'Itxi',
  16 + timeFormat: 'HH:mm',
  17 + amNames: ['a.m.', 'AM', 'A'],
  18 + pmNames: ['p.m.', 'PM', 'P'],
  19 + isRTL: false
  20 + };
  21 + $.timepicker.setDefaults($.timepicker.regional['eu']);
  22 +})(jQuery);
0 23 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-fi.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Finnish translation for the jQuery Timepicker Addon */
  2 +/* Written by Juga Paazmaya (http://github.com/paazmaya) */
  3 +(function($) {
  4 + $.timepicker.regional['fi'] = {
  5 + timeOnlyTitle: 'Valitse aika',
  6 + timeText: 'Aika',
  7 + hourText: 'Tunti',
  8 + minuteText: 'Minuutti',
  9 + secondText: 'Sekunti',
  10 + millisecText: 'Millisekunnin',
  11 + microsecText: 'Mikrosekuntia',
  12 + timezoneText: 'Aikavyöhyke',
  13 + currentText: 'Nyt',
  14 + closeText: 'Sulje',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['ap.', 'AM', 'A'],
  17 + pmNames: ['ip.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['fi']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-fr.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* French translation for the jQuery Timepicker Addon */
  2 +/* Written by Thomas Lété */
  3 +(function($) {
  4 + $.timepicker.regional['fr'] = {
  5 + timeOnlyTitle: 'Choisir une heure',
  6 + timeText: 'Heure',
  7 + hourText: 'Heures',
  8 + minuteText: 'Minutes',
  9 + secondText: 'Secondes',
  10 + millisecText: 'Millisecondes',
  11 + microsecText: 'Microsecondes',
  12 + timezoneText: 'Fuseau horaire',
  13 + currentText: 'Maintenant',
  14 + closeText: 'Terminé',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['fr']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-gl.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Galician translation for the jQuery Timepicker Addon */
  2 +/* Written by David Barral */
  3 +(function($) {
  4 + $.timepicker.regional['gl'] = {
  5 + timeOnlyTitle: 'Elixir unha hora',
  6 + timeText: 'Hora',
  7 + hourText: 'Horas',
  8 + minuteText: 'Minutos',
  9 + secondText: 'Segundos',
  10 + millisecText: 'Milisegundos',
  11 + microsecText: 'Microssegundos',
  12 + timezoneText: 'Fuso horario',
  13 + currentText: 'Agora',
  14 + closeText: 'Pechar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['gl']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-he.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Hebrew translation for the jQuery Timepicker Addon */
  2 +/* Written by Lior Lapid */
  3 +(function($) {
  4 + $.timepicker.regional["he"] = {
  5 + timeOnlyTitle: "בחירת זמן",
  6 + timeText: "שעה",
  7 + hourText: "שעות",
  8 + minuteText: "דקות",
  9 + secondText: "שניות",
  10 + millisecText: "אלפית השנייה",
  11 + microsecText: "מיקרו",
  12 + timezoneText: "אזור זמן",
  13 + currentText: "עכשיו",
  14 + closeText:"סגור",
  15 + timeFormat: "HH:mm",
  16 + amNames: ['לפנה"צ', 'AM', 'A'],
  17 + pmNames: ['אחה"צ', 'PM', 'P'],
  18 + isRTL: true
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional["he"]);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-hr.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Croatian translation for the jQuery Timepicker Addon */
  2 +/* Written by Mladen */
  3 +(function($) {
  4 + $.timepicker.regional['hr'] = {
  5 + timeOnlyTitle: 'Odaberi vrijeme',
  6 + timeText: 'Vrijeme',
  7 + hourText: 'Sati',
  8 + minuteText: 'Minute',
  9 + secondText: 'Sekunde',
  10 + millisecText: 'Milisekunde',
  11 + microsecText: 'Mikrosekunde',
  12 + timezoneText: 'Vremenska zona',
  13 + currentText: 'Sada',
  14 + closeText: 'Gotovo',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['hr']);
  21 +})(jQuery);
0 22 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-hu.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Hungarian translation for the jQuery Timepicker Addon */
  2 +/* Written by Vas Gábor */
  3 +(function($) {
  4 + $.timepicker.regional['hu'] = {
  5 + timeOnlyTitle: 'Válasszon időpontot',
  6 + timeText: 'Idő',
  7 + hourText: 'Óra',
  8 + minuteText: 'Perc',
  9 + secondText: 'Másodperc',
  10 + millisecText: 'Milliszekundumos',
  11 + microsecText: 'Ezredmásodperc',
  12 + timezoneText: 'Időzóna',
  13 + currentText: 'Most',
  14 + closeText: 'Kész',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['de.', 'AM', 'A'],
  17 + pmNames: ['du.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['hu']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-id.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Indonesian translation for the jQuery Timepicker Addon */
  2 +/* Written by Nia */
  3 +(function($) {
  4 + $.timepicker.regional['id'] = {
  5 + timeOnlyTitle: 'Pilih Waktu',
  6 + timeText: 'Waktu',
  7 + hourText: 'Pukul',
  8 + minuteText: 'Menit',
  9 + secondText: 'Detik',
  10 + millisecText: 'Milidetik',
  11 + microsecText: 'Mikrodetik',
  12 + timezoneText: 'Zona Waktu',
  13 + currentText: 'Sekarang',
  14 + closeText: 'OK',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['id']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-it.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Italian translation for the jQuery Timepicker Addon */
  2 +/* Written by Marco "logicoder" Del Tongo */
  3 +(function($) {
  4 + $.timepicker.regional['it'] = {
  5 + timeOnlyTitle: 'Scegli orario',
  6 + timeText: 'Orario',
  7 + hourText: 'Ora',
  8 + minuteText: 'Minuti',
  9 + secondText: 'Secondi',
  10 + millisecText: 'Millisecondi',
  11 + microsecText: 'Microsecondi',
  12 + timezoneText: 'Fuso orario',
  13 + currentText: 'Adesso',
  14 + closeText: 'Chiudi',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['m.', 'AM', 'A'],
  17 + pmNames: ['p.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['it']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-ja.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Japanese translation for the jQuery Timepicker Addon */
  2 +/* Written by Jun Omae */
  3 +(function($) {
  4 + $.timepicker.regional['ja'] = {
  5 + timeOnlyTitle: '時間を選択',
  6 + timeText: '時間',
  7 + hourText: '時',
  8 + minuteText: '分',
  9 + secondText: '秒',
  10 + millisecText: 'ミリ秒',
  11 + microsecText: 'マイクロ秒',
  12 + timezoneText: 'タイムゾーン',
  13 + currentText: '現時刻',
  14 + closeText: '閉じる',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['午前', 'AM', 'A'],
  17 + pmNames: ['午後', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ja']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-ko.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Korean translation for the jQuery Timepicker Addon */
  2 +/* Written by Genie */
  3 +(function($) {
  4 + $.timepicker.regional['ko'] = {
  5 + timeOnlyTitle: '시간 선택',
  6 + timeText: '시간',
  7 + hourText: '시',
  8 + minuteText: '분',
  9 + secondText: '초',
  10 + millisecText: '밀리초',
  11 + microsecText: '마이크로',
  12 + timezoneText: '표준 시간대',
  13 + currentText: '현재 시각',
  14 + closeText: '닫기',
  15 + timeFormat: 'tt h:mm',
  16 + amNames: ['오전', 'AM', 'A'],
  17 + pmNames: ['오후', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ko']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-lt.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Lithuanian translation for the jQuery Timepicker Addon */
  2 +/* Written by Irmantas Šiupšinskas */
  3 +(function($) {
  4 + $.timepicker.regional['lt'] = {
  5 + timeOnlyTitle: 'Pasirinkite laiką',
  6 + timeText: 'Laikas',
  7 + hourText: 'Valandos',
  8 + minuteText: 'Minutės',
  9 + secondText: 'Sekundės',
  10 + millisecText: 'Milisekundės',
  11 + microsecText: 'Mikrosekundės',
  12 + timezoneText: 'Laiko zona',
  13 + currentText: 'Dabar',
  14 + closeText: 'Uždaryti',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['priešpiet', 'AM', 'A'],
  17 + pmNames: ['popiet', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['lt']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-nl.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Dutch translation for the jQuery Timepicker Addon */
  2 +/* Written by Martijn van der Lee */
  3 +(function($) {
  4 + $.timepicker.regional['nl'] = {
  5 + timeOnlyTitle: 'Tijdstip',
  6 + timeText: 'Tijd',
  7 + hourText: 'Uur',
  8 + minuteText: 'Minuut',
  9 + secondText: 'Seconde',
  10 + millisecText: 'Milliseconde',
  11 + microsecText: 'Microseconde',
  12 + timezoneText: 'Tijdzone',
  13 + currentText: 'Vandaag',
  14 + closeText: 'Sluiten',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['nl']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-no.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Norwegian translation for the jQuery Timepicker Addon */
  2 +/* Written by Morten Hauan (http://hauan.me) */
  3 +(function($) {
  4 + $.timepicker.regional['no'] = {
  5 + timeOnlyTitle: 'Velg tid',
  6 + timeText: 'Tid',
  7 + hourText: 'Time',
  8 + minuteText: 'Minutt',
  9 + secondText: 'Sekund',
  10 + millisecText: 'Millisekund',
  11 + microsecText: 'mikrosekund',
  12 + timezoneText: 'Tidssone',
  13 + currentText: 'Nå',
  14 + closeText: 'Lukk',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['am', 'AM', 'A'],
  17 + pmNames: ['pm', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['no']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-pl.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Polish translation for the jQuery Timepicker Addon */
  2 +/* Written by Michał Pena */
  3 +(function($) {
  4 + $.timepicker.regional['pl'] = {
  5 + timeOnlyTitle: 'Wybierz godzinę',
  6 + timeText: 'Czas',
  7 + hourText: 'Godzina',
  8 + minuteText: 'Minuta',
  9 + secondText: 'Sekunda',
  10 + millisecText: 'Milisekunda',
  11 + microsecText: 'Mikrosekunda',
  12 + timezoneText: 'Strefa czasowa',
  13 + currentText: 'Teraz',
  14 + closeText: 'Gotowe',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['pl']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-pt-BR.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Brazilian Portuguese translation for the jQuery Timepicker Addon */
  2 +/* Written by Diogo Damiani (diogodamiani@gmail.com) */
  3 +(function ($) {
  4 + $.timepicker.regional['pt-BR'] = {
  5 + timeOnlyTitle: 'Escolha o horário',
  6 + timeText: 'Horário',
  7 + hourText: 'Hora',
  8 + minuteText: 'Minutos',
  9 + secondText: 'Segundos',
  10 + millisecText: 'Milissegundos',
  11 + microsecText: 'Microssegundos',
  12 + timezoneText: 'Fuso horário',
  13 + currentText: 'Agora',
  14 + closeText: 'Fechar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['pt-BR']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-pt.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Portuguese translation for the jQuery Timepicker Addon */
  2 +/* Written by Luan Almeida */
  3 +(function($) {
  4 + $.timepicker.regional['pt'] = {
  5 + timeOnlyTitle: 'Escolha uma hora',
  6 + timeText: 'Hora',
  7 + hourText: 'Horas',
  8 + minuteText: 'Minutos',
  9 + secondText: 'Segundos',
  10 + millisecText: 'Milissegundos',
  11 + microsecText: 'Microssegundos',
  12 + timezoneText: 'Fuso horário',
  13 + currentText: 'Agora',
  14 + closeText: 'Fechar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['pt']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-ro.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Romanian translation for the jQuery Timepicker Addon */
  2 +/* Written by Romeo Adrian Cioaba */
  3 +(function($) {
  4 + $.timepicker.regional['ro'] = {
  5 + timeOnlyTitle: 'Alegeţi o oră',
  6 + timeText: 'Timp',
  7 + hourText: 'Ore',
  8 + minuteText: 'Minute',
  9 + secondText: 'Secunde',
  10 + millisecText: 'Milisecunde',
  11 + microsecText: 'Microsecunde',
  12 + timezoneText: 'Fus orar',
  13 + currentText: 'Acum',
  14 + closeText: 'Închide',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ro']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-ru.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Russian translation for the jQuery Timepicker Addon */
  2 +/* Written by Trent Richardson */
  3 +(function($) {
  4 + $.timepicker.regional['ru'] = {
  5 + timeOnlyTitle: 'Выберите время',
  6 + timeText: 'Время',
  7 + hourText: 'Часы',
  8 + minuteText: 'Минуты',
  9 + secondText: 'Секунды',
  10 + millisecText: 'Миллисекунды',
  11 + microsecText: 'Микросекунды',
  12 + timezoneText: 'Часовой пояс',
  13 + currentText: 'Сейчас',
  14 + closeText: 'Закрыть',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ru']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-sk.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Slovak translation for the jQuery Timepicker Addon */
  2 +/* Written by David Vallner */
  3 +(function($) {
  4 + $.timepicker.regional['sk'] = {
  5 + timeOnlyTitle: 'Zvoľte čas',
  6 + timeText: 'Čas',
  7 + hourText: 'Hodiny',
  8 + minuteText: 'Minúty',
  9 + secondText: 'Sekundy',
  10 + millisecText: 'Milisekundy',
  11 + microsecText: 'Mikrosekundy',
  12 + timezoneText: 'Časové pásmo',
  13 + currentText: 'Teraz',
  14 + closeText: 'Zavrieť',
  15 + timeFormat: 'H:m',
  16 + amNames: ['dop.', 'AM', 'A'],
  17 + pmNames: ['pop.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['sk']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-sr-RS.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Serbian cyrilic translation for the jQuery Timepicker Addon */
  2 +/* Written by Vladimir Jelovac */
  3 +(function($) {
  4 + $.timepicker.regional['sr-RS'] = {
  5 + timeOnlyTitle: 'Одаберите време',
  6 + timeText: 'Време',
  7 + hourText: 'Сати',
  8 + minuteText: 'Минути',
  9 + secondText: 'Секунде',
  10 + millisecText: 'Милисекунде',
  11 + microsecText: 'Микросекунде',
  12 + timezoneText: 'Временска зона',
  13 + currentText: 'Сада',
  14 + closeText: 'Затвори',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['sr-RS']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-sr-YU.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Serbian latin translation for the jQuery Timepicker Addon */
  2 +/* Written by Vladimir Jelovac */
  3 +(function($) {
  4 + $.timepicker.regional['sr-YU'] = {
  5 + timeOnlyTitle: 'Odaberite vreme',
  6 + timeText: 'Vreme',
  7 + hourText: 'Sati',
  8 + minuteText: 'Minuti',
  9 + secondText: 'Sekunde',
  10 + millisecText: 'Milisekunde',
  11 + microsecText: 'Mikrosekunde',
  12 + timezoneText: 'Vremenska zona',
  13 + currentText: 'Sada',
  14 + closeText: 'Zatvori',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['sr-YU']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-sv.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Swedish translation for the jQuery Timepicker Addon */
  2 +/* Written by Nevon */
  3 +(function($) {
  4 + $.timepicker.regional['sv'] = {
  5 + timeOnlyTitle: 'Välj en tid',
  6 + timeText: 'Tid',
  7 + hourText: 'Timme',
  8 + minuteText: 'Minut',
  9 + secondText: 'Sekund',
  10 + millisecText: 'Millisekund',
  11 + microsecText: 'Mikrosekund',
  12 + timezoneText: 'Tidszon',
  13 + currentText: 'Nu',
  14 + closeText: 'Stäng',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['sv']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-th.js 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +/* Thai translation for the jQuery Timepicker Addon */
  2 +/* Written by Yote Wachirapornpongsa */
  3 +(function($) {
  4 + $.timepicker.regional['th'] = {
  5 + timeOnlyTitle: 'เลือกเวลา',
  6 + timeText: 'เวลา ',
  7 + hourText: 'ชั่วโมง ',
  8 + minuteText: 'นาที',
  9 + secondText: 'วินาที',
  10 + millisecText: 'มิลลิวินาที',
  11 + microsecText: 'ไมโคริวินาที',
  12 + timezoneText: 'เขตเวลา',
  13 + currentText: 'เวลาปัจจุบัน',
  14 + closeText: 'ปิด',
  15 + timeFormat: 'hh:mm tt'
  16 + };
  17 + $.timepicker.setDefaults($.timepicker.regional['th']);
  18 +})(jQuery);
0 19 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-tr.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Turkish translation for the jQuery Timepicker Addon */
  2 +/* Written by Fehmi Can Saglam, Edited by Goktug Ozturk */
  3 +(function($) {
  4 + $.timepicker.regional['tr'] = {
  5 + timeOnlyTitle: 'Zaman Seçiniz',
  6 + timeText: 'Zaman',
  7 + hourText: 'Saat',
  8 + minuteText: 'Dakika',
  9 + secondText: 'Saniye',
  10 + millisecText: 'Milisaniye',
  11 + microsecText: 'Mikrosaniye',
  12 + timezoneText: 'Zaman Dilimi',
  13 + currentText: 'Şu an',
  14 + closeText: 'Tamam',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['ÖÖ', 'Ö'],
  17 + pmNames: ['ÖS', 'S'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['tr']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-uk.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Ukrainian translation for the jQuery Timepicker Addon */
  2 +/* Written by Sergey Noskov */
  3 +(function($) {
  4 + $.timepicker.regional['uk'] = {
  5 + timeOnlyTitle: 'Виберіть час',
  6 + timeText: 'Час',
  7 + hourText: 'Години',
  8 + minuteText: 'Хвилини',
  9 + secondText: 'Секунди',
  10 + millisecText: 'Мілісекунди',
  11 + microsecText: 'Мікросекунди',
  12 + timezoneText: 'Часовий пояс',
  13 + currentText: 'Зараз',
  14 + closeText: 'Закрити',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['uk']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-vi.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Vietnamese translation for the jQuery Timepicker Addon */
  2 +/* Written by Nguyen Dinh Trung */
  3 +(function($) {
  4 + $.timepicker.regional['vi'] = {
  5 + timeOnlyTitle: 'Chọn giờ',
  6 + timeText: 'Thời gian',
  7 + hourText: 'Giờ',
  8 + minuteText: 'Phút',
  9 + secondText: 'Giây',
  10 + millisecText: 'Mili giây',
  11 + microsecText: 'Micrô giây',
  12 + timezoneText: 'Múi giờ',
  13 + currentText: 'Hiện thời',
  14 + closeText: 'Đóng',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['SA', 'S'],
  17 + pmNames: ['CH', 'C'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['vi']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-zh-CN.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Simplified Chinese translation for the jQuery Timepicker Addon /
  2 +/ Written by Will Lu */
  3 +(function($) {
  4 + $.timepicker.regional['zh-CN'] = {
  5 + timeOnlyTitle: '选择时间',
  6 + timeText: '时间',
  7 + hourText: '小时',
  8 + minuteText: '分钟',
  9 + secondText: '秒钟',
  10 + millisecText: '毫秒',
  11 + microsecText: '微秒',
  12 + timezoneText: '时区',
  13 + currentText: '现在时间',
  14 + closeText: '关闭',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['zh-CN']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/i18n/jquery-ui-timepicker-zh-TW.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Chinese translation for the jQuery Timepicker Addon */
  2 +/* Written by Alang.lin */
  3 +(function($) {
  4 + $.timepicker.regional['zh-TW'] = {
  5 + timeOnlyTitle: '選擇時分秒',
  6 + timeText: '時間',
  7 + hourText: '時',
  8 + minuteText: '分',
  9 + secondText: '秒',
  10 + millisecText: '毫秒',
  11 + microsecText: '微秒',
  12 + timezoneText: '時區',
  13 + currentText: '現在時間',
  14 + closeText: '確定',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['上午', 'AM', 'A'],
  17 + pmNames: ['下午', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['zh-TW']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/index.html 0 → 100644
... ... @@ -0,0 +1,980 @@
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2 +<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3 + <head>
  4 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5 + <title>Adding a Timepicker to jQuery UI Datepicker</title>
  6 + <meta name="Description" content="jQuery Timepicker Addon. Add a timepicker to your jQuery UI Datepicker. With options to show only time, format time, and much more." />
  7 + <meta name="Keywords" content="jQuery, UI, datepicker, timepicker, datetime, time, format" />
  8 +
  9 + <style type="text/css">
  10 + body,img,p,h1,h2,h3,h4,h5,h6,form,table,td,ul,ol,li,dl,dt,dd,pre,blockquote,fieldset,label{
  11 + margin:0;
  12 + padding:0;
  13 + border:0;
  14 + }
  15 + body{ background-color: #777; border-top: solid 10px #7b94b2; font: 90% Arial, Helvetica, sans-serif; padding: 20px; }
  16 + h1,h2,h3{ margin: 10px 0; }
  17 + h1{}
  18 + h2{ color: #f66; }
  19 + h3{ color: #6b84a2; }
  20 + p{ margin: 10px 0; }
  21 + a{ color: #7b94b2; }
  22 + ul,ol{ margin: 10px 0 10px 40px; }
  23 + li{ margin: 4px 0; }
  24 + dl.defs{ margin: 10px 0 10px 40px; }
  25 + dl.defs dt{ font-weight: bold; line-height: 20px; margin: 10px 0 0 0; }
  26 + dl.defs dd{ margin: -20px 0 10px 160px; padding-bottom: 10px; border-bottom: solid 1px #eee;}
  27 + pre{ font-size: 12px; line-height: 16px; padding: 5px 5px 5px 10px; margin: 10px 0; background-color: #e4f4d4; border-left: solid 5px #9EC45F; overflow: auto; tab-size: 4; -moz-tab-size: 4; -o-tab-size: 4; -webkit-tab-size: 4; }
  28 +
  29 + .wrapper{ background-color: #ffffff; width: 800px; border: solid 1px #eeeeee; padding: 20px; margin: 0 auto; }
  30 + #tabs{ margin: 20px -20px; border: none; }
  31 + #tabs, #ui-datepicker-div, .ui-datepicker{ font-size: 85%; }
  32 + .clear{ clear: both; }
  33 +
  34 + .example-container{ background-color: #f4f4f4; border-bottom: solid 2px #777777; margin: 0 0 20px 40px; padding: 20px; }
  35 + .example-container input{ border: solid 1px #aaa; padding: 4px; width: 175px; }
  36 + .ebook{}
  37 + .ebook img.ebookimg{ float: left; margin: 0 15px 15px 0; width: 100px; }
  38 + .ebook .buyp a iframe{ margin-bottom: -5px; }
  39 + </style>
  40 +
  41 + <link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" />
  42 + <link rel="stylesheet" media="all" type="text/css" href="jquery-ui-timepicker-addon.css" />
  43 +
  44 + </head>
  45 + <body>
  46 + <div class="wrapper">
  47 + <h1>Adding a Timepicker to jQuery UI Datepicker</h1>
  48 +
  49 + <p>The timepicker addon adds a timepicker to jQuery UI Datepicker, thus the datepicker and slider components (jQueryUI) are required for using any of these. In addition all datepicker options are still available through the timepicker addon.</p>
  50 +
  51 + <p>If you are interested in contributing to Timepicker Addon please <a href="http://github.com/trentrichardson/jQuery-Timepicker-Addon" title="Check out Timepicker on GitHub">check it out on GitHub</a>. If you do make additions please keep in mind I enjoy tabs over spaces,.. But contributions are welcome in any form.</p>
  52 +
  53 + <p><a href="http://trentrichardson.com" title="Back to Blog">Back to Blog</a> or <a href="http://twitter.com/practicalweb" title="Follow Me on Twitter">Follow on Twitter</a></p>
  54 +
  55 + <a href="http://carbounce.com" title="Car Bounce" style="float: right;display: inline-block;width:380px;padding: 10px;background-color: #fbfbfb;border: dotted 4px #e8e8e8;color: #9EC45F;font-size: 16px;text-decoration:none;letter-spacing:1px;"><img src="http://carbounce.com/img/logo_small.png" alt="Car Bounce" align="left" style="margin-right: 20px;"/>Try my new app to keep you informed of your car's financing status and value.</a>
  56 +
  57 + <h2>Donation</h2>
  58 + <p>Has this Timepicker Addon been helpful to you?</p>
  59 + <div class="donation">
  60 + <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  61 + <input type="hidden" name="cmd" value="_s-xclick">
  62 + <input type="hidden" name="hosted_button_id" value="C2QQHR7JQGD28">
  63 + <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  64 + <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
  65 + </form>
  66 + </div>
  67 +
  68 + <div id="tabs">
  69 + <ul>
  70 + <li><a href="#tp-getting-started" title="Getting Started">Getting Started</a></li>
  71 + <li><a href="#tp-options" title="Options">Options</a></li>
  72 + <li><a href="#tp-formatting" title="Examples">Formatting</a></li>
  73 + <li><a href="#tp-localization" title="Examples">Localization</a></li>
  74 + <li><a href="#tp-examples" title="Examples">Examples</a></li>
  75 + </ul>
  76 +<!-- ############################################################################# -->
  77 +<!-- Getting Started
  78 +<!-- ############################################################################# -->
  79 +<div id="tp-getting-started">
  80 + <h2>Getting Started</h2>
  81 +
  82 + <h3>Highly Recommended</h3>
  83 +
  84 + <h4>Handling Time eBook</h4>
  85 + <div class="ebook">
  86 + <p>Check out the <a href="http://trentrichardson.com/ebooks/handling-time/" title="Handling Time eBook">Handling Time eBook</a> to learn from the basic setup to advanced i18n usage, and from client's javascript to the server's database.</p>
  87 + <a href="http://trentrichardson.com/ebooks/handling-time/" title="Handling Time eBook"><img src="http://trentrichardson.com/wp-content/uploads/2013/04/time-book-titlepage.jpg" alt="Handling Time eBook" style="float:left;width:100px;margin:0 15px 15px 0;" /></a>
  88 + <p class="buyp"><a href="https://sellfy.com/p/8gxZ" id="8gxZ" class="sellfy-buy-button">buy</a> eBook + Example code</p>
  89 + <p class="buyp"><a href="https://sellfy.com/p/LvAG" id="LvAG" class="sellfy-buy-button">buy</a> eBook</p>
  90 + <div class="clear"></div>
  91 + </div>
  92 +
  93 + <h4>Subscribe to Blog and Twitter</h4>
  94 + <p><a href="http://trentrichardson.com" title="Subscribe to TrentRichardson.com via email">Subscribe to my blog via email</a> and follow <a href="http://twitter.com/practicalweb" title="Follow Me on Twitter">@PracticalWeb</a> on Twitter. I post for nearly every new version, so you know about updates.</p>
  95 + <div class="clear"></div>
  96 + <br />
  97 +
  98 + <h3>Download</h3>
  99 + <p><a href="jquery-ui-timepicker-addon.js" title="Download Timepicker Addon">Download Timepicker Addon</a></p>
  100 + <p><a href="http://github.com/trentrichardson/jQuery-Timepicker-Addon" title="Check out Timepicker on GitHub">Download/Contribute on GitHub</a> (Need the entire repo? Find a bug? See if its fixed here)</p>
  101 + <p>There is a small bit of required CSS (<a href="jquery-ui-timepicker-addon.css" title="Download CSS">Download</a>):</p>
  102 +<pre>/* css for timepicker */
  103 +.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
  104 +.ui-timepicker-div dl { text-align: left; }
  105 +.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
  106 +.ui-timepicker-div dl dd { margin: 0 10px 10px 45%; }
  107 +.ui-timepicker-div td { font-size: 90%; }
  108 +.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
  109 +
  110 +.ui-timepicker-rtl{ direction: rtl; }
  111 +.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
  112 +.ui-timepicker-rtl dl dt{ float: right; clear: right; }
  113 +.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
  114 +</pre>
  115 + <br />
  116 +
  117 + <h3>Requirements</h3>
  118 + <p>You also need to include jQuery and jQuery UI with datepicker and slider wigits. You should include them in your page in the following order:</p>
  119 + <ol>
  120 + <li>jQuery</li>
  121 + <li>jQueryUI (with datepicker and slider wigits)</li>
  122 + <li>Timepicker</li>
  123 + </ol>
  124 +
  125 + <br />
  126 + <h3>Version</h3>
  127 + <p>Version 1.4.4</p>
  128 +
  129 + <p>Last updated on 2014-03-29</p>
  130 + <p>jQuery Timepicker Addon is currently available for use in all personal or commercial projects under the MIT license.</p>
  131 + <p><a href="http://trentrichardson.com/Impromptu/MIT-LICENSE.txt" title="MIT License">MIT License</a></p>
  132 +
  133 +</div>
  134 +
  135 +<!-- ############################################################################# -->
  136 +<!-- Options
  137 +<!-- ############################################################################# -->
  138 +<div id="tp-options">
  139 + <h2>Options</h2>
  140 +
  141 + <p>The timepicker does inherit all options from datepicker. However, there are many options that are shared by them both, and many timepicker only options:</p>
  142 +
  143 + <h3>Localization Options</h3>
  144 + <dl class="defs">
  145 + <dt>currentText</dt>
  146 + <dd><em>Default: "Now", A Localization Setting</em> - Text for the Now button.</dd>
  147 +
  148 + <dt>closeText</dt>
  149 + <dd><em>Default: "Done", A Localization Setting</em> - Text for the Close button.</dd>
  150 +
  151 + <dt>amNames</dt>
  152 + <dd><em>Default: ['AM', 'A'], A Localization Setting</em> - Array of strings to try and parse against to determine AM.</dd>
  153 +
  154 + <dt>pmNames</dt>
  155 + <dd><em>Default: ['PM', 'P'], A Localization Setting</em> - Array of strings to try and parse against to determine PM.</dd>
  156 +
  157 + <dt>timeFormat</dt>
  158 + <dd><em>Default: "HH:mm", A Localization Setting</em> - String of format tokens to be replaced with the time. <a href="#tp-formatting" title="Formatting" onclick="$('#tabs').tabs('select',2);">See Formatting</a>.</dd>
  159 +
  160 + <dt>timeSuffix</dt>
  161 + <dd><em>Default: "", A Localization Setting</em> - String to place after the formatted time.</dd>
  162 +
  163 + <dt>timeOnlyTitle</dt>
  164 + <dd><em>Default: "Choose Time", A Localization Setting</em> - Title of the wigit when using only timepicker.</dd>
  165 +
  166 + <dt>timeText</dt>
  167 + <dd><em>Default: "Time", A Localization Setting</em> - Label used within timepicker for the formatted time.</dd>
  168 +
  169 + <dt>hourText</dt>
  170 + <dd><em>Default: "Hour", A Localization Setting</em> - Label used to identify the hour slider.</dd>
  171 +
  172 + <dt>minuteText</dt>
  173 + <dd><em>Default: "Minute", A Localization Setting</em> - Label used to identify the minute slider.</dd>
  174 +
  175 + <dt>secondText</dt>
  176 + <dd><em>Default: "Second", A Localization Setting</em> - Label used to identify the second slider.</dd>
  177 +
  178 + <dt>millisecText</dt>
  179 + <dd><em>Default: "Millisecond", A Localization Setting</em> - Label used to identify the millisecond slider.</dd>
  180 +
  181 + <dt>microsecText</dt>
  182 + <dd><em>Default: "Microsecond", A Localization Setting</em> - Label used to identify the microsecond slider.</dd>
  183 +
  184 + <dt>timezoneText</dt>
  185 + <dd><em>Default: "Timezone", A Localization Setting</em> - Label used to identify the timezone slider.</dd>
  186 +
  187 + <dt>isRTL</dt>
  188 + <dd><em>Default: false, A Localization Setting</em> - Right to Left support.</dd>
  189 + </dl>
  190 +
  191 + <h3>Alt Field Options</h3>
  192 + <dl class="defs">
  193 +
  194 + <dt>altFieldTimeOnly</dt>
  195 + <dd><em>Default: true</em> - When altField is used from datepicker altField will only receive the formatted time and the original field only receives date.</dd>
  196 +
  197 + <dt>altSeparator</dt>
  198 + <dd><em>Default: (separator option)</em> - String placed between formatted date and formatted time in the altField.</dd>
  199 +
  200 + <dt>altTimeSuffix</dt>
  201 + <dd><em>Default: (timeSuffix option)</em> - String always placed after the formatted time in the altField.</dd>
  202 +
  203 + <dt>altTimeFormat</dt>
  204 + <dd><em>Default: (timeFormat option)</em> - The time format to use with the altField.</dd>
  205 + </dl>
  206 +
  207 + <h3>Timezone Options</h3>
  208 + <dl class="defs">
  209 +
  210 + <dt>timezoneList</dt>
  211 + <dd><em>Default: [generated timezones]</em> - An array of timezones used to populate the timezone select. Can be an array of values or an array of objects: { label: "EDT", value: -240 }. The value should be the offset number in minutes. So "-0400" which is the format "-hhmm", would equate to -240 minutes.</dd>
  212 + </dl>
  213 +
  214 + <h3>Time Field Options</h3>
  215 + <dl class="defs">
  216 +
  217 + <dt>controlType</dt>
  218 + <dd><em>Default: 'slider'</em> - Whether to use 'slider' or 'select'. If 'slider' is unavailable through jQueryUI, 'select' will be used. For advanced usage you may pass an object which implements "create", "options", "value" methods to use controls other than sliders or selects. See the _controls property in the source code for more details.
  219 +<pre>{
  220 + create: function(tp_inst, obj, unit, val, min, max, step){
  221 + // generate whatever controls you want here, just return obj
  222 + },
  223 + options: function(tp_inst, obj, unit, opts, val){
  224 + // if val==undefined return the value, else return obj
  225 + },
  226 + value: function(tp_inst, obj, unit, val){
  227 + // if val==undefined return the value, else return obj
  228 + }
  229 +}</pre>
  230 + </dd>
  231 +
  232 + <dt>showHour</dt>
  233 + <dd><em>Default: null</em> - Whether to show the hour control. The default of null will use detection from timeFormat.</dd>
  234 +
  235 + <dt>showMinute</dt>
  236 + <dd><em>Default: null</em> - Whether to show the minute control. The default of null will use detection from timeFormat.</dd>
  237 +
  238 + <dt>showSecond</dt>
  239 + <dd><em>Default: null</em> - Whether to show the second control. The default of null will use detection from timeFormat.</dd>
  240 +
  241 + <dt>showMillisec</dt>
  242 + <dd><em>Default: null</em> - Whether to show the millisecond control. The default of null will use detection from timeFormat.</dd>
  243 +
  244 + <dt>showMicrosec</dt>
  245 + <dd><em>Default: null</em> - Whether to show the microsecond control. The default of null will use detection from timeFormat.</dd>
  246 +
  247 + <dt>showTimezone</dt>
  248 + <dd><em>Default: null</em> - Whether to show the timezone select.</dd>
  249 +
  250 + <dt>showTime</dt>
  251 + <dd><em>Default: true</em> - Whether to show the time selected within the datetimepicker.</dd>
  252 +
  253 + <dt>stepHour</dt>
  254 + <dd><em>Default: 1</em> - Hours per step the slider makes.</dd>
  255 +
  256 + <dt>stepMinute</dt>
  257 + <dd><em>Default: 1</em> - Minutes per step the slider makes.</dd>
  258 +
  259 + <dt>stepSecond</dt>
  260 + <dd><em>Default: 1</em> - Seconds per step the slider makes.</dd>
  261 +
  262 + <dt>stepMillisec</dt>
  263 + <dd><em>Default: 1</em> - Milliseconds per step the slider makes.</dd>
  264 +
  265 + <dt>stepMicrosec</dt>
  266 + <dd><em>Default: 1</em> - Microseconds per step the slider makes.</dd>
  267 +
  268 + <dt>hour</dt>
  269 + <dd><em>Default: 0</em> - Initial hour set.</dd>
  270 +
  271 + <dt>minute</dt>
  272 + <dd><em>Default: 0</em> - Initial minute set.</dd>
  273 +
  274 + <dt>second</dt>
  275 + <dd><em>Default: 0</em> - Initial second set.</dd>
  276 +
  277 + <dt>millisec</dt>
  278 + <dd><em>Default: 0</em> - Initial millisecond set.</dd>
  279 +
  280 + <dt>microsec</dt>
  281 + <dd><em>Default: 0</em> - Initial microsecond set. Note: Javascript's native Date object does not natively support microseconds. Timepicker adds ability to simply Date.setMicroseconds(m) and Date.getMicroseconds(). Date comparisons will not acknowledge microseconds. Use this only for display purposes.</dd>
  282 +
  283 + <dt>timezone</dt>
  284 + <dd><em>Default: null</em> - Initial timezone set. This is the offset in minutes. If null the browser's local timezone will be used. If you're timezone is "-0400" you would use -240. For backwards compatibility you may pass "-0400", however the timezone is stored in minutes and more reliable.</dd>
  285 +
  286 + <dt>hourMin</dt>
  287 + <dd><em>Default: 0</em> - The minimum hour allowed for all dates.</dd>
  288 +
  289 + <dt>minuteMin</dt>
  290 + <dd><em>Default: 0</em> - The minimum minute allowed for all dates.</dd>
  291 +
  292 + <dt>secondMin</dt>
  293 + <dd><em>Default: 0</em> - The minimum second allowed for all dates.</dd>
  294 +
  295 + <dt>millisecMin</dt>
  296 + <dd><em>Default: 0</em> - The minimum millisecond allowed for all dates.</dd>
  297 +
  298 + <dt>microsecMin</dt>
  299 + <dd><em>Default: 0</em> - The minimum microsecond allowed for all dates.</dd>
  300 +
  301 + <dt>hourMax</dt>
  302 + <dd><em>Default: 23</em> - The maximum hour allowed for all dates.</dd>
  303 +
  304 + <dt>minuteMax</dt>
  305 + <dd><em>Default: 59</em> - The maximum minute allowed for all dates.</dd>
  306 +
  307 + <dt>secondMax</dt>
  308 + <dd><em>Default: 59</em> - The maximum second allowed for all dates.</dd>
  309 +
  310 + <dt>millisecMax</dt>
  311 + <dd><em>Default: 999</em> - The maximum millisecond allowed for all dates.</dd>
  312 +
  313 + <dt>microsecMax</dt>
  314 + <dd><em>Default: 999</em> - The maximum microsecond allowed for all dates.</dd>
  315 +
  316 + <dt>hourGrid</dt>
  317 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be generated under the slider. This number represents the units (in hours) between labels.</dd>
  318 +
  319 + <dt>minuteGrid</dt>
  320 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be generated under the slider. This number represents the units (in minutes) between labels.</dd>
  321 +
  322 + <dt>secondGrid</dt>
  323 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in seconds) between labels.</dd>
  324 +
  325 + <dt>millisecGrid</dt>
  326 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in milliseconds) between labels.</dd>
  327 +
  328 + <dt>microsecGrid</dt>
  329 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in microseconds) between labels.</dd>
  330 + </dl>
  331 +
  332 + <h3>Other Options</h3>
  333 + <dl class="defs">
  334 + <dt>showButtonPanel</dt>
  335 + <dd><em>Default: true</em> - Whether to show the button panel at the bottom. This is generally needed.</dd>
  336 +
  337 + <dt>timeOnly</dt>
  338 + <dd><em>Default: false</em> - Hide the datepicker and only provide a time interface.</dd>
  339 +
  340 + <dt>timeOnlyShowDate</dt>
  341 + <dd><em>Default: false</em> - Show the date and time in the input, but only allow the timepicker.</dd>
  342 +
  343 + <dt>onSelect</dt>
  344 + <dd><em>Default: null</em> - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).</dd>
  345 +
  346 + <dt>alwaysSetTime</dt>
  347 + <dd><em>Default: true</em> - Always have a time set internally, even before user has chosen one.</dd>
  348 +
  349 + <dt>separator</dt>
  350 + <dd><em>Default: " "</em> - When formatting the time this string is placed between the formatted date and formatted time.</dd>
  351 +
  352 + <dt>pickerTimeFormat</dt>
  353 + <dd><em>Default: (timeFormat option)</em> - How to format the time displayed within the timepicker.</dd>
  354 +
  355 + <dt>pickerTimeSuffix</dt>
  356 + <dd><em>Default: (timeSuffix option)</em> - String to place after the formatted time within the timepicker.</dd>
  357 +
  358 + <dt>showTimepicker</dt>
  359 + <dd><em>Default: true</em> - Whether to show the timepicker within the datepicker.</dd>
  360 +
  361 + <dt>addSliderAccess</dt>
  362 + <dd><em>Default: false</em> - Adds the <a href="http://trentrichardson.com/examples/jQuery-SliderAccess/" title="jQueryUI Slider Access Plugin">sliderAccess plugin</a> to sliders within timepicker</dd>
  363 +
  364 + <dt>sliderAccessArgs</dt>
  365 + <dd><em>Default: null</em> - Object to pass to sliderAccess when used.</dd>
  366 +
  367 + <dt>defaultValue</dt>
  368 + <dd><em>Default: null</em> - String of the default time value placed in the input on focus when the input is empty.</dd>
  369 +
  370 + <dt>minDateTime</dt>
  371 + <dd><em>Default: null</em> - Date object of the minimum datetime allowed. Also available as minDate.</dd>
  372 +
  373 + <dt>maxDateTime</dt>
  374 + <dd><em>Default: null</em> - Date object of the maximum datetime allowed. Also Available as maxDate.</dd>
  375 +
  376 + <dt>minTime</dt>
  377 + <dd><em>Default: null</em> - String of the minimum time allowed. '8:00 am' will restrict to times after 8am</dd>
  378 +
  379 + <dt>maxTime</dt>
  380 + <dd><em>Default: null</em> - String of the maximum time allowed. '8:00 pm' will restrict to times before 8pm</dd>
  381 +
  382 + <dt>parse</dt>
  383 + <dd><em>Default: 'strict'</em> - How to parse the time string. Two methods are provided: 'strict' which must match the timeFormat exactly, and 'loose' which uses javascript's new Date(timeString) to guess the time. You may also pass in a function(timeFormat, timeString, options) to handle the parsing yourself, returning a simple object:
  384 +<pre>{
  385 + hour: 19,
  386 + minute: 10,
  387 + second: 23,
  388 + millisec: 45,
  389 + microsec: 23,
  390 + timezone: '-0400'
  391 +}</pre>
  392 + </dd>
  393 + </dl>
  394 +
  395 +</div>
  396 +
  397 +<!-- ############################################################################# -->
  398 +<!-- Formatting
  399 +<!-- ############################################################################# -->
  400 +<div id="tp-formatting">
  401 +
  402 + <h2>Formatting Your Time</h2>
  403 +
  404 + <p>The default format is "HH:mm". To use 12 hour time use something similar to: "hh:mm tt". When both "t" and lower case "h" are present in the timeFormat, 12 hour time will be used.</p>
  405 +
  406 + <dl class="defs">
  407 + <dt>H</dt><dd>Hour with no leading 0 (24 hour)</dd>
  408 + <dt>HH</dt><dd>Hour with leading 0 (24 hour)</dd>
  409 + <dt>h</dt><dd>Hour with no leading 0 (12 hour)</dd>
  410 + <dt>hh</dt><dd>Hour with leading 0 (12 hour)</dd>
  411 + <dt>m</dt><dd>Minute with no leading 0</dd>
  412 + <dt>mm</dt><dd>Minute with leading 0</dd>
  413 + <dt>s</dt><dd>Second with no leading 0</dd>
  414 + <dt>ss</dt><dd>Second with leading 0</dd>
  415 + <dt>l</dt><dd>Milliseconds always with leading 0</dd>
  416 + <dt>c</dt><dd>Microseconds always with leading 0</dd>
  417 + <dt>t</dt><dd>a or p for AM/PM</dd>
  418 + <dt>T</dt><dd>A or P for AM/PM</dd>
  419 + <dt>tt</dt><dd>am or pm for AM/PM</dd>
  420 + <dt>TT</dt><dd>AM or PM for AM/PM</dd>
  421 + <dt>z</dt><dd>Timezone as defined by timezoneList</dd>
  422 + <dt>Z</dt><dd>Timezone in Iso 8601 format (+04:45)</dd>
  423 + <dt>'...'</dt><dd>Literal text (Uses single quotes)</dd>
  424 + </dl>
  425 +
  426 + <p>Formats are used in the following ways:</p>
  427 + <ul>
  428 + <li>timeFormat option</li>
  429 + <li>altTimeFormat option</li>
  430 + <li>pickerTimeFormat option</li>
  431 + <li>$.datepicker.formatTime(format, timeObj, options) utility method</li>
  432 + <li>$.datepicker.parseTime(format, timeStr, options) utility method</li>
  433 + </ul>
  434 +
  435 + <p>For help with formatting the date portion, visit the datepicker documentation for <a href="http://docs.jquery.com/UI/Datepicker/formatDate" title="jQuery UI Datepicker Formatting">formatting dates</a>.</p>
  436 +</div>
  437 +
  438 +<!-- ############################################################################# -->
  439 +<!-- Localization
  440 +<!-- ############################################################################# -->
  441 +<div id="tp-localization">
  442 +
  443 + <h2>Working with Localizations</h2>
  444 +
  445 + <p>Timepicker comes with many translations and localizations, thanks to all the contributors. They can be found in the i18n folder in the git repo.</p>
  446 +
  447 + <p>The quick and cheap way to use localizations is to pass in options to a timepicker instance:</p>
  448 +
  449 +<pre>$('#example123').timepicker({
  450 + timeOnlyTitle: 'Выберите время',
  451 + timeText: 'Время',
  452 + hourText: 'Часы',
  453 + minuteText: 'Минуты',
  454 + secondText: 'Секунды',
  455 + currentText: 'Сейчас',
  456 + closeText: 'Закрыть'
  457 +});
  458 +</pre>
  459 + <p>However, if you plan to use timepicker extensively you will need to include (build your own) localization. It is simply assigning those same variables to an object. As you see in the example below we maintain a separate object for timepicker. This way we aren't bound to any changes within datepicker.</p>
  460 +
  461 +<pre>$.datepicker.regional['ru'] = {
  462 + closeText: 'Закрыть',
  463 + prevText: '&#x3c;Пред',
  464 + nextText: 'След&#x3e;',
  465 + currentText: 'Сегодня',
  466 + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
  467 + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
  468 + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
  469 + 'Июл','Авг','Сен','Окт','Ноя','Дек'],
  470 + dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
  471 + dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
  472 + dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
  473 + weekHeader: 'Не',
  474 + dateFormat: 'dd.mm.yy',
  475 + firstDay: 1,
  476 + isRTL: false,
  477 + showMonthAfterYear: false,
  478 + yearSuffix: ''
  479 +};
  480 +$.datepicker.setDefaults($.datepicker.regional['ru']);
  481 +
  482 +
  483 +$.timepicker.regional['ru'] = {
  484 + timeOnlyTitle: 'Выберите время',
  485 + timeText: 'Время',
  486 + hourText: 'Часы',
  487 + minuteText: 'Минуты',
  488 + secondText: 'Секунды',
  489 + millisecText: 'Миллисекунды',
  490 + timezoneText: 'Часовой пояс',
  491 + currentText: 'Сейчас',
  492 + closeText: 'Закрыть',
  493 + timeFormat: 'HH:mm',
  494 + amNames: ['AM', 'A'],
  495 + pmNames: ['PM', 'P'],
  496 + isRTL: false
  497 +};
  498 +$.timepicker.setDefaults($.timepicker.regional['ru']);
  499 +</pre>
  500 + <p>Now all you have to do is call timepicker and the Russian localization is used. Generally you only need to include the localization file, it will setDefaults() for you.</p>
  501 + <p>You can also visit <a href="http://docs.jquery.com/UI/Datepicker/Localization" title="localization for datepicker" target="_BLANK">localization for datepicker</a> for more information about datepicker localizations.</p>
  502 +</div>
  503 +
  504 +<!-- ############################################################################# -->
  505 +<!-- Examples
  506 +<!-- ############################################################################# -->
  507 +<div id="tp-examples">
  508 + <h2>Examples</h2>
  509 +
  510 + <ul>
  511 + <li><a href="#basic_examples" title="Basic Initializations">Basic Initializations</a></li>
  512 + <li><a href="#timezone_examples" title="Using Timezones">Using Timezones</a></li>
  513 + <li><a href="#slider_examples" title="Slider Modifications">Slider Modifications</a></li>
  514 + <li><a href="#alt_examples" title="Alternate Field">Alternate Fields</a></li>
  515 + <li><a href="#rest_examples" title="Time Restraints">Time Restraints</a></li>
  516 + <li><a href="#utility_examples" title="Utilities">Utilities</a></li>
  517 + </ul>
  518 +
  519 + <h3 id="basic_examples">Basic Initializations</h3>
  520 +
  521 + <!-- ============= example -->
  522 + <div class="example-container">
  523 + <p>Add a simple datetimepicker to jQuery UI's datepicker</p>
  524 + <div>
  525 + <input type="text" name="basic_example_1" id="basic_example_1" value="" />
  526 + </div>
  527 +<pre>
  528 +$('#basic_example_1').datetimepicker();
  529 +</pre>
  530 + </div>
  531 +
  532 +
  533 + <!-- ============= example -->
  534 + <div class="example-container">
  535 + <p>Add only a timepicker:</p>
  536 + <div>
  537 + <input type="text" name="basic_example_2" id="basic_example_2" value="" />
  538 + </div>
  539 +<pre>
  540 +$('#basic_example_2').timepicker();
  541 +</pre>
  542 + </div>
  543 +
  544 + <!-- ============= example -->
  545 + <div class="example-container">
  546 + <p>Format the time:</p>
  547 + <div>
  548 + <input type="text" name="basic_example_3" id="basic_example_3" value="" />
  549 + </div>
  550 +<pre>
  551 +$('#basic_example_3').datetimepicker({
  552 + timeFormat: "hh:mm tt"
  553 +});
  554 +</pre>
  555 + </div>
  556 +
  557 + <h3 id="timezone_examples">Using Timezones</h3>
  558 +
  559 + <!-- ============= example -->
  560 + <div class="example-container">
  561 + <p>Simplest timezone usage:</p>
  562 + <div>
  563 + <input type="text" name="timezone_example_1" id="timezone_example_1" value="" />
  564 + </div>
  565 +<pre>
  566 +$('#timezone_example_1').datetimepicker({
  567 + timeFormat: 'hh:mm tt z'
  568 +});
  569 +</pre>
  570 + </div>
  571 +
  572 + <!-- ============= example -->
  573 + <div class="example-container">
  574 + <p>Define your own timezone options:</p>
  575 + <div>
  576 + <input type="text" name="timezone_example_2" id="timezone_example_2" value="" />
  577 + </div>
  578 +<pre>
  579 +$('#timezone_example_2').datetimepicker({
  580 + timeFormat: 'HH:mm z',
  581 + timezoneList: [
  582 + { value: -300, label: 'Eastern'},
  583 + { value: -360, label: 'Central' },
  584 + { value: -420, label: 'Mountain' },
  585 + { value: -480, label: 'Pacific' }
  586 + ]
  587 +});
  588 +</pre>
  589 + </div>
  590 +
  591 + <!-- ============= example -->
  592 + <div class="example-container">
  593 + <p>You may also use timezone string abbreviations for values. This should be used with caution. Computing accurate javascript Date objects may not be possible when trying to retrieve or set the date from timepicker (see setDate and getDate examples below). For simple input values however this should work.</p>
  594 + <div>
  595 + <input type="text" name="timezone_example_3" id="timezone_example_3" value="" />
  596 + </div>
  597 +<pre>
  598 +$('#timezone_example_3').datetimepicker({
  599 + timeFormat: 'HH:mm z',
  600 + timezone: 'MT',
  601 + timezoneList: [
  602 + { value: 'ET', label: 'Eastern'},
  603 + { value: 'CT', label: 'Central' },
  604 + { value: 'MT', label: 'Mountain' },
  605 + { value: 'PT', label: 'Pacific' }
  606 + ]
  607 +});
  608 +
  609 +</pre>
  610 + </div>
  611 +
  612 + <h3 id="slider_examples">Slider Modifications</h3>
  613 +
  614 + <!-- ============= example -->
  615 + <div class="example-container">
  616 + <p>Add a grid to each slider:</p>
  617 + <div>
  618 + <input type="text" name="slider_example_1" id="slider_example_1" value="" />
  619 + </div>
  620 +<pre>
  621 +$('#slider_example_1').timepicker({
  622 + hourGrid: 4,
  623 + minuteGrid: 10,
  624 + timeFormat: 'hh:mm tt'
  625 +});
  626 +</pre>
  627 + </div>
  628 +
  629 + <!-- ============= example -->
  630 + <div class="example-container">
  631 + <p>Set the interval step of sliders:</p>
  632 + <div>
  633 + <input type="text" name="slider_example_2" id="slider_example_2" value="" />
  634 + </div>
  635 +<pre>
  636 +$('#slider_example_2').datetimepicker({
  637 + timeFormat: 'HH:mm:ss',
  638 + stepHour: 2,
  639 + stepMinute: 10,
  640 + stepSecond: 10
  641 +});
  642 +</pre>
  643 + </div>
  644 +
  645 + <!-- ============= example -->
  646 + <div class="example-container">
  647 + <p>Add sliderAccess plugin for touch devices:</p>
  648 + <div>
  649 + <input type="text" name="slider_example_3" id="slider_example_3" value="" />
  650 + </div>
  651 +<pre>
  652 +$('#slider_example_3').datetimepicker({
  653 + addSliderAccess: true,
  654 + sliderAccessArgs: { touchonly: false }
  655 +});</pre>
  656 + </div>
  657 +
  658 + <!-- ============= example -->
  659 + <div class="example-container">
  660 + <p>Use dropdowns instead of sliders. By default if slider is not available dropdowns will be used.</p>
  661 + <div>
  662 + <input type="text" name="slider_example_4" id="slider_example_4" value="" />
  663 + </div>
  664 +<pre>
  665 +$('#slider_example_4').datetimepicker({
  666 + controlType: 'select',
  667 + timeFormat: 'hh:mm tt'
  668 +});</pre>
  669 + </div>
  670 +
  671 + <!-- ============= example -->
  672 + <div class="example-container">
  673 + <p>Create your own control by implementing the create, options, and value methods. If you want to use your new control for all instances use the $.timepicker.setDefaults({controlType:myControl}). Here we implement jQueryUI's spinner control (jQueryUI 1.9+).</p>
  674 + <div>
  675 + <input type="text" name="slider_example_5" id="slider_example_5" value="" />
  676 + </div>
  677 +<pre>var myControl= {
  678 + create: function(tp_inst, obj, unit, val, min, max, step){
  679 + $('&lt;input class="ui-timepicker-input" value="'+val+'" style="width:50%"&gt;')
  680 + .appendTo(obj)
  681 + .spinner({
  682 + min: min,
  683 + max: max,
  684 + step: step,
  685 + change: function(e,ui){ // key events
  686 + // don't call if api was used and not key press
  687 + if(e.originalEvent !== undefined)
  688 + tp_inst._onTimeChange();
  689 + tp_inst._onSelectHandler();
  690 + },
  691 + spin: function(e,ui){ // spin events
  692 + tp_inst.control.value(tp_inst, obj, unit, ui.value);
  693 + tp_inst._onTimeChange();
  694 + tp_inst._onSelectHandler();
  695 + }
  696 + });
  697 + return obj;
  698 + },
  699 + options: function(tp_inst, obj, unit, opts, val){
  700 + if(typeof(opts) == 'string' && val !== undefined)
  701 + return obj.find('.ui-timepicker-input').spinner(opts, val);
  702 + return obj.find('.ui-timepicker-input').spinner(opts);
  703 + },
  704 + value: function(tp_inst, obj, unit, val){
  705 + if(val !== undefined)
  706 + return obj.find('.ui-timepicker-input').spinner('value', val);
  707 + return obj.find('.ui-timepicker-input').spinner('value');
  708 + }
  709 +};
  710 +
  711 +$('#slider_example_5').datetimepicker({
  712 + controlType: myControl
  713 +});</pre>
  714 + </div>
  715 +
  716 + <h3 id="alt_examples">Alternate Fields</h3>
  717 +
  718 + <!-- ============= example -->
  719 + <div class="example-container">
  720 + <p>Alt field in the simplest form:</p>
  721 + <div>
  722 + <input type="text" name="alt_example_1" id="alt_example_1" value="09/15/2012" />
  723 + <input type="text" name="alt_example_1_alt" id="alt_example_1_alt" value="10:15" />
  724 + </div>
  725 +<pre>
  726 +$('#alt_example_1').datetimepicker({
  727 + altField: "#alt_example_1_alt"
  728 +});
  729 +</pre>
  730 + </div>
  731 +
  732 + <!-- ============= example -->
  733 + <div class="example-container">
  734 + <p>With datetime in both:</p>
  735 + <div>
  736 + <input type="text" name="alt_example_2" id="alt_example_2" value="" />
  737 + <input type="text" name="alt_example_2_alt" id="alt_example_2_alt" value="" />
  738 + </div>
  739 +<pre>
  740 +$('#alt_example_2').datetimepicker({
  741 + altField: "#alt_example_2_alt",
  742 + altFieldTimeOnly: false
  743 +});
  744 +</pre>
  745 + </div>
  746 +
  747 + <!-- ============= example -->
  748 + <div class="example-container">
  749 + <p>Format the altField differently:</p>
  750 + <div>
  751 + <input type="text" name="alt_example_3" id="alt_example_3" value="" />
  752 + <input type="text" name="alt_example_3_alt" id="alt_example_3_alt" value="" />
  753 + </div>
  754 +<pre>
  755 +$('#alt_example_3').datetimepicker({
  756 + altField: "#alt_example_3_alt",
  757 + altFieldTimeOnly: false,
  758 + altFormat: "yy-mm-dd",
  759 + altTimeFormat: "h:m t",
  760 + altSeparator: " @ "
  761 +});
  762 +</pre>
  763 + </div>
  764 +
  765 + <!-- ============= example -->
  766 + <div class="example-container">
  767 + <p>With inline mode using altField:</p>
  768 + <div>
  769 + <input type="text" name="alt_example_4_alt" id="alt_example_4_alt" value="" />
  770 + <span id="alt_example_4" ></span>
  771 + </div>
  772 +<pre>
  773 +$('#alt_example_4').datetimepicker({
  774 + altField: "#alt_example_4_alt",
  775 + altFieldTimeOnly: false
  776 +});
  777 +</pre>
  778 + </div>
  779 +
  780 + <h3 id="rest_examples">Time Restraints</h3>
  781 +
  782 + <!-- ============= example -->
  783 + <div class="example-container">
  784 + <p>Set the min/max hour of every date:</p>
  785 + <div>
  786 + <input type="text" name="rest_example_1" id="rest_example_1" value="" />
  787 + </div>
  788 +<pre>
  789 +$('#rest_example_1').timepicker({
  790 + hourMin: 8,
  791 + hourMax: 16
  792 +});
  793 +</pre>
  794 + </div>
  795 +
  796 + <!-- ============= example -->
  797 + <div class="example-container">
  798 + <p>Set the min/max date numerically:</p>
  799 + <div>
  800 + <input type="text" name="rest_example_2" id="rest_example_2" value="" />
  801 + </div>
  802 +<pre>
  803 +$('#rest_example_2').datetimepicker({
  804 + numberOfMonths: 2,
  805 + minDate: 0,
  806 + maxDate: 30
  807 +});
  808 +</pre>
  809 + </div>
  810 +
  811 + <!-- ============= example -->
  812 + <div class="example-container">
  813 + <p>Set the min/max date and time with a Date object:</p>
  814 + <div>
  815 + <input type="text" name="rest_example_3" id="rest_example_3" value="" />
  816 + </div>
  817 +<pre>
  818 +$('#rest_example_3').datetimepicker({
  819 + minDate: new Date(2010, 11, 20, 8, 30),
  820 + maxDate: new Date(2010, 11, 31, 17, 30)
  821 +});
  822 +</pre>
  823 + </div>
  824 +
  825 + <!-- ============= example -->
  826 + <div class="example-container">
  827 + <p>Restrict a start and end date by using onSelect and onClose events for more control over functionality:</p>
  828 + <p>For more examples and advanced usage grab the <a href="http://trentrichardson.com/ebooks/handling-time/" title="Handling Time eBook">Handling Time eBook</a>.</p>
  829 + <div>
  830 + <input type="text" name="rest_example_4_start" id="rest_example_4_start" value="" />
  831 + <input type="text" name="rest_example_4_end" id="rest_example_4_end" value="" />
  832 + </div>
  833 +<pre>
  834 +var startDateTextBox = $('#rest_example_4_start');
  835 +var endDateTextBox = $('#rest_example_4_end');
  836 +
  837 +startDateTextBox.datetimepicker({
  838 + timeFormat: 'HH:mm z',
  839 + onClose: function(dateText, inst) {
  840 + if (endDateTextBox.val() != '') {
  841 + var testStartDate = startDateTextBox.datetimepicker('getDate');
  842 + var testEndDate = endDateTextBox.datetimepicker('getDate');
  843 + if (testStartDate > testEndDate)
  844 + endDateTextBox.datetimepicker('setDate', testStartDate);
  845 + }
  846 + else {
  847 + endDateTextBox.val(dateText);
  848 + }
  849 + },
  850 + onSelect: function (selectedDateTime){
  851 + endDateTextBox.datetimepicker('option', 'minDate', startDateTextBox.datetimepicker('getDate') );
  852 + }
  853 +});
  854 +endDateTextBox.datetimepicker({
  855 + timeFormat: 'HH:mm z',
  856 + onClose: function(dateText, inst) {
  857 + if (startDateTextBox.val() != '') {
  858 + var testStartDate = startDateTextBox.datetimepicker('getDate');
  859 + var testEndDate = endDateTextBox.datetimepicker('getDate');
  860 + if (testStartDate > testEndDate)
  861 + startDateTextBox.datetimepicker('setDate', testEndDate);
  862 + }
  863 + else {
  864 + startDateTextBox.val(dateText);
  865 + }
  866 + },
  867 + onSelect: function (selectedDateTime){
  868 + startDateTextBox.datetimepicker('option', 'maxDate', endDateTextBox.datetimepicker('getDate') );
  869 + }
  870 +});
  871 +</pre>
  872 + </div>
  873 +
  874 + <h3 id="utility_examples">Utilities</h3>
  875 +
  876 + <!-- ============= example -->
  877 + <div class="example-container">
  878 + <p>Get and Set Datetime with the getDate and setDate methods. This example uses timezone to demonstrate the timepicker regonizes the timezones and computes the offsets when getting and setting.</p>
  879 + <div>
  880 + <input type="text" name="utility_example_1" id="utility_example_1" value="" />
  881 + <button id="utility_example_1_setdt" value="1">Set Datetime</button>
  882 + <button id="utility_example_1_getdt" value="1">Get Datetime</button>
  883 + </div>
  884 +
  885 +<pre>
  886 +var ex13 = $('#utility_example_1');
  887 +
  888 +ex13.datetimepicker({
  889 + timeFormat: 'hh:mm tt z',
  890 + separator: ' @ ',
  891 + showTimezone: true
  892 +});
  893 +
  894 +$('#utility_example_1_setdt').click(function(){
  895 + ex13.datetimepicker('setDate', (new Date()) );
  896 +});
  897 +
  898 +$('#utility_example_1_getdt').click(function(){
  899 + alert(ex13.datetimepicker('getDate'));
  900 +});
  901 +</pre>
  902 + </div>
  903 +
  904 + <!-- ============= example -->
  905 + <div class="example-container">
  906 + <p>Use the utility function to format your own time. $.datepicker.formatTime(format, time, options)</p>
  907 + <dl class="defs">
  908 + <dt>format</dt><dd>required - string represenation of the time format to use</dd>
  909 + <dt>time</dt><dd>required - hash: { hour, minute, second, millisecond, timezone }</dd>
  910 + <dt>options</dt><dd>optional - hash of any options in regional translation (ampm, amNames, pmNames..)</dd>
  911 + </dl>
  912 + <p>Returns a time string in the specified format.</p>
  913 + <div>
  914 + <div id="utility_example_2"></div>
  915 + </div>
  916 +
  917 +<pre>
  918 +$('#utility_example_2').text(
  919 + $.datepicker.formatTime('HH:mm z', { hour: 14, minute: 36, timezone: '+2000' }, {})
  920 +);
  921 +</pre>
  922 + </div>
  923 +
  924 + <!-- ============= example -->
  925 + <div class="example-container">
  926 + <p>Use the utility function to parses a formatted time. $.datepicker.parseTime(format, timeString, options)</p>
  927 + <dl class="defs">
  928 + <dt>format</dt><dd>required - string represenation of the time format to use</dd>
  929 + <dt>time</dt><dd>required - time string matching the format given in parameter 1</dd>
  930 + <dt>options</dt><dd>optional - hash of any options in regional translation (ampm, amNames, pmNames..)</dd>
  931 + </dl>
  932 + <p>Returns an object with hours, minutes, seconds, milliseconds, timezone.</p>
  933 + <div>
  934 + <div id="utility_example_3"></div>
  935 + </div>
  936 +
  937 +<pre>
  938 +$('#utility_example_3').text(JSON.stringify(
  939 + $.datepicker.parseTime('HH:mm:ss:l z', "14:36:21:765 +2000", {})
  940 +));
  941 +</pre>
  942 + </div>
  943 +
  944 +</div>
  945 + </div>
  946 +
  947 +
  948 + </div>
  949 +
  950 +
  951 + <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  952 + <script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
  953 + <script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
  954 + <script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
  955 +
  956 + <script type="text/javascript">
  957 +
  958 + $(function(){
  959 + $('#tabs').tabs();
  960 +
  961 + $('.example-container > pre').each(function(i){
  962 + eval($(this).text());
  963 + });
  964 + });
  965 +
  966 + </script>
  967 +
  968 + <script type="text/javascript" src="https://sellfy.com/js/api_buttons.js"></script>
  969 +
  970 + <script type="text/javascript"> /*
  971 + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  972 + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  973 + */</script>
  974 + <script type="text/javascript"> /*
  975 + try {
  976 + var pageTracker = _gat._getTracker("UA-7602218-1");
  977 + pageTracker._trackPageview();
  978 + } catch(err) {}*/</script>
  979 + </body>
  980 +</html>
0 981 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/jquery-ui-sliderAccess.js 0 → 100644
... ... @@ -0,0 +1,91 @@
  1 +/*
  2 + * jQuery UI Slider Access
  3 + * By: Trent Richardson [http://trentrichardson.com]
  4 + * Version 0.3
  5 + * Last Modified: 10/20/2012
  6 + *
  7 + * Copyright 2011 Trent Richardson
  8 + * Dual licensed under the MIT and GPL licenses.
  9 + * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
  10 + * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
  11 + *
  12 + */
  13 + (function($){
  14 +
  15 + $.fn.extend({
  16 + sliderAccess: function(options){
  17 + options = options || {};
  18 + options.touchonly = options.touchonly !== undefined? options.touchonly : true; // by default only show it if touch device
  19 +
  20 + if(options.touchonly === true && !("ontouchend" in document)){
  21 + return $(this);
  22 + }
  23 +
  24 + return $(this).each(function(i,obj){
  25 + var $t = $(this),
  26 + o = $.extend({},{
  27 + where: 'after',
  28 + step: $t.slider('option','step'),
  29 + upIcon: 'ui-icon-plus',
  30 + downIcon: 'ui-icon-minus',
  31 + text: false,
  32 + upText: '+',
  33 + downText: '-',
  34 + buttonset: true,
  35 + buttonsetTag: 'span',
  36 + isRTL: false
  37 + }, options),
  38 + $buttons = $('<'+ o.buttonsetTag +' class="ui-slider-access">'+
  39 + '<button data-icon="'+ o.downIcon +'" data-step="'+ (o.isRTL? o.step : o.step*-1) +'">'+ o.downText +'</button>'+
  40 + '<button data-icon="'+ o.upIcon +'" data-step="'+ (o.isRTL? o.step*-1 : o.step) +'">'+ o.upText +'</button>'+
  41 + '</'+ o.buttonsetTag +'>');
  42 +
  43 + $buttons.children('button').each(function(j, jobj){
  44 + var $jt = $(this);
  45 + $jt.button({
  46 + text: o.text,
  47 + icons: { primary: $jt.data('icon') }
  48 + })
  49 + .click(function(e){
  50 + var step = $jt.data('step'),
  51 + curr = $t.slider('value'),
  52 + newval = curr += step*1,
  53 + minval = $t.slider('option','min'),
  54 + maxval = $t.slider('option','max'),
  55 + slidee = $t.slider("option", "slide") || function(){},
  56 + stope = $t.slider("option", "stop") || function(){};
  57 +
  58 + e.preventDefault();
  59 +
  60 + if(newval < minval || newval > maxval){
  61 + return;
  62 + }
  63 +
  64 + $t.slider('value', newval);
  65 +
  66 + slidee.call($t, null, { value: newval });
  67 + stope.call($t, null, { value: newval });
  68 + });
  69 + });
  70 +
  71 + // before or after
  72 + $t[o.where]($buttons);
  73 +
  74 + if(o.buttonset){
  75 + $buttons.removeClass('ui-corner-right').removeClass('ui-corner-left').buttonset();
  76 + $buttons.eq(0).addClass('ui-corner-left');
  77 + $buttons.eq(1).addClass('ui-corner-right');
  78 + }
  79 +
  80 + // adjust the width so we don't break the original layout
  81 + var bOuterWidth = $buttons.css({
  82 + marginLeft: ((o.where === 'after' && !o.isRTL) || (o.where === 'before' && o.isRTL)? 10:0),
  83 + marginRight: ((o.where === 'before' && !o.isRTL) || (o.where === 'after' && o.isRTL)? 10:0)
  84 + }).outerWidth(true) + 5;
  85 + var tOuterWidth = $t.outerWidth(true);
  86 + $t.css('display','inline-block').width(tOuterWidth-bOuterWidth);
  87 + });
  88 + }
  89 + });
  90 +
  91 +})(jQuery);
0 92 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/jquery-ui-timepicker-addon.css 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
  2 +.ui-timepicker-div dl { text-align: left; }
  3 +.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
  4 +.ui-timepicker-div dl dd { margin: 0 10px 10px 40%; }
  5 +.ui-timepicker-div td { font-size: 90%; }
  6 +.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
  7 +
  8 +.ui-timepicker-rtl{ direction: rtl; }
  9 +.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
  10 +.ui-timepicker-rtl dl dt{ float: right; clear: right; }
  11 +.ui-timepicker-rtl dl dd { margin: 0 40% 10px 10px; }
0 12 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/jquery-ui-timepicker-addon.js 0 → 100644
... ... @@ -0,0 +1,2197 @@
  1 +/*! jQuery Timepicker Addon - v1.4.4 - 2014-03-29
  2 +* http://trentrichardson.com/examples/timepicker
  3 +* Copyright (c) 2014 Trent Richardson; Licensed MIT */
  4 +(function ($) {
  5 +
  6 + /*
  7 + * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
  8 + */
  9 + $.ui.timepicker = $.ui.timepicker || {};
  10 + if ($.ui.timepicker.version) {
  11 + return;
  12 + }
  13 +
  14 + /*
  15 + * Extend jQueryUI, get it started with our version number
  16 + */
  17 + $.extend($.ui, {
  18 + timepicker: {
  19 + version: "1.4.4"
  20 + }
  21 + });
  22 +
  23 + /*
  24 + * Timepicker manager.
  25 + * Use the singleton instance of this class, $.timepicker, to interact with the time picker.
  26 + * Settings for (groups of) time pickers are maintained in an instance object,
  27 + * allowing multiple different settings on the same page.
  28 + */
  29 + var Timepicker = function () {
  30 + this.regional = []; // Available regional settings, indexed by language code
  31 + this.regional[''] = { // Default regional settings
  32 + currentText: 'Now',
  33 + closeText: 'Done',
  34 + amNames: ['AM', 'A'],
  35 + pmNames: ['PM', 'P'],
  36 + timeFormat: 'HH:mm',
  37 + timeSuffix: '',
  38 + timeOnlyTitle: 'Choose Time',
  39 + timeText: 'Time',
  40 + hourText: 'Hour',
  41 + minuteText: 'Minute',
  42 + secondText: 'Second',
  43 + millisecText: 'Millisecond',
  44 + microsecText: 'Microsecond',
  45 + timezoneText: 'Time Zone',
  46 + isRTL: false
  47 + };
  48 + this._defaults = { // Global defaults for all the datetime picker instances
  49 + showButtonPanel: true,
  50 + timeOnly: false,
  51 + timeOnlyShowDate: false,
  52 + showHour: null,
  53 + showMinute: null,
  54 + showSecond: null,
  55 + showMillisec: null,
  56 + showMicrosec: null,
  57 + showTimezone: null,
  58 + showTime: true,
  59 + stepHour: 1,
  60 + stepMinute: 1,
  61 + stepSecond: 1,
  62 + stepMillisec: 1,
  63 + stepMicrosec: 1,
  64 + hour: 0,
  65 + minute: 0,
  66 + second: 0,
  67 + millisec: 0,
  68 + microsec: 0,
  69 + timezone: null,
  70 + hourMin: 0,
  71 + minuteMin: 0,
  72 + secondMin: 0,
  73 + millisecMin: 0,
  74 + microsecMin: 0,
  75 + hourMax: 23,
  76 + minuteMax: 59,
  77 + secondMax: 59,
  78 + millisecMax: 999,
  79 + microsecMax: 999,
  80 + minDateTime: null,
  81 + maxDateTime: null,
  82 + maxTime: null,
  83 + minTime: null,
  84 + onSelect: null,
  85 + hourGrid: 0,
  86 + minuteGrid: 0,
  87 + secondGrid: 0,
  88 + millisecGrid: 0,
  89 + microsecGrid: 0,
  90 + alwaysSetTime: true,
  91 + separator: ' ',
  92 + altFieldTimeOnly: true,
  93 + altTimeFormat: null,
  94 + altSeparator: null,
  95 + altTimeSuffix: null,
  96 + pickerTimeFormat: null,
  97 + pickerTimeSuffix: null,
  98 + showTimepicker: true,
  99 + timezoneList: null,
  100 + addSliderAccess: false,
  101 + sliderAccessArgs: null,
  102 + controlType: 'slider',
  103 + defaultValue: null,
  104 + parse: 'strict'
  105 + };
  106 + $.extend(this._defaults, this.regional['']);
  107 + };
  108 +
  109 + $.extend(Timepicker.prototype, {
  110 + $input: null,
  111 + $altInput: null,
  112 + $timeObj: null,
  113 + inst: null,
  114 + hour_slider: null,
  115 + minute_slider: null,
  116 + second_slider: null,
  117 + millisec_slider: null,
  118 + microsec_slider: null,
  119 + timezone_select: null,
  120 + maxTime: null,
  121 + minTime: null,
  122 + hour: 0,
  123 + minute: 0,
  124 + second: 0,
  125 + millisec: 0,
  126 + microsec: 0,
  127 + timezone: null,
  128 + hourMinOriginal: null,
  129 + minuteMinOriginal: null,
  130 + secondMinOriginal: null,
  131 + millisecMinOriginal: null,
  132 + microsecMinOriginal: null,
  133 + hourMaxOriginal: null,
  134 + minuteMaxOriginal: null,
  135 + secondMaxOriginal: null,
  136 + millisecMaxOriginal: null,
  137 + microsecMaxOriginal: null,
  138 + ampm: '',
  139 + formattedDate: '',
  140 + formattedTime: '',
  141 + formattedDateTime: '',
  142 + timezoneList: null,
  143 + units: ['hour', 'minute', 'second', 'millisec', 'microsec'],
  144 + support: {},
  145 + control: null,
  146 +
  147 + /*
  148 + * Override the default settings for all instances of the time picker.
  149 + * @param {Object} settings object - the new settings to use as defaults (anonymous object)
  150 + * @return {Object} the manager object
  151 + */
  152 + setDefaults: function (settings) {
  153 + extendRemove(this._defaults, settings || {});
  154 + return this;
  155 + },
  156 +
  157 + /*
  158 + * Create a new Timepicker instance
  159 + */
  160 + _newInst: function ($input, opts) {
  161 + var tp_inst = new Timepicker(),
  162 + inlineSettings = {},
  163 + fns = {},
  164 + overrides, i;
  165 +
  166 + for (var attrName in this._defaults) {
  167 + if (this._defaults.hasOwnProperty(attrName)) {
  168 + var attrValue = $input.attr('time:' + attrName);
  169 + if (attrValue) {
  170 + try {
  171 + inlineSettings[attrName] = eval(attrValue);
  172 + } catch (err) {
  173 + inlineSettings[attrName] = attrValue;
  174 + }
  175 + }
  176 + }
  177 + }
  178 +
  179 + overrides = {
  180 + beforeShow: function (input, dp_inst) {
  181 + if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
  182 + return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
  183 + }
  184 + },
  185 + onChangeMonthYear: function (year, month, dp_inst) {
  186 + // Update the time as well : this prevents the time from disappearing from the $input field.
  187 + tp_inst._updateDateTime(dp_inst);
  188 + if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
  189 + tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
  190 + }
  191 + },
  192 + onClose: function (dateText, dp_inst) {
  193 + if (tp_inst.timeDefined === true && $input.val() !== '') {
  194 + tp_inst._updateDateTime(dp_inst);
  195 + }
  196 + if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
  197 + tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
  198 + }
  199 + }
  200 + };
  201 + for (i in overrides) {
  202 + if (overrides.hasOwnProperty(i)) {
  203 + fns[i] = opts[i] || null;
  204 + }
  205 + }
  206 +
  207 + tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
  208 + evnts: fns,
  209 + timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
  210 + });
  211 + tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {
  212 + return val.toUpperCase();
  213 + });
  214 + tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {
  215 + return val.toUpperCase();
  216 + });
  217 +
  218 + // detect which units are supported
  219 + tp_inst.support = detectSupport(
  220 + tp_inst._defaults.timeFormat +
  221 + (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
  222 + (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));
  223 +
  224 + // controlType is string - key to our this._controls
  225 + if (typeof(tp_inst._defaults.controlType) === 'string') {
  226 + if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') {
  227 + tp_inst._defaults.controlType = 'select';
  228 + }
  229 + tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
  230 + }
  231 + // controlType is an object and must implement create, options, value methods
  232 + else {
  233 + tp_inst.control = tp_inst._defaults.controlType;
  234 + }
  235 +
  236 + // prep the timezone options
  237 + var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,
  238 + 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];
  239 + if (tp_inst._defaults.timezoneList !== null) {
  240 + timezoneList = tp_inst._defaults.timezoneList;
  241 + }
  242 + var tzl = timezoneList.length, tzi = 0, tzv = null;
  243 + if (tzl > 0 && typeof timezoneList[0] !== 'object') {
  244 + for (; tzi < tzl; tzi++) {
  245 + tzv = timezoneList[tzi];
  246 + timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };
  247 + }
  248 + }
  249 + tp_inst._defaults.timezoneList = timezoneList;
  250 +
  251 + // set the default units
  252 + tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
  253 + ((new Date()).getTimezoneOffset() * -1);
  254 + tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :
  255 + tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
  256 + tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :
  257 + tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
  258 + tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :
  259 + tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
  260 + tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :
  261 + tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
  262 + tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :
  263 + tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
  264 + tp_inst.ampm = '';
  265 + tp_inst.$input = $input;
  266 +
  267 + if (tp_inst._defaults.altField) {
  268 + tp_inst.$altInput = $(tp_inst._defaults.altField).css({
  269 + cursor: 'pointer'
  270 + }).focus(function () {
  271 + $input.trigger("focus");
  272 + });
  273 + }
  274 +
  275 + if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
  276 + tp_inst._defaults.minDate = new Date();
  277 + }
  278 + if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
  279 + tp_inst._defaults.maxDate = new Date();
  280 + }
  281 +
  282 + // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
  283 + if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
  284 + tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
  285 + }
  286 + if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
  287 + tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
  288 + }
  289 + if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
  290 + tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
  291 + }
  292 + if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
  293 + tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
  294 + }
  295 + tp_inst.$input.bind('focus', function () {
  296 + tp_inst._onFocus();
  297 + });
  298 +
  299 + return tp_inst;
  300 + },
  301 +
  302 + /*
  303 + * add our sliders to the calendar
  304 + */
  305 + _addTimePicker: function (dp_inst) {
  306 + var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();
  307 +
  308 + this.timeDefined = this._parseTime(currDT);
  309 + this._limitMinMaxDateTime(dp_inst, false);
  310 + this._injectTimePicker();
  311 + },
  312 +
  313 + /*
  314 + * parse the time string from input value or _setTime
  315 + */
  316 + _parseTime: function (timeString, withDate) {
  317 + if (!this.inst) {
  318 + this.inst = $.datepicker._getInst(this.$input[0]);
  319 + }
  320 +
  321 + if (withDate || !this._defaults.timeOnly) {
  322 + var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
  323 + try {
  324 + var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
  325 + if (!parseRes.timeObj) {
  326 + return false;
  327 + }
  328 + $.extend(this, parseRes.timeObj);
  329 + } catch (err) {
  330 + $.timepicker.log("Error parsing the date/time string: " + err +
  331 + "\ndate/time string = " + timeString +
  332 + "\ntimeFormat = " + this._defaults.timeFormat +
  333 + "\ndateFormat = " + dp_dateFormat);
  334 + return false;
  335 + }
  336 + return true;
  337 + } else {
  338 + var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
  339 + if (!timeObj) {
  340 + return false;
  341 + }
  342 + $.extend(this, timeObj);
  343 + return true;
  344 + }
  345 + },
  346 +
  347 + /*
  348 + * generate and inject html for timepicker into ui datepicker
  349 + */
  350 + _injectTimePicker: function () {
  351 + var $dp = this.inst.dpDiv,
  352 + o = this.inst.settings,
  353 + tp_inst = this,
  354 + litem = '',
  355 + uitem = '',
  356 + show = null,
  357 + max = {},
  358 + gridSize = {},
  359 + size = null,
  360 + i = 0,
  361 + l = 0;
  362 +
  363 + // Prevent displaying twice
  364 + if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
  365 + var noDisplay = ' style="display:none;"',
  366 + html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
  367 + '<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';
  368 +
  369 + // Create the markup
  370 + for (i = 0, l = this.units.length; i < l; i++) {
  371 + litem = this.units[i];
  372 + uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
  373 + show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];
  374 +
  375 + // Added by Peter Medeiros:
  376 + // - Figure out what the hour/minute/second max should be based on the step values.
  377 + // - Example: if stepMinute is 15, then minMax is 45.
  378 + max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
  379 + gridSize[litem] = 0;
  380 +
  381 + html += '<dt class="ui_tpicker_' + litem + '_label"' + (show ? '' : noDisplay) + '>' + o[litem + 'Text'] + '</dt>' +
  382 + '<dd class="ui_tpicker_' + litem + '"><div class="ui_tpicker_' + litem + '_slider"' + (show ? '' : noDisplay) + '></div>';
  383 +
  384 + if (show && o[litem + 'Grid'] > 0) {
  385 + html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
  386 +
  387 + if (litem === 'hour') {
  388 + for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
  389 + gridSize[litem]++;
  390 + var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);
  391 + html += '<td data-for="' + litem + '">' + tmph + '</td>';
  392 + }
  393 + }
  394 + else {
  395 + for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {
  396 + gridSize[litem]++;
  397 + html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>';
  398 + }
  399 + }
  400 +
  401 + html += '</tr></table></div>';
  402 + }
  403 + html += '</dd>';
  404 + }
  405 +
  406 + // Timezone
  407 + var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
  408 + html += '<dt class="ui_tpicker_timezone_label"' + (showTz ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
  409 + html += '<dd class="ui_tpicker_timezone" ' + (showTz ? '' : noDisplay) + '></dd>';
  410 +
  411 + // Create the elements from string
  412 + html += '</dl></div>';
  413 + var $tp = $(html);
  414 +
  415 + // if we only want time picker...
  416 + if (o.timeOnly === true) {
  417 + $tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
  418 + $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
  419 + }
  420 +
  421 + // add sliders, adjust grids, add events
  422 + for (i = 0, l = tp_inst.units.length; i < l; i++) {
  423 + litem = tp_inst.units[i];
  424 + uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
  425 + show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];
  426 +
  427 + // add the slider
  428 + 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]);
  429 +
  430 + // adjust the grid and add click event
  431 + if (show && o[litem + 'Grid'] > 0) {
  432 + size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);
  433 + $tp.find('.ui_tpicker_' + litem + ' table').css({
  434 + width: size + "%",
  435 + marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"),
  436 + marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0',
  437 + borderCollapse: 'collapse'
  438 + }).find("td").click(function (e) {
  439 + var $t = $(this),
  440 + h = $t.html(),
  441 + n = parseInt(h.replace(/[^0-9]/g), 10),
  442 + ap = h.replace(/[^apm]/ig),
  443 + f = $t.data('for'); // loses scope, so we use data-for
  444 +
  445 + if (f === 'hour') {
  446 + if (ap.indexOf('p') !== -1 && n < 12) {
  447 + n += 12;
  448 + }
  449 + else {
  450 + if (ap.indexOf('a') !== -1 && n === 12) {
  451 + n = 0;
  452 + }
  453 + }
  454 + }
  455 +
  456 + tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
  457 +
  458 + tp_inst._onTimeChange();
  459 + tp_inst._onSelectHandler();
  460 + }).css({
  461 + cursor: 'pointer',
  462 + width: (100 / gridSize[litem]) + '%',
  463 + textAlign: 'center',
  464 + overflow: 'hidden'
  465 + });
  466 + } // end if grid > 0
  467 + } // end for loop
  468 +
  469 + // Add timezone options
  470 + this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
  471 + $.fn.append.apply(this.timezone_select,
  472 + $.map(o.timezoneList, function (val, idx) {
  473 + return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
  474 + }));
  475 + if (typeof(this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") {
  476 + var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;
  477 + if (local_timezone === this.timezone) {
  478 + selectLocalTimezone(tp_inst);
  479 + } else {
  480 + this.timezone_select.val(this.timezone);
  481 + }
  482 + } else {
  483 + if (typeof(this.hour) !== "undefined" && this.hour !== null && this.hour !== "") {
  484 + this.timezone_select.val(o.timezone);
  485 + } else {
  486 + selectLocalTimezone(tp_inst);
  487 + }
  488 + }
  489 + this.timezone_select.change(function () {
  490 + tp_inst._onTimeChange();
  491 + tp_inst._onSelectHandler();
  492 + });
  493 + // End timezone options
  494 +
  495 + // inject timepicker into datepicker
  496 + var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
  497 + if ($buttonPanel.length) {
  498 + $buttonPanel.before($tp);
  499 + } else {
  500 + $dp.append($tp);
  501 + }
  502 +
  503 + this.$timeObj = $tp.find('.ui_tpicker_time');
  504 +
  505 + if (this.inst !== null) {
  506 + var timeDefined = this.timeDefined;
  507 + this._onTimeChange();
  508 + this.timeDefined = timeDefined;
  509 + }
  510 +
  511 + // slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
  512 + if (this._defaults.addSliderAccess) {
  513 + var sliderAccessArgs = this._defaults.sliderAccessArgs,
  514 + rtl = this._defaults.isRTL;
  515 + sliderAccessArgs.isRTL = rtl;
  516 +
  517 + setTimeout(function () { // fix for inline mode
  518 + if ($tp.find('.ui-slider-access').length === 0) {
  519 + $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
  520 +
  521 + // fix any grids since sliders are shorter
  522 + var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
  523 + if (sliderAccessWidth) {
  524 + $tp.find('table:visible').each(function () {
  525 + var $g = $(this),
  526 + oldWidth = $g.outerWidth(),
  527 + oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),
  528 + newWidth = oldWidth - sliderAccessWidth,
  529 + newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
  530 + css = { width: newWidth, marginRight: 0, marginLeft: 0 };
  531 + css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;
  532 + $g.css(css);
  533 + });
  534 + }
  535 + }
  536 + }, 10);
  537 + }
  538 + // end slideAccess integration
  539 +
  540 + tp_inst._limitMinMaxDateTime(this.inst, true);
  541 + }
  542 + },
  543 +
  544 + /*
  545 + * This function tries to limit the ability to go outside the
  546 + * min/max date range
  547 + */
  548 + _limitMinMaxDateTime: function (dp_inst, adjustSliders) {
  549 + var o = this._defaults,
  550 + dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
  551 +
  552 + if (!this._defaults.showTimepicker) {
  553 + return;
  554 + } // No time so nothing to check here
  555 +
  556 + if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {
  557 + var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
  558 + minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
  559 +
  560 + if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {
  561 + this.hourMinOriginal = o.hourMin;
  562 + this.minuteMinOriginal = o.minuteMin;
  563 + this.secondMinOriginal = o.secondMin;
  564 + this.millisecMinOriginal = o.millisecMin;
  565 + this.microsecMinOriginal = o.microsecMin;
  566 + }
  567 +
  568 + if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {
  569 + this._defaults.hourMin = minDateTime.getHours();
  570 + if (this.hour <= this._defaults.hourMin) {
  571 + this.hour = this._defaults.hourMin;
  572 + this._defaults.minuteMin = minDateTime.getMinutes();
  573 + if (this.minute <= this._defaults.minuteMin) {
  574 + this.minute = this._defaults.minuteMin;
  575 + this._defaults.secondMin = minDateTime.getSeconds();
  576 + if (this.second <= this._defaults.secondMin) {
  577 + this.second = this._defaults.secondMin;
  578 + this._defaults.millisecMin = minDateTime.getMilliseconds();
  579 + if (this.millisec <= this._defaults.millisecMin) {
  580 + this.millisec = this._defaults.millisecMin;
  581 + this._defaults.microsecMin = minDateTime.getMicroseconds();
  582 + } else {
  583 + if (this.microsec < this._defaults.microsecMin) {
  584 + this.microsec = this._defaults.microsecMin;
  585 + }
  586 + this._defaults.microsecMin = this.microsecMinOriginal;
  587 + }
  588 + } else {
  589 + this._defaults.millisecMin = this.millisecMinOriginal;
  590 + this._defaults.microsecMin = this.microsecMinOriginal;
  591 + }
  592 + } else {
  593 + this._defaults.secondMin = this.secondMinOriginal;
  594 + this._defaults.millisecMin = this.millisecMinOriginal;
  595 + this._defaults.microsecMin = this.microsecMinOriginal;
  596 + }
  597 + } else {
  598 + this._defaults.minuteMin = this.minuteMinOriginal;
  599 + this._defaults.secondMin = this.secondMinOriginal;
  600 + this._defaults.millisecMin = this.millisecMinOriginal;
  601 + this._defaults.microsecMin = this.microsecMinOriginal;
  602 + }
  603 + } else {
  604 + this._defaults.hourMin = this.hourMinOriginal;
  605 + this._defaults.minuteMin = this.minuteMinOriginal;
  606 + this._defaults.secondMin = this.secondMinOriginal;
  607 + this._defaults.millisecMin = this.millisecMinOriginal;
  608 + this._defaults.microsecMin = this.microsecMinOriginal;
  609 + }
  610 + }
  611 +
  612 + if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {
  613 + var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
  614 + maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
  615 +
  616 + if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {
  617 + this.hourMaxOriginal = o.hourMax;
  618 + this.minuteMaxOriginal = o.minuteMax;
  619 + this.secondMaxOriginal = o.secondMax;
  620 + this.millisecMaxOriginal = o.millisecMax;
  621 + this.microsecMaxOriginal = o.microsecMax;
  622 + }
  623 +
  624 + if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {
  625 + this._defaults.hourMax = maxDateTime.getHours();
  626 + if (this.hour >= this._defaults.hourMax) {
  627 + this.hour = this._defaults.hourMax;
  628 + this._defaults.minuteMax = maxDateTime.getMinutes();
  629 + if (this.minute >= this._defaults.minuteMax) {
  630 + this.minute = this._defaults.minuteMax;
  631 + this._defaults.secondMax = maxDateTime.getSeconds();
  632 + if (this.second >= this._defaults.secondMax) {
  633 + this.second = this._defaults.secondMax;
  634 + this._defaults.millisecMax = maxDateTime.getMilliseconds();
  635 + if (this.millisec >= this._defaults.millisecMax) {
  636 + this.millisec = this._defaults.millisecMax;
  637 + this._defaults.microsecMax = maxDateTime.getMicroseconds();
  638 + } else {
  639 + if (this.microsec > this._defaults.microsecMax) {
  640 + this.microsec = this._defaults.microsecMax;
  641 + }
  642 + this._defaults.microsecMax = this.microsecMaxOriginal;
  643 + }
  644 + } else {
  645 + this._defaults.millisecMax = this.millisecMaxOriginal;
  646 + this._defaults.microsecMax = this.microsecMaxOriginal;
  647 + }
  648 + } else {
  649 + this._defaults.secondMax = this.secondMaxOriginal;
  650 + this._defaults.millisecMax = this.millisecMaxOriginal;
  651 + this._defaults.microsecMax = this.microsecMaxOriginal;
  652 + }
  653 + } else {
  654 + this._defaults.minuteMax = this.minuteMaxOriginal;
  655 + this._defaults.secondMax = this.secondMaxOriginal;
  656 + this._defaults.millisecMax = this.millisecMaxOriginal;
  657 + this._defaults.microsecMax = this.microsecMaxOriginal;
  658 + }
  659 + } else {
  660 + this._defaults.hourMax = this.hourMaxOriginal;
  661 + this._defaults.minuteMax = this.minuteMaxOriginal;
  662 + this._defaults.secondMax = this.secondMaxOriginal;
  663 + this._defaults.millisecMax = this.millisecMaxOriginal;
  664 + this._defaults.microsecMax = this.microsecMaxOriginal;
  665 + }
  666 + }
  667 +
  668 + if (dp_inst.settings.minTime!==null) {
  669 + var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime);
  670 + if (this.hour<tempMinTime.getHours()) {
  671 + this.hour=this._defaults.hourMin=tempMinTime.getHours();
  672 + this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
  673 + } else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {
  674 + this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
  675 + } else {
  676 + if (this._defaults.hourMin<tempMinTime.getHours()) {
  677 + this._defaults.hourMin=tempMinTime.getHours();
  678 + this._defaults.minuteMin=tempMinTime.getMinutes();
  679 + } else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {
  680 + this._defaults.minuteMin=tempMinTime.getMinutes();
  681 + } else {
  682 + this._defaults.minuteMin=0;
  683 + }
  684 + }
  685 + }
  686 +
  687 + if (dp_inst.settings.maxTime!==null) {
  688 + var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime);
  689 + if (this.hour>tempMaxTime.getHours()) {
  690 + this.hour=this._defaults.hourMax=tempMaxTime.getHours();
  691 + this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
  692 + } else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {
  693 + this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
  694 + } else {
  695 + if (this._defaults.hourMax>tempMaxTime.getHours()) {
  696 + this._defaults.hourMax=tempMaxTime.getHours();
  697 + this._defaults.minuteMax=tempMaxTime.getMinutes();
  698 + } else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {
  699 + this._defaults.minuteMax=tempMaxTime.getMinutes();
  700 + } else {
  701 + this._defaults.minuteMax=59;
  702 + }
  703 + }
  704 + }
  705 +
  706 + if (adjustSliders !== undefined && adjustSliders === true) {
  707 + var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
  708 + minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
  709 + secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
  710 + millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10),
  711 + microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);
  712 +
  713 + if (this.hour_slider) {
  714 + this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour });
  715 + this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
  716 + }
  717 + if (this.minute_slider) {
  718 + this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute });
  719 + this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
  720 + }
  721 + if (this.second_slider) {
  722 + this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond });
  723 + this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
  724 + }
  725 + if (this.millisec_slider) {
  726 + this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec });
  727 + this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
  728 + }
  729 + if (this.microsec_slider) {
  730 + this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec });
  731 + this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));
  732 + }
  733 + }
  734 +
  735 + },
  736 +
  737 + /*
  738 + * when a slider moves, set the internal time...
  739 + * on time change is also called when the time is updated in the text field
  740 + */
  741 + _onTimeChange: function () {
  742 + if (!this._defaults.showTimepicker) {
  743 + return;
  744 + }
  745 + var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
  746 + minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
  747 + second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
  748 + millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
  749 + microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false,
  750 + timezone = (this.timezone_select) ? this.timezone_select.val() : false,
  751 + o = this._defaults,
  752 + pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
  753 + pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
  754 +
  755 + if (typeof(hour) === 'object') {
  756 + hour = false;
  757 + }
  758 + if (typeof(minute) === 'object') {
  759 + minute = false;
  760 + }
  761 + if (typeof(second) === 'object') {
  762 + second = false;
  763 + }
  764 + if (typeof(millisec) === 'object') {
  765 + millisec = false;
  766 + }
  767 + if (typeof(microsec) === 'object') {
  768 + microsec = false;
  769 + }
  770 + if (typeof(timezone) === 'object') {
  771 + timezone = false;
  772 + }
  773 +
  774 + if (hour !== false) {
  775 + hour = parseInt(hour, 10);
  776 + }
  777 + if (minute !== false) {
  778 + minute = parseInt(minute, 10);
  779 + }
  780 + if (second !== false) {
  781 + second = parseInt(second, 10);
  782 + }
  783 + if (millisec !== false) {
  784 + millisec = parseInt(millisec, 10);
  785 + }
  786 + if (microsec !== false) {
  787 + microsec = parseInt(microsec, 10);
  788 + }
  789 + if (timezone !== false) {
  790 + timezone = timezone.toString();
  791 + }
  792 +
  793 + var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];
  794 +
  795 + // If the update was done in the input field, the input field should not be updated.
  796 + // If the update was done using the sliders, update the input field.
  797 + var hasChanged = (
  798 + hour !== parseInt(this.hour,10) || // sliders should all be numeric
  799 + minute !== parseInt(this.minute,10) ||
  800 + second !== parseInt(this.second,10) ||
  801 + millisec !== parseInt(this.millisec,10) ||
  802 + microsec !== parseInt(this.microsec,10) ||
  803 + (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
  804 + (this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
  805 + );
  806 +
  807 + if (hasChanged) {
  808 +
  809 + if (hour !== false) {
  810 + this.hour = hour;
  811 + }
  812 + if (minute !== false) {
  813 + this.minute = minute;
  814 + }
  815 + if (second !== false) {
  816 + this.second = second;
  817 + }
  818 + if (millisec !== false) {
  819 + this.millisec = millisec;
  820 + }
  821 + if (microsec !== false) {
  822 + this.microsec = microsec;
  823 + }
  824 + if (timezone !== false) {
  825 + this.timezone = timezone;
  826 + }
  827 +
  828 + if (!this.inst) {
  829 + this.inst = $.datepicker._getInst(this.$input[0]);
  830 + }
  831 +
  832 + this._limitMinMaxDateTime(this.inst, true);
  833 + }
  834 + if (this.support.ampm) {
  835 + this.ampm = ampm;
  836 + }
  837 +
  838 + // Updates the time within the timepicker
  839 + this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
  840 + if (this.$timeObj) {
  841 + if (pickerTimeFormat === o.timeFormat) {
  842 + this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
  843 + }
  844 + else {
  845 + this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
  846 + }
  847 + }
  848 +
  849 + this.timeDefined = true;
  850 + if (hasChanged) {
  851 + this._updateDateTime();
  852 + //this.$input.focus(); // may automatically open the picker on setDate
  853 + }
  854 + },
  855 +
  856 + /*
  857 + * call custom onSelect.
  858 + * bind to sliders slidestop, and grid click.
  859 + */
  860 + _onSelectHandler: function () {
  861 + var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
  862 + var inputEl = this.$input ? this.$input[0] : null;
  863 + if (onSelect && inputEl) {
  864 + onSelect.apply(inputEl, [this.formattedDateTime, this]);
  865 + }
  866 + },
  867 +
  868 + /*
  869 + * update our input with the new date time..
  870 + */
  871 + _updateDateTime: function (dp_inst) {
  872 + dp_inst = this.inst || dp_inst;
  873 + var dtTmp = (dp_inst.currentYear > 0?
  874 + new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
  875 + new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
  876 + dt = $.datepicker._daylightSavingAdjust(dtTmp),
  877 + //dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
  878 + //dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),
  879 + dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
  880 + formatCfg = $.datepicker._getFormatConfig(dp_inst),
  881 + timeAvailable = dt !== null && this.timeDefined;
  882 + this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
  883 + var formattedDateTime = this.formattedDate;
  884 +
  885 + // if a slider was changed but datepicker doesn't have a value yet, set it
  886 + if (dp_inst.lastVal === "") {
  887 + dp_inst.currentYear = dp_inst.selectedYear;
  888 + dp_inst.currentMonth = dp_inst.selectedMonth;
  889 + dp_inst.currentDay = dp_inst.selectedDay;
  890 + }
  891 +
  892 + /*
  893 + * remove following lines to force every changes in date picker to change the input value
  894 + * Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
  895 + * If the user manually empty the value in the input field, the date picker will never change selected value.
  896 + */
  897 + //if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
  898 + // return;
  899 + //}
  900 +
  901 + if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
  902 + formattedDateTime = this.formattedTime;
  903 + } else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {
  904 + formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
  905 + }
  906 +
  907 + this.formattedDateTime = formattedDateTime;
  908 +
  909 + if (!this._defaults.showTimepicker) {
  910 + this.$input.val(this.formattedDate);
  911 + } else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
  912 + this.$altInput.val(this.formattedTime);
  913 + this.$input.val(this.formattedDate);
  914 + } else if (this.$altInput) {
  915 + this.$input.val(formattedDateTime);
  916 + var altFormattedDateTime = '',
  917 + altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
  918 + altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
  919 +
  920 + if (!this._defaults.timeOnly) {
  921 + if (this._defaults.altFormat) {
  922 + altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
  923 + }
  924 + else {
  925 + altFormattedDateTime = this.formattedDate;
  926 + }
  927 +
  928 + if (altFormattedDateTime) {
  929 + altFormattedDateTime += altSeparator;
  930 + }
  931 + }
  932 +
  933 + if (this._defaults.altTimeFormat) {
  934 + altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
  935 + }
  936 + else {
  937 + altFormattedDateTime += this.formattedTime + altTimeSuffix;
  938 + }
  939 + this.$altInput.val(altFormattedDateTime);
  940 + } else {
  941 + this.$input.val(formattedDateTime);
  942 + }
  943 +
  944 + this.$input.trigger("change");
  945 + },
  946 +
  947 + _onFocus: function () {
  948 + if (!this.$input.val() && this._defaults.defaultValue) {
  949 + this.$input.val(this._defaults.defaultValue);
  950 + var inst = $.datepicker._getInst(this.$input.get(0)),
  951 + tp_inst = $.datepicker._get(inst, 'timepicker');
  952 + if (tp_inst) {
  953 + if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
  954 + try {
  955 + $.datepicker._updateDatepicker(inst);
  956 + } catch (err) {
  957 + $.timepicker.log(err);
  958 + }
  959 + }
  960 + }
  961 + }
  962 + },
  963 +
  964 + /*
  965 + * Small abstraction to control types
  966 + * We can add more, just be sure to follow the pattern: create, options, value
  967 + */
  968 + _controls: {
  969 + // slider methods
  970 + slider: {
  971 + create: function (tp_inst, obj, unit, val, min, max, step) {
  972 + var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
  973 + return obj.prop('slide', null).slider({
  974 + orientation: "horizontal",
  975 + value: rtl ? val * -1 : val,
  976 + min: rtl ? max * -1 : min,
  977 + max: rtl ? min * -1 : max,
  978 + step: step,
  979 + slide: function (event, ui) {
  980 + tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
  981 + tp_inst._onTimeChange();
  982 + },
  983 + stop: function (event, ui) {
  984 + tp_inst._onSelectHandler();
  985 + }
  986 + });
  987 + },
  988 + options: function (tp_inst, obj, unit, opts, val) {
  989 + if (tp_inst._defaults.isRTL) {
  990 + if (typeof(opts) === 'string') {
  991 + if (opts === 'min' || opts === 'max') {
  992 + if (val !== undefined) {
  993 + return obj.slider(opts, val * -1);
  994 + }
  995 + return Math.abs(obj.slider(opts));
  996 + }
  997 + return obj.slider(opts);
  998 + }
  999 + var min = opts.min,
  1000 + max = opts.max;
  1001 + opts.min = opts.max = null;
  1002 + if (min !== undefined) {
  1003 + opts.max = min * -1;
  1004 + }
  1005 + if (max !== undefined) {
  1006 + opts.min = max * -1;
  1007 + }
  1008 + return obj.slider(opts);
  1009 + }
  1010 + if (typeof(opts) === 'string' && val !== undefined) {
  1011 + return obj.slider(opts, val);
  1012 + }
  1013 + return obj.slider(opts);
  1014 + },
  1015 + value: function (tp_inst, obj, unit, val) {
  1016 + if (tp_inst._defaults.isRTL) {
  1017 + if (val !== undefined) {
  1018 + return obj.slider('value', val * -1);
  1019 + }
  1020 + return Math.abs(obj.slider('value'));
  1021 + }
  1022 + if (val !== undefined) {
  1023 + return obj.slider('value', val);
  1024 + }
  1025 + return obj.slider('value');
  1026 + }
  1027 + },
  1028 + // select methods
  1029 + select: {
  1030 + create: function (tp_inst, obj, unit, val, min, max, step) {
  1031 + var sel = '<select class="ui-timepicker-select" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
  1032 + format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
  1033 +
  1034 + for (var i = min; i <= max; i += step) {
  1035 + sel += '<option value="' + i + '"' + (i === val ? ' selected' : '') + '>';
  1036 + if (unit === 'hour') {
  1037 + sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, '')), {hour: i}, tp_inst._defaults);
  1038 + }
  1039 + else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; }
  1040 + else {sel += '0' + i.toString(); }
  1041 + sel += '</option>';
  1042 + }
  1043 + sel += '</select>';
  1044 +
  1045 + obj.children('select').remove();
  1046 +
  1047 + $(sel).appendTo(obj).change(function (e) {
  1048 + tp_inst._onTimeChange();
  1049 + tp_inst._onSelectHandler();
  1050 + });
  1051 +
  1052 + return obj;
  1053 + },
  1054 + options: function (tp_inst, obj, unit, opts, val) {
  1055 + var o = {},
  1056 + $t = obj.children('select');
  1057 + if (typeof(opts) === 'string') {
  1058 + if (val === undefined) {
  1059 + return $t.data(opts);
  1060 + }
  1061 + o[opts] = val;
  1062 + }
  1063 + else { o = opts; }
  1064 + return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
  1065 + },
  1066 + value: function (tp_inst, obj, unit, val) {
  1067 + var $t = obj.children('select');
  1068 + if (val !== undefined) {
  1069 + return $t.val(val);
  1070 + }
  1071 + return $t.val();
  1072 + }
  1073 + }
  1074 + } // end _controls
  1075 +
  1076 + });
  1077 +
  1078 + $.fn.extend({
  1079 + /*
  1080 + * shorthand just to use timepicker.
  1081 + */
  1082 + timepicker: function (o) {
  1083 + o = o || {};
  1084 + var tmp_args = Array.prototype.slice.call(arguments);
  1085 +
  1086 + if (typeof o === 'object') {
  1087 + tmp_args[0] = $.extend(o, {
  1088 + timeOnly: true
  1089 + });
  1090 + }
  1091 +
  1092 + return $(this).each(function () {
  1093 + $.fn.datetimepicker.apply($(this), tmp_args);
  1094 + });
  1095 + },
  1096 +
  1097 + /*
  1098 + * extend timepicker to datepicker
  1099 + */
  1100 + datetimepicker: function (o) {
  1101 + o = o || {};
  1102 + var tmp_args = arguments;
  1103 +
  1104 + if (typeof(o) === 'string') {
  1105 + if (o === 'getDate') {
  1106 + return $.fn.datepicker.apply($(this[0]), tmp_args);
  1107 + } else {
  1108 + return this.each(function () {
  1109 + var $t = $(this);
  1110 + $t.datepicker.apply($t, tmp_args);
  1111 + });
  1112 + }
  1113 + } else {
  1114 + return this.each(function () {
  1115 + var $t = $(this);
  1116 + $t.datepicker($.timepicker._newInst($t, o)._defaults);
  1117 + });
  1118 + }
  1119 + }
  1120 + });
  1121 +
  1122 + /*
  1123 + * Public Utility to parse date and time
  1124 + */
  1125 + $.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
  1126 + var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
  1127 + if (parseRes.timeObj) {
  1128 + var t = parseRes.timeObj;
  1129 + parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
  1130 + parseRes.date.setMicroseconds(t.microsec);
  1131 + }
  1132 +
  1133 + return parseRes.date;
  1134 + };
  1135 +
  1136 + /*
  1137 + * Public utility to parse time
  1138 + */
  1139 + $.datepicker.parseTime = function (timeFormat, timeString, options) {
  1140 + var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),
  1141 + iso8601 = (timeFormat.replace(/\'.*?\'/g, '').indexOf('Z') !== -1);
  1142 +
  1143 + // Strict parse requires the timeString to match the timeFormat exactly
  1144 + var strictParse = function (f, s, o) {
  1145 +
  1146 + // pattern for standard and localized AM/PM markers
  1147 + var getPatternAmpm = function (amNames, pmNames) {
  1148 + var markers = [];
  1149 + if (amNames) {
  1150 + $.merge(markers, amNames);
  1151 + }
  1152 + if (pmNames) {
  1153 + $.merge(markers, pmNames);
  1154 + }
  1155 + markers = $.map(markers, function (val) {
  1156 + return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
  1157 + });
  1158 + return '(' + markers.join('|') + ')?';
  1159 + };
  1160 +
  1161 + // figure out position of time elements.. cause js cant do named captures
  1162 + var getFormatPositions = function (timeFormat) {
  1163 + var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),
  1164 + orders = {
  1165 + h: -1,
  1166 + m: -1,
  1167 + s: -1,
  1168 + l: -1,
  1169 + c: -1,
  1170 + t: -1,
  1171 + z: -1
  1172 + };
  1173 +
  1174 + if (finds) {
  1175 + for (var i = 0; i < finds.length; i++) {
  1176 + if (orders[finds[i].toString().charAt(0)] === -1) {
  1177 + orders[finds[i].toString().charAt(0)] = i + 1;
  1178 + }
  1179 + }
  1180 + }
  1181 + return orders;
  1182 + };
  1183 +
  1184 + var regstr = '^' + f.toString()
  1185 + .replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
  1186 + var ml = match.length;
  1187 + switch (match.charAt(0).toLowerCase()) {
  1188 + case 'h':
  1189 + return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
  1190 + case 'm':
  1191 + return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
  1192 + case 's':
  1193 + return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
  1194 + case 'l':
  1195 + return '(\\d?\\d?\\d)';
  1196 + case 'c':
  1197 + return '(\\d?\\d?\\d)';
  1198 + case 'z':
  1199 + return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
  1200 + case 't':
  1201 + return getPatternAmpm(o.amNames, o.pmNames);
  1202 + default: // literal escaped in quotes
  1203 + return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
  1204 + }
  1205 + })
  1206 + .replace(/\s/g, '\\s?') +
  1207 + o.timeSuffix + '$',
  1208 + order = getFormatPositions(f),
  1209 + ampm = '',
  1210 + treg;
  1211 +
  1212 + treg = s.match(new RegExp(regstr, 'i'));
  1213 +
  1214 + var resTime = {
  1215 + hour: 0,
  1216 + minute: 0,
  1217 + second: 0,
  1218 + millisec: 0,
  1219 + microsec: 0
  1220 + };
  1221 +
  1222 + if (treg) {
  1223 + if (order.t !== -1) {
  1224 + if (treg[order.t] === undefined || treg[order.t].length === 0) {
  1225 + ampm = '';
  1226 + resTime.ampm = '';
  1227 + } else {
  1228 + ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
  1229 + resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];
  1230 + }
  1231 + }
  1232 +
  1233 + if (order.h !== -1) {
  1234 + if (ampm === 'AM' && treg[order.h] === '12') {
  1235 + resTime.hour = 0; // 12am = 0 hour
  1236 + } else {
  1237 + if (ampm === 'PM' && treg[order.h] !== '12') {
  1238 + resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
  1239 + } else {
  1240 + resTime.hour = Number(treg[order.h]);
  1241 + }
  1242 + }
  1243 + }
  1244 +
  1245 + if (order.m !== -1) {
  1246 + resTime.minute = Number(treg[order.m]);
  1247 + }
  1248 + if (order.s !== -1) {
  1249 + resTime.second = Number(treg[order.s]);
  1250 + }
  1251 + if (order.l !== -1) {
  1252 + resTime.millisec = Number(treg[order.l]);
  1253 + }
  1254 + if (order.c !== -1) {
  1255 + resTime.microsec = Number(treg[order.c]);
  1256 + }
  1257 + if (order.z !== -1 && treg[order.z] !== undefined) {
  1258 + resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]);
  1259 + }
  1260 +
  1261 +
  1262 + return resTime;
  1263 + }
  1264 + return false;
  1265 + };// end strictParse
  1266 +
  1267 + // First try JS Date, if that fails, use strictParse
  1268 + var looseParse = function (f, s, o) {
  1269 + try {
  1270 + var d = new Date('2012-01-01 ' + s);
  1271 + if (isNaN(d.getTime())) {
  1272 + d = new Date('2012-01-01T' + s);
  1273 + if (isNaN(d.getTime())) {
  1274 + d = new Date('01/01/2012 ' + s);
  1275 + if (isNaN(d.getTime())) {
  1276 + throw "Unable to parse time with native Date: " + s;
  1277 + }
  1278 + }
  1279 + }
  1280 +
  1281 + return {
  1282 + hour: d.getHours(),
  1283 + minute: d.getMinutes(),
  1284 + second: d.getSeconds(),
  1285 + millisec: d.getMilliseconds(),
  1286 + microsec: d.getMicroseconds(),
  1287 + timezone: d.getTimezoneOffset() * -1
  1288 + };
  1289 + }
  1290 + catch (err) {
  1291 + try {
  1292 + return strictParse(f, s, o);
  1293 + }
  1294 + catch (err2) {
  1295 + $.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
  1296 + }
  1297 + }
  1298 + return false;
  1299 + }; // end looseParse
  1300 +
  1301 + if (typeof o.parse === "function") {
  1302 + return o.parse(timeFormat, timeString, o);
  1303 + }
  1304 + if (o.parse === 'loose') {
  1305 + return looseParse(timeFormat, timeString, o);
  1306 + }
  1307 + return strictParse(timeFormat, timeString, o);
  1308 + };
  1309 +
  1310 + /**
  1311 + * Public utility to format the time
  1312 + * @param {string} format format of the time
  1313 + * @param {Object} time Object not a Date for timezones
  1314 + * @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm
  1315 + * @returns {string} the formatted time
  1316 + */
  1317 + $.datepicker.formatTime = function (format, time, options) {
  1318 + options = options || {};
  1319 + options = $.extend({}, $.timepicker._defaults, options);
  1320 + time = $.extend({
  1321 + hour: 0,
  1322 + minute: 0,
  1323 + second: 0,
  1324 + millisec: 0,
  1325 + microsec: 0,
  1326 + timezone: null
  1327 + }, time);
  1328 +
  1329 + var tmptime = format,
  1330 + ampmName = options.amNames[0],
  1331 + hour = parseInt(time.hour, 10);
  1332 +
  1333 + if (hour > 11) {
  1334 + ampmName = options.pmNames[0];
  1335 + }
  1336 +
  1337 + tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
  1338 + switch (match) {
  1339 + case 'HH':
  1340 + return ('0' + hour).slice(-2);
  1341 + case 'H':
  1342 + return hour;
  1343 + case 'hh':
  1344 + return ('0' + convert24to12(hour)).slice(-2);
  1345 + case 'h':
  1346 + return convert24to12(hour);
  1347 + case 'mm':
  1348 + return ('0' + time.minute).slice(-2);
  1349 + case 'm':
  1350 + return time.minute;
  1351 + case 'ss':
  1352 + return ('0' + time.second).slice(-2);
  1353 + case 's':
  1354 + return time.second;
  1355 + case 'l':
  1356 + return ('00' + time.millisec).slice(-3);
  1357 + case 'c':
  1358 + return ('00' + time.microsec).slice(-3);
  1359 + case 'z':
  1360 + return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
  1361 + case 'Z':
  1362 + return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
  1363 + case 'T':
  1364 + return ampmName.charAt(0).toUpperCase();
  1365 + case 'TT':
  1366 + return ampmName.toUpperCase();
  1367 + case 't':
  1368 + return ampmName.charAt(0).toLowerCase();
  1369 + case 'tt':
  1370 + return ampmName.toLowerCase();
  1371 + default:
  1372 + return match.replace(/'/g, "");
  1373 + }
  1374 + });
  1375 +
  1376 + return tmptime;
  1377 + };
  1378 +
  1379 + /*
  1380 + * the bad hack :/ override datepicker so it doesn't close on select
  1381 + // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
  1382 + */
  1383 + $.datepicker._base_selectDate = $.datepicker._selectDate;
  1384 + $.datepicker._selectDate = function (id, dateStr) {
  1385 + var inst = this._getInst($(id)[0]),
  1386 + tp_inst = this._get(inst, 'timepicker');
  1387 +
  1388 + if (tp_inst && inst.settings.showTimepicker) {
  1389 + tp_inst._limitMinMaxDateTime(inst, true);
  1390 + inst.inline = inst.stay_open = true;
  1391 + //This way the onSelect handler called from calendarpicker get the full dateTime
  1392 + this._base_selectDate(id, dateStr);
  1393 + inst.inline = inst.stay_open = false;
  1394 + this._notifyChange(inst);
  1395 + this._updateDatepicker(inst);
  1396 + } else {
  1397 + this._base_selectDate(id, dateStr);
  1398 + }
  1399 + };
  1400 +
  1401 + /*
  1402 + * second bad hack :/ override datepicker so it triggers an event when changing the input field
  1403 + * and does not redraw the datepicker on every selectDate event
  1404 + */
  1405 + $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
  1406 + $.datepicker._updateDatepicker = function (inst) {
  1407 +
  1408 + // don't popup the datepicker if there is another instance already opened
  1409 + var input = inst.input[0];
  1410 + if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
  1411 + return;
  1412 + }
  1413 +
  1414 + if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
  1415 +
  1416 + this._base_updateDatepicker(inst);
  1417 +
  1418 + // Reload the time control when changing something in the input text field.
  1419 + var tp_inst = this._get(inst, 'timepicker');
  1420 + if (tp_inst) {
  1421 + tp_inst._addTimePicker(inst);
  1422 + }
  1423 + }
  1424 + };
  1425 +
  1426 + /*
  1427 + * third bad hack :/ override datepicker so it allows spaces and colon in the input field
  1428 + */
  1429 + $.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
  1430 + $.datepicker._doKeyPress = function (event) {
  1431 + var inst = $.datepicker._getInst(event.target),
  1432 + tp_inst = $.datepicker._get(inst, 'timepicker');
  1433 +
  1434 + if (tp_inst) {
  1435 + if ($.datepicker._get(inst, 'constrainInput')) {
  1436 + var ampm = tp_inst.support.ampm,
  1437 + tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
  1438 + dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
  1439 + datetimeChars = tp_inst._defaults.timeFormat.toString()
  1440 + .replace(/[hms]/g, '')
  1441 + .replace(/TT/g, ampm ? 'APM' : '')
  1442 + .replace(/Tt/g, ampm ? 'AaPpMm' : '')
  1443 + .replace(/tT/g, ampm ? 'AaPpMm' : '')
  1444 + .replace(/T/g, ampm ? 'AP' : '')
  1445 + .replace(/tt/g, ampm ? 'apm' : '')
  1446 + .replace(/t/g, ampm ? 'ap' : '') +
  1447 + " " + tp_inst._defaults.separator +
  1448 + tp_inst._defaults.timeSuffix +
  1449 + (tz ? tp_inst._defaults.timezoneList.join('') : '') +
  1450 + (tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
  1451 + dateChars,
  1452 + chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
  1453 + return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
  1454 + }
  1455 + }
  1456 +
  1457 + return $.datepicker._base_doKeyPress(event);
  1458 + };
  1459 +
  1460 + /*
  1461 + * Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
  1462 + * Update any alternate field to synchronise with the main field.
  1463 + */
  1464 + $.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
  1465 + $.datepicker._updateAlternate = function (inst) {
  1466 + var tp_inst = this._get(inst, 'timepicker');
  1467 + if (tp_inst) {
  1468 + var altField = tp_inst._defaults.altField;
  1469 + if (altField) { // update alternate field too
  1470 + var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
  1471 + date = this._getDate(inst),
  1472 + formatCfg = $.datepicker._getFormatConfig(inst),
  1473 + altFormattedDateTime = '',
  1474 + altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
  1475 + altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
  1476 + altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
  1477 +
  1478 + altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
  1479 + if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
  1480 + if (tp_inst._defaults.altFormat) {
  1481 + altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;
  1482 + }
  1483 + else {
  1484 + altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
  1485 + }
  1486 + }
  1487 + $(altField).val(altFormattedDateTime);
  1488 + }
  1489 + }
  1490 + else {
  1491 + $.datepicker._base_updateAlternate(inst);
  1492 + }
  1493 + };
  1494 +
  1495 + /*
  1496 + * Override key up event to sync manual input changes.
  1497 + */
  1498 + $.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
  1499 + $.datepicker._doKeyUp = function (event) {
  1500 + var inst = $.datepicker._getInst(event.target),
  1501 + tp_inst = $.datepicker._get(inst, 'timepicker');
  1502 +
  1503 + if (tp_inst) {
  1504 + if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
  1505 + try {
  1506 + $.datepicker._updateDatepicker(inst);
  1507 + } catch (err) {
  1508 + $.timepicker.log(err);
  1509 + }
  1510 + }
  1511 + }
  1512 +
  1513 + return $.datepicker._base_doKeyUp(event);
  1514 + };
  1515 +
  1516 + /*
  1517 + * override "Today" button to also grab the time.
  1518 + */
  1519 + $.datepicker._base_gotoToday = $.datepicker._gotoToday;
  1520 + $.datepicker._gotoToday = function (id) {
  1521 + var inst = this._getInst($(id)[0]),
  1522 + $dp = inst.dpDiv;
  1523 + this._base_gotoToday(id);
  1524 + var tp_inst = this._get(inst, 'timepicker');
  1525 + selectLocalTimezone(tp_inst);
  1526 + var now = new Date();
  1527 + this._setTime(inst, now);
  1528 + $('.ui-datepicker-today', $dp).click();
  1529 + };
  1530 +
  1531 + /*
  1532 + * Disable & enable the Time in the datetimepicker
  1533 + */
  1534 + $.datepicker._disableTimepickerDatepicker = function (target) {
  1535 + var inst = this._getInst(target);
  1536 + if (!inst) {
  1537 + return;
  1538 + }
  1539 +
  1540 + var tp_inst = this._get(inst, 'timepicker');
  1541 + $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
  1542 + if (tp_inst) {
  1543 + inst.settings.showTimepicker = false;
  1544 + tp_inst._defaults.showTimepicker = false;
  1545 + tp_inst._updateDateTime(inst);
  1546 + }
  1547 + };
  1548 +
  1549 + $.datepicker._enableTimepickerDatepicker = function (target) {
  1550 + var inst = this._getInst(target);
  1551 + if (!inst) {
  1552 + return;
  1553 + }
  1554 +
  1555 + var tp_inst = this._get(inst, 'timepicker');
  1556 + $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
  1557 + if (tp_inst) {
  1558 + inst.settings.showTimepicker = true;
  1559 + tp_inst._defaults.showTimepicker = true;
  1560 + tp_inst._addTimePicker(inst); // Could be disabled on page load
  1561 + tp_inst._updateDateTime(inst);
  1562 + }
  1563 + };
  1564 +
  1565 + /*
  1566 + * Create our own set time function
  1567 + */
  1568 + $.datepicker._setTime = function (inst, date) {
  1569 + var tp_inst = this._get(inst, 'timepicker');
  1570 + if (tp_inst) {
  1571 + var defaults = tp_inst._defaults;
  1572 +
  1573 + // calling _setTime with no date sets time to defaults
  1574 + tp_inst.hour = date ? date.getHours() : defaults.hour;
  1575 + tp_inst.minute = date ? date.getMinutes() : defaults.minute;
  1576 + tp_inst.second = date ? date.getSeconds() : defaults.second;
  1577 + tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
  1578 + tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
  1579 +
  1580 + //check if within min/max times..
  1581 + tp_inst._limitMinMaxDateTime(inst, true);
  1582 +
  1583 + tp_inst._onTimeChange();
  1584 + tp_inst._updateDateTime(inst);
  1585 + }
  1586 + };
  1587 +
  1588 + /*
  1589 + * Create new public method to set only time, callable as $().datepicker('setTime', date)
  1590 + */
  1591 + $.datepicker._setTimeDatepicker = function (target, date, withDate) {
  1592 + var inst = this._getInst(target);
  1593 + if (!inst) {
  1594 + return;
  1595 + }
  1596 +
  1597 + var tp_inst = this._get(inst, 'timepicker');
  1598 +
  1599 + if (tp_inst) {
  1600 + this._setDateFromField(inst);
  1601 + var tp_date;
  1602 + if (date) {
  1603 + if (typeof date === "string") {
  1604 + tp_inst._parseTime(date, withDate);
  1605 + tp_date = new Date();
  1606 + tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
  1607 + tp_date.setMicroseconds(tp_inst.microsec);
  1608 + } else {
  1609 + tp_date = new Date(date.getTime());
  1610 + tp_date.setMicroseconds(date.getMicroseconds());
  1611 + }
  1612 + if (tp_date.toString() === 'Invalid Date') {
  1613 + tp_date = undefined;
  1614 + }
  1615 + this._setTime(inst, tp_date);
  1616 + }
  1617 + }
  1618 +
  1619 + };
  1620 +
  1621 + /*
  1622 + * override setDate() to allow setting time too within Date object
  1623 + */
  1624 + $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
  1625 + $.datepicker._setDateDatepicker = function (target, date) {
  1626 + var inst = this._getInst(target);
  1627 + if (!inst) {
  1628 + return;
  1629 + }
  1630 +
  1631 + if (typeof(date) === 'string') {
  1632 + date = new Date(date);
  1633 + if (!date.getTime()) {
  1634 + $.timepicker.log("Error creating Date object from string.");
  1635 + }
  1636 + }
  1637 +
  1638 + var tp_inst = this._get(inst, 'timepicker');
  1639 + var tp_date;
  1640 + if (date instanceof Date) {
  1641 + tp_date = new Date(date.getTime());
  1642 + tp_date.setMicroseconds(date.getMicroseconds());
  1643 + } else {
  1644 + tp_date = date;
  1645 + }
  1646 +
  1647 + // This is important if you are using the timezone option, javascript's Date
  1648 + // object will only return the timezone offset for the current locale, so we
  1649 + // adjust it accordingly. If not using timezone option this won't matter..
  1650 + // If a timezone is different in tp, keep the timezone as is
  1651 + if (tp_inst && tp_date) {
  1652 + // look out for DST if tz wasn't specified
  1653 + if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
  1654 + tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
  1655 + }
  1656 + date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
  1657 + tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
  1658 + }
  1659 +
  1660 + this._updateDatepicker(inst);
  1661 + this._base_setDateDatepicker.apply(this, arguments);
  1662 + this._setTimeDatepicker(target, tp_date, true);
  1663 + };
  1664 +
  1665 + /*
  1666 + * override getDate() to allow getting time too within Date object
  1667 + */
  1668 + $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
  1669 + $.datepicker._getDateDatepicker = function (target, noDefault) {
  1670 + var inst = this._getInst(target);
  1671 + if (!inst) {
  1672 + return;
  1673 + }
  1674 +
  1675 + var tp_inst = this._get(inst, 'timepicker');
  1676 +
  1677 + if (tp_inst) {
  1678 + // if it hasn't yet been defined, grab from field
  1679 + if (inst.lastVal === undefined) {
  1680 + this._setDateFromField(inst, noDefault);
  1681 + }
  1682 +
  1683 + var date = this._getDate(inst);
  1684 + if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
  1685 + date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
  1686 + date.setMicroseconds(tp_inst.microsec);
  1687 +
  1688 + // This is important if you are using the timezone option, javascript's Date
  1689 + // object will only return the timezone offset for the current locale, so we
  1690 + // adjust it accordingly. If not using timezone option this won't matter..
  1691 + if (tp_inst.timezone != null) {
  1692 + // look out for DST if tz wasn't specified
  1693 + if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
  1694 + tp_inst.timezone = date.getTimezoneOffset() * -1;
  1695 + }
  1696 + date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
  1697 + }
  1698 + }
  1699 + return date;
  1700 + }
  1701 + return this._base_getDateDatepicker(target, noDefault);
  1702 + };
  1703 +
  1704 + /*
  1705 + * override parseDate() because UI 1.8.14 throws an error about "Extra characters"
  1706 + * An option in datapicker to ignore extra format characters would be nicer.
  1707 + */
  1708 + $.datepicker._base_parseDate = $.datepicker.parseDate;
  1709 + $.datepicker.parseDate = function (format, value, settings) {
  1710 + var date;
  1711 + try {
  1712 + date = this._base_parseDate(format, value, settings);
  1713 + } catch (err) {
  1714 + // Hack! The error message ends with a colon, a space, and
  1715 + // the "extra" characters. We rely on that instead of
  1716 + // attempting to perfectly reproduce the parsing algorithm.
  1717 + if (err.indexOf(":") >= 0) {
  1718 + date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings);
  1719 + $.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
  1720 + } else {
  1721 + throw err;
  1722 + }
  1723 + }
  1724 + return date;
  1725 + };
  1726 +
  1727 + /*
  1728 + * override formatDate to set date with time to the input
  1729 + */
  1730 + $.datepicker._base_formatDate = $.datepicker._formatDate;
  1731 + $.datepicker._formatDate = function (inst, day, month, year) {
  1732 + var tp_inst = this._get(inst, 'timepicker');
  1733 + if (tp_inst) {
  1734 + tp_inst._updateDateTime(inst);
  1735 + return tp_inst.$input.val();
  1736 + }
  1737 + return this._base_formatDate(inst);
  1738 + };
  1739 +
  1740 + /*
  1741 + * override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
  1742 + */
  1743 + $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
  1744 + $.datepicker._optionDatepicker = function (target, name, value) {
  1745 + var inst = this._getInst(target),
  1746 + name_clone;
  1747 + if (!inst) {
  1748 + return null;
  1749 + }
  1750 +
  1751 + var tp_inst = this._get(inst, 'timepicker');
  1752 + if (tp_inst) {
  1753 + var min = null,
  1754 + max = null,
  1755 + onselect = null,
  1756 + overrides = tp_inst._defaults.evnts,
  1757 + fns = {},
  1758 + prop;
  1759 + if (typeof name === 'string') { // if min/max was set with the string
  1760 + if (name === 'minDate' || name === 'minDateTime') {
  1761 + min = value;
  1762 + } else if (name === 'maxDate' || name === 'maxDateTime') {
  1763 + max = value;
  1764 + } else if (name === 'onSelect') {
  1765 + onselect = value;
  1766 + } else if (overrides.hasOwnProperty(name)) {
  1767 + if (typeof (value) === 'undefined') {
  1768 + return overrides[name];
  1769 + }
  1770 + fns[name] = value;
  1771 + name_clone = {}; //empty results in exiting function after overrides updated
  1772 + }
  1773 + } else if (typeof name === 'object') { //if min/max was set with the JSON
  1774 + if (name.minDate) {
  1775 + min = name.minDate;
  1776 + } else if (name.minDateTime) {
  1777 + min = name.minDateTime;
  1778 + } else if (name.maxDate) {
  1779 + max = name.maxDate;
  1780 + } else if (name.maxDateTime) {
  1781 + max = name.maxDateTime;
  1782 + }
  1783 + for (prop in overrides) {
  1784 + if (overrides.hasOwnProperty(prop) && name[prop]) {
  1785 + fns[prop] = name[prop];
  1786 + }
  1787 + }
  1788 + }
  1789 + for (prop in fns) {
  1790 + if (fns.hasOwnProperty(prop)) {
  1791 + overrides[prop] = fns[prop];
  1792 + if (!name_clone) { name_clone = $.extend({}, name); }
  1793 + delete name_clone[prop];
  1794 + }
  1795 + }
  1796 + if (name_clone && isEmptyObject(name_clone)) { return; }
  1797 + if (min) { //if min was set
  1798 + if (min === 0) {
  1799 + min = new Date();
  1800 + } else {
  1801 + min = new Date(min);
  1802 + }
  1803 + tp_inst._defaults.minDate = min;
  1804 + tp_inst._defaults.minDateTime = min;
  1805 + } else if (max) { //if max was set
  1806 + if (max === 0) {
  1807 + max = new Date();
  1808 + } else {
  1809 + max = new Date(max);
  1810 + }
  1811 + tp_inst._defaults.maxDate = max;
  1812 + tp_inst._defaults.maxDateTime = max;
  1813 + } else if (onselect) {
  1814 + tp_inst._defaults.onSelect = onselect;
  1815 + }
  1816 + }
  1817 + if (value === undefined) {
  1818 + return this._base_optionDatepicker.call($.datepicker, target, name);
  1819 + }
  1820 + return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
  1821 + };
  1822 +
  1823 + /*
  1824 + * jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
  1825 + * it will return false for all objects
  1826 + */
  1827 + var isEmptyObject = function (obj) {
  1828 + var prop;
  1829 + for (prop in obj) {
  1830 + if (obj.hasOwnProperty(prop)) {
  1831 + return false;
  1832 + }
  1833 + }
  1834 + return true;
  1835 + };
  1836 +
  1837 + /*
  1838 + * jQuery extend now ignores nulls!
  1839 + */
  1840 + var extendRemove = function (target, props) {
  1841 + $.extend(target, props);
  1842 + for (var name in props) {
  1843 + if (props[name] === null || props[name] === undefined) {
  1844 + target[name] = props[name];
  1845 + }
  1846 + }
  1847 + return target;
  1848 + };
  1849 +
  1850 + /*
  1851 + * Determine by the time format which units are supported
  1852 + * Returns an object of booleans for each unit
  1853 + */
  1854 + var detectSupport = function (timeFormat) {
  1855 + var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals
  1856 + isIn = function (f, t) { // does the format contain the token?
  1857 + return f.indexOf(t) !== -1 ? true : false;
  1858 + };
  1859 + return {
  1860 + hour: isIn(tf, 'h'),
  1861 + minute: isIn(tf, 'm'),
  1862 + second: isIn(tf, 's'),
  1863 + millisec: isIn(tf, 'l'),
  1864 + microsec: isIn(tf, 'c'),
  1865 + timezone: isIn(tf, 'z'),
  1866 + ampm: isIn(tf, 't') && isIn(timeFormat, 'h'),
  1867 + iso8601: isIn(timeFormat, 'Z')
  1868 + };
  1869 + };
  1870 +
  1871 + /*
  1872 + * Converts 24 hour format into 12 hour
  1873 + * Returns 12 hour without leading 0
  1874 + */
  1875 + var convert24to12 = function (hour) {
  1876 + hour %= 12;
  1877 +
  1878 + if (hour === 0) {
  1879 + hour = 12;
  1880 + }
  1881 +
  1882 + return String(hour);
  1883 + };
  1884 +
  1885 + var computeEffectiveSetting = function (settings, property) {
  1886 + return settings && settings[property] ? settings[property] : $.timepicker._defaults[property];
  1887 + };
  1888 +
  1889 + /*
  1890 + * Splits datetime string into date and time substrings.
  1891 + * Throws exception when date can't be parsed
  1892 + * Returns {dateString: dateString, timeString: timeString}
  1893 + */
  1894 + var splitDateTime = function (dateTimeString, timeSettings) {
  1895 + // The idea is to get the number separator occurrences in datetime and the time format requested (since time has
  1896 + // fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
  1897 + var separator = computeEffectiveSetting(timeSettings, 'separator'),
  1898 + format = computeEffectiveSetting(timeSettings, 'timeFormat'),
  1899 + timeParts = format.split(separator), // how many occurrences of separator may be in our format?
  1900 + timePartsLen = timeParts.length,
  1901 + allParts = dateTimeString.split(separator),
  1902 + allPartsLen = allParts.length;
  1903 +
  1904 + if (allPartsLen > 1) {
  1905 + return {
  1906 + dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),
  1907 + timeString: allParts.splice(0, timePartsLen).join(separator)
  1908 + };
  1909 + }
  1910 +
  1911 + return {
  1912 + dateString: dateTimeString,
  1913 + timeString: ''
  1914 + };
  1915 + };
  1916 +
  1917 + /*
  1918 + * Internal function to parse datetime interval
  1919 + * Returns: {date: Date, timeObj: Object}, where
  1920 + * date - parsed date without time (type Date)
  1921 + * timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional
  1922 + */
  1923 + var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
  1924 + var date,
  1925 + parts,
  1926 + parsedTime;
  1927 +
  1928 + parts = splitDateTime(dateTimeString, timeSettings);
  1929 + date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);
  1930 +
  1931 + if (parts.timeString === '') {
  1932 + return {
  1933 + date: date
  1934 + };
  1935 + }
  1936 +
  1937 + parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);
  1938 +
  1939 + if (!parsedTime) {
  1940 + throw 'Wrong time format';
  1941 + }
  1942 +
  1943 + return {
  1944 + date: date,
  1945 + timeObj: parsedTime
  1946 + };
  1947 + };
  1948 +
  1949 + /*
  1950 + * Internal function to set timezone_select to the local timezone
  1951 + */
  1952 + var selectLocalTimezone = function (tp_inst, date) {
  1953 + if (tp_inst && tp_inst.timezone_select) {
  1954 + var now = date || new Date();
  1955 + tp_inst.timezone_select.val(-now.getTimezoneOffset());
  1956 + }
  1957 + };
  1958 +
  1959 + /*
  1960 + * Create a Singleton Instance
  1961 + */
  1962 + $.timepicker = new Timepicker();
  1963 +
  1964 + /**
  1965 + * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
  1966 + * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned
  1967 + * @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45"
  1968 + * @return {string}
  1969 + */
  1970 + $.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) {
  1971 + if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {
  1972 + return tzMinutes;
  1973 + }
  1974 +
  1975 + var off = tzMinutes,
  1976 + minutes = off % 60,
  1977 + hours = (off - minutes) / 60,
  1978 + iso = iso8601 ? ':' : '',
  1979 + tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);
  1980 +
  1981 + if (tz === '+00:00') {
  1982 + return 'Z';
  1983 + }
  1984 + return tz;
  1985 + };
  1986 +
  1987 + /**
  1988 + * Get the number in minutes that represents a timezone string
  1989 + * @param {string} tzString formatted like "+0500", "-1245", "Z"
  1990 + * @return {number} the offset minutes or the original string if it doesn't match expectations
  1991 + */
  1992 + $.timepicker.timezoneOffsetNumber = function (tzString) {
  1993 + var normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with "+1245"
  1994 +
  1995 + if (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset
  1996 + return 0;
  1997 + }
  1998 +
  1999 + if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
  2000 + return tzString;
  2001 + }
  2002 +
  2003 + return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
  2004 + ((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
  2005 + parseInt(normalized.substr(3, 2), 10))); // minutes
  2006 + };
  2007 +
  2008 + /**
  2009 + * No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
  2010 + * @param {Date} date
  2011 + * @param {string} toTimezone formatted like "+0500", "-1245"
  2012 + * @return {Date}
  2013 + */
  2014 + $.timepicker.timezoneAdjust = function (date, toTimezone) {
  2015 + var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
  2016 + if (!isNaN(toTz)) {
  2017 + date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz);
  2018 + }
  2019 + return date;
  2020 + };
  2021 +
  2022 + /**
  2023 + * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
  2024 + * enforce date range limits.
  2025 + * n.b. The input value must be correctly formatted (reformatting is not supported)
  2026 + * @param {Element} startTime
  2027 + * @param {Element} endTime
  2028 + * @param {Object} options Options for the timepicker() call
  2029 + * @return {jQuery}
  2030 + */
  2031 + $.timepicker.timeRange = function (startTime, endTime, options) {
  2032 + return $.timepicker.handleRange('timepicker', startTime, endTime, options);
  2033 + };
  2034 +
  2035 + /**
  2036 + * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
  2037 + * enforce date range limits.
  2038 + * @param {Element} startTime
  2039 + * @param {Element} endTime
  2040 + * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,
  2041 + * a boolean value that can be used to reformat the input values to the `dateFormat`.
  2042 + * @param {string} method Can be used to specify the type of picker to be added
  2043 + * @return {jQuery}
  2044 + */
  2045 + $.timepicker.datetimeRange = function (startTime, endTime, options) {
  2046 + $.timepicker.handleRange('datetimepicker', startTime, endTime, options);
  2047 + };
  2048 +
  2049 + /**
  2050 + * Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to
  2051 + * enforce date range limits.
  2052 + * @param {Element} startTime
  2053 + * @param {Element} endTime
  2054 + * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,
  2055 + * a boolean value that can be used to reformat the input values to the `dateFormat`.
  2056 + * @return {jQuery}
  2057 + */
  2058 + $.timepicker.dateRange = function (startTime, endTime, options) {
  2059 + $.timepicker.handleRange('datepicker', startTime, endTime, options);
  2060 + };
  2061 +
  2062 + /**
  2063 + * Calls `method` on the `startTime` and `endTime` elements, and configures them to
  2064 + * enforce date range limits.
  2065 + * @param {string} method Can be used to specify the type of picker to be added
  2066 + * @param {Element} startTime
  2067 + * @param {Element} endTime
  2068 + * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,
  2069 + * a boolean value that can be used to reformat the input values to the `dateFormat`.
  2070 + * @return {jQuery}
  2071 + */
  2072 + $.timepicker.handleRange = function (method, startTime, endTime, options) {
  2073 + options = $.extend({}, {
  2074 + minInterval: 0, // min allowed interval in milliseconds
  2075 + maxInterval: 0, // max allowed interval in milliseconds
  2076 + start: {}, // options for start picker
  2077 + end: {} // options for end picker
  2078 + }, options);
  2079 +
  2080 + // for the mean time this fixes an issue with calling getDate with timepicker()
  2081 + var timeOnly = false;
  2082 + if(method === 'timepicker'){
  2083 + timeOnly = true;
  2084 + method = 'datetimepicker';
  2085 + }
  2086 +
  2087 + function checkDates(changed, other) {
  2088 + var startdt = startTime[method]('getDate'),
  2089 + enddt = endTime[method]('getDate'),
  2090 + changeddt = changed[method]('getDate');
  2091 +
  2092 + if (startdt !== null) {
  2093 + var minDate = new Date(startdt.getTime()),
  2094 + maxDate = new Date(startdt.getTime());
  2095 +
  2096 + minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);
  2097 + maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);
  2098 +
  2099 + if (options.minInterval > 0 && minDate > enddt) { // minInterval check
  2100 + endTime[method]('setDate', minDate);
  2101 + }
  2102 + else if (options.maxInterval > 0 && maxDate < enddt) { // max interval check
  2103 + endTime[method]('setDate', maxDate);
  2104 + }
  2105 + else if (startdt > enddt) {
  2106 + other[method]('setDate', changeddt);
  2107 + }
  2108 + }
  2109 + }
  2110 +
  2111 + function selected(changed, other, option) {
  2112 + if (!changed.val()) {
  2113 + return;
  2114 + }
  2115 + var date = changed[method].call(changed, 'getDate');
  2116 + if (date !== null && options.minInterval > 0) {
  2117 + if (option === 'minDate') {
  2118 + date.setMilliseconds(date.getMilliseconds() + options.minInterval);
  2119 + }
  2120 + if (option === 'maxDate') {
  2121 + date.setMilliseconds(date.getMilliseconds() - options.minInterval);
  2122 + }
  2123 + }
  2124 + if (date.getTime) {
  2125 + other[method].call(other, 'option', option, date);
  2126 + }
  2127 + }
  2128 +
  2129 + $.fn[method].call(startTime, $.extend({
  2130 + timeOnly: timeOnly,
  2131 + onClose: function (dateText, inst) {
  2132 + checkDates($(this), endTime);
  2133 + },
  2134 + onSelect: function (selectedDateTime) {
  2135 + selected($(this), endTime, 'minDate');
  2136 + }
  2137 + }, options, options.start));
  2138 + $.fn[method].call(endTime, $.extend({
  2139 + timeOnly: timeOnly,
  2140 + onClose: function (dateText, inst) {
  2141 + checkDates($(this), startTime);
  2142 + },
  2143 + onSelect: function (selectedDateTime) {
  2144 + selected($(this), startTime, 'maxDate');
  2145 + }
  2146 + }, options, options.end));
  2147 +
  2148 + checkDates(startTime, endTime);
  2149 + selected(startTime, endTime, 'minDate');
  2150 + selected(endTime, startTime, 'maxDate');
  2151 + return $([startTime.get(0), endTime.get(0)]);
  2152 + };
  2153 +
  2154 + /**
  2155 + * Log error or data to the console during error or debugging
  2156 + * @param {Object} err pass any type object to log to the console during error or debugging
  2157 + * @return {void}
  2158 + */
  2159 + $.timepicker.log = function (err) {
  2160 + if (window.console) {
  2161 + window.console.log(err);
  2162 + }
  2163 + };
  2164 +
  2165 + /*
  2166 + * Add util object to allow access to private methods for testability.
  2167 + */
  2168 + $.timepicker._util = {
  2169 + _extendRemove: extendRemove,
  2170 + _isEmptyObject: isEmptyObject,
  2171 + _convert24to12: convert24to12,
  2172 + _detectSupport: detectSupport,
  2173 + _selectLocalTimezone: selectLocalTimezone,
  2174 + _computeEffectiveSetting: computeEffectiveSetting,
  2175 + _splitDateTime: splitDateTime,
  2176 + _parseDateTimeInternal: parseDateTimeInternal
  2177 + };
  2178 +
  2179 + /*
  2180 + * Microsecond support
  2181 + */
  2182 + if (!Date.prototype.getMicroseconds) {
  2183 + Date.prototype.microseconds = 0;
  2184 + Date.prototype.getMicroseconds = function () { return this.microseconds; };
  2185 + Date.prototype.setMicroseconds = function (m) {
  2186 + this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000));
  2187 + this.microseconds = m % 1000;
  2188 + return this;
  2189 + };
  2190 + }
  2191 +
  2192 + /*
  2193 + * Keep up with the version
  2194 + */
  2195 + $.timepicker.version = "1.4.4";
  2196 +
  2197 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/dist/jquery-ui-timepicker-addon.min.css 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +/*! jQuery Timepicker Addon - v1.4.4 - 2014-03-29
  2 +* http://trentrichardson.com/examples/timepicker
  3 +* Copyright (c) 2014 Trent Richardson; Licensed MIT */
  4 +
  5 +.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:0;border:0;margin:0;padding:0}.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}
0 6 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/dist/jquery-ui-timepicker-addon.min.js 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +/*! jQuery Timepicker Addon - v1.4.4 - 2014-03-29
  2 +* http://trentrichardson.com/examples/timepicker
  3 +* Copyright (c) 2014 Trent Richardson; Licensed MIT */
  4 +(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.4.4"}});var Timepicker=function(){this.regional=[],this.regional[""]={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:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,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:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",defaultValue:null,parse:"strict"},$.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,setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_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(e,t){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],e,t,tp_inst):void 0},onChangeMonthYear:function(e,t,i){tp_inst._updateDateTime(i),$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],e,t,i,tp_inst)},onClose:function(e,t){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(t),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],e,t,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(e){return e.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(e){return e.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&$.ui.slider===void 0&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;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];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),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,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField).css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&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()}),tp_inst},_addTimePicker:function(e){var t=this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val();this.timeDefined=this._parseTime(t),this._limitMinMaxDateTime(e,!1),this._injectTimePicker()},_parseTime:function(e,t){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),t||!this._defaults.timeOnly){var i=$.datepicker._get(this.inst,"dateFormat");try{var s=parseDateTimeInternal(i,this._defaults.timeFormat,e,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!s.timeObj)return!1;$.extend(this,s.timeObj)}catch(a){return $.timepicker.log("Error parsing the date/time string: "+a+"\ndate/time string = "+e+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+i),!1}return!0}var n=$.datepicker.parseTime(this._defaults.timeFormat,e,this._defaults);return n?($.extend(this,n),!0):!1},_injectTimePicker:function(){var e=this.inst.dpDiv,t=this.inst.settings,i=this,s="",a="",n=null,r={},l={},o=null,c=0,u=0;if(0===e.find("div.ui-timepicker-div").length&&t.showTimepicker){var m=' style="display:none;"',d='<div class="ui-timepicker-div'+(t.isRTL?" ui-timepicker-rtl":"")+'"><dl>'+'<dt class="ui_tpicker_time_label"'+(t.showTime?"":m)+">"+t.timeText+"</dt>"+'<dd class="ui_tpicker_time"'+(t.showTime?"":m)+"></dd>";for(c=0,u=this.units.length;u>c;c++){if(s=this.units[c],a=s.substr(0,1).toUpperCase()+s.substr(1),n=null!==t["show"+a]?t["show"+a]:this.support[s],r[s]=parseInt(t[s+"Max"]-(t[s+"Max"]-t[s+"Min"])%t["step"+a],10),l[s]=0,d+='<dt class="ui_tpicker_'+s+'_label"'+(n?"":m)+">"+t[s+"Text"]+"</dt>"+'<dd class="ui_tpicker_'+s+'"><div class="ui_tpicker_'+s+'_slider"'+(n?"":m)+"></div>",n&&t[s+"Grid"]>0){if(d+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===s)for(var h=t[s+"Min"];r[s]>=h;h+=parseInt(t[s+"Grid"],10)){l[s]++;var p=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:h},t);d+='<td data-for="'+s+'">'+p+"</td>"}else for(var _=t[s+"Min"];r[s]>=_;_+=parseInt(t[s+"Grid"],10))l[s]++,d+='<td data-for="'+s+'">'+(10>_?"0":"")+_+"</td>";d+="</tr></table></div>"}d+="</dd>"}var f=null!==t.showTimezone?t.showTimezone:this.support.timezone;d+='<dt class="ui_tpicker_timezone_label"'+(f?"":m)+">"+t.timezoneText+"</dt>",d+='<dd class="ui_tpicker_timezone" '+(f?"":m)+"></dd>",d+="</dl></div>";var g=$(d);for(t.timeOnly===!0&&(g.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+t.timeOnlyTitle+"</div>"+"</div>"),e.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),c=0,u=i.units.length;u>c;c++)s=i.units[c],a=s.substr(0,1).toUpperCase()+s.substr(1),n=null!==t["show"+a]?t["show"+a]:this.support[s],i[s+"_slider"]=i.control.create(i,g.find(".ui_tpicker_"+s+"_slider"),s,i[s],t[s+"Min"],r[s],t["step"+a]),n&&t[s+"Grid"]>0&&(o=100*l[s]*t[s+"Grid"]/(r[s]-t[s+"Min"]),g.find(".ui_tpicker_"+s+" table").css({width:o+"%",marginLeft:t.isRTL?"0":o/(-2*l[s])+"%",marginRight:t.isRTL?o/(-2*l[s])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(){var e=$(this),t=e.html(),a=parseInt(t.replace(/[^0-9]/g),10),n=t.replace(/[^apm]/gi),r=e.data("for");"hour"===r&&(-1!==n.indexOf("p")&&12>a?a+=12:-1!==n.indexOf("a")&&12===a&&(a=0)),i.control.value(i,i[r+"_slider"],s,a),i._onTimeChange(),i._onSelectHandler()}).css({cursor:"pointer",width:100/l[s]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=g.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(t.timezoneList,function(e){return $("<option />").val("object"==typeof e?e.value:e).text("object"==typeof e?e.label:e)})),this.timezone!==void 0&&null!==this.timezone&&""!==this.timezone){var M=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();M===this.timezone?selectLocalTimezone(i):this.timezone_select.val(this.timezone)}else this.hour!==void 0&&null!==this.hour&&""!==this.hour?this.timezone_select.val(t.timezone):selectLocalTimezone(i);this.timezone_select.change(function(){i._onTimeChange(),i._onSelectHandler()});var v=e.find(".ui-datepicker-buttonpane");if(v.length?v.before(g):e.append(g),this.$timeObj=g.find(".ui_tpicker_time"),null!==this.inst){var k=this.timeDefined;this._onTimeChange(),this.timeDefined=k}if(this._defaults.addSliderAccess){var T=this._defaults.sliderAccessArgs,D=this._defaults.isRTL;T.isRTL=D,setTimeout(function(){if(0===g.find(".ui-slider-access").length){g.find(".ui-slider:visible").sliderAccess(T);var e=g.find(".ui-slider-access:eq(0)").outerWidth(!0);e&&g.find("table:visible").each(function(){var t=$(this),i=t.outerWidth(),s=(""+t.css(D?"marginRight":"marginLeft")).replace("%",""),a=i-e,n=s*a/i+"%",r={width:a,marginRight:0,marginLeft:0};r[D?"marginRight":"marginLeft"]=n,t.css(r)})}},10)}i._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(e,t){var i=this._defaults,s=new Date(e.selectedYear,e.selectedMonth,e.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(e,"minDateTime")&&void 0!==$.datepicker._get(e,"minDateTime")&&s){var a=$.datepicker._get(e,"minDateTime"),n=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0);(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal||null===this.millisecMinOriginal||null===this.microsecMinOriginal)&&(this.hourMinOriginal=i.hourMin,this.minuteMinOriginal=i.minuteMin,this.secondMinOriginal=i.secondMin,this.millisecMinOriginal=i.millisecMin,this.microsecMinOriginal=i.microsecMin),e.settings.timeOnly||n.getTime()===s.getTime()?(this._defaults.hourMin=a.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=a.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=a.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=a.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=a.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(e,"maxDateTime")&&void 0!==$.datepicker._get(e,"maxDateTime")&&s){var r=$.datepicker._get(e,"maxDateTime"),l=new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0,0);(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal||null===this.millisecMaxOriginal)&&(this.hourMaxOriginal=i.hourMax,this.minuteMaxOriginal=i.minuteMax,this.secondMaxOriginal=i.secondMax,this.millisecMaxOriginal=i.millisecMax,this.microsecMaxOriginal=i.microsecMax),e.settings.timeOnly||l.getTime()===s.getTime()?(this._defaults.hourMax=r.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=r.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=r.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=r.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=r.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==e.settings.minTime){var o=new Date("01/01/1970 "+e.settings.minTime);this.hour<o.getHours()?(this.hour=this._defaults.hourMin=o.getHours(),this.minute=this._defaults.minuteMin=o.getMinutes()):this.hour===o.getHours()&&this.minute<o.getMinutes()?this.minute=this._defaults.minuteMin=o.getMinutes():this._defaults.hourMin<o.getHours()?(this._defaults.hourMin=o.getHours(),this._defaults.minuteMin=o.getMinutes()):this._defaults.minuteMin=this._defaults.hourMin===o.getHours()===this.hour&&this._defaults.minuteMin<o.getMinutes()?o.getMinutes():0}if(null!==e.settings.maxTime){var c=new Date("01/01/1970 "+e.settings.maxTime);this.hour>c.getHours()?(this.hour=this._defaults.hourMax=c.getHours(),this.minute=this._defaults.minuteMax=c.getMinutes()):this.hour===c.getHours()&&this.minute>c.getMinutes()?this.minute=this._defaults.minuteMax=c.getMinutes():this._defaults.hourMax>c.getHours()?(this._defaults.hourMax=c.getHours(),this._defaults.minuteMax=c.getMinutes()):this._defaults.minuteMax=this._defaults.hourMax===c.getHours()===this.hour&&this._defaults.minuteMax>c.getMinutes()?c.getMinutes():59}if(void 0!==t&&t===!0){var u=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),m=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),d=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),h=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),p=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:u,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:m,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:d,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:h,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:p,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var e=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,t=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,i=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,s=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,a=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,n=this.timezone_select?this.timezone_select.val():!1,r=this._defaults,l=r.pickerTimeFormat||r.timeFormat,o=r.pickerTimeSuffix||r.timeSuffix;"object"==typeof e&&(e=!1),"object"==typeof t&&(t=!1),"object"==typeof i&&(i=!1),"object"==typeof s&&(s=!1),"object"==typeof a&&(a=!1),"object"==typeof n&&(n=!1),e!==!1&&(e=parseInt(e,10)),t!==!1&&(t=parseInt(t,10)),i!==!1&&(i=parseInt(i,10)),s!==!1&&(s=parseInt(s,10)),a!==!1&&(a=parseInt(a,10)),n!==!1&&(n=""+n);var c=r[12>e?"amNames":"pmNames"][0],u=e!==parseInt(this.hour,10)||t!==parseInt(this.minute,10)||i!==parseInt(this.second,10)||s!==parseInt(this.millisec,10)||a!==parseInt(this.microsec,10)||this.ampm.length>0&&12>e!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&n!==""+this.timezone;u&&(e!==!1&&(this.hour=e),t!==!1&&(this.minute=t),i!==!1&&(this.second=i),s!==!1&&(this.millisec=s),a!==!1&&(this.microsec=a),n!==!1&&(this.timezone=n),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=c),this.formattedTime=$.datepicker.formatTime(r.timeFormat,this,r),this.$timeObj&&(l===r.timeFormat?this.$timeObj.text(this.formattedTime+o):this.$timeObj.text($.datepicker.formatTime(l,this,r)+o)),this.timeDefined=!0,u&&this._updateDateTime()}},_onSelectHandler:function(){var e=this._defaults.onSelect||this.inst.settings.onSelect,t=this.$input?this.$input[0]:null;e&&t&&e.apply(t,[this.formattedDateTime,this])},_updateDateTime:function(e){e=this.inst||e;var t=e.currentYear>0?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(e.selectedYear,e.selectedMonth,e.selectedDay),i=$.datepicker._daylightSavingAdjust(t),s=$.datepicker._get(e,"dateFormat"),a=$.datepicker._getFormatConfig(e),n=null!==i&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(s,null===i?new Date:i,a);var r=this.formattedDate;if(""===e.lastVal&&(e.currentYear=e.selectedYear,e.currentMonth=e.selectedMonth,e.currentDay=e.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?r=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||n)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(r+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=r,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(r);var l="",o=this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,c=this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(l=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===i?new Date:i,a):this.formattedDate,l&&(l+=o)),l+=this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+c:this.formattedTime+c,this.$altInput.val(l)}else this.$input.val(r);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var e=$.datepicker._getInst(this.$input.get(0)),t=$.datepicker._get(e,"timepicker");if(t&&t._defaults.timeOnly&&e.input.val()!==e.lastVal)try{$.datepicker._updateDatepicker(e)}catch(i){$.timepicker.log(i)}}},_controls:{slider:{create:function(e,t,i,s,a,n,r){var l=e._defaults.isRTL;return t.prop("slide",null).slider({orientation:"horizontal",value:l?-1*s:s,min:l?-1*n:a,max:l?-1*a:n,step:r,slide:function(t,s){e.control.value(e,$(this),i,l?-1*s.value:s.value),e._onTimeChange()},stop:function(){e._onSelectHandler()}})},options:function(e,t,i,s,a){if(e._defaults.isRTL){if("string"==typeof s)return"min"===s||"max"===s?void 0!==a?t.slider(s,-1*a):Math.abs(t.slider(s)):t.slider(s);var n=s.min,r=s.max;return s.min=s.max=null,void 0!==n&&(s.max=-1*n),void 0!==r&&(s.min=-1*r),t.slider(s)}return"string"==typeof s&&void 0!==a?t.slider(s,a):t.slider(s)},value:function(e,t,i,s){return e._defaults.isRTL?void 0!==s?t.slider("value",-1*s):Math.abs(t.slider("value")):void 0!==s?t.slider("value",s):t.slider("value")}},select:{create:function(e,t,i,s,a,n,r){for(var l='<select class="ui-timepicker-select" data-unit="'+i+'" data-min="'+a+'" data-max="'+n+'" data-step="'+r+'">',o=e._defaults.pickerTimeFormat||e._defaults.timeFormat,c=a;n>=c;c+=r)l+='<option value="'+c+'"'+(c===s?" selected":"")+">",l+="hour"===i?$.datepicker.formatTime($.trim(o.replace(/[^ht ]/gi,"")),{hour:c},e._defaults):"millisec"===i||"microsec"===i||c>=10?c:"0"+(""+c),l+="</option>";return l+="</select>",t.children("select").remove(),$(l).appendTo(t).change(function(){e._onTimeChange(),e._onSelectHandler()}),t},options:function(e,t,i,s,a){var n={},r=t.children("select");if("string"==typeof s){if(void 0===a)return r.data(s);n[s]=a}else n=s;return e.control.create(e,t,r.data("unit"),r.val(),n.min||r.data("min"),n.max||r.data("max"),n.step||r.data("step"))},value:function(e,t,i,s){var a=t.children("select");return void 0!==s?a.val(s):a.val()}}}}),$.fn.extend({timepicker:function(e){e=e||{};var t=Array.prototype.slice.call(arguments);return"object"==typeof e&&(t[0]=$.extend(e,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),t)})},datetimepicker:function(e){e=e||{};var t=arguments;return"string"==typeof e?"getDate"===e?$.fn.datepicker.apply($(this[0]),t):this.each(function(){var e=$(this);e.datepicker.apply(e,t)}):this.each(function(){var t=$(this);t.datepicker($.timepicker._newInst(t,e)._defaults)})}}),$.datepicker.parseDateTime=function(e,t,i,s,a){var n=parseDateTimeInternal(e,t,i,s,a);if(n.timeObj){var r=n.timeObj;n.date.setHours(r.hour,r.minute,r.second,r.millisec),n.date.setMicroseconds(r.microsec)}return n.date},$.datepicker.parseTime=function(e,t,i){var s=extendRemove(extendRemove({},$.timepicker._defaults),i||{});-1!==e.replace(/\'.*?\'/g,"").indexOf("Z");var a=function(e,t,i){var s,a=function(e,t){var i=[];return e&&$.merge(i,e),t&&$.merge(i,t),i=$.map(i,function(e){return e.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+i.join("|")+")?"},n=function(e){var t=e.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),i={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(t)for(var s=0;t.length>s;s++)-1===i[(""+t[s]).charAt(0)]&&(i[(""+t[s]).charAt(0)]=s+1);return i},r="^"+(""+e).replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(e){var t=e.length;switch(e.charAt(0).toLowerCase()){case"h":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"m":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"s":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return a(i.amNames,i.pmNames);default:return"("+e.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(e){return"\\"+e})+")?"}}).replace(/\s/g,"\\s?")+i.timeSuffix+"$",l=n(e),o="";s=t.match(RegExp(r,"i"));var c={hour:0,minute:0,second:0,millisec:0,microsec:0};return s?(-1!==l.t&&(void 0===s[l.t]||0===s[l.t].length?(o="",c.ampm=""):(o=-1!==$.inArray(s[l.t].toUpperCase(),i.amNames)?"AM":"PM",c.ampm=i["AM"===o?"amNames":"pmNames"][0])),-1!==l.h&&(c.hour="AM"===o&&"12"===s[l.h]?0:"PM"===o&&"12"!==s[l.h]?parseInt(s[l.h],10)+12:Number(s[l.h])),-1!==l.m&&(c.minute=Number(s[l.m])),-1!==l.s&&(c.second=Number(s[l.s])),-1!==l.l&&(c.millisec=Number(s[l.l])),-1!==l.c&&(c.microsec=Number(s[l.c])),-1!==l.z&&void 0!==s[l.z]&&(c.timezone=$.timepicker.timezoneOffsetNumber(s[l.z])),c):!1},n=function(e,t,i){try{var s=new Date("2012-01-01 "+t);if(isNaN(s.getTime())&&(s=new Date("2012-01-01T"+t),isNaN(s.getTime())&&(s=new Date("01/01/2012 "+t),isNaN(s.getTime()))))throw"Unable to parse time with native Date: "+t;return{hour:s.getHours(),minute:s.getMinutes(),second:s.getSeconds(),millisec:s.getMilliseconds(),microsec:s.getMicroseconds(),timezone:-1*s.getTimezoneOffset()}}catch(n){try{return a(e,t,i)}catch(r){$.timepicker.log("Unable to parse \ntimeString: "+t+"\ntimeFormat: "+e)}}return!1};return"function"==typeof s.parse?s.parse(e,t,s):"loose"===s.parse?n(e,t,s):a(e,t,s)},$.datepicker.formatTime=function(e,t,i){i=i||{},i=$.extend({},$.timepicker._defaults,i),t=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},t);var s=e,a=i.amNames[0],n=parseInt(t.hour,10);return n>11&&(a=i.pmNames[0]),s=s.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(e){switch(e){case"HH":return("0"+n).slice(-2);case"H":return n;case"hh":return("0"+convert24to12(n)).slice(-2);case"h":return convert24to12(n);case"mm":return("0"+t.minute).slice(-2);case"m":return t.minute;case"ss":return("0"+t.second).slice(-2);case"s":return t.second;case"l":return("00"+t.millisec).slice(-3);case"c":return("00"+t.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===t.timezone?i.timezone:t.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===t.timezone?i.timezone:t.timezone,!0);case"T":return a.charAt(0).toUpperCase();case"TT":return a.toUpperCase();case"t":return a.charAt(0).toLowerCase();case"tt":return a.toLowerCase();default:return e.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(e,t){var i=this._getInst($(e)[0]),s=this._get(i,"timepicker");s&&i.settings.showTimepicker?(s._limitMinMaxDateTime(i,!0),i.inline=i.stay_open=!0,this._base_selectDate(e,t),i.inline=i.stay_open=!1,this._notifyChange(i),this._updateDatepicker(i)):this._base_selectDate(e,t)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(e){var t=e.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==e&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==t||"boolean"==typeof e.stay_open&&e.stay_open!==!1)){this._base_updateDatepicker(e);var i=this._get(e,"timepicker");i&&i._addTimePicker(e)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(e){var t=$.datepicker._getInst(e.target),i=$.datepicker._get(t,"timepicker");if(i&&$.datepicker._get(t,"constrainInput")){var s=i.support.ampm,a=null!==i._defaults.showTimezone?i._defaults.showTimezone:i.support.timezone,n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=(""+i._defaults.timeFormat).replace(/[hms]/g,"").replace(/TT/g,s?"APM":"").replace(/Tt/g,s?"AaPpMm":"").replace(/tT/g,s?"AaPpMm":"").replace(/T/g,s?"AP":"").replace(/tt/g,s?"apm":"").replace(/t/g,s?"ap":"")+" "+i._defaults.separator+i._defaults.timeSuffix+(a?i._defaults.timezoneList.join(""):"")+i._defaults.amNames.join("")+i._defaults.pmNames.join("")+n,l=String.fromCharCode(void 0===e.charCode?e.keyCode:e.charCode);return e.ctrlKey||" ">l||!n||r.indexOf(l)>-1}return $.datepicker._base_doKeyPress(e)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(e){var t=this._get(e,"timepicker");if(t){var i=t._defaults.altField;if(i){var s=(t._defaults.altFormat||t._defaults.dateFormat,this._getDate(e)),a=$.datepicker._getFormatConfig(e),n="",r=t._defaults.altSeparator?t._defaults.altSeparator:t._defaults.separator,l=t._defaults.altTimeSuffix?t._defaults.altTimeSuffix:t._defaults.timeSuffix,o=null!==t._defaults.altTimeFormat?t._defaults.altTimeFormat:t._defaults.timeFormat;n+=$.datepicker.formatTime(o,t,t._defaults)+l,t._defaults.timeOnly||t._defaults.altFieldTimeOnly||null===s||(n=t._defaults.altFormat?$.datepicker.formatDate(t._defaults.altFormat,s,a)+r+n:t.formattedDate+r+n),$(i).val(n)}}else $.datepicker._base_updateAlternate(e)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(e){var t=$.datepicker._getInst(e.target),i=$.datepicker._get(t,"timepicker");if(i&&i._defaults.timeOnly&&t.input.val()!==t.lastVal)try{$.datepicker._updateDatepicker(t)}catch(s){$.timepicker.log(s)}return $.datepicker._base_doKeyUp(e)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(e){var t=this._getInst($(e)[0]),i=t.dpDiv;this._base_gotoToday(e);var s=this._get(t,"timepicker");selectLocalTimezone(s);var a=new Date;this._setTime(t,a),$(".ui-datepicker-today",i).click()},$.datepicker._disableTimepickerDatepicker=function(e){var t=this._getInst(e);if(t){var i=this._get(t,"timepicker");$(e).datepicker("getDate"),i&&(t.settings.showTimepicker=!1,i._defaults.showTimepicker=!1,i._updateDateTime(t))}},$.datepicker._enableTimepickerDatepicker=function(e){var t=this._getInst(e);if(t){var i=this._get(t,"timepicker");$(e).datepicker("getDate"),i&&(t.settings.showTimepicker=!0,i._defaults.showTimepicker=!0,i._addTimePicker(t),i._updateDateTime(t))}},$.datepicker._setTime=function(e,t){var i=this._get(e,"timepicker");if(i){var s=i._defaults;i.hour=t?t.getHours():s.hour,i.minute=t?t.getMinutes():s.minute,i.second=t?t.getSeconds():s.second,i.millisec=t?t.getMilliseconds():s.millisec,i.microsec=t?t.getMicroseconds():s.microsec,i._limitMinMaxDateTime(e,!0),i._onTimeChange(),i._updateDateTime(e)
  5 +}},$.datepicker._setTimeDatepicker=function(e,t,i){var s=this._getInst(e);if(s){var a=this._get(s,"timepicker");if(a){this._setDateFromField(s);var n;t&&("string"==typeof t?(a._parseTime(t,i),n=new Date,n.setHours(a.hour,a.minute,a.second,a.millisec),n.setMicroseconds(a.microsec)):(n=new Date(t.getTime()),n.setMicroseconds(t.getMicroseconds())),"Invalid Date"==""+n&&(n=void 0),this._setTime(s,n))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(e,t){var i=this._getInst(e);if(i){"string"==typeof t&&(t=new Date(t),t.getTime()||$.timepicker.log("Error creating Date object from string."));var s,a=this._get(i,"timepicker");t instanceof Date?(s=new Date(t.getTime()),s.setMicroseconds(t.getMicroseconds())):s=t,a&&s&&(a.support.timezone||null!==a._defaults.timezone||(a.timezone=-1*s.getTimezoneOffset()),t=$.timepicker.timezoneAdjust(t,a.timezone),s=$.timepicker.timezoneAdjust(s,a.timezone)),this._updateDatepicker(i),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(e,s,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(e,t){var i=this._getInst(e);if(i){var s=this._get(i,"timepicker");if(s){void 0===i.lastVal&&this._setDateFromField(i,t);var a=this._getDate(i);return a&&s._parseTime($(e).val(),s.timeOnly)&&(a.setHours(s.hour,s.minute,s.second,s.millisec),a.setMicroseconds(s.microsec),null!=s.timezone&&(s.support.timezone||null!==s._defaults.timezone||(s.timezone=-1*a.getTimezoneOffset()),a=$.timepicker.timezoneAdjust(a,s.timezone))),a}return this._base_getDateDatepicker(e,t)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(e,t,i){var s;try{s=this._base_parseDate(e,t,i)}catch(a){if(!(a.indexOf(":")>=0))throw a;s=this._base_parseDate(e,t.substring(0,t.length-(a.length-a.indexOf(":")-2)),i),$.timepicker.log("Error parsing the date string: "+a+"\ndate string = "+t+"\ndate format = "+e)}return s},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(e){var t=this._get(e,"timepicker");return t?(t._updateDateTime(e),t.$input.val()):this._base_formatDate(e)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(e,t,i){var s,a=this._getInst(e);if(!a)return null;var n=this._get(a,"timepicker");if(n){var r,l=null,o=null,c=null,u=n._defaults.evnts,m={};if("string"==typeof t){if("minDate"===t||"minDateTime"===t)l=i;else if("maxDate"===t||"maxDateTime"===t)o=i;else if("onSelect"===t)c=i;else if(u.hasOwnProperty(t)){if(i===void 0)return u[t];m[t]=i,s={}}}else if("object"==typeof t){t.minDate?l=t.minDate:t.minDateTime?l=t.minDateTime:t.maxDate?o=t.maxDate:t.maxDateTime&&(o=t.maxDateTime);for(r in u)u.hasOwnProperty(r)&&t[r]&&(m[r]=t[r])}for(r in m)m.hasOwnProperty(r)&&(u[r]=m[r],s||(s=$.extend({},t)),delete s[r]);if(s&&isEmptyObject(s))return;l?(l=0===l?new Date:new Date(l),n._defaults.minDate=l,n._defaults.minDateTime=l):o?(o=0===o?new Date:new Date(o),n._defaults.maxDate=o,n._defaults.maxDateTime=o):c&&(n._defaults.onSelect=c)}return void 0===i?this._base_optionDatepicker.call($.datepicker,e,t):this._base_optionDatepicker.call($.datepicker,e,s||t,i)};var isEmptyObject=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0},extendRemove=function(e,t){$.extend(e,t);for(var i in t)(null===t[i]||void 0===t[i])&&(e[i]=t[i]);return e},detectSupport=function(e){var t=e.replace(/'.*?'/g,"").toLowerCase(),i=function(e,t){return-1!==e.indexOf(t)?!0:!1};return{hour:i(t,"h"),minute:i(t,"m"),second:i(t,"s"),millisec:i(t,"l"),microsec:i(t,"c"),timezone:i(t,"z"),ampm:i(t,"t")&&i(e,"h"),iso8601:i(e,"Z")}},convert24to12=function(e){return e%=12,0===e&&(e=12),e+""},computeEffectiveSetting=function(e,t){return e&&e[t]?e[t]:$.timepicker._defaults[t]},splitDateTime=function(e,t){var i=computeEffectiveSetting(t,"separator"),s=computeEffectiveSetting(t,"timeFormat"),a=s.split(i),n=a.length,r=e.split(i),l=r.length;return l>1?{dateString:r.splice(0,l-n).join(i),timeString:r.splice(0,n).join(i)}:{dateString:e,timeString:""}},parseDateTimeInternal=function(e,t,i,s,a){var n,r,l;if(r=splitDateTime(i,a),n=$.datepicker._base_parseDate(e,r.dateString,s),""===r.timeString)return{date:n};if(l=$.datepicker.parseTime(t,r.timeString,a),!l)throw"Wrong time format";return{date:n,timeObj:l}},selectLocalTimezone=function(e,t){if(e&&e.timezone_select){var i=t||new Date;e.timezone_select.val(-i.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(e,t){if(isNaN(e)||e>840||-720>e)return e;var i=e,s=i%60,a=(i-s)/60,n=t?":":"",r=(i>=0?"+":"-")+("0"+Math.abs(a)).slice(-2)+n+("0"+Math.abs(s)).slice(-2);return"+00:00"===r?"Z":r},$.timepicker.timezoneOffsetNumber=function(e){var t=(""+e).replace(":","");return"Z"===t.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(t)?("-"===t.substr(0,1)?-1:1)*(60*parseInt(t.substr(1,2),10)+parseInt(t.substr(3,2),10)):e},$.timepicker.timezoneAdjust=function(e,t){var i=$.timepicker.timezoneOffsetNumber(t);return isNaN(i)||e.setMinutes(e.getMinutes()+-e.getTimezoneOffset()-i),e},$.timepicker.timeRange=function(e,t,i){return $.timepicker.handleRange("timepicker",e,t,i)},$.timepicker.datetimeRange=function(e,t,i){$.timepicker.handleRange("datetimepicker",e,t,i)},$.timepicker.dateRange=function(e,t,i){$.timepicker.handleRange("datepicker",e,t,i)},$.timepicker.handleRange=function(e,t,i,s){function a(a,n){var r=t[e]("getDate"),l=i[e]("getDate"),o=a[e]("getDate");if(null!==r){var c=new Date(r.getTime()),u=new Date(r.getTime());c.setMilliseconds(c.getMilliseconds()+s.minInterval),u.setMilliseconds(u.getMilliseconds()+s.maxInterval),s.minInterval>0&&c>l?i[e]("setDate",c):s.maxInterval>0&&l>u?i[e]("setDate",u):r>l&&n[e]("setDate",o)}}function n(t,i,a){if(t.val()){var n=t[e].call(t,"getDate");null!==n&&s.minInterval>0&&("minDate"===a&&n.setMilliseconds(n.getMilliseconds()+s.minInterval),"maxDate"===a&&n.setMilliseconds(n.getMilliseconds()-s.minInterval)),n.getTime&&i[e].call(i,"option",a,n)}}s=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},s);var r=!1;return"timepicker"===e&&(r=!0,e="datetimepicker"),$.fn[e].call(t,$.extend({timeOnly:r,onClose:function(){a($(this),i)},onSelect:function(){n($(this),i,"minDate")}},s,s.start)),$.fn[e].call(i,$.extend({timeOnly:r,onClose:function(){a($(this),t)},onSelect:function(){n($(this),t,"maxDate")}},s,s.end)),a(t,i),n(t,i,"minDate"),n(i,t,"maxDate"),$([t.get(0),i.get(0)])},$.timepicker.log=function(e){window.console&&window.console.log(e)},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(e){return this.setMilliseconds(this.getMilliseconds()+Math.floor(e/1e3)),this.microseconds=e%1e3,this}),$.timepicker.version="1.4.4"}})(jQuery);
0 6 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/jquery-ui-timepicker-addon.json 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +{
  2 + "name": "jquery-ui-timepicker-addon",
  3 + "title": "jQuery Timepicker Addon",
  4 + "description": "A timepicker addon for jQueryUI datepicker.",
  5 + "version": "1.4.4",
  6 + "modified": "2014-03-29",
  7 + "homepage": "http://trentrichardson.com/examples/timepicker",
  8 + "author": {
  9 + "name": "Trent Richardson",
  10 + "email": "trentdrichardson@gmail.com",
  11 + "url": "http://trentrichardson.com"
  12 + },
  13 + "repository": {
  14 + "type": "git",
  15 + "url": "git://github.com/trentrichardson/jQuery-Timepicker-Addon.git"
  16 + },
  17 + "bugs": "https://github.com/trentrichardson/jQuery-Timepicker-Addon/issues",
  18 + "licenses": [
  19 + {
  20 + "type": "MIT",
  21 + "url": "http://trentrichardson.com/examples/jQuery-Timepicker-Addon/blob/master/LICENSE-MIT"
  22 + }
  23 + ],
  24 + "dependencies": {
  25 + "jquery": "*"
  26 + },
  27 + "keywords": []
  28 +}
0 29 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/lib/jasmine-1.3.1/MIT.LICENSE 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +Copyright (c) 2008-2011 Pivotal Labs
  2 +
  3 +Permission is hereby granted, free of charge, to any person obtaining
  4 +a copy of this software and associated documentation files (the
  5 +"Software"), to deal in the Software without restriction, including
  6 +without limitation the rights to use, copy, modify, merge, publish,
  7 +distribute, sublicense, and/or sell copies of the Software, and to
  8 +permit persons to whom the Software is furnished to do so, subject to
  9 +the following conditions:
  10 +
  11 +The above copyright notice and this permission notice shall be
  12 +included in all copies or substantial portions of the Software.
  13 +
  14 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  18 +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19 +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20 +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
... ...
public/javascripts/jquery-timepicker-addon/lib/jasmine-1.3.1/jasmine-html.js 0 → 100644
... ... @@ -0,0 +1,681 @@
  1 +jasmine.HtmlReporterHelpers = {};
  2 +
  3 +jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
  4 + var el = document.createElement(type);
  5 +
  6 + for (var i = 2; i < arguments.length; i++) {
  7 + var child = arguments[i];
  8 +
  9 + if (typeof child === 'string') {
  10 + el.appendChild(document.createTextNode(child));
  11 + } else {
  12 + if (child) {
  13 + el.appendChild(child);
  14 + }
  15 + }
  16 + }
  17 +
  18 + for (var attr in attrs) {
  19 + if (attr == "className") {
  20 + el[attr] = attrs[attr];
  21 + } else {
  22 + el.setAttribute(attr, attrs[attr]);
  23 + }
  24 + }
  25 +
  26 + return el;
  27 +};
  28 +
  29 +jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
  30 + var results = child.results();
  31 + var status = results.passed() ? 'passed' : 'failed';
  32 + if (results.skipped) {
  33 + status = 'skipped';
  34 + }
  35 +
  36 + return status;
  37 +};
  38 +
  39 +jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
  40 + var parentDiv = this.dom.summary;
  41 + var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
  42 + var parent = child[parentSuite];
  43 +
  44 + if (parent) {
  45 + if (typeof this.views.suites[parent.id] == 'undefined') {
  46 + this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
  47 + }
  48 + parentDiv = this.views.suites[parent.id].element;
  49 + }
  50 +
  51 + parentDiv.appendChild(childElement);
  52 +};
  53 +
  54 +
  55 +jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
  56 + for(var fn in jasmine.HtmlReporterHelpers) {
  57 + ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
  58 + }
  59 +};
  60 +
  61 +jasmine.HtmlReporter = function(_doc) {
  62 + var self = this;
  63 + var doc = _doc || window.document;
  64 +
  65 + var reporterView;
  66 +
  67 + var dom = {};
  68 +
  69 + // Jasmine Reporter Public Interface
  70 + self.logRunningSpecs = false;
  71 +
  72 + self.reportRunnerStarting = function(runner) {
  73 + var specs = runner.specs() || [];
  74 +
  75 + if (specs.length == 0) {
  76 + return;
  77 + }
  78 +
  79 + createReporterDom(runner.env.versionString());
  80 + doc.body.appendChild(dom.reporter);
  81 + setExceptionHandling();
  82 +
  83 + reporterView = new jasmine.HtmlReporter.ReporterView(dom);
  84 + reporterView.addSpecs(specs, self.specFilter);
  85 + };
  86 +
  87 + self.reportRunnerResults = function(runner) {
  88 + reporterView && reporterView.complete();
  89 + };
  90 +
  91 + self.reportSuiteResults = function(suite) {
  92 + reporterView.suiteComplete(suite);
  93 + };
  94 +
  95 + self.reportSpecStarting = function(spec) {
  96 + if (self.logRunningSpecs) {
  97 + self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
  98 + }
  99 + };
  100 +
  101 + self.reportSpecResults = function(spec) {
  102 + reporterView.specComplete(spec);
  103 + };
  104 +
  105 + self.log = function() {
  106 + var console = jasmine.getGlobal().console;
  107 + if (console && console.log) {
  108 + if (console.log.apply) {
  109 + console.log.apply(console, arguments);
  110 + } else {
  111 + console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
  112 + }
  113 + }
  114 + };
  115 +
  116 + self.specFilter = function(spec) {
  117 + if (!focusedSpecName()) {
  118 + return true;
  119 + }
  120 +
  121 + return spec.getFullName().indexOf(focusedSpecName()) === 0;
  122 + };
  123 +
  124 + return self;
  125 +
  126 + function focusedSpecName() {
  127 + var specName;
  128 +
  129 + (function memoizeFocusedSpec() {
  130 + if (specName) {
  131 + return;
  132 + }
  133 +
  134 + var paramMap = [];
  135 + var params = jasmine.HtmlReporter.parameters(doc);
  136 +
  137 + for (var i = 0; i < params.length; i++) {
  138 + var p = params[i].split('=');
  139 + paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
  140 + }
  141 +
  142 + specName = paramMap.spec;
  143 + })();
  144 +
  145 + return specName;
  146 + }
  147 +
  148 + function createReporterDom(version) {
  149 + dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
  150 + dom.banner = self.createDom('div', { className: 'banner' },
  151 + self.createDom('span', { className: 'title' }, "Jasmine "),
  152 + self.createDom('span', { className: 'version' }, version)),
  153 +
  154 + dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
  155 + dom.alert = self.createDom('div', {className: 'alert'},
  156 + self.createDom('span', { className: 'exceptions' },
  157 + self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'),
  158 + self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))),
  159 + dom.results = self.createDom('div', {className: 'results'},
  160 + dom.summary = self.createDom('div', { className: 'summary' }),
  161 + dom.details = self.createDom('div', { id: 'details' }))
  162 + );
  163 + }
  164 +
  165 + function noTryCatch() {
  166 + return window.location.search.match(/catch=false/);
  167 + }
  168 +
  169 + function searchWithCatch() {
  170 + var params = jasmine.HtmlReporter.parameters(window.document);
  171 + var removed = false;
  172 + var i = 0;
  173 +
  174 + while (!removed && i < params.length) {
  175 + if (params[i].match(/catch=/)) {
  176 + params.splice(i, 1);
  177 + removed = true;
  178 + }
  179 + i++;
  180 + }
  181 + if (jasmine.CATCH_EXCEPTIONS) {
  182 + params.push("catch=false");
  183 + }
  184 +
  185 + return params.join("&");
  186 + }
  187 +
  188 + function setExceptionHandling() {
  189 + var chxCatch = document.getElementById('no_try_catch');
  190 +
  191 + if (noTryCatch()) {
  192 + chxCatch.setAttribute('checked', true);
  193 + jasmine.CATCH_EXCEPTIONS = false;
  194 + }
  195 + chxCatch.onclick = function() {
  196 + window.location.search = searchWithCatch();
  197 + };
  198 + }
  199 +};
  200 +jasmine.HtmlReporter.parameters = function(doc) {
  201 + var paramStr = doc.location.search.substring(1);
  202 + var params = [];
  203 +
  204 + if (paramStr.length > 0) {
  205 + params = paramStr.split('&');
  206 + }
  207 + return params;
  208 +}
  209 +jasmine.HtmlReporter.sectionLink = function(sectionName) {
  210 + var link = '?';
  211 + var params = [];
  212 +
  213 + if (sectionName) {
  214 + params.push('spec=' + encodeURIComponent(sectionName));
  215 + }
  216 + if (!jasmine.CATCH_EXCEPTIONS) {
  217 + params.push("catch=false");
  218 + }
  219 + if (params.length > 0) {
  220 + link += params.join("&");
  221 + }
  222 +
  223 + return link;
  224 +};
  225 +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);
  226 +jasmine.HtmlReporter.ReporterView = function(dom) {
  227 + this.startedAt = new Date();
  228 + this.runningSpecCount = 0;
  229 + this.completeSpecCount = 0;
  230 + this.passedCount = 0;
  231 + this.failedCount = 0;
  232 + this.skippedCount = 0;
  233 +
  234 + this.createResultsMenu = function() {
  235 + this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
  236 + this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
  237 + ' | ',
  238 + this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
  239 +
  240 + this.summaryMenuItem.onclick = function() {
  241 + dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
  242 + };
  243 +
  244 + this.detailsMenuItem.onclick = function() {
  245 + showDetails();
  246 + };
  247 + };
  248 +
  249 + this.addSpecs = function(specs, specFilter) {
  250 + this.totalSpecCount = specs.length;
  251 +
  252 + this.views = {
  253 + specs: {},
  254 + suites: {}
  255 + };
  256 +
  257 + for (var i = 0; i < specs.length; i++) {
  258 + var spec = specs[i];
  259 + this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
  260 + if (specFilter(spec)) {
  261 + this.runningSpecCount++;
  262 + }
  263 + }
  264 + };
  265 +
  266 + this.specComplete = function(spec) {
  267 + this.completeSpecCount++;
  268 +
  269 + if (isUndefined(this.views.specs[spec.id])) {
  270 + this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
  271 + }
  272 +
  273 + var specView = this.views.specs[spec.id];
  274 +
  275 + switch (specView.status()) {
  276 + case 'passed':
  277 + this.passedCount++;
  278 + break;
  279 +
  280 + case 'failed':
  281 + this.failedCount++;
  282 + break;
  283 +
  284 + case 'skipped':
  285 + this.skippedCount++;
  286 + break;
  287 + }
  288 +
  289 + specView.refresh();
  290 + this.refresh();
  291 + };
  292 +
  293 + this.suiteComplete = function(suite) {
  294 + var suiteView = this.views.suites[suite.id];
  295 + if (isUndefined(suiteView)) {
  296 + return;
  297 + }
  298 + suiteView.refresh();
  299 + };
  300 +
  301 + this.refresh = function() {
  302 +
  303 + if (isUndefined(this.resultsMenu)) {
  304 + this.createResultsMenu();
  305 + }
  306 +
  307 + // currently running UI
  308 + if (isUndefined(this.runningAlert)) {
  309 + this.runningAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "runningAlert bar" });
  310 + dom.alert.appendChild(this.runningAlert);
  311 + }
  312 + this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
  313 +
  314 + // skipped specs UI
  315 + if (isUndefined(this.skippedAlert)) {
  316 + this.skippedAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "skippedAlert bar" });
  317 + }
  318 +
  319 + this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
  320 +
  321 + if (this.skippedCount === 1 && isDefined(dom.alert)) {
  322 + dom.alert.appendChild(this.skippedAlert);
  323 + }
  324 +
  325 + // passing specs UI
  326 + if (isUndefined(this.passedAlert)) {
  327 + this.passedAlert = this.createDom('span', { href: jasmine.HtmlReporter.sectionLink(), className: "passingAlert bar" });
  328 + }
  329 + this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
  330 +
  331 + // failing specs UI
  332 + if (isUndefined(this.failedAlert)) {
  333 + this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
  334 + }
  335 + this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
  336 +
  337 + if (this.failedCount === 1 && isDefined(dom.alert)) {
  338 + dom.alert.appendChild(this.failedAlert);
  339 + dom.alert.appendChild(this.resultsMenu);
  340 + }
  341 +
  342 + // summary info
  343 + this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
  344 + this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
  345 + };
  346 +
  347 + this.complete = function() {
  348 + dom.alert.removeChild(this.runningAlert);
  349 +
  350 + this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
  351 +
  352 + if (this.failedCount === 0) {
  353 + dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
  354 + } else {
  355 + showDetails();
  356 + }
  357 +
  358 + dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
  359 + };
  360 +
  361 + return this;
  362 +
  363 + function showDetails() {
  364 + if (dom.reporter.className.search(/showDetails/) === -1) {
  365 + dom.reporter.className += " showDetails";
  366 + }
  367 + }
  368 +
  369 + function isUndefined(obj) {
  370 + return typeof obj === 'undefined';
  371 + }
  372 +
  373 + function isDefined(obj) {
  374 + return !isUndefined(obj);
  375 + }
  376 +
  377 + function specPluralizedFor(count) {
  378 + var str = count + " spec";
  379 + if (count > 1) {
  380 + str += "s"
  381 + }
  382 + return str;
  383 + }
  384 +
  385 +};
  386 +
  387 +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
  388 +
  389 +
  390 +jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
  391 + this.spec = spec;
  392 + this.dom = dom;
  393 + this.views = views;
  394 +
  395 + this.symbol = this.createDom('li', { className: 'pending' });
  396 + this.dom.symbolSummary.appendChild(this.symbol);
  397 +
  398 + this.summary = this.createDom('div', { className: 'specSummary' },
  399 + this.createDom('a', {
  400 + className: 'description',
  401 + href: jasmine.HtmlReporter.sectionLink(this.spec.getFullName()),
  402 + title: this.spec.getFullName()
  403 + }, this.spec.description)
  404 + );
  405 +
  406 + this.detail = this.createDom('div', { className: 'specDetail' },
  407 + this.createDom('a', {
  408 + className: 'description',
  409 + href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
  410 + title: this.spec.getFullName()
  411 + }, this.spec.getFullName())
  412 + );
  413 +};
  414 +
  415 +jasmine.HtmlReporter.SpecView.prototype.status = function() {
  416 + return this.getSpecStatus(this.spec);
  417 +};
  418 +
  419 +jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
  420 + this.symbol.className = this.status();
  421 +
  422 + switch (this.status()) {
  423 + case 'skipped':
  424 + break;
  425 +
  426 + case 'passed':
  427 + this.appendSummaryToSuiteDiv();
  428 + break;
  429 +
  430 + case 'failed':
  431 + this.appendSummaryToSuiteDiv();
  432 + this.appendFailureDetail();
  433 + break;
  434 + }
  435 +};
  436 +
  437 +jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
  438 + this.summary.className += ' ' + this.status();
  439 + this.appendToSummary(this.spec, this.summary);
  440 +};
  441 +
  442 +jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
  443 + this.detail.className += ' ' + this.status();
  444 +
  445 + var resultItems = this.spec.results().getItems();
  446 + var messagesDiv = this.createDom('div', { className: 'messages' });
  447 +
  448 + for (var i = 0; i < resultItems.length; i++) {
  449 + var result = resultItems[i];
  450 +
  451 + if (result.type == 'log') {
  452 + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
  453 + } else if (result.type == 'expect' && result.passed && !result.passed()) {
  454 + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
  455 +
  456 + if (result.trace.stack) {
  457 + messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
  458 + }
  459 + }
  460 + }
  461 +
  462 + if (messagesDiv.childNodes.length > 0) {
  463 + this.detail.appendChild(messagesDiv);
  464 + this.dom.details.appendChild(this.detail);
  465 + }
  466 +};
  467 +
  468 +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
  469 + this.suite = suite;
  470 + this.dom = dom;
  471 + this.views = views;
  472 +
  473 + this.element = this.createDom('div', { className: 'suite' },
  474 + this.createDom('a', { className: 'description', href: jasmine.HtmlReporter.sectionLink(this.suite.getFullName()) }, this.suite.description)
  475 + );
  476 +
  477 + this.appendToSummary(this.suite, this.element);
  478 +};
  479 +
  480 +jasmine.HtmlReporter.SuiteView.prototype.status = function() {
  481 + return this.getSpecStatus(this.suite);
  482 +};
  483 +
  484 +jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
  485 + this.element.className += " " + this.status();
  486 +};
  487 +
  488 +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
  489 +
  490 +/* @deprecated Use jasmine.HtmlReporter instead
  491 + */
  492 +jasmine.TrivialReporter = function(doc) {
  493 + this.document = doc || document;
  494 + this.suiteDivs = {};
  495 + this.logRunningSpecs = false;
  496 +};
  497 +
  498 +jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
  499 + var el = document.createElement(type);
  500 +
  501 + for (var i = 2; i < arguments.length; i++) {
  502 + var child = arguments[i];
  503 +
  504 + if (typeof child === 'string') {
  505 + el.appendChild(document.createTextNode(child));
  506 + } else {
  507 + if (child) { el.appendChild(child); }
  508 + }
  509 + }
  510 +
  511 + for (var attr in attrs) {
  512 + if (attr == "className") {
  513 + el[attr] = attrs[attr];
  514 + } else {
  515 + el.setAttribute(attr, attrs[attr]);
  516 + }
  517 + }
  518 +
  519 + return el;
  520 +};
  521 +
  522 +jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
  523 + var showPassed, showSkipped;
  524 +
  525 + this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
  526 + this.createDom('div', { className: 'banner' },
  527 + this.createDom('div', { className: 'logo' },
  528 + this.createDom('span', { className: 'title' }, "Jasmine"),
  529 + this.createDom('span', { className: 'version' }, runner.env.versionString())),
  530 + this.createDom('div', { className: 'options' },
  531 + "Show ",
  532 + showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
  533 + this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
  534 + showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
  535 + this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
  536 + )
  537 + ),
  538 +
  539 + this.runnerDiv = this.createDom('div', { className: 'runner running' },
  540 + this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
  541 + this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
  542 + this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
  543 + );
  544 +
  545 + this.document.body.appendChild(this.outerDiv);
  546 +
  547 + var suites = runner.suites();
  548 + for (var i = 0; i < suites.length; i++) {
  549 + var suite = suites[i];
  550 + var suiteDiv = this.createDom('div', { className: 'suite' },
  551 + this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
  552 + this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
  553 + this.suiteDivs[suite.id] = suiteDiv;
  554 + var parentDiv = this.outerDiv;
  555 + if (suite.parentSuite) {
  556 + parentDiv = this.suiteDivs[suite.parentSuite.id];
  557 + }
  558 + parentDiv.appendChild(suiteDiv);
  559 + }
  560 +
  561 + this.startedAt = new Date();
  562 +
  563 + var self = this;
  564 + showPassed.onclick = function(evt) {
  565 + if (showPassed.checked) {
  566 + self.outerDiv.className += ' show-passed';
  567 + } else {
  568 + self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
  569 + }
  570 + };
  571 +
  572 + showSkipped.onclick = function(evt) {
  573 + if (showSkipped.checked) {
  574 + self.outerDiv.className += ' show-skipped';
  575 + } else {
  576 + self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
  577 + }
  578 + };
  579 +};
  580 +
  581 +jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
  582 + var results = runner.results();
  583 + var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
  584 + this.runnerDiv.setAttribute("class", className);
  585 + //do it twice for IE
  586 + this.runnerDiv.setAttribute("className", className);
  587 + var specs = runner.specs();
  588 + var specCount = 0;
  589 + for (var i = 0; i < specs.length; i++) {
  590 + if (this.specFilter(specs[i])) {
  591 + specCount++;
  592 + }
  593 + }
  594 + var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
  595 + message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
  596 + this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
  597 +
  598 + this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
  599 +};
  600 +
  601 +jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
  602 + var results = suite.results();
  603 + var status = results.passed() ? 'passed' : 'failed';
  604 + if (results.totalCount === 0) { // todo: change this to check results.skipped
  605 + status = 'skipped';
  606 + }
  607 + this.suiteDivs[suite.id].className += " " + status;
  608 +};
  609 +
  610 +jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
  611 + if (this.logRunningSpecs) {
  612 + this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
  613 + }
  614 +};
  615 +
  616 +jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
  617 + var results = spec.results();
  618 + var status = results.passed() ? 'passed' : 'failed';
  619 + if (results.skipped) {
  620 + status = 'skipped';
  621 + }
  622 + var specDiv = this.createDom('div', { className: 'spec ' + status },
  623 + this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
  624 + this.createDom('a', {
  625 + className: 'description',
  626 + href: '?spec=' + encodeURIComponent(spec.getFullName()),
  627 + title: spec.getFullName()
  628 + }, spec.description));
  629 +
  630 +
  631 + var resultItems = results.getItems();
  632 + var messagesDiv = this.createDom('div', { className: 'messages' });
  633 + for (var i = 0; i < resultItems.length; i++) {
  634 + var result = resultItems[i];
  635 +
  636 + if (result.type == 'log') {
  637 + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
  638 + } else if (result.type == 'expect' && result.passed && !result.passed()) {
  639 + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
  640 +
  641 + if (result.trace.stack) {
  642 + messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
  643 + }
  644 + }
  645 + }
  646 +
  647 + if (messagesDiv.childNodes.length > 0) {
  648 + specDiv.appendChild(messagesDiv);
  649 + }
  650 +
  651 + this.suiteDivs[spec.suite.id].appendChild(specDiv);
  652 +};
  653 +
  654 +jasmine.TrivialReporter.prototype.log = function() {
  655 + var console = jasmine.getGlobal().console;
  656 + if (console && console.log) {
  657 + if (console.log.apply) {
  658 + console.log.apply(console, arguments);
  659 + } else {
  660 + console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
  661 + }
  662 + }
  663 +};
  664 +
  665 +jasmine.TrivialReporter.prototype.getLocation = function() {
  666 + return this.document.location;
  667 +};
  668 +
  669 +jasmine.TrivialReporter.prototype.specFilter = function(spec) {
  670 + var paramMap = {};
  671 + var params = this.getLocation().search.substring(1).split('&');
  672 + for (var i = 0; i < params.length; i++) {
  673 + var p = params[i].split('=');
  674 + paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
  675 + }
  676 +
  677 + if (!paramMap.spec) {
  678 + return true;
  679 + }
  680 + return spec.getFullName().indexOf(paramMap.spec) === 0;
  681 +};
... ...
public/javascripts/jquery-timepicker-addon/lib/jasmine-1.3.1/jasmine.css 0 → 100644
... ... @@ -0,0 +1,82 @@
  1 +body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
  2 +
  3 +#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
  4 +#HTMLReporter a { text-decoration: none; }
  5 +#HTMLReporter a:hover { text-decoration: underline; }
  6 +#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
  7 +#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
  8 +#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
  9 +#HTMLReporter .version { color: #aaaaaa; }
  10 +#HTMLReporter .banner { margin-top: 14px; }
  11 +#HTMLReporter .duration { color: #aaaaaa; float: right; }
  12 +#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
  13 +#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
  14 +#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
  15 +#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
  16 +#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
  17 +#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
  18 +#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
  19 +#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
  20 +#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
  21 +#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
  22 +#HTMLReporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; }
  23 +#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
  24 +#HTMLReporter .runningAlert { background-color: #666666; }
  25 +#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
  26 +#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
  27 +#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
  28 +#HTMLReporter .passingAlert { background-color: #a6b779; }
  29 +#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
  30 +#HTMLReporter .failingAlert { background-color: #cf867e; }
  31 +#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
  32 +#HTMLReporter .results { margin-top: 14px; }
  33 +#HTMLReporter #details { display: none; }
  34 +#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
  35 +#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
  36 +#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
  37 +#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
  38 +#HTMLReporter.showDetails .summary { display: none; }
  39 +#HTMLReporter.showDetails #details { display: block; }
  40 +#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
  41 +#HTMLReporter .summary { margin-top: 14px; }
  42 +#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
  43 +#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
  44 +#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
  45 +#HTMLReporter .description + .suite { margin-top: 0; }
  46 +#HTMLReporter .suite { margin-top: 14px; }
  47 +#HTMLReporter .suite a { color: #333333; }
  48 +#HTMLReporter #details .specDetail { margin-bottom: 28px; }
  49 +#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
  50 +#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
  51 +#HTMLReporter .resultMessage span.result { display: block; }
  52 +#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
  53 +
  54 +#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
  55 +#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
  56 +#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
  57 +#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
  58 +#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
  59 +#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
  60 +#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
  61 +#TrivialReporter .runner.running { background-color: yellow; }
  62 +#TrivialReporter .options { text-align: right; font-size: .8em; }
  63 +#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
  64 +#TrivialReporter .suite .suite { margin: 5px; }
  65 +#TrivialReporter .suite.passed { background-color: #dfd; }
  66 +#TrivialReporter .suite.failed { background-color: #fdd; }
  67 +#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
  68 +#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
  69 +#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
  70 +#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
  71 +#TrivialReporter .spec.skipped { background-color: #bbb; }
  72 +#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
  73 +#TrivialReporter .passed { background-color: #cfc; display: none; }
  74 +#TrivialReporter .failed { background-color: #fbb; }
  75 +#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
  76 +#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
  77 +#TrivialReporter .resultMessage .mismatch { color: black; }
  78 +#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
  79 +#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
  80 +#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
  81 +#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
  82 +#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }
... ...
public/javascripts/jquery-timepicker-addon/lib/jasmine-1.3.1/jasmine.js 0 → 100644
... ... @@ -0,0 +1,2600 @@
  1 +var isCommonJS = typeof window == "undefined" && typeof exports == "object";
  2 +
  3 +/**
  4 + * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
  5 + *
  6 + * @namespace
  7 + */
  8 +var jasmine = {};
  9 +if (isCommonJS) exports.jasmine = jasmine;
  10 +/**
  11 + * @private
  12 + */
  13 +jasmine.unimplementedMethod_ = function() {
  14 + throw new Error("unimplemented method");
  15 +};
  16 +
  17 +/**
  18 + * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
  19 + * a plain old variable and may be redefined by somebody else.
  20 + *
  21 + * @private
  22 + */
  23 +jasmine.undefined = jasmine.___undefined___;
  24 +
  25 +/**
  26 + * Show diagnostic messages in the console if set to true
  27 + *
  28 + */
  29 +jasmine.VERBOSE = false;
  30 +
  31 +/**
  32 + * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
  33 + *
  34 + */
  35 +jasmine.DEFAULT_UPDATE_INTERVAL = 250;
  36 +
  37 +/**
  38 + * Maximum levels of nesting that will be included when an object is pretty-printed
  39 + */
  40 +jasmine.MAX_PRETTY_PRINT_DEPTH = 40;
  41 +
  42 +/**
  43 + * Default timeout interval in milliseconds for waitsFor() blocks.
  44 + */
  45 +jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
  46 +
  47 +/**
  48 + * By default exceptions thrown in the context of a test are caught by jasmine so that it can run the remaining tests in the suite.
  49 + * Set to false to let the exception bubble up in the browser.
  50 + *
  51 + */
  52 +jasmine.CATCH_EXCEPTIONS = true;
  53 +
  54 +jasmine.getGlobal = function() {
  55 + function getGlobal() {
  56 + return this;
  57 + }
  58 +
  59 + return getGlobal();
  60 +};
  61 +
  62 +/**
  63 + * Allows for bound functions to be compared. Internal use only.
  64 + *
  65 + * @ignore
  66 + * @private
  67 + * @param base {Object} bound 'this' for the function
  68 + * @param name {Function} function to find
  69 + */
  70 +jasmine.bindOriginal_ = function(base, name) {
  71 + var original = base[name];
  72 + if (original.apply) {
  73 + return function() {
  74 + return original.apply(base, arguments);
  75 + };
  76 + } else {
  77 + // IE support
  78 + return jasmine.getGlobal()[name];
  79 + }
  80 +};
  81 +
  82 +jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
  83 +jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
  84 +jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
  85 +jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
  86 +
  87 +jasmine.MessageResult = function(values) {
  88 + this.type = 'log';
  89 + this.values = values;
  90 + this.trace = new Error(); // todo: test better
  91 +};
  92 +
  93 +jasmine.MessageResult.prototype.toString = function() {
  94 + var text = "";
  95 + for (var i = 0; i < this.values.length; i++) {
  96 + if (i > 0) text += " ";
  97 + if (jasmine.isString_(this.values[i])) {
  98 + text += this.values[i];
  99 + } else {
  100 + text += jasmine.pp(this.values[i]);
  101 + }
  102 + }
  103 + return text;
  104 +};
  105 +
  106 +jasmine.ExpectationResult = function(params) {
  107 + this.type = 'expect';
  108 + this.matcherName = params.matcherName;
  109 + this.passed_ = params.passed;
  110 + this.expected = params.expected;
  111 + this.actual = params.actual;
  112 + this.message = this.passed_ ? 'Passed.' : params.message;
  113 +
  114 + var trace = (params.trace || new Error(this.message));
  115 + this.trace = this.passed_ ? '' : trace;
  116 +};
  117 +
  118 +jasmine.ExpectationResult.prototype.toString = function () {
  119 + return this.message;
  120 +};
  121 +
  122 +jasmine.ExpectationResult.prototype.passed = function () {
  123 + return this.passed_;
  124 +};
  125 +
  126 +/**
  127 + * Getter for the Jasmine environment. Ensures one gets created
  128 + */
  129 +jasmine.getEnv = function() {
  130 + var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
  131 + return env;
  132 +};
  133 +
  134 +/**
  135 + * @ignore
  136 + * @private
  137 + * @param value
  138 + * @returns {Boolean}
  139 + */
  140 +jasmine.isArray_ = function(value) {
  141 + return jasmine.isA_("Array", value);
  142 +};
  143 +
  144 +/**
  145 + * @ignore
  146 + * @private
  147 + * @param value
  148 + * @returns {Boolean}
  149 + */
  150 +jasmine.isString_ = function(value) {
  151 + return jasmine.isA_("String", value);
  152 +};
  153 +
  154 +/**
  155 + * @ignore
  156 + * @private
  157 + * @param value
  158 + * @returns {Boolean}
  159 + */
  160 +jasmine.isNumber_ = function(value) {
  161 + return jasmine.isA_("Number", value);
  162 +};
  163 +
  164 +/**
  165 + * @ignore
  166 + * @private
  167 + * @param {String} typeName
  168 + * @param value
  169 + * @returns {Boolean}
  170 + */
  171 +jasmine.isA_ = function(typeName, value) {
  172 + return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
  173 +};
  174 +
  175 +/**
  176 + * Pretty printer for expecations. Takes any object and turns it into a human-readable string.
  177 + *
  178 + * @param value {Object} an object to be outputted
  179 + * @returns {String}
  180 + */
  181 +jasmine.pp = function(value) {
  182 + var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
  183 + stringPrettyPrinter.format(value);
  184 + return stringPrettyPrinter.string;
  185 +};
  186 +
  187 +/**
  188 + * Returns true if the object is a DOM Node.
  189 + *
  190 + * @param {Object} obj object to check
  191 + * @returns {Boolean}
  192 + */
  193 +jasmine.isDomNode = function(obj) {
  194 + return obj.nodeType > 0;
  195 +};
  196 +
  197 +/**
  198 + * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter.
  199 + *
  200 + * @example
  201 + * // don't care about which function is passed in, as long as it's a function
  202 + * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
  203 + *
  204 + * @param {Class} clazz
  205 + * @returns matchable object of the type clazz
  206 + */
  207 +jasmine.any = function(clazz) {
  208 + return new jasmine.Matchers.Any(clazz);
  209 +};
  210 +
  211 +/**
  212 + * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the
  213 + * attributes on the object.
  214 + *
  215 + * @example
  216 + * // don't care about any other attributes than foo.
  217 + * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"});
  218 + *
  219 + * @param sample {Object} sample
  220 + * @returns matchable object for the sample
  221 + */
  222 +jasmine.objectContaining = function (sample) {
  223 + return new jasmine.Matchers.ObjectContaining(sample);
  224 +};
  225 +
  226 +/**
  227 + * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
  228 + *
  229 + * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
  230 + * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
  231 + *
  232 + * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
  233 + *
  234 + * Spies are torn down at the end of every spec.
  235 + *
  236 + * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
  237 + *
  238 + * @example
  239 + * // a stub
  240 + * var myStub = jasmine.createSpy('myStub'); // can be used anywhere
  241 + *
  242 + * // spy example
  243 + * var foo = {
  244 + * not: function(bool) { return !bool; }
  245 + * }
  246 + *
  247 + * // actual foo.not will not be called, execution stops
  248 + * spyOn(foo, 'not');
  249 +
  250 + // foo.not spied upon, execution will continue to implementation
  251 + * spyOn(foo, 'not').andCallThrough();
  252 + *
  253 + * // fake example
  254 + * var foo = {
  255 + * not: function(bool) { return !bool; }
  256 + * }
  257 + *
  258 + * // foo.not(val) will return val
  259 + * spyOn(foo, 'not').andCallFake(function(value) {return value;});
  260 + *
  261 + * // mock example
  262 + * foo.not(7 == 7);
  263 + * expect(foo.not).toHaveBeenCalled();
  264 + * expect(foo.not).toHaveBeenCalledWith(true);
  265 + *
  266 + * @constructor
  267 + * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
  268 + * @param {String} name
  269 + */
  270 +jasmine.Spy = function(name) {
  271 + /**
  272 + * The name of the spy, if provided.
  273 + */
  274 + this.identity = name || 'unknown';
  275 + /**
  276 + * Is this Object a spy?
  277 + */
  278 + this.isSpy = true;
  279 + /**
  280 + * The actual function this spy stubs.
  281 + */
  282 + this.plan = function() {
  283 + };
  284 + /**
  285 + * Tracking of the most recent call to the spy.
  286 + * @example
  287 + * var mySpy = jasmine.createSpy('foo');
  288 + * mySpy(1, 2);
  289 + * mySpy.mostRecentCall.args = [1, 2];
  290 + */
  291 + this.mostRecentCall = {};
  292 +
  293 + /**
  294 + * Holds arguments for each call to the spy, indexed by call count
  295 + * @example
  296 + * var mySpy = jasmine.createSpy('foo');
  297 + * mySpy(1, 2);
  298 + * mySpy(7, 8);
  299 + * mySpy.mostRecentCall.args = [7, 8];
  300 + * mySpy.argsForCall[0] = [1, 2];
  301 + * mySpy.argsForCall[1] = [7, 8];
  302 + */
  303 + this.argsForCall = [];
  304 + this.calls = [];
  305 +};
  306 +
  307 +/**
  308 + * Tells a spy to call through to the actual implemenatation.
  309 + *
  310 + * @example
  311 + * var foo = {
  312 + * bar: function() { // do some stuff }
  313 + * }
  314 + *
  315 + * // defining a spy on an existing property: foo.bar
  316 + * spyOn(foo, 'bar').andCallThrough();
  317 + */
  318 +jasmine.Spy.prototype.andCallThrough = function() {
  319 + this.plan = this.originalValue;
  320 + return this;
  321 +};
  322 +
  323 +/**
  324 + * For setting the return value of a spy.
  325 + *
  326 + * @example
  327 + * // defining a spy from scratch: foo() returns 'baz'
  328 + * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
  329 + *
  330 + * // defining a spy on an existing property: foo.bar() returns 'baz'
  331 + * spyOn(foo, 'bar').andReturn('baz');
  332 + *
  333 + * @param {Object} value
  334 + */
  335 +jasmine.Spy.prototype.andReturn = function(value) {
  336 + this.plan = function() {
  337 + return value;
  338 + };
  339 + return this;
  340 +};
  341 +
  342 +/**
  343 + * For throwing an exception when a spy is called.
  344 + *
  345 + * @example
  346 + * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
  347 + * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
  348 + *
  349 + * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
  350 + * spyOn(foo, 'bar').andThrow('baz');
  351 + *
  352 + * @param {String} exceptionMsg
  353 + */
  354 +jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
  355 + this.plan = function() {
  356 + throw exceptionMsg;
  357 + };
  358 + return this;
  359 +};
  360 +
  361 +/**
  362 + * Calls an alternate implementation when a spy is called.
  363 + *
  364 + * @example
  365 + * var baz = function() {
  366 + * // do some stuff, return something
  367 + * }
  368 + * // defining a spy from scratch: foo() calls the function baz
  369 + * var foo = jasmine.createSpy('spy on foo').andCall(baz);
  370 + *
  371 + * // defining a spy on an existing property: foo.bar() calls an anonymnous function
  372 + * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
  373 + *
  374 + * @param {Function} fakeFunc
  375 + */
  376 +jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
  377 + this.plan = fakeFunc;
  378 + return this;
  379 +};
  380 +
  381 +/**
  382 + * Resets all of a spy's the tracking variables so that it can be used again.
  383 + *
  384 + * @example
  385 + * spyOn(foo, 'bar');
  386 + *
  387 + * foo.bar();
  388 + *
  389 + * expect(foo.bar.callCount).toEqual(1);
  390 + *
  391 + * foo.bar.reset();
  392 + *
  393 + * expect(foo.bar.callCount).toEqual(0);
  394 + */
  395 +jasmine.Spy.prototype.reset = function() {
  396 + this.wasCalled = false;
  397 + this.callCount = 0;
  398 + this.argsForCall = [];
  399 + this.calls = [];
  400 + this.mostRecentCall = {};
  401 +};
  402 +
  403 +jasmine.createSpy = function(name) {
  404 +
  405 + var spyObj = function() {
  406 + spyObj.wasCalled = true;
  407 + spyObj.callCount++;
  408 + var args = jasmine.util.argsToArray(arguments);
  409 + spyObj.mostRecentCall.object = this;
  410 + spyObj.mostRecentCall.args = args;
  411 + spyObj.argsForCall.push(args);
  412 + spyObj.calls.push({object: this, args: args});
  413 + return spyObj.plan.apply(this, arguments);
  414 + };
  415 +
  416 + var spy = new jasmine.Spy(name);
  417 +
  418 + for (var prop in spy) {
  419 + spyObj[prop] = spy[prop];
  420 + }
  421 +
  422 + spyObj.reset();
  423 +
  424 + return spyObj;
  425 +};
  426 +
  427 +/**
  428 + * Determines whether an object is a spy.
  429 + *
  430 + * @param {jasmine.Spy|Object} putativeSpy
  431 + * @returns {Boolean}
  432 + */
  433 +jasmine.isSpy = function(putativeSpy) {
  434 + return putativeSpy && putativeSpy.isSpy;
  435 +};
  436 +
  437 +/**
  438 + * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something
  439 + * large in one call.
  440 + *
  441 + * @param {String} baseName name of spy class
  442 + * @param {Array} methodNames array of names of methods to make spies
  443 + */
  444 +jasmine.createSpyObj = function(baseName, methodNames) {
  445 + if (!jasmine.isArray_(methodNames) || methodNames.length === 0) {
  446 + throw new Error('createSpyObj requires a non-empty array of method names to create spies for');
  447 + }
  448 + var obj = {};
  449 + for (var i = 0; i < methodNames.length; i++) {
  450 + obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);
  451 + }
  452 + return obj;
  453 +};
  454 +
  455 +/**
  456 + * All parameters are pretty-printed and concatenated together, then written to the current spec's output.
  457 + *
  458 + * Be careful not to leave calls to <code>jasmine.log</code> in production code.
  459 + */
  460 +jasmine.log = function() {
  461 + var spec = jasmine.getEnv().currentSpec;
  462 + spec.log.apply(spec, arguments);
  463 +};
  464 +
  465 +/**
  466 + * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy.
  467 + *
  468 + * @example
  469 + * // spy example
  470 + * var foo = {
  471 + * not: function(bool) { return !bool; }
  472 + * }
  473 + * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
  474 + *
  475 + * @see jasmine.createSpy
  476 + * @param obj
  477 + * @param methodName
  478 + * @return {jasmine.Spy} a Jasmine spy that can be chained with all spy methods
  479 + */
  480 +var spyOn = function(obj, methodName) {
  481 + return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
  482 +};
  483 +if (isCommonJS) exports.spyOn = spyOn;
  484 +
  485 +/**
  486 + * Creates a Jasmine spec that will be added to the current suite.
  487 + *
  488 + * // TODO: pending tests
  489 + *
  490 + * @example
  491 + * it('should be true', function() {
  492 + * expect(true).toEqual(true);
  493 + * });
  494 + *
  495 + * @param {String} desc description of this specification
  496 + * @param {Function} func defines the preconditions and expectations of the spec
  497 + */
  498 +var it = function(desc, func) {
  499 + return jasmine.getEnv().it(desc, func);
  500 +};
  501 +if (isCommonJS) exports.it = it;
  502 +
  503 +/**
  504 + * Creates a <em>disabled</em> Jasmine spec.
  505 + *
  506 + * A convenience method that allows existing specs to be disabled temporarily during development.
  507 + *
  508 + * @param {String} desc description of this specification
  509 + * @param {Function} func defines the preconditions and expectations of the spec
  510 + */
  511 +var xit = function(desc, func) {
  512 + return jasmine.getEnv().xit(desc, func);
  513 +};
  514 +if (isCommonJS) exports.xit = xit;
  515 +
  516 +/**
  517 + * Starts a chain for a Jasmine expectation.
  518 + *
  519 + * It is passed an Object that is the actual value and should chain to one of the many
  520 + * jasmine.Matchers functions.
  521 + *
  522 + * @param {Object} actual Actual value to test against and expected value
  523 + * @return {jasmine.Matchers}
  524 + */
  525 +var expect = function(actual) {
  526 + return jasmine.getEnv().currentSpec.expect(actual);
  527 +};
  528 +if (isCommonJS) exports.expect = expect;
  529 +
  530 +/**
  531 + * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs.
  532 + *
  533 + * @param {Function} func Function that defines part of a jasmine spec.
  534 + */
  535 +var runs = function(func) {
  536 + jasmine.getEnv().currentSpec.runs(func);
  537 +};
  538 +if (isCommonJS) exports.runs = runs;
  539 +
  540 +/**
  541 + * Waits a fixed time period before moving to the next block.
  542 + *
  543 + * @deprecated Use waitsFor() instead
  544 + * @param {Number} timeout milliseconds to wait
  545 + */
  546 +var waits = function(timeout) {
  547 + jasmine.getEnv().currentSpec.waits(timeout);
  548 +};
  549 +if (isCommonJS) exports.waits = waits;
  550 +
  551 +/**
  552 + * Waits for the latchFunction to return true before proceeding to the next block.
  553 + *
  554 + * @param {Function} latchFunction
  555 + * @param {String} optional_timeoutMessage
  556 + * @param {Number} optional_timeout
  557 + */
  558 +var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
  559 + jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);
  560 +};
  561 +if (isCommonJS) exports.waitsFor = waitsFor;
  562 +
  563 +/**
  564 + * A function that is called before each spec in a suite.
  565 + *
  566 + * Used for spec setup, including validating assumptions.
  567 + *
  568 + * @param {Function} beforeEachFunction
  569 + */
  570 +var beforeEach = function(beforeEachFunction) {
  571 + jasmine.getEnv().beforeEach(beforeEachFunction);
  572 +};
  573 +if (isCommonJS) exports.beforeEach = beforeEach;
  574 +
  575 +/**
  576 + * A function that is called after each spec in a suite.
  577 + *
  578 + * Used for restoring any state that is hijacked during spec execution.
  579 + *
  580 + * @param {Function} afterEachFunction
  581 + */
  582 +var afterEach = function(afterEachFunction) {
  583 + jasmine.getEnv().afterEach(afterEachFunction);
  584 +};
  585 +if (isCommonJS) exports.afterEach = afterEach;
  586 +
  587 +/**
  588 + * Defines a suite of specifications.
  589 + *
  590 + * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
  591 + * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
  592 + * of setup in some tests.
  593 + *
  594 + * @example
  595 + * // TODO: a simple suite
  596 + *
  597 + * // TODO: a simple suite with a nested describe block
  598 + *
  599 + * @param {String} description A string, usually the class under test.
  600 + * @param {Function} specDefinitions function that defines several specs.
  601 + */
  602 +var describe = function(description, specDefinitions) {
  603 + return jasmine.getEnv().describe(description, specDefinitions);
  604 +};
  605 +if (isCommonJS) exports.describe = describe;
  606 +
  607 +/**
  608 + * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
  609 + *
  610 + * @param {String} description A string, usually the class under test.
  611 + * @param {Function} specDefinitions function that defines several specs.
  612 + */
  613 +var xdescribe = function(description, specDefinitions) {
  614 + return jasmine.getEnv().xdescribe(description, specDefinitions);
  615 +};
  616 +if (isCommonJS) exports.xdescribe = xdescribe;
  617 +
  618 +
  619 +// Provide the XMLHttpRequest class for IE 5.x-6.x:
  620 +jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
  621 + function tryIt(f) {
  622 + try {
  623 + return f();
  624 + } catch(e) {
  625 + }
  626 + return null;
  627 + }
  628 +
  629 + var xhr = tryIt(function() {
  630 + return new ActiveXObject("Msxml2.XMLHTTP.6.0");
  631 + }) ||
  632 + tryIt(function() {
  633 + return new ActiveXObject("Msxml2.XMLHTTP.3.0");
  634 + }) ||
  635 + tryIt(function() {
  636 + return new ActiveXObject("Msxml2.XMLHTTP");
  637 + }) ||
  638 + tryIt(function() {
  639 + return new ActiveXObject("Microsoft.XMLHTTP");
  640 + });
  641 +
  642 + if (!xhr) throw new Error("This browser does not support XMLHttpRequest.");
  643 +
  644 + return xhr;
  645 +} : XMLHttpRequest;
  646 +/**
  647 + * @namespace
  648 + */
  649 +jasmine.util = {};
  650 +
  651 +/**
  652 + * Declare that a child class inherit it's prototype from the parent class.
  653 + *
  654 + * @private
  655 + * @param {Function} childClass
  656 + * @param {Function} parentClass
  657 + */
  658 +jasmine.util.inherit = function(childClass, parentClass) {
  659 + /**
  660 + * @private
  661 + */
  662 + var subclass = function() {
  663 + };
  664 + subclass.prototype = parentClass.prototype;
  665 + childClass.prototype = new subclass();
  666 +};
  667 +
  668 +jasmine.util.formatException = function(e) {
  669 + var lineNumber;
  670 + if (e.line) {
  671 + lineNumber = e.line;
  672 + }
  673 + else if (e.lineNumber) {
  674 + lineNumber = e.lineNumber;
  675 + }
  676 +
  677 + var file;
  678 +
  679 + if (e.sourceURL) {
  680 + file = e.sourceURL;
  681 + }
  682 + else if (e.fileName) {
  683 + file = e.fileName;
  684 + }
  685 +
  686 + var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();
  687 +
  688 + if (file && lineNumber) {
  689 + message += ' in ' + file + ' (line ' + lineNumber + ')';
  690 + }
  691 +
  692 + return message;
  693 +};
  694 +
  695 +jasmine.util.htmlEscape = function(str) {
  696 + if (!str) return str;
  697 + return str.replace(/&/g, '&amp;')
  698 + .replace(/</g, '&lt;')
  699 + .replace(/>/g, '&gt;');
  700 +};
  701 +
  702 +jasmine.util.argsToArray = function(args) {
  703 + var arrayOfArgs = [];
  704 + for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);
  705 + return arrayOfArgs;
  706 +};
  707 +
  708 +jasmine.util.extend = function(destination, source) {
  709 + for (var property in source) destination[property] = source[property];
  710 + return destination;
  711 +};
  712 +
  713 +/**
  714 + * Environment for Jasmine
  715 + *
  716 + * @constructor
  717 + */
  718 +jasmine.Env = function() {
  719 + this.currentSpec = null;
  720 + this.currentSuite = null;
  721 + this.currentRunner_ = new jasmine.Runner(this);
  722 +
  723 + this.reporter = new jasmine.MultiReporter();
  724 +
  725 + this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
  726 + this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
  727 + this.lastUpdate = 0;
  728 + this.specFilter = function() {
  729 + return true;
  730 + };
  731 +
  732 + this.nextSpecId_ = 0;
  733 + this.nextSuiteId_ = 0;
  734 + this.equalityTesters_ = [];
  735 +
  736 + // wrap matchers
  737 + this.matchersClass = function() {
  738 + jasmine.Matchers.apply(this, arguments);
  739 + };
  740 + jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
  741 +
  742 + jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
  743 +};
  744 +
  745 +
  746 +jasmine.Env.prototype.setTimeout = jasmine.setTimeout;
  747 +jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
  748 +jasmine.Env.prototype.setInterval = jasmine.setInterval;
  749 +jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
  750 +
  751 +/**
  752 + * @returns an object containing jasmine version build info, if set.
  753 + */
  754 +jasmine.Env.prototype.version = function () {
  755 + if (jasmine.version_) {
  756 + return jasmine.version_;
  757 + } else {
  758 + throw new Error('Version not set');
  759 + }
  760 +};
  761 +
  762 +/**
  763 + * @returns string containing jasmine version build info, if set.
  764 + */
  765 +jasmine.Env.prototype.versionString = function() {
  766 + if (!jasmine.version_) {
  767 + return "version unknown";
  768 + }
  769 +
  770 + var version = this.version();
  771 + var versionString = version.major + "." + version.minor + "." + version.build;
  772 + if (version.release_candidate) {
  773 + versionString += ".rc" + version.release_candidate;
  774 + }
  775 + versionString += " revision " + version.revision;
  776 + return versionString;
  777 +};
  778 +
  779 +/**
  780 + * @returns a sequential integer starting at 0
  781 + */
  782 +jasmine.Env.prototype.nextSpecId = function () {
  783 + return this.nextSpecId_++;
  784 +};
  785 +
  786 +/**
  787 + * @returns a sequential integer starting at 0
  788 + */
  789 +jasmine.Env.prototype.nextSuiteId = function () {
  790 + return this.nextSuiteId_++;
  791 +};
  792 +
  793 +/**
  794 + * Register a reporter to receive status updates from Jasmine.
  795 + * @param {jasmine.Reporter} reporter An object which will receive status updates.
  796 + */
  797 +jasmine.Env.prototype.addReporter = function(reporter) {
  798 + this.reporter.addReporter(reporter);
  799 +};
  800 +
  801 +jasmine.Env.prototype.execute = function() {
  802 + this.currentRunner_.execute();
  803 +};
  804 +
  805 +jasmine.Env.prototype.describe = function(description, specDefinitions) {
  806 + var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
  807 +
  808 + var parentSuite = this.currentSuite;
  809 + if (parentSuite) {
  810 + parentSuite.add(suite);
  811 + } else {
  812 + this.currentRunner_.add(suite);
  813 + }
  814 +
  815 + this.currentSuite = suite;
  816 +
  817 + var declarationError = null;
  818 + try {
  819 + specDefinitions.call(suite);
  820 + } catch(e) {
  821 + declarationError = e;
  822 + }
  823 +
  824 + if (declarationError) {
  825 + this.it("encountered a declaration exception", function() {
  826 + throw declarationError;
  827 + });
  828 + }
  829 +
  830 + this.currentSuite = parentSuite;
  831 +
  832 + return suite;
  833 +};
  834 +
  835 +jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
  836 + if (this.currentSuite) {
  837 + this.currentSuite.beforeEach(beforeEachFunction);
  838 + } else {
  839 + this.currentRunner_.beforeEach(beforeEachFunction);
  840 + }
  841 +};
  842 +
  843 +jasmine.Env.prototype.currentRunner = function () {
  844 + return this.currentRunner_;
  845 +};
  846 +
  847 +jasmine.Env.prototype.afterEach = function(afterEachFunction) {
  848 + if (this.currentSuite) {
  849 + this.currentSuite.afterEach(afterEachFunction);
  850 + } else {
  851 + this.currentRunner_.afterEach(afterEachFunction);
  852 + }
  853 +
  854 +};
  855 +
  856 +jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {
  857 + return {
  858 + execute: function() {
  859 + }
  860 + };
  861 +};
  862 +
  863 +jasmine.Env.prototype.it = function(description, func) {
  864 + var spec = new jasmine.Spec(this, this.currentSuite, description);
  865 + this.currentSuite.add(spec);
  866 + this.currentSpec = spec;
  867 +
  868 + if (func) {
  869 + spec.runs(func);
  870 + }
  871 +
  872 + return spec;
  873 +};
  874 +
  875 +jasmine.Env.prototype.xit = function(desc, func) {
  876 + return {
  877 + id: this.nextSpecId(),
  878 + runs: function() {
  879 + }
  880 + };
  881 +};
  882 +
  883 +jasmine.Env.prototype.compareRegExps_ = function(a, b, mismatchKeys, mismatchValues) {
  884 + if (a.source != b.source)
  885 + mismatchValues.push("expected pattern /" + b.source + "/ is not equal to the pattern /" + a.source + "/");
  886 +
  887 + if (a.ignoreCase != b.ignoreCase)
  888 + mismatchValues.push("expected modifier i was" + (b.ignoreCase ? " " : " not ") + "set and does not equal the origin modifier");
  889 +
  890 + if (a.global != b.global)
  891 + mismatchValues.push("expected modifier g was" + (b.global ? " " : " not ") + "set and does not equal the origin modifier");
  892 +
  893 + if (a.multiline != b.multiline)
  894 + mismatchValues.push("expected modifier m was" + (b.multiline ? " " : " not ") + "set and does not equal the origin modifier");
  895 +
  896 + if (a.sticky != b.sticky)
  897 + mismatchValues.push("expected modifier y was" + (b.sticky ? " " : " not ") + "set and does not equal the origin modifier");
  898 +
  899 + return (mismatchValues.length === 0);
  900 +};
  901 +
  902 +jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
  903 + if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
  904 + return true;
  905 + }
  906 +
  907 + a.__Jasmine_been_here_before__ = b;
  908 + b.__Jasmine_been_here_before__ = a;
  909 +
  910 + var hasKey = function(obj, keyName) {
  911 + return obj !== null && obj[keyName] !== jasmine.undefined;
  912 + };
  913 +
  914 + for (var property in b) {
  915 + if (!hasKey(a, property) && hasKey(b, property)) {
  916 + mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
  917 + }
  918 + }
  919 + for (property in a) {
  920 + if (!hasKey(b, property) && hasKey(a, property)) {
  921 + mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
  922 + }
  923 + }
  924 + for (property in b) {
  925 + if (property == '__Jasmine_been_here_before__') continue;
  926 + if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {
  927 + mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
  928 + }
  929 + }
  930 +
  931 + if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {
  932 + mismatchValues.push("arrays were not the same length");
  933 + }
  934 +
  935 + delete a.__Jasmine_been_here_before__;
  936 + delete b.__Jasmine_been_here_before__;
  937 + return (mismatchKeys.length === 0 && mismatchValues.length === 0);
  938 +};
  939 +
  940 +jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
  941 + mismatchKeys = mismatchKeys || [];
  942 + mismatchValues = mismatchValues || [];
  943 +
  944 + for (var i = 0; i < this.equalityTesters_.length; i++) {
  945 + var equalityTester = this.equalityTesters_[i];
  946 + var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);
  947 + if (result !== jasmine.undefined) return result;
  948 + }
  949 +
  950 + if (a === b) return true;
  951 +
  952 + if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {
  953 + return (a == jasmine.undefined && b == jasmine.undefined);
  954 + }
  955 +
  956 + if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
  957 + return a === b;
  958 + }
  959 +
  960 + if (a instanceof Date && b instanceof Date) {
  961 + return a.getTime() == b.getTime();
  962 + }
  963 +
  964 + if (a.jasmineMatches) {
  965 + return a.jasmineMatches(b);
  966 + }
  967 +
  968 + if (b.jasmineMatches) {
  969 + return b.jasmineMatches(a);
  970 + }
  971 +
  972 + if (a instanceof jasmine.Matchers.ObjectContaining) {
  973 + return a.matches(b);
  974 + }
  975 +
  976 + if (b instanceof jasmine.Matchers.ObjectContaining) {
  977 + return b.matches(a);
  978 + }
  979 +
  980 + if (jasmine.isString_(a) && jasmine.isString_(b)) {
  981 + return (a == b);
  982 + }
  983 +
  984 + if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {
  985 + return (a == b);
  986 + }
  987 +
  988 + if (a instanceof RegExp && b instanceof RegExp) {
  989 + return this.compareRegExps_(a, b, mismatchKeys, mismatchValues);
  990 + }
  991 +
  992 + if (typeof a === "object" && typeof b === "object") {
  993 + return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
  994 + }
  995 +
  996 + //Straight check
  997 + return (a === b);
  998 +};
  999 +
  1000 +jasmine.Env.prototype.contains_ = function(haystack, needle) {
  1001 + if (jasmine.isArray_(haystack)) {
  1002 + for (var i = 0; i < haystack.length; i++) {
  1003 + if (this.equals_(haystack[i], needle)) return true;
  1004 + }
  1005 + return false;
  1006 + }
  1007 + return haystack.indexOf(needle) >= 0;
  1008 +};
  1009 +
  1010 +jasmine.Env.prototype.addEqualityTester = function(equalityTester) {
  1011 + this.equalityTesters_.push(equalityTester);
  1012 +};
  1013 +/** No-op base class for Jasmine reporters.
  1014 + *
  1015 + * @constructor
  1016 + */
  1017 +jasmine.Reporter = function() {
  1018 +};
  1019 +
  1020 +//noinspection JSUnusedLocalSymbols
  1021 +jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
  1022 +};
  1023 +
  1024 +//noinspection JSUnusedLocalSymbols
  1025 +jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
  1026 +};
  1027 +
  1028 +//noinspection JSUnusedLocalSymbols
  1029 +jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
  1030 +};
  1031 +
  1032 +//noinspection JSUnusedLocalSymbols
  1033 +jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
  1034 +};
  1035 +
  1036 +//noinspection JSUnusedLocalSymbols
  1037 +jasmine.Reporter.prototype.reportSpecResults = function(spec) {
  1038 +};
  1039 +
  1040 +//noinspection JSUnusedLocalSymbols
  1041 +jasmine.Reporter.prototype.log = function(str) {
  1042 +};
  1043 +
  1044 +/**
  1045 + * Blocks are functions with executable code that make up a spec.
  1046 + *
  1047 + * @constructor
  1048 + * @param {jasmine.Env} env
  1049 + * @param {Function} func
  1050 + * @param {jasmine.Spec} spec
  1051 + */
  1052 +jasmine.Block = function(env, func, spec) {
  1053 + this.env = env;
  1054 + this.func = func;
  1055 + this.spec = spec;
  1056 +};
  1057 +
  1058 +jasmine.Block.prototype.execute = function(onComplete) {
  1059 + if (!jasmine.CATCH_EXCEPTIONS) {
  1060 + this.func.apply(this.spec);
  1061 + }
  1062 + else {
  1063 + try {
  1064 + this.func.apply(this.spec);
  1065 + } catch (e) {
  1066 + this.spec.fail(e);
  1067 + }
  1068 + }
  1069 + onComplete();
  1070 +};
  1071 +/** JavaScript API reporter.
  1072 + *
  1073 + * @constructor
  1074 + */
  1075 +jasmine.JsApiReporter = function() {
  1076 + this.started = false;
  1077 + this.finished = false;
  1078 + this.suites_ = [];
  1079 + this.results_ = {};
  1080 +};
  1081 +
  1082 +jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
  1083 + this.started = true;
  1084 + var suites = runner.topLevelSuites();
  1085 + for (var i = 0; i < suites.length; i++) {
  1086 + var suite = suites[i];
  1087 + this.suites_.push(this.summarize_(suite));
  1088 + }
  1089 +};
  1090 +
  1091 +jasmine.JsApiReporter.prototype.suites = function() {
  1092 + return this.suites_;
  1093 +};
  1094 +
  1095 +jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
  1096 + var isSuite = suiteOrSpec instanceof jasmine.Suite;
  1097 + var summary = {
  1098 + id: suiteOrSpec.id,
  1099 + name: suiteOrSpec.description,
  1100 + type: isSuite ? 'suite' : 'spec',
  1101 + children: []
  1102 + };
  1103 +
  1104 + if (isSuite) {
  1105 + var children = suiteOrSpec.children();
  1106 + for (var i = 0; i < children.length; i++) {
  1107 + summary.children.push(this.summarize_(children[i]));
  1108 + }
  1109 + }
  1110 + return summary;
  1111 +};
  1112 +
  1113 +jasmine.JsApiReporter.prototype.results = function() {
  1114 + return this.results_;
  1115 +};
  1116 +
  1117 +jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {
  1118 + return this.results_[specId];
  1119 +};
  1120 +
  1121 +//noinspection JSUnusedLocalSymbols
  1122 +jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {
  1123 + this.finished = true;
  1124 +};
  1125 +
  1126 +//noinspection JSUnusedLocalSymbols
  1127 +jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {
  1128 +};
  1129 +
  1130 +//noinspection JSUnusedLocalSymbols
  1131 +jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {
  1132 + this.results_[spec.id] = {
  1133 + messages: spec.results().getItems(),
  1134 + result: spec.results().failedCount > 0 ? "failed" : "passed"
  1135 + };
  1136 +};
  1137 +
  1138 +//noinspection JSUnusedLocalSymbols
  1139 +jasmine.JsApiReporter.prototype.log = function(str) {
  1140 +};
  1141 +
  1142 +jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
  1143 + var results = {};
  1144 + for (var i = 0; i < specIds.length; i++) {
  1145 + var specId = specIds[i];
  1146 + results[specId] = this.summarizeResult_(this.results_[specId]);
  1147 + }
  1148 + return results;
  1149 +};
  1150 +
  1151 +jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
  1152 + var summaryMessages = [];
  1153 + var messagesLength = result.messages.length;
  1154 + for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
  1155 + var resultMessage = result.messages[messageIndex];
  1156 + summaryMessages.push({
  1157 + text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
  1158 + passed: resultMessage.passed ? resultMessage.passed() : true,
  1159 + type: resultMessage.type,
  1160 + message: resultMessage.message,
  1161 + trace: {
  1162 + stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
  1163 + }
  1164 + });
  1165 + }
  1166 +
  1167 + return {
  1168 + result : result.result,
  1169 + messages : summaryMessages
  1170 + };
  1171 +};
  1172 +
  1173 +/**
  1174 + * @constructor
  1175 + * @param {jasmine.Env} env
  1176 + * @param actual
  1177 + * @param {jasmine.Spec} spec
  1178 + */
  1179 +jasmine.Matchers = function(env, actual, spec, opt_isNot) {
  1180 + this.env = env;
  1181 + this.actual = actual;
  1182 + this.spec = spec;
  1183 + this.isNot = opt_isNot || false;
  1184 + this.reportWasCalled_ = false;
  1185 +};
  1186 +
  1187 +// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
  1188 +jasmine.Matchers.pp = function(str) {
  1189 + throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
  1190 +};
  1191 +
  1192 +// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
  1193 +jasmine.Matchers.prototype.report = function(result, failing_message, details) {
  1194 + throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
  1195 +};
  1196 +
  1197 +jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
  1198 + for (var methodName in prototype) {
  1199 + if (methodName == 'report') continue;
  1200 + var orig = prototype[methodName];
  1201 + matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
  1202 + }
  1203 +};
  1204 +
  1205 +jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
  1206 + return function() {
  1207 + var matcherArgs = jasmine.util.argsToArray(arguments);
  1208 + var result = matcherFunction.apply(this, arguments);
  1209 +
  1210 + if (this.isNot) {
  1211 + result = !result;
  1212 + }
  1213 +
  1214 + if (this.reportWasCalled_) return result;
  1215 +
  1216 + var message;
  1217 + if (!result) {
  1218 + if (this.message) {
  1219 + message = this.message.apply(this, arguments);
  1220 + if (jasmine.isArray_(message)) {
  1221 + message = message[this.isNot ? 1 : 0];
  1222 + }
  1223 + } else {
  1224 + var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
  1225 + message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate;
  1226 + if (matcherArgs.length > 0) {
  1227 + for (var i = 0; i < matcherArgs.length; i++) {
  1228 + if (i > 0) message += ",";
  1229 + message += " " + jasmine.pp(matcherArgs[i]);
  1230 + }
  1231 + }
  1232 + message += ".";
  1233 + }
  1234 + }
  1235 + var expectationResult = new jasmine.ExpectationResult({
  1236 + matcherName: matcherName,
  1237 + passed: result,
  1238 + expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],
  1239 + actual: this.actual,
  1240 + message: message
  1241 + });
  1242 + this.spec.addMatcherResult(expectationResult);
  1243 + return jasmine.undefined;
  1244 + };
  1245 +};
  1246 +
  1247 +
  1248 +
  1249 +
  1250 +/**
  1251 + * toBe: compares the actual to the expected using ===
  1252 + * @param expected
  1253 + */
  1254 +jasmine.Matchers.prototype.toBe = function(expected) {
  1255 + return this.actual === expected;
  1256 +};
  1257 +
  1258 +/**
  1259 + * toNotBe: compares the actual to the expected using !==
  1260 + * @param expected
  1261 + * @deprecated as of 1.0. Use not.toBe() instead.
  1262 + */
  1263 +jasmine.Matchers.prototype.toNotBe = function(expected) {
  1264 + return this.actual !== expected;
  1265 +};
  1266 +
  1267 +/**
  1268 + * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
  1269 + *
  1270 + * @param expected
  1271 + */
  1272 +jasmine.Matchers.prototype.toEqual = function(expected) {
  1273 + return this.env.equals_(this.actual, expected);
  1274 +};
  1275 +
  1276 +/**
  1277 + * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
  1278 + * @param expected
  1279 + * @deprecated as of 1.0. Use not.toEqual() instead.
  1280 + */
  1281 +jasmine.Matchers.prototype.toNotEqual = function(expected) {
  1282 + return !this.env.equals_(this.actual, expected);
  1283 +};
  1284 +
  1285 +/**
  1286 + * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes
  1287 + * a pattern or a String.
  1288 + *
  1289 + * @param expected
  1290 + */
  1291 +jasmine.Matchers.prototype.toMatch = function(expected) {
  1292 + return new RegExp(expected).test(this.actual);
  1293 +};
  1294 +
  1295 +/**
  1296 + * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
  1297 + * @param expected
  1298 + * @deprecated as of 1.0. Use not.toMatch() instead.
  1299 + */
  1300 +jasmine.Matchers.prototype.toNotMatch = function(expected) {
  1301 + return !(new RegExp(expected).test(this.actual));
  1302 +};
  1303 +
  1304 +/**
  1305 + * Matcher that compares the actual to jasmine.undefined.
  1306 + */
  1307 +jasmine.Matchers.prototype.toBeDefined = function() {
  1308 + return (this.actual !== jasmine.undefined);
  1309 +};
  1310 +
  1311 +/**
  1312 + * Matcher that compares the actual to jasmine.undefined.
  1313 + */
  1314 +jasmine.Matchers.prototype.toBeUndefined = function() {
  1315 + return (this.actual === jasmine.undefined);
  1316 +};
  1317 +
  1318 +/**
  1319 + * Matcher that compares the actual to null.
  1320 + */
  1321 +jasmine.Matchers.prototype.toBeNull = function() {
  1322 + return (this.actual === null);
  1323 +};
  1324 +
  1325 +/**
  1326 + * Matcher that compares the actual to NaN.
  1327 + */
  1328 +jasmine.Matchers.prototype.toBeNaN = function() {
  1329 + this.message = function() {
  1330 + return [ "Expected " + jasmine.pp(this.actual) + " to be NaN." ];
  1331 + };
  1332 +
  1333 + return (this.actual !== this.actual);
  1334 +};
  1335 +
  1336 +/**
  1337 + * Matcher that boolean not-nots the actual.
  1338 + */
  1339 +jasmine.Matchers.prototype.toBeTruthy = function() {
  1340 + return !!this.actual;
  1341 +};
  1342 +
  1343 +
  1344 +/**
  1345 + * Matcher that boolean nots the actual.
  1346 + */
  1347 +jasmine.Matchers.prototype.toBeFalsy = function() {
  1348 + return !this.actual;
  1349 +};
  1350 +
  1351 +
  1352 +/**
  1353 + * Matcher that checks to see if the actual, a Jasmine spy, was called.
  1354 + */
  1355 +jasmine.Matchers.prototype.toHaveBeenCalled = function() {
  1356 + if (arguments.length > 0) {
  1357 + throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
  1358 + }
  1359 +
  1360 + if (!jasmine.isSpy(this.actual)) {
  1361 + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
  1362 + }
  1363 +
  1364 + this.message = function() {
  1365 + return [
  1366 + "Expected spy " + this.actual.identity + " to have been called.",
  1367 + "Expected spy " + this.actual.identity + " not to have been called."
  1368 + ];
  1369 + };
  1370 +
  1371 + return this.actual.wasCalled;
  1372 +};
  1373 +
  1374 +/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
  1375 +jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;
  1376 +
  1377 +/**
  1378 + * Matcher that checks to see if the actual, a Jasmine spy, was not called.
  1379 + *
  1380 + * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
  1381 + */
  1382 +jasmine.Matchers.prototype.wasNotCalled = function() {
  1383 + if (arguments.length > 0) {
  1384 + throw new Error('wasNotCalled does not take arguments');
  1385 + }
  1386 +
  1387 + if (!jasmine.isSpy(this.actual)) {
  1388 + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
  1389 + }
  1390 +
  1391 + this.message = function() {
  1392 + return [
  1393 + "Expected spy " + this.actual.identity + " to not have been called.",
  1394 + "Expected spy " + this.actual.identity + " to have been called."
  1395 + ];
  1396 + };
  1397 +
  1398 + return !this.actual.wasCalled;
  1399 +};
  1400 +
  1401 +/**
  1402 + * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
  1403 + *
  1404 + * @example
  1405 + *
  1406 + */
  1407 +jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
  1408 + var expectedArgs = jasmine.util.argsToArray(arguments);
  1409 + if (!jasmine.isSpy(this.actual)) {
  1410 + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
  1411 + }
  1412 + this.message = function() {
  1413 + var invertedMessage = "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was.";
  1414 + var positiveMessage = "";
  1415 + if (this.actual.callCount === 0) {
  1416 + positiveMessage = "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.";
  1417 + } else {
  1418 + positiveMessage = "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but actual calls were " + jasmine.pp(this.actual.argsForCall).replace(/^\[ | \]$/g, '')
  1419 + }
  1420 + return [positiveMessage, invertedMessage];
  1421 + };
  1422 +
  1423 + return this.env.contains_(this.actual.argsForCall, expectedArgs);
  1424 +};
  1425 +
  1426 +/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
  1427 +jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;
  1428 +
  1429 +/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
  1430 +jasmine.Matchers.prototype.wasNotCalledWith = function() {
  1431 + var expectedArgs = jasmine.util.argsToArray(arguments);
  1432 + if (!jasmine.isSpy(this.actual)) {
  1433 + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
  1434 + }
  1435 +
  1436 + this.message = function() {
  1437 + return [
  1438 + "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was",
  1439 + "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was"
  1440 + ];
  1441 + };
  1442 +
  1443 + return !this.env.contains_(this.actual.argsForCall, expectedArgs);
  1444 +};
  1445 +
  1446 +/**
  1447 + * Matcher that checks that the expected item is an element in the actual Array.
  1448 + *
  1449 + * @param {Object} expected
  1450 + */
  1451 +jasmine.Matchers.prototype.toContain = function(expected) {
  1452 + return this.env.contains_(this.actual, expected);
  1453 +};
  1454 +
  1455 +/**
  1456 + * Matcher that checks that the expected item is NOT an element in the actual Array.
  1457 + *
  1458 + * @param {Object} expected
  1459 + * @deprecated as of 1.0. Use not.toContain() instead.
  1460 + */
  1461 +jasmine.Matchers.prototype.toNotContain = function(expected) {
  1462 + return !this.env.contains_(this.actual, expected);
  1463 +};
  1464 +
  1465 +jasmine.Matchers.prototype.toBeLessThan = function(expected) {
  1466 + return this.actual < expected;
  1467 +};
  1468 +
  1469 +jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
  1470 + return this.actual > expected;
  1471 +};
  1472 +
  1473 +/**
  1474 + * Matcher that checks that the expected item is equal to the actual item
  1475 + * up to a given level of decimal precision (default 2).
  1476 + *
  1477 + * @param {Number} expected
  1478 + * @param {Number} precision, as number of decimal places
  1479 + */
  1480 +jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) {
  1481 + if (!(precision === 0)) {
  1482 + precision = precision || 2;
  1483 + }
  1484 + return Math.abs(expected - this.actual) < (Math.pow(10, -precision) / 2);
  1485 +};
  1486 +
  1487 +/**
  1488 + * Matcher that checks that the expected exception was thrown by the actual.
  1489 + *
  1490 + * @param {String} [expected]
  1491 + */
  1492 +jasmine.Matchers.prototype.toThrow = function(expected) {
  1493 + var result = false;
  1494 + var exception;
  1495 + if (typeof this.actual != 'function') {
  1496 + throw new Error('Actual is not a function');
  1497 + }
  1498 + try {
  1499 + this.actual();
  1500 + } catch (e) {
  1501 + exception = e;
  1502 + }
  1503 + if (exception) {
  1504 + result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));
  1505 + }
  1506 +
  1507 + var not = this.isNot ? "not " : "";
  1508 +
  1509 + this.message = function() {
  1510 + if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
  1511 + return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' ');
  1512 + } else {
  1513 + return "Expected function to throw an exception.";
  1514 + }
  1515 + };
  1516 +
  1517 + return result;
  1518 +};
  1519 +
  1520 +jasmine.Matchers.Any = function(expectedClass) {
  1521 + this.expectedClass = expectedClass;
  1522 +};
  1523 +
  1524 +jasmine.Matchers.Any.prototype.jasmineMatches = function(other) {
  1525 + if (this.expectedClass == String) {
  1526 + return typeof other == 'string' || other instanceof String;
  1527 + }
  1528 +
  1529 + if (this.expectedClass == Number) {
  1530 + return typeof other == 'number' || other instanceof Number;
  1531 + }
  1532 +
  1533 + if (this.expectedClass == Function) {
  1534 + return typeof other == 'function' || other instanceof Function;
  1535 + }
  1536 +
  1537 + if (this.expectedClass == Object) {
  1538 + return typeof other == 'object';
  1539 + }
  1540 +
  1541 + return other instanceof this.expectedClass;
  1542 +};
  1543 +
  1544 +jasmine.Matchers.Any.prototype.jasmineToString = function() {
  1545 + return '<jasmine.any(' + this.expectedClass + ')>';
  1546 +};
  1547 +
  1548 +jasmine.Matchers.ObjectContaining = function (sample) {
  1549 + this.sample = sample;
  1550 +};
  1551 +
  1552 +jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
  1553 + mismatchKeys = mismatchKeys || [];
  1554 + mismatchValues = mismatchValues || [];
  1555 +
  1556 + var env = jasmine.getEnv();
  1557 +
  1558 + var hasKey = function(obj, keyName) {
  1559 + return obj != null && obj[keyName] !== jasmine.undefined;
  1560 + };
  1561 +
  1562 + for (var property in this.sample) {
  1563 + if (!hasKey(other, property) && hasKey(this.sample, property)) {
  1564 + mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
  1565 + }
  1566 + else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) {
  1567 + mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual.");
  1568 + }
  1569 + }
  1570 +
  1571 + return (mismatchKeys.length === 0 && mismatchValues.length === 0);
  1572 +};
  1573 +
  1574 +jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () {
  1575 + return "<jasmine.objectContaining(" + jasmine.pp(this.sample) + ")>";
  1576 +};
  1577 +// Mock setTimeout, clearTimeout
  1578 +// Contributed by Pivotal Computer Systems, www.pivotalsf.com
  1579 +
  1580 +jasmine.FakeTimer = function() {
  1581 + this.reset();
  1582 +
  1583 + var self = this;
  1584 + self.setTimeout = function(funcToCall, millis) {
  1585 + self.timeoutsMade++;
  1586 + self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
  1587 + return self.timeoutsMade;
  1588 + };
  1589 +
  1590 + self.setInterval = function(funcToCall, millis) {
  1591 + self.timeoutsMade++;
  1592 + self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
  1593 + return self.timeoutsMade;
  1594 + };
  1595 +
  1596 + self.clearTimeout = function(timeoutKey) {
  1597 + self.scheduledFunctions[timeoutKey] = jasmine.undefined;
  1598 + };
  1599 +
  1600 + self.clearInterval = function(timeoutKey) {
  1601 + self.scheduledFunctions[timeoutKey] = jasmine.undefined;
  1602 + };
  1603 +
  1604 +};
  1605 +
  1606 +jasmine.FakeTimer.prototype.reset = function() {
  1607 + this.timeoutsMade = 0;
  1608 + this.scheduledFunctions = {};
  1609 + this.nowMillis = 0;
  1610 +};
  1611 +
  1612 +jasmine.FakeTimer.prototype.tick = function(millis) {
  1613 + var oldMillis = this.nowMillis;
  1614 + var newMillis = oldMillis + millis;
  1615 + this.runFunctionsWithinRange(oldMillis, newMillis);
  1616 + this.nowMillis = newMillis;
  1617 +};
  1618 +
  1619 +jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
  1620 + var scheduledFunc;
  1621 + var funcsToRun = [];
  1622 + for (var timeoutKey in this.scheduledFunctions) {
  1623 + scheduledFunc = this.scheduledFunctions[timeoutKey];
  1624 + if (scheduledFunc != jasmine.undefined &&
  1625 + scheduledFunc.runAtMillis >= oldMillis &&
  1626 + scheduledFunc.runAtMillis <= nowMillis) {
  1627 + funcsToRun.push(scheduledFunc);
  1628 + this.scheduledFunctions[timeoutKey] = jasmine.undefined;
  1629 + }
  1630 + }
  1631 +
  1632 + if (funcsToRun.length > 0) {
  1633 + funcsToRun.sort(function(a, b) {
  1634 + return a.runAtMillis - b.runAtMillis;
  1635 + });
  1636 + for (var i = 0; i < funcsToRun.length; ++i) {
  1637 + try {
  1638 + var funcToRun = funcsToRun[i];
  1639 + this.nowMillis = funcToRun.runAtMillis;
  1640 + funcToRun.funcToCall();
  1641 + if (funcToRun.recurring) {
  1642 + this.scheduleFunction(funcToRun.timeoutKey,
  1643 + funcToRun.funcToCall,
  1644 + funcToRun.millis,
  1645 + true);
  1646 + }
  1647 + } catch(e) {
  1648 + }
  1649 + }
  1650 + this.runFunctionsWithinRange(oldMillis, nowMillis);
  1651 + }
  1652 +};
  1653 +
  1654 +jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
  1655 + this.scheduledFunctions[timeoutKey] = {
  1656 + runAtMillis: this.nowMillis + millis,
  1657 + funcToCall: funcToCall,
  1658 + recurring: recurring,
  1659 + timeoutKey: timeoutKey,
  1660 + millis: millis
  1661 + };
  1662 +};
  1663 +
  1664 +/**
  1665 + * @namespace
  1666 + */
  1667 +jasmine.Clock = {
  1668 + defaultFakeTimer: new jasmine.FakeTimer(),
  1669 +
  1670 + reset: function() {
  1671 + jasmine.Clock.assertInstalled();
  1672 + jasmine.Clock.defaultFakeTimer.reset();
  1673 + },
  1674 +
  1675 + tick: function(millis) {
  1676 + jasmine.Clock.assertInstalled();
  1677 + jasmine.Clock.defaultFakeTimer.tick(millis);
  1678 + },
  1679 +
  1680 + runFunctionsWithinRange: function(oldMillis, nowMillis) {
  1681 + jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
  1682 + },
  1683 +
  1684 + scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
  1685 + jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
  1686 + },
  1687 +
  1688 + useMock: function() {
  1689 + if (!jasmine.Clock.isInstalled()) {
  1690 + var spec = jasmine.getEnv().currentSpec;
  1691 + spec.after(jasmine.Clock.uninstallMock);
  1692 +
  1693 + jasmine.Clock.installMock();
  1694 + }
  1695 + },
  1696 +
  1697 + installMock: function() {
  1698 + jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
  1699 + },
  1700 +
  1701 + uninstallMock: function() {
  1702 + jasmine.Clock.assertInstalled();
  1703 + jasmine.Clock.installed = jasmine.Clock.real;
  1704 + },
  1705 +
  1706 + real: {
  1707 + setTimeout: jasmine.getGlobal().setTimeout,
  1708 + clearTimeout: jasmine.getGlobal().clearTimeout,
  1709 + setInterval: jasmine.getGlobal().setInterval,
  1710 + clearInterval: jasmine.getGlobal().clearInterval
  1711 + },
  1712 +
  1713 + assertInstalled: function() {
  1714 + if (!jasmine.Clock.isInstalled()) {
  1715 + throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
  1716 + }
  1717 + },
  1718 +
  1719 + isInstalled: function() {
  1720 + return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
  1721 + },
  1722 +
  1723 + installed: null
  1724 +};
  1725 +jasmine.Clock.installed = jasmine.Clock.real;
  1726 +
  1727 +//else for IE support
  1728 +jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
  1729 + if (jasmine.Clock.installed.setTimeout.apply) {
  1730 + return jasmine.Clock.installed.setTimeout.apply(this, arguments);
  1731 + } else {
  1732 + return jasmine.Clock.installed.setTimeout(funcToCall, millis);
  1733 + }
  1734 +};
  1735 +
  1736 +jasmine.getGlobal().setInterval = function(funcToCall, millis) {
  1737 + if (jasmine.Clock.installed.setInterval.apply) {
  1738 + return jasmine.Clock.installed.setInterval.apply(this, arguments);
  1739 + } else {
  1740 + return jasmine.Clock.installed.setInterval(funcToCall, millis);
  1741 + }
  1742 +};
  1743 +
  1744 +jasmine.getGlobal().clearTimeout = function(timeoutKey) {
  1745 + if (jasmine.Clock.installed.clearTimeout.apply) {
  1746 + return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
  1747 + } else {
  1748 + return jasmine.Clock.installed.clearTimeout(timeoutKey);
  1749 + }
  1750 +};
  1751 +
  1752 +jasmine.getGlobal().clearInterval = function(timeoutKey) {
  1753 + if (jasmine.Clock.installed.clearTimeout.apply) {
  1754 + return jasmine.Clock.installed.clearInterval.apply(this, arguments);
  1755 + } else {
  1756 + return jasmine.Clock.installed.clearInterval(timeoutKey);
  1757 + }
  1758 +};
  1759 +
  1760 +/**
  1761 + * @constructor
  1762 + */
  1763 +jasmine.MultiReporter = function() {
  1764 + this.subReporters_ = [];
  1765 +};
  1766 +jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
  1767 +
  1768 +jasmine.MultiReporter.prototype.addReporter = function(reporter) {
  1769 + this.subReporters_.push(reporter);
  1770 +};
  1771 +
  1772 +(function() {
  1773 + var functionNames = [
  1774 + "reportRunnerStarting",
  1775 + "reportRunnerResults",
  1776 + "reportSuiteResults",
  1777 + "reportSpecStarting",
  1778 + "reportSpecResults",
  1779 + "log"
  1780 + ];
  1781 + for (var i = 0; i < functionNames.length; i++) {
  1782 + var functionName = functionNames[i];
  1783 + jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
  1784 + return function() {
  1785 + for (var j = 0; j < this.subReporters_.length; j++) {
  1786 + var subReporter = this.subReporters_[j];
  1787 + if (subReporter[functionName]) {
  1788 + subReporter[functionName].apply(subReporter, arguments);
  1789 + }
  1790 + }
  1791 + };
  1792 + })(functionName);
  1793 + }
  1794 +})();
  1795 +/**
  1796 + * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
  1797 + *
  1798 + * @constructor
  1799 + */
  1800 +jasmine.NestedResults = function() {
  1801 + /**
  1802 + * The total count of results
  1803 + */
  1804 + this.totalCount = 0;
  1805 + /**
  1806 + * Number of passed results
  1807 + */
  1808 + this.passedCount = 0;
  1809 + /**
  1810 + * Number of failed results
  1811 + */
  1812 + this.failedCount = 0;
  1813 + /**
  1814 + * Was this suite/spec skipped?
  1815 + */
  1816 + this.skipped = false;
  1817 + /**
  1818 + * @ignore
  1819 + */
  1820 + this.items_ = [];
  1821 +};
  1822 +
  1823 +/**
  1824 + * Roll up the result counts.
  1825 + *
  1826 + * @param result
  1827 + */
  1828 +jasmine.NestedResults.prototype.rollupCounts = function(result) {
  1829 + this.totalCount += result.totalCount;
  1830 + this.passedCount += result.passedCount;
  1831 + this.failedCount += result.failedCount;
  1832 +};
  1833 +
  1834 +/**
  1835 + * Adds a log message.
  1836 + * @param values Array of message parts which will be concatenated later.
  1837 + */
  1838 +jasmine.NestedResults.prototype.log = function(values) {
  1839 + this.items_.push(new jasmine.MessageResult(values));
  1840 +};
  1841 +
  1842 +/**
  1843 + * Getter for the results: message & results.
  1844 + */
  1845 +jasmine.NestedResults.prototype.getItems = function() {
  1846 + return this.items_;
  1847 +};
  1848 +
  1849 +/**
  1850 + * Adds a result, tracking counts (total, passed, & failed)
  1851 + * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
  1852 + */
  1853 +jasmine.NestedResults.prototype.addResult = function(result) {
  1854 + if (result.type != 'log') {
  1855 + if (result.items_) {
  1856 + this.rollupCounts(result);
  1857 + } else {
  1858 + this.totalCount++;
  1859 + if (result.passed()) {
  1860 + this.passedCount++;
  1861 + } else {
  1862 + this.failedCount++;
  1863 + }
  1864 + }
  1865 + }
  1866 + this.items_.push(result);
  1867 +};
  1868 +
  1869 +/**
  1870 + * @returns {Boolean} True if <b>everything</b> below passed
  1871 + */
  1872 +jasmine.NestedResults.prototype.passed = function() {
  1873 + return this.passedCount === this.totalCount;
  1874 +};
  1875 +/**
  1876 + * Base class for pretty printing for expectation results.
  1877 + */
  1878 +jasmine.PrettyPrinter = function() {
  1879 + this.ppNestLevel_ = 0;
  1880 +};
  1881 +
  1882 +/**
  1883 + * Formats a value in a nice, human-readable string.
  1884 + *
  1885 + * @param value
  1886 + */
  1887 +jasmine.PrettyPrinter.prototype.format = function(value) {
  1888 + this.ppNestLevel_++;
  1889 + try {
  1890 + if (value === jasmine.undefined) {
  1891 + this.emitScalar('undefined');
  1892 + } else if (value === null) {
  1893 + this.emitScalar('null');
  1894 + } else if (value === jasmine.getGlobal()) {
  1895 + this.emitScalar('<global>');
  1896 + } else if (value.jasmineToString) {
  1897 + this.emitScalar(value.jasmineToString());
  1898 + } else if (typeof value === 'string') {
  1899 + this.emitString(value);
  1900 + } else if (jasmine.isSpy(value)) {
  1901 + this.emitScalar("spy on " + value.identity);
  1902 + } else if (value instanceof RegExp) {
  1903 + this.emitScalar(value.toString());
  1904 + } else if (typeof value === 'function') {
  1905 + this.emitScalar('Function');
  1906 + } else if (typeof value.nodeType === 'number') {
  1907 + this.emitScalar('HTMLNode');
  1908 + } else if (value instanceof Date) {
  1909 + this.emitScalar('Date(' + value + ')');
  1910 + } else if (value.__Jasmine_been_here_before__) {
  1911 + this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
  1912 + } else if (jasmine.isArray_(value) || typeof value == 'object') {
  1913 + value.__Jasmine_been_here_before__ = true;
  1914 + if (jasmine.isArray_(value)) {
  1915 + this.emitArray(value);
  1916 + } else {
  1917 + this.emitObject(value);
  1918 + }
  1919 + delete value.__Jasmine_been_here_before__;
  1920 + } else {
  1921 + this.emitScalar(value.toString());
  1922 + }
  1923 + } finally {
  1924 + this.ppNestLevel_--;
  1925 + }
  1926 +};
  1927 +
  1928 +jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
  1929 + for (var property in obj) {
  1930 + if (!obj.hasOwnProperty(property)) continue;
  1931 + if (property == '__Jasmine_been_here_before__') continue;
  1932 + fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined &&
  1933 + obj.__lookupGetter__(property) !== null) : false);
  1934 + }
  1935 +};
  1936 +
  1937 +jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;
  1938 +jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;
  1939 +jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;
  1940 +jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;
  1941 +
  1942 +jasmine.StringPrettyPrinter = function() {
  1943 + jasmine.PrettyPrinter.call(this);
  1944 +
  1945 + this.string = '';
  1946 +};
  1947 +jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);
  1948 +
  1949 +jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {
  1950 + this.append(value);
  1951 +};
  1952 +
  1953 +jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
  1954 + this.append("'" + value + "'");
  1955 +};
  1956 +
  1957 +jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
  1958 + if (this.ppNestLevel_ > jasmine.MAX_PRETTY_PRINT_DEPTH) {
  1959 + this.append("Array");
  1960 + return;
  1961 + }
  1962 +
  1963 + this.append('[ ');
  1964 + for (var i = 0; i < array.length; i++) {
  1965 + if (i > 0) {
  1966 + this.append(', ');
  1967 + }
  1968 + this.format(array[i]);
  1969 + }
  1970 + this.append(' ]');
  1971 +};
  1972 +
  1973 +jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
  1974 + if (this.ppNestLevel_ > jasmine.MAX_PRETTY_PRINT_DEPTH) {
  1975 + this.append("Object");
  1976 + return;
  1977 + }
  1978 +
  1979 + var self = this;
  1980 + this.append('{ ');
  1981 + var first = true;
  1982 +
  1983 + this.iterateObject(obj, function(property, isGetter) {
  1984 + if (first) {
  1985 + first = false;
  1986 + } else {
  1987 + self.append(', ');
  1988 + }
  1989 +
  1990 + self.append(property);
  1991 + self.append(' : ');
  1992 + if (isGetter) {
  1993 + self.append('<getter>');
  1994 + } else {
  1995 + self.format(obj[property]);
  1996 + }
  1997 + });
  1998 +
  1999 + this.append(' }');
  2000 +};
  2001 +
  2002 +jasmine.StringPrettyPrinter.prototype.append = function(value) {
  2003 + this.string += value;
  2004 +};
  2005 +jasmine.Queue = function(env) {
  2006 + this.env = env;
  2007 +
  2008 + // parallel to blocks. each true value in this array means the block will
  2009 + // get executed even if we abort
  2010 + this.ensured = [];
  2011 + this.blocks = [];
  2012 + this.running = false;
  2013 + this.index = 0;
  2014 + this.offset = 0;
  2015 + this.abort = false;
  2016 +};
  2017 +
  2018 +jasmine.Queue.prototype.addBefore = function(block, ensure) {
  2019 + if (ensure === jasmine.undefined) {
  2020 + ensure = false;
  2021 + }
  2022 +
  2023 + this.blocks.unshift(block);
  2024 + this.ensured.unshift(ensure);
  2025 +};
  2026 +
  2027 +jasmine.Queue.prototype.add = function(block, ensure) {
  2028 + if (ensure === jasmine.undefined) {
  2029 + ensure = false;
  2030 + }
  2031 +
  2032 + this.blocks.push(block);
  2033 + this.ensured.push(ensure);
  2034 +};
  2035 +
  2036 +jasmine.Queue.prototype.insertNext = function(block, ensure) {
  2037 + if (ensure === jasmine.undefined) {
  2038 + ensure = false;
  2039 + }
  2040 +
  2041 + this.ensured.splice((this.index + this.offset + 1), 0, ensure);
  2042 + this.blocks.splice((this.index + this.offset + 1), 0, block);
  2043 + this.offset++;
  2044 +};
  2045 +
  2046 +jasmine.Queue.prototype.start = function(onComplete) {
  2047 + this.running = true;
  2048 + this.onComplete = onComplete;
  2049 + this.next_();
  2050 +};
  2051 +
  2052 +jasmine.Queue.prototype.isRunning = function() {
  2053 + return this.running;
  2054 +};
  2055 +
  2056 +jasmine.Queue.LOOP_DONT_RECURSE = true;
  2057 +
  2058 +jasmine.Queue.prototype.next_ = function() {
  2059 + var self = this;
  2060 + var goAgain = true;
  2061 +
  2062 + while (goAgain) {
  2063 + goAgain = false;
  2064 +
  2065 + if (self.index < self.blocks.length && !(this.abort && !this.ensured[self.index])) {
  2066 + var calledSynchronously = true;
  2067 + var completedSynchronously = false;
  2068 +
  2069 + var onComplete = function () {
  2070 + if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {
  2071 + completedSynchronously = true;
  2072 + return;
  2073 + }
  2074 +
  2075 + if (self.blocks[self.index].abort) {
  2076 + self.abort = true;
  2077 + }
  2078 +
  2079 + self.offset = 0;
  2080 + self.index++;
  2081 +
  2082 + var now = new Date().getTime();
  2083 + if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
  2084 + self.env.lastUpdate = now;
  2085 + self.env.setTimeout(function() {
  2086 + self.next_();
  2087 + }, 0);
  2088 + } else {
  2089 + if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
  2090 + goAgain = true;
  2091 + } else {
  2092 + self.next_();
  2093 + }
  2094 + }
  2095 + };
  2096 + self.blocks[self.index].execute(onComplete);
  2097 +
  2098 + calledSynchronously = false;
  2099 + if (completedSynchronously) {
  2100 + onComplete();
  2101 + }
  2102 +
  2103 + } else {
  2104 + self.running = false;
  2105 + if (self.onComplete) {
  2106 + self.onComplete();
  2107 + }
  2108 + }
  2109 + }
  2110 +};
  2111 +
  2112 +jasmine.Queue.prototype.results = function() {
  2113 + var results = new jasmine.NestedResults();
  2114 + for (var i = 0; i < this.blocks.length; i++) {
  2115 + if (this.blocks[i].results) {
  2116 + results.addResult(this.blocks[i].results());
  2117 + }
  2118 + }
  2119 + return results;
  2120 +};
  2121 +
  2122 +
  2123 +/**
  2124 + * Runner
  2125 + *
  2126 + * @constructor
  2127 + * @param {jasmine.Env} env
  2128 + */
  2129 +jasmine.Runner = function(env) {
  2130 + var self = this;
  2131 + self.env = env;
  2132 + self.queue = new jasmine.Queue(env);
  2133 + self.before_ = [];
  2134 + self.after_ = [];
  2135 + self.suites_ = [];
  2136 +};
  2137 +
  2138 +jasmine.Runner.prototype.execute = function() {
  2139 + var self = this;
  2140 + if (self.env.reporter.reportRunnerStarting) {
  2141 + self.env.reporter.reportRunnerStarting(this);
  2142 + }
  2143 + self.queue.start(function () {
  2144 + self.finishCallback();
  2145 + });
  2146 +};
  2147 +
  2148 +jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
  2149 + beforeEachFunction.typeName = 'beforeEach';
  2150 + this.before_.splice(0,0,beforeEachFunction);
  2151 +};
  2152 +
  2153 +jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
  2154 + afterEachFunction.typeName = 'afterEach';
  2155 + this.after_.splice(0,0,afterEachFunction);
  2156 +};
  2157 +
  2158 +
  2159 +jasmine.Runner.prototype.finishCallback = function() {
  2160 + this.env.reporter.reportRunnerResults(this);
  2161 +};
  2162 +
  2163 +jasmine.Runner.prototype.addSuite = function(suite) {
  2164 + this.suites_.push(suite);
  2165 +};
  2166 +
  2167 +jasmine.Runner.prototype.add = function(block) {
  2168 + if (block instanceof jasmine.Suite) {
  2169 + this.addSuite(block);
  2170 + }
  2171 + this.queue.add(block);
  2172 +};
  2173 +
  2174 +jasmine.Runner.prototype.specs = function () {
  2175 + var suites = this.suites();
  2176 + var specs = [];
  2177 + for (var i = 0; i < suites.length; i++) {
  2178 + specs = specs.concat(suites[i].specs());
  2179 + }
  2180 + return specs;
  2181 +};
  2182 +
  2183 +jasmine.Runner.prototype.suites = function() {
  2184 + return this.suites_;
  2185 +};
  2186 +
  2187 +jasmine.Runner.prototype.topLevelSuites = function() {
  2188 + var topLevelSuites = [];
  2189 + for (var i = 0; i < this.suites_.length; i++) {
  2190 + if (!this.suites_[i].parentSuite) {
  2191 + topLevelSuites.push(this.suites_[i]);
  2192 + }
  2193 + }
  2194 + return topLevelSuites;
  2195 +};
  2196 +
  2197 +jasmine.Runner.prototype.results = function() {
  2198 + return this.queue.results();
  2199 +};
  2200 +/**
  2201 + * Internal representation of a Jasmine specification, or test.
  2202 + *
  2203 + * @constructor
  2204 + * @param {jasmine.Env} env
  2205 + * @param {jasmine.Suite} suite
  2206 + * @param {String} description
  2207 + */
  2208 +jasmine.Spec = function(env, suite, description) {
  2209 + if (!env) {
  2210 + throw new Error('jasmine.Env() required');
  2211 + }
  2212 + if (!suite) {
  2213 + throw new Error('jasmine.Suite() required');
  2214 + }
  2215 + var spec = this;
  2216 + spec.id = env.nextSpecId ? env.nextSpecId() : null;
  2217 + spec.env = env;
  2218 + spec.suite = suite;
  2219 + spec.description = description;
  2220 + spec.queue = new jasmine.Queue(env);
  2221 +
  2222 + spec.afterCallbacks = [];
  2223 + spec.spies_ = [];
  2224 +
  2225 + spec.results_ = new jasmine.NestedResults();
  2226 + spec.results_.description = description;
  2227 + spec.matchersClass = null;
  2228 +};
  2229 +
  2230 +jasmine.Spec.prototype.getFullName = function() {
  2231 + return this.suite.getFullName() + ' ' + this.description + '.';
  2232 +};
  2233 +
  2234 +
  2235 +jasmine.Spec.prototype.results = function() {
  2236 + return this.results_;
  2237 +};
  2238 +
  2239 +/**
  2240 + * All parameters are pretty-printed and concatenated together, then written to the spec's output.
  2241 + *
  2242 + * Be careful not to leave calls to <code>jasmine.log</code> in production code.
  2243 + */
  2244 +jasmine.Spec.prototype.log = function() {
  2245 + return this.results_.log(arguments);
  2246 +};
  2247 +
  2248 +jasmine.Spec.prototype.runs = function (func) {
  2249 + var block = new jasmine.Block(this.env, func, this);
  2250 + this.addToQueue(block);
  2251 + return this;
  2252 +};
  2253 +
  2254 +jasmine.Spec.prototype.addToQueue = function (block) {
  2255 + if (this.queue.isRunning()) {
  2256 + this.queue.insertNext(block);
  2257 + } else {
  2258 + this.queue.add(block);
  2259 + }
  2260 +};
  2261 +
  2262 +/**
  2263 + * @param {jasmine.ExpectationResult} result
  2264 + */
  2265 +jasmine.Spec.prototype.addMatcherResult = function(result) {
  2266 + this.results_.addResult(result);
  2267 +};
  2268 +
  2269 +jasmine.Spec.prototype.expect = function(actual) {
  2270 + var positive = new (this.getMatchersClass_())(this.env, actual, this);
  2271 + positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
  2272 + return positive;
  2273 +};
  2274 +
  2275 +/**
  2276 + * Waits a fixed time period before moving to the next block.
  2277 + *
  2278 + * @deprecated Use waitsFor() instead
  2279 + * @param {Number} timeout milliseconds to wait
  2280 + */
  2281 +jasmine.Spec.prototype.waits = function(timeout) {
  2282 + var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
  2283 + this.addToQueue(waitsFunc);
  2284 + return this;
  2285 +};
  2286 +
  2287 +/**
  2288 + * Waits for the latchFunction to return true before proceeding to the next block.
  2289 + *
  2290 + * @param {Function} latchFunction
  2291 + * @param {String} optional_timeoutMessage
  2292 + * @param {Number} optional_timeout
  2293 + */
  2294 +jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
  2295 + var latchFunction_ = null;
  2296 + var optional_timeoutMessage_ = null;
  2297 + var optional_timeout_ = null;
  2298 +
  2299 + for (var i = 0; i < arguments.length; i++) {
  2300 + var arg = arguments[i];
  2301 + switch (typeof arg) {
  2302 + case 'function':
  2303 + latchFunction_ = arg;
  2304 + break;
  2305 + case 'string':
  2306 + optional_timeoutMessage_ = arg;
  2307 + break;
  2308 + case 'number':
  2309 + optional_timeout_ = arg;
  2310 + break;
  2311 + }
  2312 + }
  2313 +
  2314 + var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
  2315 + this.addToQueue(waitsForFunc);
  2316 + return this;
  2317 +};
  2318 +
  2319 +jasmine.Spec.prototype.fail = function (e) {
  2320 + var expectationResult = new jasmine.ExpectationResult({
  2321 + passed: false,
  2322 + message: e ? jasmine.util.formatException(e) : 'Exception',
  2323 + trace: { stack: e.stack }
  2324 + });
  2325 + this.results_.addResult(expectationResult);
  2326 +};
  2327 +
  2328 +jasmine.Spec.prototype.getMatchersClass_ = function() {
  2329 + return this.matchersClass || this.env.matchersClass;
  2330 +};
  2331 +
  2332 +jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
  2333 + var parent = this.getMatchersClass_();
  2334 + var newMatchersClass = function() {
  2335 + parent.apply(this, arguments);
  2336 + };
  2337 + jasmine.util.inherit(newMatchersClass, parent);
  2338 + jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
  2339 + this.matchersClass = newMatchersClass;
  2340 +};
  2341 +
  2342 +jasmine.Spec.prototype.finishCallback = function() {
  2343 + this.env.reporter.reportSpecResults(this);
  2344 +};
  2345 +
  2346 +jasmine.Spec.prototype.finish = function(onComplete) {
  2347 + this.removeAllSpies();
  2348 + this.finishCallback();
  2349 + if (onComplete) {
  2350 + onComplete();
  2351 + }
  2352 +};
  2353 +
  2354 +jasmine.Spec.prototype.after = function(doAfter) {
  2355 + if (this.queue.isRunning()) {
  2356 + this.queue.add(new jasmine.Block(this.env, doAfter, this), true);
  2357 + } else {
  2358 + this.afterCallbacks.unshift(doAfter);
  2359 + }
  2360 +};
  2361 +
  2362 +jasmine.Spec.prototype.execute = function(onComplete) {
  2363 + var spec = this;
  2364 + if (!spec.env.specFilter(spec)) {
  2365 + spec.results_.skipped = true;
  2366 + spec.finish(onComplete);
  2367 + return;
  2368 + }
  2369 +
  2370 + this.env.reporter.reportSpecStarting(this);
  2371 +
  2372 + spec.env.currentSpec = spec;
  2373 +
  2374 + spec.addBeforesAndAftersToQueue();
  2375 +
  2376 + spec.queue.start(function () {
  2377 + spec.finish(onComplete);
  2378 + });
  2379 +};
  2380 +
  2381 +jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
  2382 + var runner = this.env.currentRunner();
  2383 + var i;
  2384 +
  2385 + for (var suite = this.suite; suite; suite = suite.parentSuite) {
  2386 + for (i = 0; i < suite.before_.length; i++) {
  2387 + this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
  2388 + }
  2389 + }
  2390 + for (i = 0; i < runner.before_.length; i++) {
  2391 + this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
  2392 + }
  2393 + for (i = 0; i < this.afterCallbacks.length; i++) {
  2394 + this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this), true);
  2395 + }
  2396 + for (suite = this.suite; suite; suite = suite.parentSuite) {
  2397 + for (i = 0; i < suite.after_.length; i++) {
  2398 + this.queue.add(new jasmine.Block(this.env, suite.after_[i], this), true);
  2399 + }
  2400 + }
  2401 + for (i = 0; i < runner.after_.length; i++) {
  2402 + this.queue.add(new jasmine.Block(this.env, runner.after_[i], this), true);
  2403 + }
  2404 +};
  2405 +
  2406 +jasmine.Spec.prototype.explodes = function() {
  2407 + throw 'explodes function should not have been called';
  2408 +};
  2409 +
  2410 +jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
  2411 + if (obj == jasmine.undefined) {
  2412 + throw "spyOn could not find an object to spy upon for " + methodName + "()";
  2413 + }
  2414 +
  2415 + if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {
  2416 + throw methodName + '() method does not exist';
  2417 + }
  2418 +
  2419 + if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {
  2420 + throw new Error(methodName + ' has already been spied upon');
  2421 + }
  2422 +
  2423 + var spyObj = jasmine.createSpy(methodName);
  2424 +
  2425 + this.spies_.push(spyObj);
  2426 + spyObj.baseObj = obj;
  2427 + spyObj.methodName = methodName;
  2428 + spyObj.originalValue = obj[methodName];
  2429 +
  2430 + obj[methodName] = spyObj;
  2431 +
  2432 + return spyObj;
  2433 +};
  2434 +
  2435 +jasmine.Spec.prototype.removeAllSpies = function() {
  2436 + for (var i = 0; i < this.spies_.length; i++) {
  2437 + var spy = this.spies_[i];
  2438 + spy.baseObj[spy.methodName] = spy.originalValue;
  2439 + }
  2440 + this.spies_ = [];
  2441 +};
  2442 +
  2443 +/**
  2444 + * Internal representation of a Jasmine suite.
  2445 + *
  2446 + * @constructor
  2447 + * @param {jasmine.Env} env
  2448 + * @param {String} description
  2449 + * @param {Function} specDefinitions
  2450 + * @param {jasmine.Suite} parentSuite
  2451 + */
  2452 +jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
  2453 + var self = this;
  2454 + self.id = env.nextSuiteId ? env.nextSuiteId() : null;
  2455 + self.description = description;
  2456 + self.queue = new jasmine.Queue(env);
  2457 + self.parentSuite = parentSuite;
  2458 + self.env = env;
  2459 + self.before_ = [];
  2460 + self.after_ = [];
  2461 + self.children_ = [];
  2462 + self.suites_ = [];
  2463 + self.specs_ = [];
  2464 +};
  2465 +
  2466 +jasmine.Suite.prototype.getFullName = function() {
  2467 + var fullName = this.description;
  2468 + for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
  2469 + fullName = parentSuite.description + ' ' + fullName;
  2470 + }
  2471 + return fullName;
  2472 +};
  2473 +
  2474 +jasmine.Suite.prototype.finish = function(onComplete) {
  2475 + this.env.reporter.reportSuiteResults(this);
  2476 + this.finished = true;
  2477 + if (typeof(onComplete) == 'function') {
  2478 + onComplete();
  2479 + }
  2480 +};
  2481 +
  2482 +jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
  2483 + beforeEachFunction.typeName = 'beforeEach';
  2484 + this.before_.unshift(beforeEachFunction);
  2485 +};
  2486 +
  2487 +jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
  2488 + afterEachFunction.typeName = 'afterEach';
  2489 + this.after_.unshift(afterEachFunction);
  2490 +};
  2491 +
  2492 +jasmine.Suite.prototype.results = function() {
  2493 + return this.queue.results();
  2494 +};
  2495 +
  2496 +jasmine.Suite.prototype.add = function(suiteOrSpec) {
  2497 + this.children_.push(suiteOrSpec);
  2498 + if (suiteOrSpec instanceof jasmine.Suite) {
  2499 + this.suites_.push(suiteOrSpec);
  2500 + this.env.currentRunner().addSuite(suiteOrSpec);
  2501 + } else {
  2502 + this.specs_.push(suiteOrSpec);
  2503 + }
  2504 + this.queue.add(suiteOrSpec);
  2505 +};
  2506 +
  2507 +jasmine.Suite.prototype.specs = function() {
  2508 + return this.specs_;
  2509 +};
  2510 +
  2511 +jasmine.Suite.prototype.suites = function() {
  2512 + return this.suites_;
  2513 +};
  2514 +
  2515 +jasmine.Suite.prototype.children = function() {
  2516 + return this.children_;
  2517 +};
  2518 +
  2519 +jasmine.Suite.prototype.execute = function(onComplete) {
  2520 + var self = this;
  2521 + this.queue.start(function () {
  2522 + self.finish(onComplete);
  2523 + });
  2524 +};
  2525 +jasmine.WaitsBlock = function(env, timeout, spec) {
  2526 + this.timeout = timeout;
  2527 + jasmine.Block.call(this, env, null, spec);
  2528 +};
  2529 +
  2530 +jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);
  2531 +
  2532 +jasmine.WaitsBlock.prototype.execute = function (onComplete) {
  2533 + if (jasmine.VERBOSE) {
  2534 + this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');
  2535 + }
  2536 + this.env.setTimeout(function () {
  2537 + onComplete();
  2538 + }, this.timeout);
  2539 +};
  2540 +/**
  2541 + * A block which waits for some condition to become true, with timeout.
  2542 + *
  2543 + * @constructor
  2544 + * @extends jasmine.Block
  2545 + * @param {jasmine.Env} env The Jasmine environment.
  2546 + * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.
  2547 + * @param {Function} latchFunction A function which returns true when the desired condition has been met.
  2548 + * @param {String} message The message to display if the desired condition hasn't been met within the given time period.
  2549 + * @param {jasmine.Spec} spec The Jasmine spec.
  2550 + */
  2551 +jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
  2552 + this.timeout = timeout || env.defaultTimeoutInterval;
  2553 + this.latchFunction = latchFunction;
  2554 + this.message = message;
  2555 + this.totalTimeSpentWaitingForLatch = 0;
  2556 + jasmine.Block.call(this, env, null, spec);
  2557 +};
  2558 +jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);
  2559 +
  2560 +jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;
  2561 +
  2562 +jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
  2563 + if (jasmine.VERBOSE) {
  2564 + this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
  2565 + }
  2566 + var latchFunctionResult;
  2567 + try {
  2568 + latchFunctionResult = this.latchFunction.apply(this.spec);
  2569 + } catch (e) {
  2570 + this.spec.fail(e);
  2571 + onComplete();
  2572 + return;
  2573 + }
  2574 +
  2575 + if (latchFunctionResult) {
  2576 + onComplete();
  2577 + } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {
  2578 + var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');
  2579 + this.spec.fail({
  2580 + name: 'timeout',
  2581 + message: message
  2582 + });
  2583 +
  2584 + this.abort = true;
  2585 + onComplete();
  2586 + } else {
  2587 + this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
  2588 + var self = this;
  2589 + this.env.setTimeout(function() {
  2590 + self.execute(onComplete);
  2591 + }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
  2592 + }
  2593 +};
  2594 +
  2595 +jasmine.version_= {
  2596 + "major": 1,
  2597 + "minor": 3,
  2598 + "build": 1,
  2599 + "revision": 1354556913
  2600 +};
... ...
public/javascripts/jquery-timepicker-addon/lib/jasmine-jquery.js 0 → 100644
... ... @@ -0,0 +1,659 @@
  1 +/*!
  2 + Jasmine-jQuery: a set of jQuery helpers for Jasmine tests.
  3 +
  4 + Version 1.5.2
  5 +
  6 + https://github.com/velesin/jasmine-jquery
  7 +
  8 + Copyright (c) 2010-2013 Wojciech Zawistowski, Travis Jeffery
  9 +
  10 + Permission is hereby granted, free of charge, to any person obtaining
  11 + a copy of this software and associated documentation files (the
  12 + "Software"), to deal in the Software without restriction, including
  13 + without limitation the rights to use, copy, modify, merge, publish,
  14 + distribute, sublicense, and/or sell copies of the Software, and to
  15 + permit persons to whom the Software is furnished to do so, subject to
  16 + the following conditions:
  17 +
  18 + The above copyright notice and this permission notice shall be
  19 + included in all copies or substantial portions of the Software.
  20 +
  21 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22 + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24 + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25 + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26 + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27 + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28 +*/
  29 +var readFixtures = function() {
  30 + return jasmine.getFixtures().proxyCallTo_('read', arguments)
  31 +}
  32 +
  33 +var preloadFixtures = function() {
  34 + jasmine.getFixtures().proxyCallTo_('preload', arguments)
  35 +}
  36 +
  37 +var loadFixtures = function() {
  38 + jasmine.getFixtures().proxyCallTo_('load', arguments)
  39 +}
  40 +
  41 +var appendLoadFixtures = function() {
  42 + jasmine.getFixtures().proxyCallTo_('appendLoad', arguments)
  43 +}
  44 +
  45 +var setFixtures = function(html) {
  46 + jasmine.getFixtures().proxyCallTo_('set', arguments)
  47 +}
  48 +
  49 +var appendSetFixtures = function() {
  50 + jasmine.getFixtures().proxyCallTo_('appendSet', arguments)
  51 +}
  52 +
  53 +var sandbox = function(attributes) {
  54 + return jasmine.getFixtures().sandbox(attributes)
  55 +}
  56 +
  57 +var spyOnEvent = function(selector, eventName) {
  58 + return jasmine.JQuery.events.spyOn(selector, eventName)
  59 +}
  60 +
  61 +var preloadStyleFixtures = function() {
  62 + jasmine.getStyleFixtures().proxyCallTo_('preload', arguments)
  63 +}
  64 +
  65 +var loadStyleFixtures = function() {
  66 + jasmine.getStyleFixtures().proxyCallTo_('load', arguments)
  67 +}
  68 +
  69 +var appendLoadStyleFixtures = function() {
  70 + jasmine.getStyleFixtures().proxyCallTo_('appendLoad', arguments)
  71 +}
  72 +
  73 +var setStyleFixtures = function(html) {
  74 + jasmine.getStyleFixtures().proxyCallTo_('set', arguments)
  75 +}
  76 +
  77 +var appendSetStyleFixtures = function(html) {
  78 + jasmine.getStyleFixtures().proxyCallTo_('appendSet', arguments)
  79 +}
  80 +
  81 +var loadJSONFixtures = function() {
  82 + return jasmine.getJSONFixtures().proxyCallTo_('load', arguments)
  83 +}
  84 +
  85 +var getJSONFixture = function(url) {
  86 + return jasmine.getJSONFixtures().proxyCallTo_('read', arguments)[url]
  87 +}
  88 +
  89 +jasmine.spiedEventsKey = function (selector, eventName) {
  90 + return [$(selector).selector, eventName].toString()
  91 +}
  92 +
  93 +jasmine.getFixtures = function() {
  94 + return jasmine.currentFixtures_ = jasmine.currentFixtures_ || new jasmine.Fixtures()
  95 +}
  96 +
  97 +jasmine.getStyleFixtures = function() {
  98 + return jasmine.currentStyleFixtures_ = jasmine.currentStyleFixtures_ || new jasmine.StyleFixtures()
  99 +}
  100 +
  101 +jasmine.Fixtures = function() {
  102 + this.containerId = 'jasmine-fixtures'
  103 + this.fixturesCache_ = {}
  104 + this.fixturesPath = 'spec/javascripts/fixtures'
  105 +}
  106 +
  107 +jasmine.Fixtures.prototype.set = function(html) {
  108 + this.cleanUp()
  109 + this.createContainer_(html)
  110 +}
  111 +
  112 +jasmine.Fixtures.prototype.appendSet= function(html) {
  113 + this.addToContainer_(html)
  114 +}
  115 +
  116 +jasmine.Fixtures.prototype.preload = function() {
  117 + this.read.apply(this, arguments)
  118 +}
  119 +
  120 +jasmine.Fixtures.prototype.load = function() {
  121 + this.cleanUp()
  122 + this.createContainer_(this.read.apply(this, arguments))
  123 +}
  124 +
  125 +jasmine.Fixtures.prototype.appendLoad = function() {
  126 + this.addToContainer_(this.read.apply(this, arguments))
  127 +}
  128 +
  129 +jasmine.Fixtures.prototype.read = function() {
  130 + var htmlChunks = []
  131 +
  132 + var fixtureUrls = arguments
  133 + for(var urlCount = fixtureUrls.length, urlIndex = 0; urlIndex < urlCount; urlIndex++) {
  134 + htmlChunks.push(this.getFixtureHtml_(fixtureUrls[urlIndex]))
  135 + }
  136 +
  137 + return htmlChunks.join('')
  138 +}
  139 +
  140 +jasmine.Fixtures.prototype.clearCache = function() {
  141 + this.fixturesCache_ = {}
  142 +}
  143 +
  144 +jasmine.Fixtures.prototype.cleanUp = function() {
  145 + $('#' + this.containerId).remove()
  146 +}
  147 +
  148 +jasmine.Fixtures.prototype.sandbox = function(attributes) {
  149 + var attributesToSet = attributes || {}
  150 + return $('<div id="sandbox" />').attr(attributesToSet)
  151 +}
  152 +
  153 +jasmine.Fixtures.prototype.createContainer_ = function(html) {
  154 + var container
  155 + if(html instanceof $) {
  156 + container = $('<div id="' + this.containerId + '" />')
  157 + container.html(html)
  158 + } else {
  159 + container = '<div id="' + this.containerId + '">' + html + '</div>'
  160 + }
  161 + $(document.body).append(container)
  162 +}
  163 +
  164 +jasmine.Fixtures.prototype.addToContainer_ = function(html){
  165 + var container = $(document.body).find('#'+this.containerId).append(html)
  166 + if(!container.length){
  167 + this.createContainer_(html)
  168 + }
  169 +}
  170 +
  171 +jasmine.Fixtures.prototype.getFixtureHtml_ = function(url) {
  172 + if (typeof this.fixturesCache_[url] === 'undefined') {
  173 + this.loadFixtureIntoCache_(url)
  174 + }
  175 + return this.fixturesCache_[url]
  176 +}
  177 +
  178 +jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function(relativeUrl) {
  179 + var url = this.makeFixtureUrl_(relativeUrl)
  180 + var request = $.ajax({
  181 + type: "GET",
  182 + url: url + "?" + new Date().getTime(),
  183 + async: false
  184 + })
  185 + this.fixturesCache_[relativeUrl] = request.responseText
  186 +}
  187 +
  188 +jasmine.Fixtures.prototype.makeFixtureUrl_ = function(relativeUrl){
  189 + return this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl
  190 +}
  191 +
  192 +jasmine.Fixtures.prototype.proxyCallTo_ = function(methodName, passedArguments) {
  193 + return this[methodName].apply(this, passedArguments)
  194 +}
  195 +
  196 +
  197 +jasmine.StyleFixtures = function() {
  198 + this.fixturesCache_ = {}
  199 + this.fixturesNodes_ = []
  200 + this.fixturesPath = 'spec/javascripts/fixtures'
  201 +}
  202 +
  203 +jasmine.StyleFixtures.prototype.set = function(css) {
  204 + this.cleanUp()
  205 + this.createStyle_(css)
  206 +}
  207 +
  208 +jasmine.StyleFixtures.prototype.appendSet = function(css) {
  209 + this.createStyle_(css)
  210 +}
  211 +
  212 +jasmine.StyleFixtures.prototype.preload = function() {
  213 + this.read_.apply(this, arguments)
  214 +}
  215 +
  216 +jasmine.StyleFixtures.prototype.load = function() {
  217 + this.cleanUp()
  218 + this.createStyle_(this.read_.apply(this, arguments))
  219 +}
  220 +
  221 +jasmine.StyleFixtures.prototype.appendLoad = function() {
  222 + this.createStyle_(this.read_.apply(this, arguments))
  223 +}
  224 +
  225 +jasmine.StyleFixtures.prototype.cleanUp = function() {
  226 + while(this.fixturesNodes_.length) {
  227 + this.fixturesNodes_.pop().remove()
  228 + }
  229 +}
  230 +
  231 +jasmine.StyleFixtures.prototype.createStyle_ = function(html) {
  232 + var styleText = $('<div></div>').html(html).text(),
  233 + style = $('<style>' + styleText + '</style>')
  234 +
  235 + this.fixturesNodes_.push(style)
  236 +
  237 + $('head').append(style)
  238 +}
  239 +
  240 +jasmine.StyleFixtures.prototype.clearCache = jasmine.Fixtures.prototype.clearCache
  241 +
  242 +jasmine.StyleFixtures.prototype.read_ = jasmine.Fixtures.prototype.read
  243 +
  244 +jasmine.StyleFixtures.prototype.getFixtureHtml_ = jasmine.Fixtures.prototype.getFixtureHtml_
  245 +
  246 +jasmine.StyleFixtures.prototype.loadFixtureIntoCache_ = jasmine.Fixtures.prototype.loadFixtureIntoCache_
  247 +
  248 +jasmine.StyleFixtures.prototype.makeFixtureUrl_ = jasmine.Fixtures.prototype.makeFixtureUrl_
  249 +
  250 +jasmine.StyleFixtures.prototype.proxyCallTo_ = jasmine.Fixtures.prototype.proxyCallTo_
  251 +
  252 +jasmine.getJSONFixtures = function() {
  253 + return jasmine.currentJSONFixtures_ = jasmine.currentJSONFixtures_ || new jasmine.JSONFixtures()
  254 +}
  255 +
  256 +jasmine.JSONFixtures = function() {
  257 + this.fixturesCache_ = {}
  258 + this.fixturesPath = 'spec/javascripts/fixtures/json'
  259 +}
  260 +
  261 +jasmine.JSONFixtures.prototype.load = function() {
  262 + this.read.apply(this, arguments)
  263 + return this.fixturesCache_
  264 +}
  265 +
  266 +jasmine.JSONFixtures.prototype.read = function() {
  267 + var fixtureUrls = arguments
  268 + for(var urlCount = fixtureUrls.length, urlIndex = 0; urlIndex < urlCount; urlIndex++) {
  269 + this.getFixtureData_(fixtureUrls[urlIndex])
  270 + }
  271 + return this.fixturesCache_
  272 +}
  273 +
  274 +jasmine.JSONFixtures.prototype.clearCache = function() {
  275 + this.fixturesCache_ = {}
  276 +}
  277 +
  278 +jasmine.JSONFixtures.prototype.getFixtureData_ = function(url) {
  279 + this.loadFixtureIntoCache_(url)
  280 + return this.fixturesCache_[url]
  281 +}
  282 +
  283 +jasmine.JSONFixtures.prototype.loadFixtureIntoCache_ = function(relativeUrl) {
  284 + var self = this
  285 + var url = this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl
  286 + $.ajax({
  287 + async: false, // must be synchronous to guarantee that no tests are run before fixture is loaded
  288 + cache: false,
  289 + dataType: 'json',
  290 + url: url,
  291 + success: function(data) {
  292 + self.fixturesCache_[relativeUrl] = data
  293 + },
  294 + error: function(jqXHR, status, errorThrown) {
  295 + throw Error('JSONFixture could not be loaded: ' + url + ' (status: ' + status + ', message: ' + errorThrown.message + ')')
  296 + }
  297 + })
  298 +}
  299 +
  300 +jasmine.JSONFixtures.prototype.proxyCallTo_ = function(methodName, passedArguments) {
  301 + return this[methodName].apply(this, passedArguments)
  302 +}
  303 +
  304 +jasmine.JQuery = function() {}
  305 +
  306 +jasmine.JQuery.browserTagCaseIndependentHtml = function(html) {
  307 + return $('<div/>').append(html).html()
  308 +}
  309 +
  310 +jasmine.JQuery.elementToString = function(element) {
  311 + var domEl = $(element).get(0)
  312 + if (domEl == undefined || domEl.cloneNode)
  313 + return $('<div />').append($(element).clone()).html()
  314 + else
  315 + return element.toString()
  316 +}
  317 +
  318 +jasmine.JQuery.matchersClass = {}
  319 +
  320 +!function(namespace) {
  321 + var data = {
  322 + spiedEvents: {},
  323 + handlers: []
  324 + }
  325 +
  326 + namespace.events = {
  327 + spyOn: function(selector, eventName) {
  328 + var handler = function(e) {
  329 + data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)] = jasmine.util.argsToArray(arguments)
  330 + }
  331 + $(selector).on(eventName, handler)
  332 + data.handlers.push(handler)
  333 + return {
  334 + selector: selector,
  335 + eventName: eventName,
  336 + handler: handler,
  337 + reset: function(){
  338 + delete data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)]
  339 + }
  340 + }
  341 + },
  342 +
  343 + args: function(selector, eventName) {
  344 + var actualArgs = data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)];
  345 +
  346 + if (!actualArgs) {
  347 + throw "There is no spy for " + eventName + " on " + selector.toString() + ". Make sure to create a spy using spyOnEvent.";
  348 + }
  349 +
  350 + return actualArgs;
  351 + },
  352 +
  353 + wasTriggered: function(selector, eventName) {
  354 + return !!(data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)])
  355 + },
  356 +
  357 + wasTriggeredWith: function(selector, eventName, expectedArgs, env) {
  358 + var actualArgs = jasmine.JQuery.events.args(selector, eventName).slice(1);
  359 + if (Object.prototype.toString.call(expectedArgs) !== '[object Array]') {
  360 + actualArgs = actualArgs[0];
  361 + }
  362 + return env.equals_(expectedArgs, actualArgs);
  363 + },
  364 +
  365 + wasPrevented: function(selector, eventName) {
  366 + var args = data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)],
  367 + e = args ? args[0] : undefined;
  368 + return e && e.isDefaultPrevented()
  369 + },
  370 +
  371 + wasStopped: function(selector, eventName) {
  372 + var args = data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)],
  373 + e = args ? args[0] : undefined;
  374 + return e && e.isPropagationStopped()
  375 + },
  376 +
  377 + cleanUp: function() {
  378 + data.spiedEvents = {}
  379 + data.handlers = []
  380 + }
  381 + }
  382 +}(jasmine.JQuery)
  383 +
  384 +!function(){
  385 + var jQueryMatchers = {
  386 + toHaveClass: function(className) {
  387 + return this.actual.hasClass(className)
  388 + },
  389 +
  390 + toHaveCss: function(css){
  391 + for (var prop in css){
  392 + if (this.actual.css(prop) !== css[prop]) return false
  393 + }
  394 + return true
  395 + },
  396 +
  397 + toBeVisible: function() {
  398 + return this.actual.is(':visible')
  399 + },
  400 +
  401 + toBeHidden: function() {
  402 + return this.actual.is(':hidden')
  403 + },
  404 +
  405 + toBeSelected: function() {
  406 + return this.actual.is(':selected')
  407 + },
  408 +
  409 + toBeChecked: function() {
  410 + return this.actual.is(':checked')
  411 + },
  412 +
  413 + toBeEmpty: function() {
  414 + return this.actual.is(':empty')
  415 + },
  416 +
  417 + toExist: function() {
  418 + return $(document).find(this.actual).length
  419 + },
  420 +
  421 + toHaveLength: function(length) {
  422 + return this.actual.length === length
  423 + },
  424 +
  425 + toHaveAttr: function(attributeName, expectedAttributeValue) {
  426 + return hasProperty(this.actual.attr(attributeName), expectedAttributeValue)
  427 + },
  428 +
  429 + toHaveProp: function(propertyName, expectedPropertyValue) {
  430 + return hasProperty(this.actual.prop(propertyName), expectedPropertyValue)
  431 + },
  432 +
  433 + toHaveId: function(id) {
  434 + return this.actual.attr('id') == id
  435 + },
  436 +
  437 + toHaveHtml: function(html) {
  438 + return this.actual.html() == jasmine.JQuery.browserTagCaseIndependentHtml(html)
  439 + },
  440 +
  441 + toContainHtml: function(html){
  442 + var actualHtml = this.actual.html()
  443 + var expectedHtml = jasmine.JQuery.browserTagCaseIndependentHtml(html)
  444 + return (actualHtml.indexOf(expectedHtml) >= 0)
  445 + },
  446 +
  447 + toHaveText: function(text) {
  448 + var trimmedText = $.trim(this.actual.text())
  449 + if (text && $.isFunction(text.test)) {
  450 + return text.test(trimmedText)
  451 + } else {
  452 + return trimmedText == text
  453 + }
  454 + },
  455 +
  456 + toContainText: function(text) {
  457 + var trimmedText = $.trim(this.actual.text())
  458 + if (text && $.isFunction(text.test)) {
  459 + return text.test(trimmedText)
  460 + } else {
  461 + return trimmedText.indexOf(text) != -1;
  462 + }
  463 + },
  464 +
  465 + toHaveValue: function(value) {
  466 + return this.actual.val() === value
  467 + },
  468 +
  469 + toHaveData: function(key, expectedValue) {
  470 + return hasProperty(this.actual.data(key), expectedValue)
  471 + },
  472 +
  473 + toBe: function(selector) {
  474 + return this.actual.is(selector)
  475 + },
  476 +
  477 + toContain: function(selector) {
  478 + return this.actual.find(selector).length
  479 + },
  480 +
  481 + toBeDisabled: function(selector){
  482 + return this.actual.is(':disabled')
  483 + },
  484 +
  485 + toBeFocused: function(selector) {
  486 + return this.actual[0] === this.actual[0].ownerDocument.activeElement
  487 + },
  488 +
  489 + toHandle: function(event) {
  490 +
  491 + var events = $._data(this.actual.get(0), "events")
  492 +
  493 + if(!events || !event || typeof event !== "string") {
  494 + return false
  495 + }
  496 +
  497 + var namespaces = event.split(".")
  498 + var eventType = namespaces.shift()
  499 + var sortedNamespaces = namespaces.slice(0).sort()
  500 + var namespaceRegExp = new RegExp("(^|\\.)" + sortedNamespaces.join("\\.(?:.*\\.)?") + "(\\.|$)")
  501 +
  502 + if(events[eventType] && namespaces.length) {
  503 + for(var i = 0; i < events[eventType].length; i++) {
  504 + var namespace = events[eventType][i].namespace
  505 + if(namespaceRegExp.test(namespace)) {
  506 + return true
  507 + }
  508 + }
  509 + } else {
  510 + return events[eventType] && events[eventType].length > 0
  511 + }
  512 + },
  513 +
  514 + // tests the existence of a specific event binding + handler
  515 + toHandleWith: function(eventName, eventHandler) {
  516 + var stack = $._data(this.actual.get(0), "events")[eventName]
  517 + for (var i = 0; i < stack.length; i++) {
  518 + if (stack[i].handler == eventHandler) return true
  519 + }
  520 + return false
  521 + }
  522 + }
  523 +
  524 + var hasProperty = function(actualValue, expectedValue) {
  525 + if (expectedValue === undefined) return actualValue !== undefined
  526 + return actualValue == expectedValue
  527 + }
  528 +
  529 + var bindMatcher = function(methodName) {
  530 + var builtInMatcher = jasmine.Matchers.prototype[methodName]
  531 +
  532 + jasmine.JQuery.matchersClass[methodName] = function() {
  533 + if (this.actual
  534 + && (this.actual instanceof $
  535 + || jasmine.isDomNode(this.actual))) {
  536 + this.actual = $(this.actual)
  537 + var result = jQueryMatchers[methodName].apply(this, arguments)
  538 + var element
  539 + if (this.actual.get && (element = this.actual.get()[0]) && !$.isWindow(element) && element.tagName !== "HTML")
  540 + this.actual = jasmine.JQuery.elementToString(this.actual)
  541 + return result
  542 + }
  543 +
  544 + if (builtInMatcher) {
  545 + return builtInMatcher.apply(this, arguments)
  546 + }
  547 +
  548 + return false
  549 + }
  550 + }
  551 +
  552 + for(var methodName in jQueryMatchers) {
  553 + bindMatcher(methodName)
  554 + }
  555 +}()
  556 +
  557 +beforeEach(function() {
  558 + this.addMatchers(jasmine.JQuery.matchersClass)
  559 + this.addMatchers({
  560 + toHaveBeenTriggeredOn: function(selector) {
  561 + this.message = function() {
  562 + return [
  563 + "Expected event " + this.actual + " to have been triggered on " + selector,
  564 + "Expected event " + this.actual + " not to have been triggered on " + selector
  565 + ]
  566 + }
  567 + return jasmine.JQuery.events.wasTriggered(selector, this.actual)
  568 + }
  569 + })
  570 + this.addMatchers({
  571 + toHaveBeenTriggered: function(){
  572 + var eventName = this.actual.eventName,
  573 + selector = this.actual.selector
  574 + this.message = function() {
  575 + return [
  576 + "Expected event " + eventName + " to have been triggered on " + selector,
  577 + "Expected event " + eventName + " not to have been triggered on " + selector
  578 + ]
  579 + }
  580 + return jasmine.JQuery.events.wasTriggered(selector, eventName)
  581 + }
  582 + })
  583 + this.addMatchers({
  584 + toHaveBeenTriggeredOnAndWith: function() {
  585 + var selector = arguments[0],
  586 + expectedArgs = arguments[1],
  587 + wasTriggered = jasmine.JQuery.events.wasTriggered(selector, this.actual);
  588 + this.message = function() {
  589 + if (wasTriggered) {
  590 + var actualArgs = jasmine.JQuery.events.args(selector, this.actual, expectedArgs)[1];
  591 + return [
  592 + "Expected event " + this.actual + " to have been triggered with " + jasmine.pp(expectedArgs) + " but it was triggered with " + jasmine.pp(actualArgs),
  593 + "Expected event " + this.actual + " not to have been triggered with " + jasmine.pp(expectedArgs) + " but it was triggered with " + jasmine.pp(actualArgs)
  594 + ]
  595 + } else {
  596 + return [
  597 + "Expected event " + this.actual + " to have been triggered on " + selector,
  598 + "Expected event " + this.actual + " not to have been triggered on " + selector
  599 + ]
  600 + }
  601 + }
  602 + return wasTriggered && jasmine.JQuery.events.wasTriggeredWith(selector, this.actual, expectedArgs, this.env);
  603 + }
  604 + })
  605 + this.addMatchers({
  606 + toHaveBeenPreventedOn: function(selector) {
  607 + this.message = function() {
  608 + return [
  609 + "Expected event " + this.actual + " to have been prevented on " + selector,
  610 + "Expected event " + this.actual + " not to have been prevented on " + selector
  611 + ]
  612 + }
  613 + return jasmine.JQuery.events.wasPrevented(selector, this.actual)
  614 + }
  615 + })
  616 + this.addMatchers({
  617 + toHaveBeenPrevented: function() {
  618 + var eventName = this.actual.eventName,
  619 + selector = this.actual.selector
  620 + this.message = function() {
  621 + return [
  622 + "Expected event " + eventName + " to have been prevented on " + selector,
  623 + "Expected event " + eventName + " not to have been prevented on " + selector
  624 + ]
  625 + }
  626 + return jasmine.JQuery.events.wasPrevented(selector, eventName)
  627 + }
  628 + })
  629 + this.addMatchers({
  630 + toHaveBeenStoppedOn: function(selector) {
  631 + this.message = function() {
  632 + return [
  633 + "Expected event " + this.actual + " to have been stopped on " + selector,
  634 + "Expected event " + this.actual + " not to have been stopped on " + selector
  635 + ]
  636 + }
  637 + return jasmine.JQuery.events.wasStopped(selector, this.actual)
  638 + }
  639 + })
  640 + this.addMatchers({
  641 + toHaveBeenStopped: function() {
  642 + var eventName = this.actual.eventName,
  643 + selector = this.actual.selector
  644 + this.message = function() {
  645 + return [
  646 + "Expected event " + eventName + " to have been stopped on " + selector,
  647 + "Expected event " + eventName + " not to have been stopped on " + selector
  648 + ]
  649 + }
  650 + return jasmine.JQuery.events.wasStopped(selector, eventName)
  651 + }
  652 + })
  653 +})
  654 +
  655 +afterEach(function() {
  656 + jasmine.getFixtures().cleanUp()
  657 + jasmine.getStyleFixtures().cleanUp()
  658 + jasmine.JQuery.events.cleanUp()
  659 +})
... ...
public/javascripts/jquery-timepicker-addon/package.json 0 → 100644
... ... @@ -0,0 +1,22 @@
  1 +{
  2 + "name": "jQuery-Timepicker-Addon",
  3 + "version": "0.0.0-ignored",
  4 + "engines": {
  5 + "node": ">= 0.8.0"
  6 + },
  7 + "scripts": {
  8 + "test": "grunt jasmine"
  9 + },
  10 + "devDependencies": {
  11 + "grunt-contrib-jshint": "~0.1.1",
  12 + "grunt-contrib-jasmine": "~0.5.1",
  13 + "grunt-contrib-concat": "~0.1.2",
  14 + "grunt-contrib-uglify": "~0.1.1",
  15 + "grunt-contrib-watch": "~0.2.0",
  16 + "grunt-contrib-clean": "~0.4.0",
  17 + "grunt-contrib-copy": "~0.4.0",
  18 + "grunt-contrib-cssmin": "~0.6.0",
  19 + "grunt-replace": "~0.4.4",
  20 + "grunt": "~0.4.1"
  21 + }
  22 +}
0 23 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/src/.jshintrc 0 → 100644
... ... @@ -0,0 +1,17 @@
  1 +{
  2 + "evil": true,
  3 + "curly": true,
  4 + "eqeqeq": true,
  5 + "immed": true,
  6 + "latedef": true,
  7 + "newcap": true,
  8 + "noarg": true,
  9 + "sub": true,
  10 + "undef": true,
  11 + "unused": false,
  12 + "loopfunc": true,
  13 + "boss": true,
  14 + "eqnull": true,
  15 + "browser": true,
  16 + "predef": ["jQuery"]
  17 +}
... ...
public/javascripts/jquery-timepicker-addon/src/docs/examples.html 0 → 100644
... ... @@ -0,0 +1,441 @@
  1 +<!-- ############################################################################# -->
  2 +<!-- Examples
  3 +<!-- ############################################################################# -->
  4 +<div id="tp-examples">
  5 + <h2>Examples</h2>
  6 +
  7 + <ul>
  8 + <li><a href="#basic_examples" title="Basic Initializations">Basic Initializations</a></li>
  9 + <li><a href="#timezone_examples" title="Using Timezones">Using Timezones</a></li>
  10 + <li><a href="#slider_examples" title="Slider Modifications">Slider Modifications</a></li>
  11 + <li><a href="#alt_examples" title="Alternate Field">Alternate Fields</a></li>
  12 + <li><a href="#rest_examples" title="Time Restraints">Time Restraints</a></li>
  13 + <li><a href="#utility_examples" title="Utilities">Utilities</a></li>
  14 + </ul>
  15 +
  16 + <h3 id="basic_examples">Basic Initializations</h3>
  17 +
  18 + <!-- ============= example -->
  19 + <div class="example-container">
  20 + <p>Add a simple datetimepicker to jQuery UI's datepicker</p>
  21 + <div>
  22 + <input type="text" name="basic_example_1" id="basic_example_1" value="" />
  23 + </div>
  24 +<pre>
  25 +$('#basic_example_1').datetimepicker();
  26 +</pre>
  27 + </div>
  28 +
  29 +
  30 + <!-- ============= example -->
  31 + <div class="example-container">
  32 + <p>Add only a timepicker:</p>
  33 + <div>
  34 + <input type="text" name="basic_example_2" id="basic_example_2" value="" />
  35 + </div>
  36 +<pre>
  37 +$('#basic_example_2').timepicker();
  38 +</pre>
  39 + </div>
  40 +
  41 + <!-- ============= example -->
  42 + <div class="example-container">
  43 + <p>Format the time:</p>
  44 + <div>
  45 + <input type="text" name="basic_example_3" id="basic_example_3" value="" />
  46 + </div>
  47 +<pre>
  48 +$('#basic_example_3').datetimepicker({
  49 + timeFormat: "hh:mm tt"
  50 +});
  51 +</pre>
  52 + </div>
  53 +
  54 + <h3 id="timezone_examples">Using Timezones</h3>
  55 +
  56 + <!-- ============= example -->
  57 + <div class="example-container">
  58 + <p>Simplest timezone usage:</p>
  59 + <div>
  60 + <input type="text" name="timezone_example_1" id="timezone_example_1" value="" />
  61 + </div>
  62 +<pre>
  63 +$('#timezone_example_1').datetimepicker({
  64 + timeFormat: 'hh:mm tt z'
  65 +});
  66 +</pre>
  67 + </div>
  68 +
  69 + <!-- ============= example -->
  70 + <div class="example-container">
  71 + <p>Define your own timezone options:</p>
  72 + <div>
  73 + <input type="text" name="timezone_example_2" id="timezone_example_2" value="" />
  74 + </div>
  75 +<pre>
  76 +$('#timezone_example_2').datetimepicker({
  77 + timeFormat: 'HH:mm z',
  78 + timezoneList: [
  79 + { value: -300, label: 'Eastern'},
  80 + { value: -360, label: 'Central' },
  81 + { value: -420, label: 'Mountain' },
  82 + { value: -480, label: 'Pacific' }
  83 + ]
  84 +});
  85 +</pre>
  86 + </div>
  87 +
  88 + <!-- ============= example -->
  89 + <div class="example-container">
  90 + <p>You may also use timezone string abbreviations for values. This should be used with caution. Computing accurate javascript Date objects may not be possible when trying to retrieve or set the date from timepicker (see setDate and getDate examples below). For simple input values however this should work.</p>
  91 + <div>
  92 + <input type="text" name="timezone_example_3" id="timezone_example_3" value="" />
  93 + </div>
  94 +<pre>
  95 +$('#timezone_example_3').datetimepicker({
  96 + timeFormat: 'HH:mm z',
  97 + timezone: 'MT',
  98 + timezoneList: [
  99 + { value: 'ET', label: 'Eastern'},
  100 + { value: 'CT', label: 'Central' },
  101 + { value: 'MT', label: 'Mountain' },
  102 + { value: 'PT', label: 'Pacific' }
  103 + ]
  104 +});
  105 +
  106 +</pre>
  107 + </div>
  108 +
  109 + <h3 id="slider_examples">Slider Modifications</h3>
  110 +
  111 + <!-- ============= example -->
  112 + <div class="example-container">
  113 + <p>Add a grid to each slider:</p>
  114 + <div>
  115 + <input type="text" name="slider_example_1" id="slider_example_1" value="" />
  116 + </div>
  117 +<pre>
  118 +$('#slider_example_1').timepicker({
  119 + hourGrid: 4,
  120 + minuteGrid: 10,
  121 + timeFormat: 'hh:mm tt'
  122 +});
  123 +</pre>
  124 + </div>
  125 +
  126 + <!-- ============= example -->
  127 + <div class="example-container">
  128 + <p>Set the interval step of sliders:</p>
  129 + <div>
  130 + <input type="text" name="slider_example_2" id="slider_example_2" value="" />
  131 + </div>
  132 +<pre>
  133 +$('#slider_example_2').datetimepicker({
  134 + timeFormat: 'HH:mm:ss',
  135 + stepHour: 2,
  136 + stepMinute: 10,
  137 + stepSecond: 10
  138 +});
  139 +</pre>
  140 + </div>
  141 +
  142 + <!-- ============= example -->
  143 + <div class="example-container">
  144 + <p>Add sliderAccess plugin for touch devices:</p>
  145 + <div>
  146 + <input type="text" name="slider_example_3" id="slider_example_3" value="" />
  147 + </div>
  148 +<pre>
  149 +$('#slider_example_3').datetimepicker({
  150 + addSliderAccess: true,
  151 + sliderAccessArgs: { touchonly: false }
  152 +});</pre>
  153 + </div>
  154 +
  155 + <!-- ============= example -->
  156 + <div class="example-container">
  157 + <p>Use dropdowns instead of sliders. By default if slider is not available dropdowns will be used.</p>
  158 + <div>
  159 + <input type="text" name="slider_example_4" id="slider_example_4" value="" />
  160 + </div>
  161 +<pre>
  162 +$('#slider_example_4').datetimepicker({
  163 + controlType: 'select',
  164 + timeFormat: 'hh:mm tt'
  165 +});</pre>
  166 + </div>
  167 +
  168 + <!-- ============= example -->
  169 + <div class="example-container">
  170 + <p>Create your own control by implementing the create, options, and value methods. If you want to use your new control for all instances use the $.timepicker.setDefaults({controlType:myControl}). Here we implement jQueryUI's spinner control (jQueryUI 1.9+).</p>
  171 + <div>
  172 + <input type="text" name="slider_example_5" id="slider_example_5" value="" />
  173 + </div>
  174 +<pre>var myControl= {
  175 + create: function(tp_inst, obj, unit, val, min, max, step){
  176 + $('&lt;input class="ui-timepicker-input" value="'+val+'" style="width:50%"&gt;')
  177 + .appendTo(obj)
  178 + .spinner({
  179 + min: min,
  180 + max: max,
  181 + step: step,
  182 + change: function(e,ui){ // key events
  183 + // don't call if api was used and not key press
  184 + if(e.originalEvent !== undefined)
  185 + tp_inst._onTimeChange();
  186 + tp_inst._onSelectHandler();
  187 + },
  188 + spin: function(e,ui){ // spin events
  189 + tp_inst.control.value(tp_inst, obj, unit, ui.value);
  190 + tp_inst._onTimeChange();
  191 + tp_inst._onSelectHandler();
  192 + }
  193 + });
  194 + return obj;
  195 + },
  196 + options: function(tp_inst, obj, unit, opts, val){
  197 + if(typeof(opts) == 'string' && val !== undefined)
  198 + return obj.find('.ui-timepicker-input').spinner(opts, val);
  199 + return obj.find('.ui-timepicker-input').spinner(opts);
  200 + },
  201 + value: function(tp_inst, obj, unit, val){
  202 + if(val !== undefined)
  203 + return obj.find('.ui-timepicker-input').spinner('value', val);
  204 + return obj.find('.ui-timepicker-input').spinner('value');
  205 + }
  206 +};
  207 +
  208 +$('#slider_example_5').datetimepicker({
  209 + controlType: myControl
  210 +});</pre>
  211 + </div>
  212 +
  213 + <h3 id="alt_examples">Alternate Fields</h3>
  214 +
  215 + <!-- ============= example -->
  216 + <div class="example-container">
  217 + <p>Alt field in the simplest form:</p>
  218 + <div>
  219 + <input type="text" name="alt_example_1" id="alt_example_1" value="09/15/2012" />
  220 + <input type="text" name="alt_example_1_alt" id="alt_example_1_alt" value="10:15" />
  221 + </div>
  222 +<pre>
  223 +$('#alt_example_1').datetimepicker({
  224 + altField: "#alt_example_1_alt"
  225 +});
  226 +</pre>
  227 + </div>
  228 +
  229 + <!-- ============= example -->
  230 + <div class="example-container">
  231 + <p>With datetime in both:</p>
  232 + <div>
  233 + <input type="text" name="alt_example_2" id="alt_example_2" value="" />
  234 + <input type="text" name="alt_example_2_alt" id="alt_example_2_alt" value="" />
  235 + </div>
  236 +<pre>
  237 +$('#alt_example_2').datetimepicker({
  238 + altField: "#alt_example_2_alt",
  239 + altFieldTimeOnly: false
  240 +});
  241 +</pre>
  242 + </div>
  243 +
  244 + <!-- ============= example -->
  245 + <div class="example-container">
  246 + <p>Format the altField differently:</p>
  247 + <div>
  248 + <input type="text" name="alt_example_3" id="alt_example_3" value="" />
  249 + <input type="text" name="alt_example_3_alt" id="alt_example_3_alt" value="" />
  250 + </div>
  251 +<pre>
  252 +$('#alt_example_3').datetimepicker({
  253 + altField: "#alt_example_3_alt",
  254 + altFieldTimeOnly: false,
  255 + altFormat: "yy-mm-dd",
  256 + altTimeFormat: "h:m t",
  257 + altSeparator: " @ "
  258 +});
  259 +</pre>
  260 + </div>
  261 +
  262 + <!-- ============= example -->
  263 + <div class="example-container">
  264 + <p>With inline mode using altField:</p>
  265 + <div>
  266 + <input type="text" name="alt_example_4_alt" id="alt_example_4_alt" value="" />
  267 + <span id="alt_example_4" ></span>
  268 + </div>
  269 +<pre>
  270 +$('#alt_example_4').datetimepicker({
  271 + altField: "#alt_example_4_alt",
  272 + altFieldTimeOnly: false
  273 +});
  274 +</pre>
  275 + </div>
  276 +
  277 + <h3 id="rest_examples">Time Restraints</h3>
  278 +
  279 + <!-- ============= example -->
  280 + <div class="example-container">
  281 + <p>Set the min/max hour of every date:</p>
  282 + <div>
  283 + <input type="text" name="rest_example_1" id="rest_example_1" value="" />
  284 + </div>
  285 +<pre>
  286 +$('#rest_example_1').timepicker({
  287 + hourMin: 8,
  288 + hourMax: 16
  289 +});
  290 +</pre>
  291 + </div>
  292 +
  293 + <!-- ============= example -->
  294 + <div class="example-container">
  295 + <p>Set the min/max date numerically:</p>
  296 + <div>
  297 + <input type="text" name="rest_example_2" id="rest_example_2" value="" />
  298 + </div>
  299 +<pre>
  300 +$('#rest_example_2').datetimepicker({
  301 + numberOfMonths: 2,
  302 + minDate: 0,
  303 + maxDate: 30
  304 +});
  305 +</pre>
  306 + </div>
  307 +
  308 + <!-- ============= example -->
  309 + <div class="example-container">
  310 + <p>Set the min/max date and time with a Date object:</p>
  311 + <div>
  312 + <input type="text" name="rest_example_3" id="rest_example_3" value="" />
  313 + </div>
  314 +<pre>
  315 +$('#rest_example_3').datetimepicker({
  316 + minDate: new Date(2010, 11, 20, 8, 30),
  317 + maxDate: new Date(2010, 11, 31, 17, 30)
  318 +});
  319 +</pre>
  320 + </div>
  321 +
  322 + <!-- ============= example -->
  323 + <div class="example-container">
  324 + <p>Restrict a start and end date by using onSelect and onClose events for more control over functionality:</p>
  325 + <p>For more examples and advanced usage grab the <a href="http://trentrichardson.com/ebooks/handling-time/" title="Handling Time eBook">Handling Time eBook</a>.</p>
  326 + <div>
  327 + <input type="text" name="rest_example_4_start" id="rest_example_4_start" value="" />
  328 + <input type="text" name="rest_example_4_end" id="rest_example_4_end" value="" />
  329 + </div>
  330 +<pre>
  331 +var startDateTextBox = $('#rest_example_4_start');
  332 +var endDateTextBox = $('#rest_example_4_end');
  333 +
  334 +startDateTextBox.datetimepicker({
  335 + timeFormat: 'HH:mm z',
  336 + onClose: function(dateText, inst) {
  337 + if (endDateTextBox.val() != '') {
  338 + var testStartDate = startDateTextBox.datetimepicker('getDate');
  339 + var testEndDate = endDateTextBox.datetimepicker('getDate');
  340 + if (testStartDate > testEndDate)
  341 + endDateTextBox.datetimepicker('setDate', testStartDate);
  342 + }
  343 + else {
  344 + endDateTextBox.val(dateText);
  345 + }
  346 + },
  347 + onSelect: function (selectedDateTime){
  348 + endDateTextBox.datetimepicker('option', 'minDate', startDateTextBox.datetimepicker('getDate') );
  349 + }
  350 +});
  351 +endDateTextBox.datetimepicker({
  352 + timeFormat: 'HH:mm z',
  353 + onClose: function(dateText, inst) {
  354 + if (startDateTextBox.val() != '') {
  355 + var testStartDate = startDateTextBox.datetimepicker('getDate');
  356 + var testEndDate = endDateTextBox.datetimepicker('getDate');
  357 + if (testStartDate > testEndDate)
  358 + startDateTextBox.datetimepicker('setDate', testEndDate);
  359 + }
  360 + else {
  361 + startDateTextBox.val(dateText);
  362 + }
  363 + },
  364 + onSelect: function (selectedDateTime){
  365 + startDateTextBox.datetimepicker('option', 'maxDate', endDateTextBox.datetimepicker('getDate') );
  366 + }
  367 +});
  368 +</pre>
  369 + </div>
  370 +
  371 + <h3 id="utility_examples">Utilities</h3>
  372 +
  373 + <!-- ============= example -->
  374 + <div class="example-container">
  375 + <p>Get and Set Datetime with the getDate and setDate methods. This example uses timezone to demonstrate the timepicker regonizes the timezones and computes the offsets when getting and setting.</p>
  376 + <div>
  377 + <input type="text" name="utility_example_1" id="utility_example_1" value="" />
  378 + <button id="utility_example_1_setdt" value="1">Set Datetime</button>
  379 + <button id="utility_example_1_getdt" value="1">Get Datetime</button>
  380 + </div>
  381 +
  382 +<pre>
  383 +var ex13 = $('#utility_example_1');
  384 +
  385 +ex13.datetimepicker({
  386 + timeFormat: 'hh:mm tt z',
  387 + separator: ' @ ',
  388 + showTimezone: true
  389 +});
  390 +
  391 +$('#utility_example_1_setdt').click(function(){
  392 + ex13.datetimepicker('setDate', (new Date()) );
  393 +});
  394 +
  395 +$('#utility_example_1_getdt').click(function(){
  396 + alert(ex13.datetimepicker('getDate'));
  397 +});
  398 +</pre>
  399 + </div>
  400 +
  401 + <!-- ============= example -->
  402 + <div class="example-container">
  403 + <p>Use the utility function to format your own time. $.datepicker.formatTime(format, time, options)</p>
  404 + <dl class="defs">
  405 + <dt>format</dt><dd>required - string represenation of the time format to use</dd>
  406 + <dt>time</dt><dd>required - hash: { hour, minute, second, millisecond, timezone }</dd>
  407 + <dt>options</dt><dd>optional - hash of any options in regional translation (ampm, amNames, pmNames..)</dd>
  408 + </dl>
  409 + <p>Returns a time string in the specified format.</p>
  410 + <div>
  411 + <div id="utility_example_2"></div>
  412 + </div>
  413 +
  414 +<pre>
  415 +$('#utility_example_2').text(
  416 + $.datepicker.formatTime('HH:mm z', { hour: 14, minute: 36, timezone: '+2000' }, {})
  417 +);
  418 +</pre>
  419 + </div>
  420 +
  421 + <!-- ============= example -->
  422 + <div class="example-container">
  423 + <p>Use the utility function to parses a formatted time. $.datepicker.parseTime(format, timeString, options)</p>
  424 + <dl class="defs">
  425 + <dt>format</dt><dd>required - string represenation of the time format to use</dd>
  426 + <dt>time</dt><dd>required - time string matching the format given in parameter 1</dd>
  427 + <dt>options</dt><dd>optional - hash of any options in regional translation (ampm, amNames, pmNames..)</dd>
  428 + </dl>
  429 + <p>Returns an object with hours, minutes, seconds, milliseconds, timezone.</p>
  430 + <div>
  431 + <div id="utility_example_3"></div>
  432 + </div>
  433 +
  434 +<pre>
  435 +$('#utility_example_3').text(JSON.stringify(
  436 + $.datepicker.parseTime('HH:mm:ss:l z', "14:36:21:765 +2000", {})
  437 +));
  438 +</pre>
  439 + </div>
  440 +
  441 +</div>
0 442 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/src/docs/footer.html 0 → 100644
... ... @@ -0,0 +1,36 @@
  1 + </div>
  2 +
  3 +
  4 + </div>
  5 +
  6 +
  7 + <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  8 + <script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
  9 + <script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
  10 + <script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
  11 +
  12 + <script type="text/javascript">
  13 +
  14 + $(function(){
  15 + $('#tabs').tabs();
  16 +
  17 + $('.example-container > pre').each(function(i){
  18 + eval($(this).text());
  19 + });
  20 + });
  21 +
  22 + </script>
  23 +
  24 + <script type="text/javascript" src="https://sellfy.com/js/api_buttons.js"></script>
  25 +
  26 + <script type="text/javascript"> /*
  27 + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  28 + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  29 + */</script>
  30 + <script type="text/javascript"> /*
  31 + try {
  32 + var pageTracker = _gat._getTracker("UA-7602218-1");
  33 + pageTracker._trackPageview();
  34 + } catch(err) {}*/</script>
  35 + </body>
  36 +</html>
0 37 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/src/docs/formatting.html 0 → 100644
... ... @@ -0,0 +1,40 @@
  1 +<!-- ############################################################################# -->
  2 +<!-- Formatting
  3 +<!-- ############################################################################# -->
  4 +<div id="tp-formatting">
  5 +
  6 + <h2>Formatting Your Time</h2>
  7 +
  8 + <p>The default format is "HH:mm". To use 12 hour time use something similar to: "hh:mm tt". When both "t" and lower case "h" are present in the timeFormat, 12 hour time will be used.</p>
  9 +
  10 + <dl class="defs">
  11 + <dt>H</dt><dd>Hour with no leading 0 (24 hour)</dd>
  12 + <dt>HH</dt><dd>Hour with leading 0 (24 hour)</dd>
  13 + <dt>h</dt><dd>Hour with no leading 0 (12 hour)</dd>
  14 + <dt>hh</dt><dd>Hour with leading 0 (12 hour)</dd>
  15 + <dt>m</dt><dd>Minute with no leading 0</dd>
  16 + <dt>mm</dt><dd>Minute with leading 0</dd>
  17 + <dt>s</dt><dd>Second with no leading 0</dd>
  18 + <dt>ss</dt><dd>Second with leading 0</dd>
  19 + <dt>l</dt><dd>Milliseconds always with leading 0</dd>
  20 + <dt>c</dt><dd>Microseconds always with leading 0</dd>
  21 + <dt>t</dt><dd>a or p for AM/PM</dd>
  22 + <dt>T</dt><dd>A or P for AM/PM</dd>
  23 + <dt>tt</dt><dd>am or pm for AM/PM</dd>
  24 + <dt>TT</dt><dd>AM or PM for AM/PM</dd>
  25 + <dt>z</dt><dd>Timezone as defined by timezoneList</dd>
  26 + <dt>Z</dt><dd>Timezone in Iso 8601 format (+04:45)</dd>
  27 + <dt>'...'</dt><dd>Literal text (Uses single quotes)</dd>
  28 + </dl>
  29 +
  30 + <p>Formats are used in the following ways:</p>
  31 + <ul>
  32 + <li>timeFormat option</li>
  33 + <li>altTimeFormat option</li>
  34 + <li>pickerTimeFormat option</li>
  35 + <li>$.datepicker.formatTime(format, timeObj, options) utility method</li>
  36 + <li>$.datepicker.parseTime(format, timeStr, options) utility method</li>
  37 + </ul>
  38 +
  39 + <p>For help with formatting the date portion, visit the datepicker documentation for <a href="http://docs.jquery.com/UI/Datepicker/formatDate" title="jQuery UI Datepicker Formatting">formatting dates</a>.</p>
  40 +</div>
... ...
public/javascripts/jquery-timepicker-addon/src/docs/header.html 0 → 100644
... ... @@ -0,0 +1,75 @@
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2 +<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3 + <head>
  4 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5 + <title>Adding a Timepicker to jQuery UI Datepicker</title>
  6 + <meta name="Description" content="jQuery Timepicker Addon. Add a timepicker to your jQuery UI Datepicker. With options to show only time, format time, and much more." />
  7 + <meta name="Keywords" content="jQuery, UI, datepicker, timepicker, datetime, time, format" />
  8 +
  9 + <style type="text/css">
  10 + body,img,p,h1,h2,h3,h4,h5,h6,form,table,td,ul,ol,li,dl,dt,dd,pre,blockquote,fieldset,label{
  11 + margin:0;
  12 + padding:0;
  13 + border:0;
  14 + }
  15 + body{ background-color: #777; border-top: solid 10px #7b94b2; font: 90% Arial, Helvetica, sans-serif; padding: 20px; }
  16 + h1,h2,h3{ margin: 10px 0; }
  17 + h1{}
  18 + h2{ color: #f66; }
  19 + h3{ color: #6b84a2; }
  20 + p{ margin: 10px 0; }
  21 + a{ color: #7b94b2; }
  22 + ul,ol{ margin: 10px 0 10px 40px; }
  23 + li{ margin: 4px 0; }
  24 + dl.defs{ margin: 10px 0 10px 40px; }
  25 + dl.defs dt{ font-weight: bold; line-height: 20px; margin: 10px 0 0 0; }
  26 + dl.defs dd{ margin: -20px 0 10px 160px; padding-bottom: 10px; border-bottom: solid 1px #eee;}
  27 + pre{ font-size: 12px; line-height: 16px; padding: 5px 5px 5px 10px; margin: 10px 0; background-color: #e4f4d4; border-left: solid 5px #9EC45F; overflow: auto; tab-size: 4; -moz-tab-size: 4; -o-tab-size: 4; -webkit-tab-size: 4; }
  28 +
  29 + .wrapper{ background-color: #ffffff; width: 800px; border: solid 1px #eeeeee; padding: 20px; margin: 0 auto; }
  30 + #tabs{ margin: 20px -20px; border: none; }
  31 + #tabs, #ui-datepicker-div, .ui-datepicker{ font-size: 85%; }
  32 + .clear{ clear: both; }
  33 +
  34 + .example-container{ background-color: #f4f4f4; border-bottom: solid 2px #777777; margin: 0 0 20px 40px; padding: 20px; }
  35 + .example-container input{ border: solid 1px #aaa; padding: 4px; width: 175px; }
  36 + .ebook{}
  37 + .ebook img.ebookimg{ float: left; margin: 0 15px 15px 0; width: 100px; }
  38 + .ebook .buyp a iframe{ margin-bottom: -5px; }
  39 + </style>
  40 +
  41 + <link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" />
  42 + <link rel="stylesheet" media="all" type="text/css" href="jquery-ui-timepicker-addon.css" />
  43 +
  44 + </head>
  45 + <body>
  46 + <div class="wrapper">
  47 + <h1>Adding a Timepicker to jQuery UI Datepicker</h1>
  48 +
  49 + <p>The timepicker addon adds a timepicker to jQuery UI Datepicker, thus the datepicker and slider components (jQueryUI) are required for using any of these. In addition all datepicker options are still available through the timepicker addon.</p>
  50 +
  51 + <p>If you are interested in contributing to Timepicker Addon please <a href="http://github.com/trentrichardson/jQuery-Timepicker-Addon" title="Check out Timepicker on GitHub">check it out on GitHub</a>. If you do make additions please keep in mind I enjoy tabs over spaces,.. But contributions are welcome in any form.</p>
  52 +
  53 + <p><a href="http://trentrichardson.com" title="Back to Blog">Back to Blog</a> or <a href="http://twitter.com/practicalweb" title="Follow Me on Twitter">Follow on Twitter</a></p>
  54 +
  55 + <a href="http://carbounce.com" title="Car Bounce" style="float: right;display: inline-block;width:380px;padding: 10px;background-color: #fbfbfb;border: dotted 4px #e8e8e8;color: #9EC45F;font-size: 16px;text-decoration:none;letter-spacing:1px;"><img src="http://carbounce.com/img/logo_small.png" alt="Car Bounce" align="left" style="margin-right: 20px;"/>Try my new app to keep you informed of your car's financing status and value.</a>
  56 +
  57 + <h2>Donation</h2>
  58 + <p>Has this Timepicker Addon been helpful to you?</p>
  59 + <div class="donation">
  60 + <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  61 + <input type="hidden" name="cmd" value="_s-xclick">
  62 + <input type="hidden" name="hosted_button_id" value="C2QQHR7JQGD28">
  63 + <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  64 + <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
  65 + </form>
  66 + </div>
  67 +
  68 + <div id="tabs">
  69 + <ul>
  70 + <li><a href="#tp-getting-started" title="Getting Started">Getting Started</a></li>
  71 + <li><a href="#tp-options" title="Options">Options</a></li>
  72 + <li><a href="#tp-formatting" title="Examples">Formatting</a></li>
  73 + <li><a href="#tp-localization" title="Examples">Localization</a></li>
  74 + <li><a href="#tp-examples" title="Examples">Examples</a></li>
  75 + </ul>
0 76 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/src/docs/i18n.html 0 → 100644
... ... @@ -0,0 +1,65 @@
  1 +<!-- ############################################################################# -->
  2 +<!-- Localization
  3 +<!-- ############################################################################# -->
  4 +<div id="tp-localization">
  5 +
  6 + <h2>Working with Localizations</h2>
  7 +
  8 + <p>Timepicker comes with many translations and localizations, thanks to all the contributors. They can be found in the i18n folder in the git repo.</p>
  9 +
  10 + <p>The quick and cheap way to use localizations is to pass in options to a timepicker instance:</p>
  11 +
  12 +<pre>$('#example123').timepicker({
  13 + timeOnlyTitle: 'Выберите время',
  14 + timeText: 'Время',
  15 + hourText: 'Часы',
  16 + minuteText: 'Минуты',
  17 + secondText: 'Секунды',
  18 + currentText: 'Сейчас',
  19 + closeText: 'Закрыть'
  20 +});
  21 +</pre>
  22 + <p>However, if you plan to use timepicker extensively you will need to include (build your own) localization. It is simply assigning those same variables to an object. As you see in the example below we maintain a separate object for timepicker. This way we aren't bound to any changes within datepicker.</p>
  23 +
  24 +<pre>$.datepicker.regional['ru'] = {
  25 + closeText: 'Закрыть',
  26 + prevText: '&#x3c;Пред',
  27 + nextText: 'След&#x3e;',
  28 + currentText: 'Сегодня',
  29 + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
  30 + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
  31 + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
  32 + 'Июл','Авг','Сен','Окт','Ноя','Дек'],
  33 + dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
  34 + dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
  35 + dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
  36 + weekHeader: 'Не',
  37 + dateFormat: 'dd.mm.yy',
  38 + firstDay: 1,
  39 + isRTL: false,
  40 + showMonthAfterYear: false,
  41 + yearSuffix: ''
  42 +};
  43 +$.datepicker.setDefaults($.datepicker.regional['ru']);
  44 +
  45 +
  46 +$.timepicker.regional['ru'] = {
  47 + timeOnlyTitle: 'Выберите время',
  48 + timeText: 'Время',
  49 + hourText: 'Часы',
  50 + minuteText: 'Минуты',
  51 + secondText: 'Секунды',
  52 + millisecText: 'Миллисекунды',
  53 + timezoneText: 'Часовой пояс',
  54 + currentText: 'Сейчас',
  55 + closeText: 'Закрыть',
  56 + timeFormat: 'HH:mm',
  57 + amNames: ['AM', 'A'],
  58 + pmNames: ['PM', 'P'],
  59 + isRTL: false
  60 +};
  61 +$.timepicker.setDefaults($.timepicker.regional['ru']);
  62 +</pre>
  63 + <p>Now all you have to do is call timepicker and the Russian localization is used. Generally you only need to include the localization file, it will setDefaults() for you.</p>
  64 + <p>You can also visit <a href="http://docs.jquery.com/UI/Datepicker/Localization" title="localization for datepicker" target="_BLANK">localization for datepicker</a> for more information about datepicker localizations.</p>
  65 +</div>
... ...
public/javascripts/jquery-timepicker-addon/src/docs/intro.html 0 → 100644
... ... @@ -0,0 +1,58 @@
  1 +<!-- ############################################################################# -->
  2 +<!-- Getting Started
  3 +<!-- ############################################################################# -->
  4 +<div id="tp-getting-started">
  5 + <h2>Getting Started</h2>
  6 +
  7 + <h3>Highly Recommended</h3>
  8 +
  9 + <h4>Handling Time eBook</h4>
  10 + <div class="ebook">
  11 + <p>Check out the <a href="http://trentrichardson.com/ebooks/handling-time/" title="Handling Time eBook">Handling Time eBook</a> to learn from the basic setup to advanced i18n usage, and from client's javascript to the server's database.</p>
  12 + <a href="http://trentrichardson.com/ebooks/handling-time/" title="Handling Time eBook"><img src="http://trentrichardson.com/wp-content/uploads/2013/04/time-book-titlepage.jpg" alt="Handling Time eBook" style="float:left;width:100px;margin:0 15px 15px 0;" /></a>
  13 + <p class="buyp"><a href="https://sellfy.com/p/8gxZ" id="8gxZ" class="sellfy-buy-button">buy</a> eBook + Example code</p>
  14 + <p class="buyp"><a href="https://sellfy.com/p/LvAG" id="LvAG" class="sellfy-buy-button">buy</a> eBook</p>
  15 + <div class="clear"></div>
  16 + </div>
  17 +
  18 + <h4>Subscribe to Blog and Twitter</h4>
  19 + <p><a href="http://trentrichardson.com" title="Subscribe to TrentRichardson.com via email">Subscribe to my blog via email</a> and follow <a href="http://twitter.com/practicalweb" title="Follow Me on Twitter">@PracticalWeb</a> on Twitter. I post for nearly every new version, so you know about updates.</p>
  20 + <div class="clear"></div>
  21 + <br />
  22 +
  23 + <h3>Download</h3>
  24 + <p><a href="jquery-ui-timepicker-addon.js" title="Download Timepicker Addon">Download Timepicker Addon</a></p>
  25 + <p><a href="http://github.com/trentrichardson/jQuery-Timepicker-Addon" title="Check out Timepicker on GitHub">Download/Contribute on GitHub</a> (Need the entire repo? Find a bug? See if its fixed here)</p>
  26 + <p>There is a small bit of required CSS (<a href="jquery-ui-timepicker-addon.css" title="Download CSS">Download</a>):</p>
  27 +<pre>/* css for timepicker */
  28 +.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
  29 +.ui-timepicker-div dl { text-align: left; }
  30 +.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
  31 +.ui-timepicker-div dl dd { margin: 0 10px 10px 45%; }
  32 +.ui-timepicker-div td { font-size: 90%; }
  33 +.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
  34 +
  35 +.ui-timepicker-rtl{ direction: rtl; }
  36 +.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
  37 +.ui-timepicker-rtl dl dt{ float: right; clear: right; }
  38 +.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
  39 +</pre>
  40 + <br />
  41 +
  42 + <h3>Requirements</h3>
  43 + <p>You also need to include jQuery and jQuery UI with datepicker and slider wigits. You should include them in your page in the following order:</p>
  44 + <ol>
  45 + <li>jQuery</li>
  46 + <li>jQueryUI (with datepicker and slider wigits)</li>
  47 + <li>Timepicker</li>
  48 + </ol>
  49 +
  50 + <br />
  51 + <h3>Version</h3>
  52 + <p>Version @@version</p>
  53 +
  54 + <p>Last updated on @@timestamp</p>
  55 + <p>jQuery Timepicker Addon is currently available for use in all personal or commercial projects under the MIT license.</p>
  56 + <p><a href="http://trentrichardson.com/Impromptu/MIT-LICENSE.txt" title="MIT License">MIT License</a></p>
  57 +
  58 +</div>
... ...
public/javascripts/jquery-timepicker-addon/src/docs/options.html 0 → 100644
... ... @@ -0,0 +1,261 @@
  1 +<!-- ############################################################################# -->
  2 +<!-- Options
  3 +<!-- ############################################################################# -->
  4 +<div id="tp-options">
  5 + <h2>Options</h2>
  6 +
  7 + <p>The timepicker does inherit all options from datepicker. However, there are many options that are shared by them both, and many timepicker only options:</p>
  8 +
  9 + <h3>Localization Options</h3>
  10 + <dl class="defs">
  11 + <dt>currentText</dt>
  12 + <dd><em>Default: "Now", A Localization Setting</em> - Text for the Now button.</dd>
  13 +
  14 + <dt>closeText</dt>
  15 + <dd><em>Default: "Done", A Localization Setting</em> - Text for the Close button.</dd>
  16 +
  17 + <dt>amNames</dt>
  18 + <dd><em>Default: ['AM', 'A'], A Localization Setting</em> - Array of strings to try and parse against to determine AM.</dd>
  19 +
  20 + <dt>pmNames</dt>
  21 + <dd><em>Default: ['PM', 'P'], A Localization Setting</em> - Array of strings to try and parse against to determine PM.</dd>
  22 +
  23 + <dt>timeFormat</dt>
  24 + <dd><em>Default: "HH:mm", A Localization Setting</em> - String of format tokens to be replaced with the time. <a href="#tp-formatting" title="Formatting" onclick="$('#tabs').tabs('select',2);">See Formatting</a>.</dd>
  25 +
  26 + <dt>timeSuffix</dt>
  27 + <dd><em>Default: "", A Localization Setting</em> - String to place after the formatted time.</dd>
  28 +
  29 + <dt>timeOnlyTitle</dt>
  30 + <dd><em>Default: "Choose Time", A Localization Setting</em> - Title of the wigit when using only timepicker.</dd>
  31 +
  32 + <dt>timeText</dt>
  33 + <dd><em>Default: "Time", A Localization Setting</em> - Label used within timepicker for the formatted time.</dd>
  34 +
  35 + <dt>hourText</dt>
  36 + <dd><em>Default: "Hour", A Localization Setting</em> - Label used to identify the hour slider.</dd>
  37 +
  38 + <dt>minuteText</dt>
  39 + <dd><em>Default: "Minute", A Localization Setting</em> - Label used to identify the minute slider.</dd>
  40 +
  41 + <dt>secondText</dt>
  42 + <dd><em>Default: "Second", A Localization Setting</em> - Label used to identify the second slider.</dd>
  43 +
  44 + <dt>millisecText</dt>
  45 + <dd><em>Default: "Millisecond", A Localization Setting</em> - Label used to identify the millisecond slider.</dd>
  46 +
  47 + <dt>microsecText</dt>
  48 + <dd><em>Default: "Microsecond", A Localization Setting</em> - Label used to identify the microsecond slider.</dd>
  49 +
  50 + <dt>timezoneText</dt>
  51 + <dd><em>Default: "Timezone", A Localization Setting</em> - Label used to identify the timezone slider.</dd>
  52 +
  53 + <dt>isRTL</dt>
  54 + <dd><em>Default: false, A Localization Setting</em> - Right to Left support.</dd>
  55 + </dl>
  56 +
  57 + <h3>Alt Field Options</h3>
  58 + <dl class="defs">
  59 +
  60 + <dt>altFieldTimeOnly</dt>
  61 + <dd><em>Default: true</em> - When altField is used from datepicker altField will only receive the formatted time and the original field only receives date.</dd>
  62 +
  63 + <dt>altSeparator</dt>
  64 + <dd><em>Default: (separator option)</em> - String placed between formatted date and formatted time in the altField.</dd>
  65 +
  66 + <dt>altTimeSuffix</dt>
  67 + <dd><em>Default: (timeSuffix option)</em> - String always placed after the formatted time in the altField.</dd>
  68 +
  69 + <dt>altTimeFormat</dt>
  70 + <dd><em>Default: (timeFormat option)</em> - The time format to use with the altField.</dd>
  71 + </dl>
  72 +
  73 + <h3>Timezone Options</h3>
  74 + <dl class="defs">
  75 +
  76 + <dt>timezoneList</dt>
  77 + <dd><em>Default: [generated timezones]</em> - An array of timezones used to populate the timezone select. Can be an array of values or an array of objects: { label: "EDT", value: -240 }. The value should be the offset number in minutes. So "-0400" which is the format "-hhmm", would equate to -240 minutes.</dd>
  78 + </dl>
  79 +
  80 + <h3>Time Field Options</h3>
  81 + <dl class="defs">
  82 +
  83 + <dt>controlType</dt>
  84 + <dd><em>Default: 'slider'</em> - Whether to use 'slider' or 'select'. If 'slider' is unavailable through jQueryUI, 'select' will be used. For advanced usage you may pass an object which implements "create", "options", "value" methods to use controls other than sliders or selects. See the _controls property in the source code for more details.
  85 +<pre>{
  86 + create: function(tp_inst, obj, unit, val, min, max, step){
  87 + // generate whatever controls you want here, just return obj
  88 + },
  89 + options: function(tp_inst, obj, unit, opts, val){
  90 + // if val==undefined return the value, else return obj
  91 + },
  92 + value: function(tp_inst, obj, unit, val){
  93 + // if val==undefined return the value, else return obj
  94 + }
  95 +}</pre>
  96 + </dd>
  97 +
  98 + <dt>showHour</dt>
  99 + <dd><em>Default: null</em> - Whether to show the hour control. The default of null will use detection from timeFormat.</dd>
  100 +
  101 + <dt>showMinute</dt>
  102 + <dd><em>Default: null</em> - Whether to show the minute control. The default of null will use detection from timeFormat.</dd>
  103 +
  104 + <dt>showSecond</dt>
  105 + <dd><em>Default: null</em> - Whether to show the second control. The default of null will use detection from timeFormat.</dd>
  106 +
  107 + <dt>showMillisec</dt>
  108 + <dd><em>Default: null</em> - Whether to show the millisecond control. The default of null will use detection from timeFormat.</dd>
  109 +
  110 + <dt>showMicrosec</dt>
  111 + <dd><em>Default: null</em> - Whether to show the microsecond control. The default of null will use detection from timeFormat.</dd>
  112 +
  113 + <dt>showTimezone</dt>
  114 + <dd><em>Default: null</em> - Whether to show the timezone select.</dd>
  115 +
  116 + <dt>showTime</dt>
  117 + <dd><em>Default: true</em> - Whether to show the time selected within the datetimepicker.</dd>
  118 +
  119 + <dt>stepHour</dt>
  120 + <dd><em>Default: 1</em> - Hours per step the slider makes.</dd>
  121 +
  122 + <dt>stepMinute</dt>
  123 + <dd><em>Default: 1</em> - Minutes per step the slider makes.</dd>
  124 +
  125 + <dt>stepSecond</dt>
  126 + <dd><em>Default: 1</em> - Seconds per step the slider makes.</dd>
  127 +
  128 + <dt>stepMillisec</dt>
  129 + <dd><em>Default: 1</em> - Milliseconds per step the slider makes.</dd>
  130 +
  131 + <dt>stepMicrosec</dt>
  132 + <dd><em>Default: 1</em> - Microseconds per step the slider makes.</dd>
  133 +
  134 + <dt>hour</dt>
  135 + <dd><em>Default: 0</em> - Initial hour set.</dd>
  136 +
  137 + <dt>minute</dt>
  138 + <dd><em>Default: 0</em> - Initial minute set.</dd>
  139 +
  140 + <dt>second</dt>
  141 + <dd><em>Default: 0</em> - Initial second set.</dd>
  142 +
  143 + <dt>millisec</dt>
  144 + <dd><em>Default: 0</em> - Initial millisecond set.</dd>
  145 +
  146 + <dt>microsec</dt>
  147 + <dd><em>Default: 0</em> - Initial microsecond set. Note: Javascript's native Date object does not natively support microseconds. Timepicker adds ability to simply Date.setMicroseconds(m) and Date.getMicroseconds(). Date comparisons will not acknowledge microseconds. Use this only for display purposes.</dd>
  148 +
  149 + <dt>timezone</dt>
  150 + <dd><em>Default: null</em> - Initial timezone set. This is the offset in minutes. If null the browser's local timezone will be used. If you're timezone is "-0400" you would use -240. For backwards compatibility you may pass "-0400", however the timezone is stored in minutes and more reliable.</dd>
  151 +
  152 + <dt>hourMin</dt>
  153 + <dd><em>Default: 0</em> - The minimum hour allowed for all dates.</dd>
  154 +
  155 + <dt>minuteMin</dt>
  156 + <dd><em>Default: 0</em> - The minimum minute allowed for all dates.</dd>
  157 +
  158 + <dt>secondMin</dt>
  159 + <dd><em>Default: 0</em> - The minimum second allowed for all dates.</dd>
  160 +
  161 + <dt>millisecMin</dt>
  162 + <dd><em>Default: 0</em> - The minimum millisecond allowed for all dates.</dd>
  163 +
  164 + <dt>microsecMin</dt>
  165 + <dd><em>Default: 0</em> - The minimum microsecond allowed for all dates.</dd>
  166 +
  167 + <dt>hourMax</dt>
  168 + <dd><em>Default: 23</em> - The maximum hour allowed for all dates.</dd>
  169 +
  170 + <dt>minuteMax</dt>
  171 + <dd><em>Default: 59</em> - The maximum minute allowed for all dates.</dd>
  172 +
  173 + <dt>secondMax</dt>
  174 + <dd><em>Default: 59</em> - The maximum second allowed for all dates.</dd>
  175 +
  176 + <dt>millisecMax</dt>
  177 + <dd><em>Default: 999</em> - The maximum millisecond allowed for all dates.</dd>
  178 +
  179 + <dt>microsecMax</dt>
  180 + <dd><em>Default: 999</em> - The maximum microsecond allowed for all dates.</dd>
  181 +
  182 + <dt>hourGrid</dt>
  183 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be generated under the slider. This number represents the units (in hours) between labels.</dd>
  184 +
  185 + <dt>minuteGrid</dt>
  186 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be generated under the slider. This number represents the units (in minutes) between labels.</dd>
  187 +
  188 + <dt>secondGrid</dt>
  189 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in seconds) between labels.</dd>
  190 +
  191 + <dt>millisecGrid</dt>
  192 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in milliseconds) between labels.</dd>
  193 +
  194 + <dt>microsecGrid</dt>
  195 + <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in microseconds) between labels.</dd>
  196 + </dl>
  197 +
  198 + <h3>Other Options</h3>
  199 + <dl class="defs">
  200 + <dt>showButtonPanel</dt>
  201 + <dd><em>Default: true</em> - Whether to show the button panel at the bottom. This is generally needed.</dd>
  202 +
  203 + <dt>timeOnly</dt>
  204 + <dd><em>Default: false</em> - Hide the datepicker and only provide a time interface.</dd>
  205 +
  206 + <dt>timeOnlyShowDate</dt>
  207 + <dd><em>Default: false</em> - Show the date and time in the input, but only allow the timepicker.</dd>
  208 +
  209 + <dt>onSelect</dt>
  210 + <dd><em>Default: null</em> - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).</dd>
  211 +
  212 + <dt>alwaysSetTime</dt>
  213 + <dd><em>Default: true</em> - Always have a time set internally, even before user has chosen one.</dd>
  214 +
  215 + <dt>separator</dt>
  216 + <dd><em>Default: " "</em> - When formatting the time this string is placed between the formatted date and formatted time.</dd>
  217 +
  218 + <dt>pickerTimeFormat</dt>
  219 + <dd><em>Default: (timeFormat option)</em> - How to format the time displayed within the timepicker.</dd>
  220 +
  221 + <dt>pickerTimeSuffix</dt>
  222 + <dd><em>Default: (timeSuffix option)</em> - String to place after the formatted time within the timepicker.</dd>
  223 +
  224 + <dt>showTimepicker</dt>
  225 + <dd><em>Default: true</em> - Whether to show the timepicker within the datepicker.</dd>
  226 +
  227 + <dt>addSliderAccess</dt>
  228 + <dd><em>Default: false</em> - Adds the <a href="http://trentrichardson.com/examples/jQuery-SliderAccess/" title="jQueryUI Slider Access Plugin">sliderAccess plugin</a> to sliders within timepicker</dd>
  229 +
  230 + <dt>sliderAccessArgs</dt>
  231 + <dd><em>Default: null</em> - Object to pass to sliderAccess when used.</dd>
  232 +
  233 + <dt>defaultValue</dt>
  234 + <dd><em>Default: null</em> - String of the default time value placed in the input on focus when the input is empty.</dd>
  235 +
  236 + <dt>minDateTime</dt>
  237 + <dd><em>Default: null</em> - Date object of the minimum datetime allowed. Also available as minDate.</dd>
  238 +
  239 + <dt>maxDateTime</dt>
  240 + <dd><em>Default: null</em> - Date object of the maximum datetime allowed. Also Available as maxDate.</dd>
  241 +
  242 + <dt>minTime</dt>
  243 + <dd><em>Default: null</em> - String of the minimum time allowed. '8:00 am' will restrict to times after 8am</dd>
  244 +
  245 + <dt>maxTime</dt>
  246 + <dd><em>Default: null</em> - String of the maximum time allowed. '8:00 pm' will restrict to times before 8pm</dd>
  247 +
  248 + <dt>parse</dt>
  249 + <dd><em>Default: 'strict'</em> - How to parse the time string. Two methods are provided: 'strict' which must match the timeFormat exactly, and 'loose' which uses javascript's new Date(timeString) to guess the time. You may also pass in a function(timeFormat, timeString, options) to handle the parsing yourself, returning a simple object:
  250 +<pre>{
  251 + hour: 19,
  252 + minute: 10,
  253 + second: 23,
  254 + millisec: 45,
  255 + microsec: 23,
  256 + timezone: '-0400'
  257 +}</pre>
  258 + </dd>
  259 + </dl>
  260 +
  261 +</div>
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-af.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Afrikaans translation for the jQuery Timepicker Addon */
  2 +/* Written by Deon Heyns */
  3 +(function($) {
  4 + $.timepicker.regional['af'] = {
  5 + timeOnlyTitle: 'Kies Tyd',
  6 + timeText: 'Tyd ',
  7 + hourText: 'Ure ',
  8 + minuteText: 'Minute',
  9 + secondText: 'Sekondes',
  10 + millisecText: 'Millisekondes',
  11 + microsecText: 'Mikrosekondes',
  12 + timezoneText: 'Tydsone',
  13 + currentText: 'Huidige Tyd',
  14 + closeText: 'Klaar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['af']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-am.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Armenian translation for the jQuery Timepicker Addon */
  2 +/* Written by Artavazd Avetisyan artavazda@hotmail.com */
  3 +(function($) {
  4 + $.timepicker.regional['am'] = {
  5 + timeOnlyTitle: 'Ընտրեք ժամանակը',
  6 + timeText: 'Ժամանակը',
  7 + hourText: 'Ժամ',
  8 + minuteText: 'Րոպե',
  9 + secondText: 'Վարկյան',
  10 + millisecText: 'Միլիվարկյան',
  11 + microsecText: 'Միկրովարկյան',
  12 + timezoneText: 'Ժամային գոտին',
  13 + currentText: 'Այժմ',
  14 + closeText: 'Փակել',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['am']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-bg.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Bulgarian translation for the jQuery Timepicker Addon */
  2 +/* Written by Plamen Kovandjiev */
  3 +(function($) {
  4 + $.timepicker.regional['bg'] = {
  5 + timeOnlyTitle: 'Изберете време',
  6 + timeText: 'Време',
  7 + hourText: 'Час',
  8 + minuteText: 'Минути',
  9 + secondText: 'Секунди',
  10 + millisecText: 'Милисекунди',
  11 + microsecText: 'Микросекунди',
  12 + timezoneText: 'Часови пояс',
  13 + currentText: 'Сега',
  14 + closeText: 'Затвори',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['bg']);
  21 +})(jQuery);
0 22 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-ca.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Catalan translation for the jQuery Timepicker Addon */
  2 +/* Written by Sergi Faber */
  3 +(function($) {
  4 + $.timepicker.regional['ca'] = {
  5 + timeOnlyTitle: 'Escollir una hora',
  6 + timeText: 'Hora',
  7 + hourText: 'Hores',
  8 + minuteText: 'Minuts',
  9 + secondText: 'Segons',
  10 + millisecText: 'Milisegons',
  11 + microsecText: 'Microsegons',
  12 + timezoneText: 'Fus horari',
  13 + currentText: 'Ara',
  14 + closeText: 'Tancar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ca']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-cs.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Czech translation for the jQuery Timepicker Addon */
  2 +/* Written by Ondřej Vodáček */
  3 +(function($) {
  4 + $.timepicker.regional['cs'] = {
  5 + timeOnlyTitle: 'Vyberte čas',
  6 + timeText: 'Čas',
  7 + hourText: 'Hodiny',
  8 + minuteText: 'Minuty',
  9 + secondText: 'Vteřiny',
  10 + millisecText: 'Milisekundy',
  11 + microsecText: 'Mikrosekundy',
  12 + timezoneText: 'Časové pásmo',
  13 + currentText: 'Nyní',
  14 + closeText: 'Zavřít',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['dop.', 'AM', 'A'],
  17 + pmNames: ['odp.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['cs']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-da.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Danish translation for the jQuery Timepicker Addon */
  2 +/* Written by Lars H. Jensen (http://www.larshj.dk) */
  3 +(function ($) {
  4 + $.timepicker.regional['da'] = {
  5 + timeOnlyTitle: 'Vælg tid',
  6 + timeText: 'Tid',
  7 + hourText: 'Time',
  8 + minuteText: 'Minut',
  9 + secondText: 'Sekund',
  10 + millisecText: 'Millisekund',
  11 + microsecText: 'Mikrosekund',
  12 + timezoneText: 'Tidszone',
  13 + currentText: 'Nu',
  14 + closeText: 'Luk',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['am', 'AM', 'A'],
  17 + pmNames: ['pm', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['da']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-de.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* German translation for the jQuery Timepicker Addon */
  2 +/* Written by Marvin */
  3 +(function($) {
  4 + $.timepicker.regional['de'] = {
  5 + timeOnlyTitle: 'Zeit wählen',
  6 + timeText: 'Zeit',
  7 + hourText: 'Stunde',
  8 + minuteText: 'Minute',
  9 + secondText: 'Sekunde',
  10 + millisecText: 'Millisekunde',
  11 + microsecText: 'Mikrosekunde',
  12 + timezoneText: 'Zeitzone',
  13 + currentText: 'Jetzt',
  14 + closeText: 'Fertig',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['vorm.', 'AM', 'A'],
  17 + pmNames: ['nachm.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['de']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-el.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Hellenic translation for the jQuery Timepicker Addon */
  2 +/* Written by Christos Pontikis */
  3 +(function($) {
  4 + $.timepicker.regional['el'] = {
  5 + timeOnlyTitle: 'Επιλογή ώρας',
  6 + timeText: 'Ώρα',
  7 + hourText: 'Ώρες',
  8 + minuteText: 'Λεπτά',
  9 + secondText: 'Δευτερόλεπτα',
  10 + millisecText: 'μιλιδευτερόλεπτο',
  11 + microsecText: 'Microseconds',
  12 + timezoneText: 'Ζώνη ώρας',
  13 + currentText: 'Τώρα',
  14 + closeText: 'Κλείσιμο',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['π.μ.', 'AM', 'A'],
  17 + pmNames: ['μ.μ.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['el']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-es.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Spanish translation for the jQuery Timepicker Addon */
  2 +/* Written by Ianaré Sévi */
  3 +(function($) {
  4 + $.timepicker.regional['es'] = {
  5 + timeOnlyTitle: 'Elegir una hora',
  6 + timeText: 'Hora',
  7 + hourText: 'Horas',
  8 + minuteText: 'Minutos',
  9 + secondText: 'Segundos',
  10 + millisecText: 'Milisegundos',
  11 + microsecText: 'Microsegundos',
  12 + timezoneText: 'Huso horario',
  13 + currentText: 'Ahora',
  14 + closeText: 'Cerrar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['es']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-et.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Estonian translation for the jQuery Timepicker Addon */
  2 +/* Written by Karl Sutt (karl@sutt.ee) */
  3 +(function($) {
  4 + $.timepicker.regional['et'] = {
  5 + timeOnlyTitle: 'Vali aeg',
  6 + timeText: 'Aeg',
  7 + hourText: 'Tund',
  8 + minuteText: 'Minut',
  9 + secondText: 'Sekund',
  10 + millisecText: 'Millisekundis',
  11 + microsecText: 'Mikrosekundis',
  12 + timezoneText: 'Ajavöönd',
  13 + currentText: 'Praegu',
  14 + closeText: 'Valmis',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['et']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-eu.js 0 → 100644
... ... @@ -0,0 +1,22 @@
  1 +/* Basque trannslation for JQuery Timepicker Addon */
  2 +/* Translated by Xabi Fer */
  3 +/* Fixed by Asier Iturralde Sarasola - iametza interaktiboa */
  4 +(function($) {
  5 + $.timepicker.regional['eu'] = {
  6 + timeOnlyTitle: 'Aukeratu ordua',
  7 + timeText: 'Ordua',
  8 + hourText: 'Orduak',
  9 + minuteText: 'Minutuak',
  10 + secondText: 'Segundoak',
  11 + millisecText: 'Milisegundoak',
  12 + microsecText: 'Mikrosegundoak',
  13 + timezoneText: 'Ordu-eremua',
  14 + currentText: 'Orain',
  15 + closeText: 'Itxi',
  16 + timeFormat: 'HH:mm',
  17 + amNames: ['a.m.', 'AM', 'A'],
  18 + pmNames: ['p.m.', 'PM', 'P'],
  19 + isRTL: false
  20 + };
  21 + $.timepicker.setDefaults($.timepicker.regional['eu']);
  22 +})(jQuery);
0 23 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-fi.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Finnish translation for the jQuery Timepicker Addon */
  2 +/* Written by Juga Paazmaya (http://github.com/paazmaya) */
  3 +(function($) {
  4 + $.timepicker.regional['fi'] = {
  5 + timeOnlyTitle: 'Valitse aika',
  6 + timeText: 'Aika',
  7 + hourText: 'Tunti',
  8 + minuteText: 'Minuutti',
  9 + secondText: 'Sekunti',
  10 + millisecText: 'Millisekunnin',
  11 + microsecText: 'Mikrosekuntia',
  12 + timezoneText: 'Aikavyöhyke',
  13 + currentText: 'Nyt',
  14 + closeText: 'Sulje',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['ap.', 'AM', 'A'],
  17 + pmNames: ['ip.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['fi']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-fr.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* French translation for the jQuery Timepicker Addon */
  2 +/* Written by Thomas Lété */
  3 +(function($) {
  4 + $.timepicker.regional['fr'] = {
  5 + timeOnlyTitle: 'Choisir une heure',
  6 + timeText: 'Heure',
  7 + hourText: 'Heures',
  8 + minuteText: 'Minutes',
  9 + secondText: 'Secondes',
  10 + millisecText: 'Millisecondes',
  11 + microsecText: 'Microsecondes',
  12 + timezoneText: 'Fuseau horaire',
  13 + currentText: 'Maintenant',
  14 + closeText: 'Terminé',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['fr']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-gl.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Galician translation for the jQuery Timepicker Addon */
  2 +/* Written by David Barral */
  3 +(function($) {
  4 + $.timepicker.regional['gl'] = {
  5 + timeOnlyTitle: 'Elixir unha hora',
  6 + timeText: 'Hora',
  7 + hourText: 'Horas',
  8 + minuteText: 'Minutos',
  9 + secondText: 'Segundos',
  10 + millisecText: 'Milisegundos',
  11 + microsecText: 'Microssegundos',
  12 + timezoneText: 'Fuso horario',
  13 + currentText: 'Agora',
  14 + closeText: 'Pechar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['gl']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-he.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Hebrew translation for the jQuery Timepicker Addon */
  2 +/* Written by Lior Lapid */
  3 +(function($) {
  4 + $.timepicker.regional["he"] = {
  5 + timeOnlyTitle: "בחירת זמן",
  6 + timeText: "שעה",
  7 + hourText: "שעות",
  8 + minuteText: "דקות",
  9 + secondText: "שניות",
  10 + millisecText: "אלפית השנייה",
  11 + microsecText: "מיקרו",
  12 + timezoneText: "אזור זמן",
  13 + currentText: "עכשיו",
  14 + closeText:"סגור",
  15 + timeFormat: "HH:mm",
  16 + amNames: ['לפנה"צ', 'AM', 'A'],
  17 + pmNames: ['אחה"צ', 'PM', 'P'],
  18 + isRTL: true
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional["he"]);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-hr.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Croatian translation for the jQuery Timepicker Addon */
  2 +/* Written by Mladen */
  3 +(function($) {
  4 + $.timepicker.regional['hr'] = {
  5 + timeOnlyTitle: 'Odaberi vrijeme',
  6 + timeText: 'Vrijeme',
  7 + hourText: 'Sati',
  8 + minuteText: 'Minute',
  9 + secondText: 'Sekunde',
  10 + millisecText: 'Milisekunde',
  11 + microsecText: 'Mikrosekunde',
  12 + timezoneText: 'Vremenska zona',
  13 + currentText: 'Sada',
  14 + closeText: 'Gotovo',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['hr']);
  21 +})(jQuery);
0 22 \ No newline at end of file
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-hu.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Hungarian translation for the jQuery Timepicker Addon */
  2 +/* Written by Vas Gábor */
  3 +(function($) {
  4 + $.timepicker.regional['hu'] = {
  5 + timeOnlyTitle: 'Válasszon időpontot',
  6 + timeText: 'Idő',
  7 + hourText: 'Óra',
  8 + minuteText: 'Perc',
  9 + secondText: 'Másodperc',
  10 + millisecText: 'Milliszekundumos',
  11 + microsecText: 'Ezredmásodperc',
  12 + timezoneText: 'Időzóna',
  13 + currentText: 'Most',
  14 + closeText: 'Kész',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['de.', 'AM', 'A'],
  17 + pmNames: ['du.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['hu']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-id.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Indonesian translation for the jQuery Timepicker Addon */
  2 +/* Written by Nia */
  3 +(function($) {
  4 + $.timepicker.regional['id'] = {
  5 + timeOnlyTitle: 'Pilih Waktu',
  6 + timeText: 'Waktu',
  7 + hourText: 'Pukul',
  8 + minuteText: 'Menit',
  9 + secondText: 'Detik',
  10 + millisecText: 'Milidetik',
  11 + microsecText: 'Mikrodetik',
  12 + timezoneText: 'Zona Waktu',
  13 + currentText: 'Sekarang',
  14 + closeText: 'OK',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['id']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-it.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Italian translation for the jQuery Timepicker Addon */
  2 +/* Written by Marco "logicoder" Del Tongo */
  3 +(function($) {
  4 + $.timepicker.regional['it'] = {
  5 + timeOnlyTitle: 'Scegli orario',
  6 + timeText: 'Orario',
  7 + hourText: 'Ora',
  8 + minuteText: 'Minuti',
  9 + secondText: 'Secondi',
  10 + millisecText: 'Millisecondi',
  11 + microsecText: 'Microsecondi',
  12 + timezoneText: 'Fuso orario',
  13 + currentText: 'Adesso',
  14 + closeText: 'Chiudi',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['m.', 'AM', 'A'],
  17 + pmNames: ['p.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['it']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-ja.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Japanese translation for the jQuery Timepicker Addon */
  2 +/* Written by Jun Omae */
  3 +(function($) {
  4 + $.timepicker.regional['ja'] = {
  5 + timeOnlyTitle: '時間を選択',
  6 + timeText: '時間',
  7 + hourText: '時',
  8 + minuteText: '分',
  9 + secondText: '秒',
  10 + millisecText: 'ミリ秒',
  11 + microsecText: 'マイクロ秒',
  12 + timezoneText: 'タイムゾーン',
  13 + currentText: '現時刻',
  14 + closeText: '閉じる',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['午前', 'AM', 'A'],
  17 + pmNames: ['午後', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ja']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-ko.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Korean translation for the jQuery Timepicker Addon */
  2 +/* Written by Genie */
  3 +(function($) {
  4 + $.timepicker.regional['ko'] = {
  5 + timeOnlyTitle: '시간 선택',
  6 + timeText: '시간',
  7 + hourText: '시',
  8 + minuteText: '분',
  9 + secondText: '초',
  10 + millisecText: '밀리초',
  11 + microsecText: '마이크로',
  12 + timezoneText: '표준 시간대',
  13 + currentText: '현재 시각',
  14 + closeText: '닫기',
  15 + timeFormat: 'tt h:mm',
  16 + amNames: ['오전', 'AM', 'A'],
  17 + pmNames: ['오후', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ko']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-lt.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Lithuanian translation for the jQuery Timepicker Addon */
  2 +/* Written by Irmantas Šiupšinskas */
  3 +(function($) {
  4 + $.timepicker.regional['lt'] = {
  5 + timeOnlyTitle: 'Pasirinkite laiką',
  6 + timeText: 'Laikas',
  7 + hourText: 'Valandos',
  8 + minuteText: 'Minutės',
  9 + secondText: 'Sekundės',
  10 + millisecText: 'Milisekundės',
  11 + microsecText: 'Mikrosekundės',
  12 + timezoneText: 'Laiko zona',
  13 + currentText: 'Dabar',
  14 + closeText: 'Uždaryti',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['priešpiet', 'AM', 'A'],
  17 + pmNames: ['popiet', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['lt']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-nl.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Dutch translation for the jQuery Timepicker Addon */
  2 +/* Written by Martijn van der Lee */
  3 +(function($) {
  4 + $.timepicker.regional['nl'] = {
  5 + timeOnlyTitle: 'Tijdstip',
  6 + timeText: 'Tijd',
  7 + hourText: 'Uur',
  8 + minuteText: 'Minuut',
  9 + secondText: 'Seconde',
  10 + millisecText: 'Milliseconde',
  11 + microsecText: 'Microseconde',
  12 + timezoneText: 'Tijdzone',
  13 + currentText: 'Vandaag',
  14 + closeText: 'Sluiten',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['nl']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-no.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Norwegian translation for the jQuery Timepicker Addon */
  2 +/* Written by Morten Hauan (http://hauan.me) */
  3 +(function($) {
  4 + $.timepicker.regional['no'] = {
  5 + timeOnlyTitle: 'Velg tid',
  6 + timeText: 'Tid',
  7 + hourText: 'Time',
  8 + minuteText: 'Minutt',
  9 + secondText: 'Sekund',
  10 + millisecText: 'Millisekund',
  11 + microsecText: 'mikrosekund',
  12 + timezoneText: 'Tidssone',
  13 + currentText: 'Nå',
  14 + closeText: 'Lukk',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['am', 'AM', 'A'],
  17 + pmNames: ['pm', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['no']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-pl.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Polish translation for the jQuery Timepicker Addon */
  2 +/* Written by Michał Pena */
  3 +(function($) {
  4 + $.timepicker.regional['pl'] = {
  5 + timeOnlyTitle: 'Wybierz godzinę',
  6 + timeText: 'Czas',
  7 + hourText: 'Godzina',
  8 + minuteText: 'Minuta',
  9 + secondText: 'Sekunda',
  10 + millisecText: 'Milisekunda',
  11 + microsecText: 'Mikrosekunda',
  12 + timezoneText: 'Strefa czasowa',
  13 + currentText: 'Teraz',
  14 + closeText: 'Gotowe',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['pl']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-pt-BR.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Brazilian Portuguese translation for the jQuery Timepicker Addon */
  2 +/* Written by Diogo Damiani (diogodamiani@gmail.com) */
  3 +(function ($) {
  4 + $.timepicker.regional['pt-BR'] = {
  5 + timeOnlyTitle: 'Escolha o horário',
  6 + timeText: 'Horário',
  7 + hourText: 'Hora',
  8 + minuteText: 'Minutos',
  9 + secondText: 'Segundos',
  10 + millisecText: 'Milissegundos',
  11 + microsecText: 'Microssegundos',
  12 + timezoneText: 'Fuso horário',
  13 + currentText: 'Agora',
  14 + closeText: 'Fechar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['pt-BR']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-pt.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Portuguese translation for the jQuery Timepicker Addon */
  2 +/* Written by Luan Almeida */
  3 +(function($) {
  4 + $.timepicker.regional['pt'] = {
  5 + timeOnlyTitle: 'Escolha uma hora',
  6 + timeText: 'Hora',
  7 + hourText: 'Horas',
  8 + minuteText: 'Minutos',
  9 + secondText: 'Segundos',
  10 + millisecText: 'Milissegundos',
  11 + microsecText: 'Microssegundos',
  12 + timezoneText: 'Fuso horário',
  13 + currentText: 'Agora',
  14 + closeText: 'Fechar',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['a.m.', 'AM', 'A'],
  17 + pmNames: ['p.m.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['pt']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-ro.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Romanian translation for the jQuery Timepicker Addon */
  2 +/* Written by Romeo Adrian Cioaba */
  3 +(function($) {
  4 + $.timepicker.regional['ro'] = {
  5 + timeOnlyTitle: 'Alegeţi o oră',
  6 + timeText: 'Timp',
  7 + hourText: 'Ore',
  8 + minuteText: 'Minute',
  9 + secondText: 'Secunde',
  10 + millisecText: 'Milisecunde',
  11 + microsecText: 'Microsecunde',
  12 + timezoneText: 'Fus orar',
  13 + currentText: 'Acum',
  14 + closeText: 'Închide',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ro']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-ru.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Russian translation for the jQuery Timepicker Addon */
  2 +/* Written by Trent Richardson */
  3 +(function($) {
  4 + $.timepicker.regional['ru'] = {
  5 + timeOnlyTitle: 'Выберите время',
  6 + timeText: 'Время',
  7 + hourText: 'Часы',
  8 + minuteText: 'Минуты',
  9 + secondText: 'Секунды',
  10 + millisecText: 'Миллисекунды',
  11 + microsecText: 'Микросекунды',
  12 + timezoneText: 'Часовой пояс',
  13 + currentText: 'Сейчас',
  14 + closeText: 'Закрыть',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['ru']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-sk.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Slovak translation for the jQuery Timepicker Addon */
  2 +/* Written by David Vallner */
  3 +(function($) {
  4 + $.timepicker.regional['sk'] = {
  5 + timeOnlyTitle: 'Zvoľte čas',
  6 + timeText: 'Čas',
  7 + hourText: 'Hodiny',
  8 + minuteText: 'Minúty',
  9 + secondText: 'Sekundy',
  10 + millisecText: 'Milisekundy',
  11 + microsecText: 'Mikrosekundy',
  12 + timezoneText: 'Časové pásmo',
  13 + currentText: 'Teraz',
  14 + closeText: 'Zavrieť',
  15 + timeFormat: 'H:m',
  16 + amNames: ['dop.', 'AM', 'A'],
  17 + pmNames: ['pop.', 'PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['sk']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-sr-RS.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Serbian cyrilic translation for the jQuery Timepicker Addon */
  2 +/* Written by Vladimir Jelovac */
  3 +(function($) {
  4 + $.timepicker.regional['sr-RS'] = {
  5 + timeOnlyTitle: 'Одаберите време',
  6 + timeText: 'Време',
  7 + hourText: 'Сати',
  8 + minuteText: 'Минути',
  9 + secondText: 'Секунде',
  10 + millisecText: 'Милисекунде',
  11 + microsecText: 'Микросекунде',
  12 + timezoneText: 'Временска зона',
  13 + currentText: 'Сада',
  14 + closeText: 'Затвори',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['sr-RS']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-sr-YU.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Serbian latin translation for the jQuery Timepicker Addon */
  2 +/* Written by Vladimir Jelovac */
  3 +(function($) {
  4 + $.timepicker.regional['sr-YU'] = {
  5 + timeOnlyTitle: 'Odaberite vreme',
  6 + timeText: 'Vreme',
  7 + hourText: 'Sati',
  8 + minuteText: 'Minuti',
  9 + secondText: 'Sekunde',
  10 + millisecText: 'Milisekunde',
  11 + microsecText: 'Mikrosekunde',
  12 + timezoneText: 'Vremenska zona',
  13 + currentText: 'Sada',
  14 + closeText: 'Zatvori',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['sr-YU']);
  21 +})(jQuery);
... ...
public/javascripts/jquery-timepicker-addon/src/i18n/jquery-ui-timepicker-sv.js 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +/* Swedish translation for the jQuery Timepicker Addon */
  2 +/* Written by Nevon */
  3 +(function($) {
  4 + $.timepicker.regional['sv'] = {
  5 + timeOnlyTitle: 'Välj en tid',
  6 + timeText: 'Tid',
  7 + hourText: 'Timme',
  8 + minuteText: 'Minut',
  9 + secondText: 'Sekund',
  10 + millisecText: 'Millisekund',
  11 + microsecText: 'Mikrosekund',
  12 + timezoneText: 'Tidszon',
  13 + currentText: 'Nu',
  14 + closeText: 'Stäng',
  15 + timeFormat: 'HH:mm',
  16 + amNames: ['AM', 'A'],
  17 + pmNames: ['PM', 'P'],
  18 + isRTL: false
  19 + };
  20 + $.timepicker.setDefaults($.timepicker.regional['sv']);
  21 +})(jQuery);
... ...