diff --git a/.distignore b/.distignore index bf0f8705..b3223609 100644 --- a/.distignore +++ b/.distignore @@ -42,4 +42,12 @@ output.log phpdoc.dist.xml release-please-config.json docker_tag -package.json \ No newline at end of file +package.json +.eslintrc.js +.prettierrc.js +.phpstan.neon.dist.yml +.phpstan.neon.dist +.phpstan-baseline.neon +.phpstan.neon.dist.yml +.phpstan.neon.dist +.phpstan-baseline.neon \ No newline at end of file diff --git a/.editorconfig b/.editorconfig index 7d267452..07844e6f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,31 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# http://make.wordpress.org/core/handbook/coding-standards/ + root = true [*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +tab_width = 4 indent_style = tab -indent_size = 2 +insert_final_newline = true trim_trailing_whitespace = true -[*.{php,js,css,scss}] -end_of_line = lf -insert_final_newline = false -indent_style = tab -indent_size = 4 \ No newline at end of file +[*\.txt] +trim_trailing_whitespace = false + +[*\.{json,yml,yaml,xml,xml\.dist,eslintrc}] +indent_style = space +indent_size = 2 + +[*.md] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = false + +[*\.svg] +insert_final_newline = false \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..69cf82c8 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +/build +/node_modules +/js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..d0c30318 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,27 @@ +/** + * External dependencies + */ +const wpConfig = require('@wordpress/scripts/config/.eslintrc.js'); + +const config = { + ...wpConfig, + rules: { + ...(wpConfig?.rules || {}), + 'jsdoc/valid-types': 'off', + 'import/no-unresolved': ['error'], + }, + env: { + browser: true, + }, + ignorePatterns: [ + '/vendor', + '/node_modules', + '/build', + '/dist', + '/tools', + '/tests', + '/**/*.min.js', + ], +}; + +module.exports = config; diff --git a/.github/workflows/phpcbf.yml b/.github/workflows/phpcbf.yml index e8fc35df..dc93215e 100644 --- a/.github/workflows/phpcbf.yml +++ b/.github/workflows/phpcbf.yml @@ -74,7 +74,7 @@ jobs: signoff: false branch: phpcbf-${{ github.run_id }}-${{ github.run_attempt }} delete-branch: true - title: "Auto Fix Formatting - ${{ github.run_id }}" + title: 'Auto Fix Formatting - ${{ github.run_id }}' body: | ${{ steps.read_report.outputs.report }} labels: | diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index e403fd98..3cfec670 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -1,38 +1,38 @@ on: - push: - paths: - - '**.php' - pull_request: - paths: - - '**.php' + push: + paths: + - "**.php" + pull_request: + paths: + - "**.php" name: WordPress Coding Standards Inspections jobs: - runPHPCSInspection: - name: Run PHPCS inspection - runs-on: ubuntu-latest - # Skip PRs if head_ref or Branches if head_name - # starts with the following auto-generated names. - # head_ref vs head_name: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context - if: | - ! startsWith( github.head_ref, 'release-please--' ) && - ! startsWith( github.head_ref, 'phpcbf-' ) && - ! startsWith( github.head_ref, 'renovate-' ) && - ! startsWith( github.head_ref, 'dependabot-' ) && - ! startsWith( github.ref_name, 'release-please--' ) && - ! startsWith( github.ref_name, 'phpcbf-' ) && - ! startsWith( github.ref_name, 'renovate-' ) && - ! startsWith( github.ref_name, 'dependabot-' ) - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Run PHPCS inspection - uses: rtCamp/action-phpcs-code-review@v3.1.1 - env: - GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }} - SKIP_FOLDERS: ".deployment,.github,assets,css,js,lib,sourcedata,wsdl,vendor" - PHPCS_STANDARD_FILE_NAME: "phpcs.xml" - with: - args: "WordPress,WordPress-Core,WordPress-Extra" + runPHPCSInspection: + name: Run PHPCS inspection + runs-on: ubuntu-latest + # Skip PRs if head_ref or Branches if head_name + # starts with the following auto-generated names. + # head_ref vs head_name: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context + if: | + ! startsWith( github.head_ref, 'release-please--' ) && + ! startsWith( github.head_ref, 'phpcbf-' ) && + ! startsWith( github.head_ref, 'renovate-' ) && + ! startsWith( github.head_ref, 'dependabot-' ) && + ! startsWith( github.ref_name, 'release-please--' ) && + ! startsWith( github.ref_name, 'phpcbf-' ) && + ! startsWith( github.ref_name, 'renovate-' ) && + ! startsWith( github.ref_name, 'dependabot-' ) + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Run PHPCS inspection + uses: rtCamp/action-phpcs-code-review@v3.1.1 + env: + GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }} + SKIP_FOLDERS: ".deployment,.github,assets,css,js,lib,sourcedata,wsdl,vendor" + PHPCS_STANDARD_FILE_NAME: "phpcs.xml.dist" + with: + args: "WordPress,WordPress-Core,WordPress-Extra" diff --git a/.github/workflows/phplint.yml b/.github/workflows/phplint.yml index ccdfecf0..6eacf49c 100644 --- a/.github/workflows/phplint.yml +++ b/.github/workflows/phplint.yml @@ -1,55 +1,55 @@ on: - push: - paths: - - '**.php' - pull_request: - paths: - - '**.php' + push: + paths: + - "**.php" + pull_request: + paths: + - "**.php" name: PHP Lint jobs: - php-lint: - runs-on: ubuntu-latest - # Skip PRs if head_ref or Branches if head_name - # starts with the following auto-generated names. - # head_ref vs head_name: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context - if: | - ! startsWith( github.head_ref, 'release-please--' ) && - ! startsWith( github.head_ref, 'phpcbf-' ) && - ! startsWith( github.head_ref, 'renovate-' ) && - ! startsWith( github.head_ref, 'dependabot-' ) && - ! startsWith( github.ref_name, 'release-please--' ) && - ! startsWith( github.ref_name, 'phpcbf-' ) && - ! startsWith( github.ref_name, 'renovate-' ) && - ! startsWith( github.ref_name, 'dependabot-' ) - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} + php-lint: + runs-on: ubuntu-latest + # Skip PRs if head_ref or Branches if head_name + # starts with the following auto-generated names. + # head_ref vs head_name: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context + if: | + ! startsWith( github.head_ref, 'release-please--' ) && + ! startsWith( github.head_ref, 'phpcbf-' ) && + ! startsWith( github.head_ref, 'renovate-' ) && + ! startsWith( github.head_ref, 'dependabot-' ) && + ! startsWith( github.ref_name, 'release-please--' ) && + ! startsWith( github.ref_name, 'phpcbf-' ) && + ! startsWith( github.ref_name, 'renovate-' ) && + ! startsWith( github.ref_name, 'dependabot-' ) + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - coverage: none - tools: cs2pr + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + coverage: none + tools: cs2pr - - name: Cache Composer dependencies - uses: actions/cache@v4 - with: - path: /tmp/composer-cache - key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: /tmp/composer-cache + key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} - - name: Composer Install - uses: php-actions/composer@v6 - with: - working_dir: ./ - dev: no - php_version: 8.2 - php_extensions: exif + - name: Composer Install + uses: php-actions/composer@v6 + with: + working_dir: ./ + dev: yes + php_version: 8.2 + php_extensions: exif - - name: PHP Lint - uses: overtrue/phplint@9.5 - with: - path: . + - name: PHP Lint + uses: overtrue/phplint@9.5 + with: + path: . diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 0acde0d9..97ffa07a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -23,7 +23,7 @@ jobs: # Update the readme but only when it's creating a new release, not during the build update-readme: - needs: [ release-please ] + needs: [release-please] if: github.event_name != 'pull_request' && github.event.pull_request.merged != true && ! needs.release-please.outputs.release_created uses: linchpin/actions/.github/workflows/update-readme.yml@v3 secrets: inherit diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml index b7cd51d5..ce1f3dff 100644 --- a/.github/workflows/wiki.yml +++ b/.github/workflows/wiki.yml @@ -1,6 +1,7 @@ on: push: branches: + - main - master - '!release-please-*' - '!renovate/*' @@ -37,4 +38,4 @@ jobs: WIKI_DIR: wiki/ GH_TOKEN: ${{ secrets.GH_WIKI_UPDATE_TOKEN }} GH_MAIL: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> - GH_NAME: ${{ github.repository_owner }} \ No newline at end of file + GH_NAME: ${{ github.repository_owner }} diff --git a/.github/workflows/wordpress.yml b/.github/workflows/wordpress.yml index 9a5c071e..339d8a79 100644 --- a/.github/workflows/wordpress.yml +++ b/.github/workflows/wordpress.yml @@ -25,7 +25,7 @@ jobs: uses: php-actions/composer@v6 with: dev: no - php_version: "7.4" + php_version: '7.4' - name: Install Yarn Dependencies run: | @@ -34,7 +34,7 @@ jobs: rm -rf node_modules - name: Clean Build Files/Folders - run : | + run: | chmod +x ./.deployment/cleanup.sh sh ./.deployment/cleanup.sh; @@ -50,6 +50,3 @@ jobs: env: SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} SVN_USERNAME: ${{ secrets.SVN_USERNAME }} - - - diff --git a/.gitignore b/.gitignore index 53c62c38..8e6cf67d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ Session.vim Thumbs.db Desktop.ini vendor +vendor-prefixed diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..51d9c372 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +npx commitlint --edit $1 \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..d0a77842 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged \ No newline at end of file diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache new file mode 100644 index 00000000..3fa820bf --- /dev/null +++ b/.php-cs-fixer.cache @@ -0,0 +1 @@ +{"php":"8.4.5","version":"3.84.0:v3.84.0#38dad0767bf2a9b516b976852200ae722fe984ca","indent":" ","lineEnding":"\n","rules":{"octal_notation":true,"clean_namespace":true,"no_unset_cast":true,"assign_null_coalescing_to_coalesce_equal":true,"normalize_index_brace":true,"short_scalar_cast":true,"heredoc_indentation":true,"no_whitespace_before_comma_in_array":{"after_heredoc":true},"trailing_comma_in_multiline":{"after_heredoc":true},"list_syntax":{"syntax":"short"},"visibility_required":true,"ternary_to_null_coalescing":true,"array_syntax":{"syntax":"short"},"native_constant_invocation":true,"native_function_casing":true,"native_function_invocation":true,"native_type_declaration_casing":true},"hashes":{"includes\/Controller\/Cron.php":"05b3ab71d8472fb9a005d933912d586e"}} \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index adb6311a..b1fe3bdd 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -13,8 +13,6 @@ $finder = PhpCsFixer\Finder::create()->in( [ __DIR__ . '/includes/', - __DIR__ . '/blocks/src/', - __DIR__ . '/blocks/src-iapi/', ] ); @@ -28,6 +26,8 @@ 'native_function_casing' => true, 'native_function_invocation' => true, 'native_type_declaration_casing' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'list_syntax' => [ 'syntax' => 'short' ], ] ); $config->setFinder( $finder ); diff --git a/.phplint.yml b/.phplint.yml index f09fd3c4..4decc9f1 100644 --- a/.phplint.yml +++ b/.phplint.yml @@ -2,8 +2,9 @@ path: ./ jobs: 10 cache: build/phplint.cache extensions: - - php + - php exclude: - - vendor - - blocks/build + - vendor + - blocks/build + - tools warning: true diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..0892bb70 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,9 @@ +module.exports = { + ...require('@wordpress/prettier-config'), + overrides: [ + { + files: ['*.yml', '*.yaml'], + options: { tabWidth: 2, useTabs: false }, + }, + ], +}; diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d60923d5..884c29a1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { ".": "1.7.1" -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..d5b524fe --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,28 @@ +{ + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.organizeImports": "explicit" + }, + "[php]": { + "editor.defaultFormatter": "junstyle.php-cs-fixer", + "editor.formatOnSave": true + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "php-cs-fixer.executablePath": "./vendor/bin/php-cs-fixer", + "php-cs-fixer.config": ".php-cs-fixer.dist.php", + "php-cs-fixer.onsave": true, + "php-cs-fixer.autoExecutable": true, + "prettier.configPath": "package.json" +} diff --git a/FAQ.md b/FAQ.md index 3e0427af..66b80dff 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,9 +1,13 @@ -# Frequently Asked Questions # +# Frequently Asked Questions -## Does this plugin work with Full Page Caching or WordPress Object Caching? ## +## Does this plugin work with Full Page Caching or WordPress Object Caching? Yes -## I'm looking for a specific type of notice that courier doesn't have, what's next? ## +## I'm looking for a specific type of notice that courier doesn't have, what's next? The great thing is that Courier Notices is highly extendable and our team is adding new features constantly since release. You can always create a pull request in GitHub or add an issue. You can also take a look at the Pro version which also has some great features. + +## Is the compatible with the block editor? + +No but our next release v2.0.0 will be diff --git a/assets/js/admin/core.js b/assets/js/admin/core.js index 2294a5e6..68804267 100644 --- a/assets/js/admin/core.js +++ b/assets/js/admin/core.js @@ -2,42 +2,2379 @@ * http://trentrichardson.com/examples/timepicker * Copyright (c) 2016 Trent Richardson; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","jquery-ui"],a):a(jQuery)}(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.6.3"}});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,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",oneLine:!1,defaultValue:null,parse:"strict",afterInject:null},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(a){return extendRemove(this._defaults,a||{}),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(a,b){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],a,b,tp_inst):void 0},onChangeMonthYear:function(a,b,c){$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],a,b,c,tp_inst)},onClose:function(a,b){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(b),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],a,b,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||this._defaults[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(a){return a.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(a){return a.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&&"undefined"==typeof $.ui.slider&&(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.hourtp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minutetp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.secondtp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisectp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsectp_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),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.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(a){var b=$.trim(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(b),this._limitMinMaxDateTime(a,!1),this._injectTimePicker(),this._afterInject()},_parseTime:function(a,b){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),b||!this._defaults.timeOnly){var c=$.datepicker._get(this.inst,"dateFormat");try{var d=parseDateTimeInternal(c,this._defaults.timeFormat,a,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!d.timeObj)return!1;$.extend(this,d.timeObj)}catch(e){return $.timepicker.log("Error parsing the date/time string: "+e+"\ndate/time string = "+a+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+c),!1}return!0}var f=$.datepicker.parseTime(this._defaults.timeFormat,a,this._defaults);return f?($.extend(this,f),!0):!1},_afterInject:function(){var a=this.inst.settings;$.isFunction(a.afterInject)&&a.afterInject.call(this)},_injectTimePicker:function(){var a=this.inst.dpDiv,b=this.inst.settings,c=this,d="",e="",f=null,g={},h={},i=null,j=0,k=0;if(0===a.find("div.ui-timepicker-div").length&&b.showTimepicker){var l=" ui_tpicker_unit_hide",m='
'+b.timeText+'
";for(j=0,k=this.units.length;k>j;j++){if(d=this.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],g[d]=parseInt(b[d+"Max"]-(b[d+"Max"]-b[d+"Min"])%b["step"+e],10),h[d]=0,m+='
'+b[d+"Text"]+'
',f&&b[d+"Grid"]>0){if(m+='
',"hour"===d)for(var n=b[d+"Min"];n<=g[d];n+=parseInt(b[d+"Grid"],10)){h[d]++;var o=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:n},b);m+='"}else for(var p=b[d+"Min"];p<=g[d];p+=parseInt(b[d+"Grid"],10))h[d]++,m+='";m+="
'+o+"'+(10>p?"0":"")+p+"
"}m+="
"}var q=null!==b.showTimezone?b.showTimezone:this.support.timezone;m+='
'+b.timezoneText+"
",m+='
',m+="
";var r=$(m);for(b.timeOnly===!0&&(r.prepend('
'+b.timeOnlyTitle+"
"),a.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),j=0,k=c.units.length;k>j;j++)d=c.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],c[d+"_slider"]=c.control.create(c,r.find(".ui_tpicker_"+d+"_slider"),d,c[d],b[d+"Min"],g[d],b["step"+e]),f&&b[d+"Grid"]>0&&(i=100*h[d]*b[d+"Grid"]/(g[d]-b[d+"Min"]),r.find(".ui_tpicker_"+d+" table").css({width:i+"%",marginLeft:b.isRTL?"0":i/(-2*h[d])+"%",marginRight:b.isRTL?i/(-2*h[d])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(a){var b=$(this),e=b.html(),f=parseInt(e.replace(/[^0-9]/g),10),g=e.replace(/[^apm]/gi),h=b.data("for");"hour"===h&&(-1!==g.indexOf("p")&&12>f?f+=12:-1!==g.indexOf("a")&&12===f&&(f=0)),c.control.value(c,c[h+"_slider"],d,f),c._onTimeChange(),c._onSelectHandler()}).css({cursor:"pointer",width:100/h[d]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=r.find(".ui_tpicker_timezone").append("").find("select"),$.fn.append.apply(this.timezone_select,$.map(b.timezoneList,function(a,b){return $("