diff --git a/.grunt/grunt-contrib-jasmine/jasmine-helper.js b/.grunt/grunt-contrib-jasmine/jasmine-helper.js new file mode 100644 index 0000000..aa18f2b --- /dev/null +++ b/.grunt/grunt-contrib-jasmine/jasmine-helper.js @@ -0,0 +1,31 @@ +/*global jasmine:false, window:false, document:false*/ + +(function(){ + 'use strict'; + + var jasmineEnv = jasmine.getEnv(); + + jasmineEnv.updateInterval = 1000; + var htmlReporter = new jasmine.HtmlReporter(); + jasmineEnv.addReporter(htmlReporter); + + jasmineEnv.specFilter = function(spec) { + return htmlReporter.specFilter(spec); + }; + + var currentWindowOnload = window.onload; + + if (document.readyState !== 'complete') { + window.onload = function() { + if (currentWindowOnload) { + currentWindowOnload(); + } + jasmineEnv.execute(); + }; + } else { + jasmineEnv.execute(); + } + + +}()); + diff --git a/.grunt/grunt-contrib-jasmine/jasmine-html.js b/.grunt/grunt-contrib-jasmine/jasmine-html.js new file mode 100644 index 0000000..543d569 --- /dev/null +++ b/.grunt/grunt-contrib-jasmine/jasmine-html.js @@ -0,0 +1,681 @@ +jasmine.HtmlReporterHelpers = {}; + +jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) { + var el = document.createElement(type); + + for (var i = 2; i < arguments.length; i++) { + var child = arguments[i]; + + if (typeof child === 'string') { + el.appendChild(document.createTextNode(child)); + } else { + if (child) { + el.appendChild(child); + } + } + } + + for (var attr in attrs) { + if (attr == "className") { + el[attr] = attrs[attr]; + } else { + el.setAttribute(attr, attrs[attr]); + } + } + + return el; +}; + +jasmine.HtmlReporterHelpers.getSpecStatus = function(child) { + var results = child.results(); + var status = results.passed() ? 'passed' : 'failed'; + if (results.skipped) { + status = 'skipped'; + } + + return status; +}; + +jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) { + var parentDiv = this.dom.summary; + var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite'; + var parent = child[parentSuite]; + + if (parent) { + if (typeof this.views.suites[parent.id] == 'undefined') { + this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views); + } + parentDiv = this.views.suites[parent.id].element; + } + + parentDiv.appendChild(childElement); +}; + + +jasmine.HtmlReporterHelpers.addHelpers = function(ctor) { + for(var fn in jasmine.HtmlReporterHelpers) { + ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn]; + } +}; + +jasmine.HtmlReporter = function(_doc) { + var self = this; + var doc = _doc || window.document; + + var reporterView; + + var dom = {}; + + // Jasmine Reporter Public Interface + self.logRunningSpecs = false; + + self.reportRunnerStarting = function(runner) { + var specs = runner.specs() || []; + + if (specs.length == 0) { + return; + } + + createReporterDom(runner.env.versionString()); + doc.body.appendChild(dom.reporter); + setExceptionHandling(); + + reporterView = new jasmine.HtmlReporter.ReporterView(dom); + reporterView.addSpecs(specs, self.specFilter); + }; + + self.reportRunnerResults = function(runner) { + reporterView && reporterView.complete(); + }; + + self.reportSuiteResults = function(suite) { + reporterView.suiteComplete(suite); + }; + + self.reportSpecStarting = function(spec) { + if (self.logRunningSpecs) { + self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); + } + }; + + self.reportSpecResults = function(spec) { + reporterView.specComplete(spec); + }; + + self.log = function() { + var console = jasmine.getGlobal().console; + if (console && console.log) { + if (console.log.apply) { + console.log.apply(console, arguments); + } else { + console.log(arguments); // ie fix: console.log.apply doesn't exist on ie + } + } + }; + + self.specFilter = function(spec) { + if (!focusedSpecName()) { + return true; + } + + return spec.getFullName().indexOf(focusedSpecName()) === 0; + }; + + return self; + + function focusedSpecName() { + var specName; + + (function memoizeFocusedSpec() { + if (specName) { + return; + } + + var paramMap = []; + var params = jasmine.HtmlReporter.parameters(doc); + + for (var i = 0; i < params.length; i++) { + var p = params[i].split('='); + paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); + } + + specName = paramMap.spec; + })(); + + return specName; + } + + function createReporterDom(version) { + dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' }, + dom.banner = self.createDom('div', { className: 'banner' }, + self.createDom('span', { className: 'title' }, "Jasmine "), + self.createDom('span', { className: 'version' }, version)), + + dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}), + dom.alert = self.createDom('div', {className: 'alert'}, + self.createDom('span', { className: 'exceptions' }, + self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'), + self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))), + dom.results = self.createDom('div', {className: 'results'}, + dom.summary = self.createDom('div', { className: 'summary' }), + dom.details = self.createDom('div', { id: 'details' })) + ); + } + + function noTryCatch() { + return window.location.search.match(/catch=false/); + } + + function searchWithCatch() { + var params = jasmine.HtmlReporter.parameters(window.document); + var removed = false; + var i = 0; + + while (!removed && i < params.length) { + if (params[i].match(/catch=/)) { + params.splice(i, 1); + removed = true; + } + i++; + } + if (jasmine.CATCH_EXCEPTIONS) { + params.push("catch=false"); + } + + return params.join("&"); + } + + function setExceptionHandling() { + var chxCatch = document.getElementById('no_try_catch'); + + if (noTryCatch()) { + chxCatch.setAttribute('checked', true); + jasmine.CATCH_EXCEPTIONS = false; + } + chxCatch.onclick = function() { + window.location.search = searchWithCatch(); + }; + } +}; +jasmine.HtmlReporter.parameters = function(doc) { + var paramStr = doc.location.search.substring(1); + var params = []; + + if (paramStr.length > 0) { + params = paramStr.split('&'); + } + return params; +} +jasmine.HtmlReporter.sectionLink = function(sectionName) { + var link = '?'; + var params = []; + + if (sectionName) { + params.push('spec=' + encodeURIComponent(sectionName)); + } + if (!jasmine.CATCH_EXCEPTIONS) { + params.push("catch=false"); + } + if (params.length > 0) { + link += params.join("&"); + } + + return link; +}; +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter); +jasmine.HtmlReporter.ReporterView = function(dom) { + this.startedAt = new Date(); + this.runningSpecCount = 0; + this.completeSpecCount = 0; + this.passedCount = 0; + this.failedCount = 0; + this.skippedCount = 0; + + this.createResultsMenu = function() { + this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'}, + this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'), + ' | ', + this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing')); + + this.summaryMenuItem.onclick = function() { + dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, ''); + }; + + this.detailsMenuItem.onclick = function() { + showDetails(); + }; + }; + + this.addSpecs = function(specs, specFilter) { + this.totalSpecCount = specs.length; + + this.views = { + specs: {}, + suites: {} + }; + + for (var i = 0; i < specs.length; i++) { + var spec = specs[i]; + this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views); + if (specFilter(spec)) { + this.runningSpecCount++; + } + } + }; + + this.specComplete = function(spec) { + this.completeSpecCount++; + + if (isUndefined(this.views.specs[spec.id])) { + this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom); + } + + var specView = this.views.specs[spec.id]; + + switch (specView.status()) { + case 'passed': + this.passedCount++; + break; + + case 'failed': + this.failedCount++; + break; + + case 'skipped': + this.skippedCount++; + break; + } + + specView.refresh(); + this.refresh(); + }; + + this.suiteComplete = function(suite) { + var suiteView = this.views.suites[suite.id]; + if (isUndefined(suiteView)) { + return; + } + suiteView.refresh(); + }; + + this.refresh = function() { + + if (isUndefined(this.resultsMenu)) { + this.createResultsMenu(); + } + + // currently running UI + if (isUndefined(this.runningAlert)) { + this.runningAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "runningAlert bar" }); + dom.alert.appendChild(this.runningAlert); + } + this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount); + + // skipped specs UI + if (isUndefined(this.skippedAlert)) { + this.skippedAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "skippedAlert bar" }); + } + + this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; + + if (this.skippedCount === 1 && isDefined(dom.alert)) { + dom.alert.appendChild(this.skippedAlert); + } + + // passing specs UI + if (isUndefined(this.passedAlert)) { + this.passedAlert = this.createDom('span', { href: jasmine.HtmlReporter.sectionLink(), className: "passingAlert bar" }); + } + this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount); + + // failing specs UI + if (isUndefined(this.failedAlert)) { + this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"}); + } + this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount); + + if (this.failedCount === 1 && isDefined(dom.alert)) { + dom.alert.appendChild(this.failedAlert); + dom.alert.appendChild(this.resultsMenu); + } + + // summary info + this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount); + this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing"; + }; + + this.complete = function() { + dom.alert.removeChild(this.runningAlert); + + this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; + + if (this.failedCount === 0) { + dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount))); + } else { + showDetails(); + } + + dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s")); + }; + + return this; + + function showDetails() { + if (dom.reporter.className.search(/showDetails/) === -1) { + dom.reporter.className += " showDetails"; + } + } + + function isUndefined(obj) { + return typeof obj === 'undefined'; + } + + function isDefined(obj) { + return !isUndefined(obj); + } + + function specPluralizedFor(count) { + var str = count + " spec"; + if (count > 1) { + str += "s" + } + return str; + } + +}; + +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView); + + +jasmine.HtmlReporter.SpecView = function(spec, dom, views) { + this.spec = spec; + this.dom = dom; + this.views = views; + + this.symbol = this.createDom('li', { className: 'pending' }); + this.dom.symbolSummary.appendChild(this.symbol); + + this.summary = this.createDom('div', { className: 'specSummary' }, + this.createDom('a', { + className: 'description', + href: jasmine.HtmlReporter.sectionLink(this.spec.getFullName()), + title: this.spec.getFullName() + }, this.spec.description) + ); + + this.detail = this.createDom('div', { className: 'specDetail' }, + this.createDom('a', { + className: 'description', + href: '?spec=' + encodeURIComponent(this.spec.getFullName()), + title: this.spec.getFullName() + }, this.spec.getFullName()) + ); +}; + +jasmine.HtmlReporter.SpecView.prototype.status = function() { + return this.getSpecStatus(this.spec); +}; + +jasmine.HtmlReporter.SpecView.prototype.refresh = function() { + this.symbol.className = this.status(); + + switch (this.status()) { + case 'skipped': + break; + + case 'passed': + this.appendSummaryToSuiteDiv(); + break; + + case 'failed': + this.appendSummaryToSuiteDiv(); + this.appendFailureDetail(); + break; + } +}; + +jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() { + this.summary.className += ' ' + this.status(); + this.appendToSummary(this.spec, this.summary); +}; + +jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() { + this.detail.className += ' ' + this.status(); + + var resultItems = this.spec.results().getItems(); + var messagesDiv = this.createDom('div', { className: 'messages' }); + + for (var i = 0; i < resultItems.length; i++) { + var result = resultItems[i]; + + if (result.type == 'log') { + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); + } else if (result.type == 'expect' && result.passed && !result.passed()) { + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); + + if (result.trace.stack) { + messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); + } + } + } + + if (messagesDiv.childNodes.length > 0) { + this.detail.appendChild(messagesDiv); + this.dom.details.appendChild(this.detail); + } +}; + +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) { + this.suite = suite; + this.dom = dom; + this.views = views; + + this.element = this.createDom('div', { className: 'suite' }, + this.createDom('a', { className: 'description', href: jasmine.HtmlReporter.sectionLink(this.suite.getFullName()) }, this.suite.description) + ); + + this.appendToSummary(this.suite, this.element); +}; + +jasmine.HtmlReporter.SuiteView.prototype.status = function() { + return this.getSpecStatus(this.suite); +}; + +jasmine.HtmlReporter.SuiteView.prototype.refresh = function() { + this.element.className += " " + this.status(); +}; + +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView); + +/* @deprecated Use jasmine.HtmlReporter instead + */ +jasmine.TrivialReporter = function(doc) { + this.document = doc || document; + this.suiteDivs = {}; + this.logRunningSpecs = false; +}; + +jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { + var el = document.createElement(type); + + for (var i = 2; i < arguments.length; i++) { + var child = arguments[i]; + + if (typeof child === 'string') { + el.appendChild(document.createTextNode(child)); + } else { + if (child) { el.appendChild(child); } + } + } + + for (var attr in attrs) { + if (attr == "className") { + el[attr] = attrs[attr]; + } else { + el.setAttribute(attr, attrs[attr]); + } + } + + return el; +}; + +jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { + var showPassed, showSkipped; + + this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' }, + this.createDom('div', { className: 'banner' }, + this.createDom('div', { className: 'logo' }, + this.createDom('span', { className: 'title' }, "Jasmine"), + this.createDom('span', { className: 'version' }, runner.env.versionString())), + this.createDom('div', { className: 'options' }, + "Show ", + showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }), + this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "), + showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }), + this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped") + ) + ), + + this.runnerDiv = this.createDom('div', { className: 'runner running' }, + this.createDom('a', { className: 'run_spec', href: '?' }, "run all"), + this.runnerMessageSpan = this.createDom('span', {}, "Running..."), + this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, "")) + ); + + this.document.body.appendChild(this.outerDiv); + + var suites = runner.suites(); + for (var i = 0; i < suites.length; i++) { + var suite = suites[i]; + var suiteDiv = this.createDom('div', { className: 'suite' }, + this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), + this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description)); + this.suiteDivs[suite.id] = suiteDiv; + var parentDiv = this.outerDiv; + if (suite.parentSuite) { + parentDiv = this.suiteDivs[suite.parentSuite.id]; + } + parentDiv.appendChild(suiteDiv); + } + + this.startedAt = new Date(); + + var self = this; + showPassed.onclick = function(evt) { + if (showPassed.checked) { + self.outerDiv.className += ' show-passed'; + } else { + self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, ''); + } + }; + + showSkipped.onclick = function(evt) { + if (showSkipped.checked) { + self.outerDiv.className += ' show-skipped'; + } else { + self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, ''); + } + }; +}; + +jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { + var results = runner.results(); + var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; + this.runnerDiv.setAttribute("class", className); + //do it twice for IE + this.runnerDiv.setAttribute("className", className); + var specs = runner.specs(); + var specCount = 0; + for (var i = 0; i < specs.length; i++) { + if (this.specFilter(specs[i])) { + specCount++; + } + } + var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); + message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; + this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild); + + this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); +}; + +jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { + var results = suite.results(); + var status = results.passed() ? 'passed' : 'failed'; + if (results.totalCount === 0) { // todo: change this to check results.skipped + status = 'skipped'; + } + this.suiteDivs[suite.id].className += " " + status; +}; + +jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) { + if (this.logRunningSpecs) { + this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); + } +}; + +jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { + var results = spec.results(); + var status = results.passed() ? 'passed' : 'failed'; + if (results.skipped) { + status = 'skipped'; + } + var specDiv = this.createDom('div', { className: 'spec ' + status }, + this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), + this.createDom('a', { + className: 'description', + href: '?spec=' + encodeURIComponent(spec.getFullName()), + title: spec.getFullName() + }, spec.description)); + + + var resultItems = results.getItems(); + var messagesDiv = this.createDom('div', { className: 'messages' }); + for (var i = 0; i < resultItems.length; i++) { + var result = resultItems[i]; + + if (result.type == 'log') { + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); + } else if (result.type == 'expect' && result.passed && !result.passed()) { + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); + + if (result.trace.stack) { + messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); + } + } + } + + if (messagesDiv.childNodes.length > 0) { + specDiv.appendChild(messagesDiv); + } + + this.suiteDivs[spec.suite.id].appendChild(specDiv); +}; + +jasmine.TrivialReporter.prototype.log = function() { + var console = jasmine.getGlobal().console; + if (console && console.log) { + if (console.log.apply) { + console.log.apply(console, arguments); + } else { + console.log(arguments); // ie fix: console.log.apply doesn't exist on ie + } + } +}; + +jasmine.TrivialReporter.prototype.getLocation = function() { + return this.document.location; +}; + +jasmine.TrivialReporter.prototype.specFilter = function(spec) { + var paramMap = {}; + var params = this.getLocation().search.substring(1).split('&'); + for (var i = 0; i < params.length; i++) { + var p = params[i].split('='); + paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); + } + + if (!paramMap.spec) { + return true; + } + return spec.getFullName().indexOf(paramMap.spec) === 0; +}; diff --git a/.grunt/grunt-contrib-jasmine/jasmine.css b/.grunt/grunt-contrib-jasmine/jasmine.css new file mode 100644 index 0000000..8c008dc --- /dev/null +++ b/.grunt/grunt-contrib-jasmine/jasmine.css @@ -0,0 +1,82 @@ +body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; } + +#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; } +#HTMLReporter a { text-decoration: none; } +#HTMLReporter a:hover { text-decoration: underline; } +#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; } +#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; } +#HTMLReporter #jasmine_content { position: fixed; right: 100%; } +#HTMLReporter .version { color: #aaaaaa; } +#HTMLReporter .banner { margin-top: 14px; } +#HTMLReporter .duration { color: #aaaaaa; float: right; } +#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; } +#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; } +#HTMLReporter .symbolSummary li.passed { font-size: 14px; } +#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; } +#HTMLReporter .symbolSummary li.failed { line-height: 9px; } +#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; } +#HTMLReporter .symbolSummary li.skipped { font-size: 14px; } +#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; } +#HTMLReporter .symbolSummary li.pending { line-height: 11px; } +#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; } +#HTMLReporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; } +#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } +#HTMLReporter .runningAlert { background-color: #666666; } +#HTMLReporter .skippedAlert { background-color: #aaaaaa; } +#HTMLReporter .skippedAlert:first-child { background-color: #333333; } +#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; } +#HTMLReporter .passingAlert { background-color: #a6b779; } +#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; } +#HTMLReporter .failingAlert { background-color: #cf867e; } +#HTMLReporter .failingAlert:first-child { background-color: #b03911; } +#HTMLReporter .results { margin-top: 14px; } +#HTMLReporter #details { display: none; } +#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; } +#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; } +#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; } +#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; } +#HTMLReporter.showDetails .summary { display: none; } +#HTMLReporter.showDetails #details { display: block; } +#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; } +#HTMLReporter .summary { margin-top: 14px; } +#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; } +#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; } +#HTMLReporter .summary .specSummary.failed a { color: #b03911; } +#HTMLReporter .description + .suite { margin-top: 0; } +#HTMLReporter .suite { margin-top: 14px; } +#HTMLReporter .suite a { color: #333333; } +#HTMLReporter #details .specDetail { margin-bottom: 28px; } +#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; } +#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; } +#HTMLReporter .resultMessage span.result { display: block; } +#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; } + +#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;*/ /*}*/ } +#TrivialReporter a:visited, #TrivialReporter a { color: #303; } +#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; } +#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; } +#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; } +#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; } +#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; } +#TrivialReporter .runner.running { background-color: yellow; } +#TrivialReporter .options { text-align: right; font-size: .8em; } +#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; } +#TrivialReporter .suite .suite { margin: 5px; } +#TrivialReporter .suite.passed { background-color: #dfd; } +#TrivialReporter .suite.failed { background-color: #fdd; } +#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; } +#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; } +#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; } +#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; } +#TrivialReporter .spec.skipped { background-color: #bbb; } +#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; } +#TrivialReporter .passed { background-color: #cfc; display: none; } +#TrivialReporter .failed { background-color: #fbb; } +#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; } +#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; } +#TrivialReporter .resultMessage .mismatch { color: black; } +#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; } +#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; } +#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; } +#TrivialReporter #jasmine_content { position: fixed; right: 100%; } +#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; } diff --git a/.grunt/grunt-contrib-jasmine/jasmine.js b/.grunt/grunt-contrib-jasmine/jasmine.js new file mode 100644 index 0000000..6b3459b --- /dev/null +++ b/.grunt/grunt-contrib-jasmine/jasmine.js @@ -0,0 +1,2600 @@ +var isCommonJS = typeof window == "undefined" && typeof exports == "object"; + +/** + * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework. + * + * @namespace + */ +var jasmine = {}; +if (isCommonJS) exports.jasmine = jasmine; +/** + * @private + */ +jasmine.unimplementedMethod_ = function() { + throw new Error("unimplemented method"); +}; + +/** + * Use jasmine.undefined instead of undefined, since undefined is just + * a plain old variable and may be redefined by somebody else. + * + * @private + */ +jasmine.undefined = jasmine.___undefined___; + +/** + * Show diagnostic messages in the console if set to true + * + */ +jasmine.VERBOSE = false; + +/** + * 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. + * + */ +jasmine.DEFAULT_UPDATE_INTERVAL = 250; + +/** + * Maximum levels of nesting that will be included when an object is pretty-printed + */ +jasmine.MAX_PRETTY_PRINT_DEPTH = 40; + +/** + * Default timeout interval in milliseconds for waitsFor() blocks. + */ +jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; + +/** + * 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. + * Set to false to let the exception bubble up in the browser. + * + */ +jasmine.CATCH_EXCEPTIONS = true; + +jasmine.getGlobal = function() { + function getGlobal() { + return this; + } + + return getGlobal(); +}; + +/** + * Allows for bound functions to be compared. Internal use only. + * + * @ignore + * @private + * @param base {Object} bound 'this' for the function + * @param name {Function} function to find + */ +jasmine.bindOriginal_ = function(base, name) { + var original = base[name]; + if (original.apply) { + return function() { + return original.apply(base, arguments); + }; + } else { + // IE support + return jasmine.getGlobal()[name]; + } +}; + +jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout'); +jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout'); +jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval'); +jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval'); + +jasmine.MessageResult = function(values) { + this.type = 'log'; + this.values = values; + this.trace = new Error(); // todo: test better +}; + +jasmine.MessageResult.prototype.toString = function() { + var text = ""; + for (var i = 0; i < this.values.length; i++) { + if (i > 0) text += " "; + if (jasmine.isString_(this.values[i])) { + text += this.values[i]; + } else { + text += jasmine.pp(this.values[i]); + } + } + return text; +}; + +jasmine.ExpectationResult = function(params) { + this.type = 'expect'; + this.matcherName = params.matcherName; + this.passed_ = params.passed; + this.expected = params.expected; + this.actual = params.actual; + this.message = this.passed_ ? 'Passed.' : params.message; + + var trace = (params.trace || new Error(this.message)); + this.trace = this.passed_ ? '' : trace; +}; + +jasmine.ExpectationResult.prototype.toString = function () { + return this.message; +}; + +jasmine.ExpectationResult.prototype.passed = function () { + return this.passed_; +}; + +/** + * Getter for the Jasmine environment. Ensures one gets created + */ +jasmine.getEnv = function() { + var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env(); + return env; +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isArray_ = function(value) { + return jasmine.isA_("Array", value); +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isString_ = function(value) { + return jasmine.isA_("String", value); +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isNumber_ = function(value) { + return jasmine.isA_("Number", value); +}; + +/** + * @ignore + * @private + * @param {String} typeName + * @param value + * @returns {Boolean} + */ +jasmine.isA_ = function(typeName, value) { + return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; +}; + +/** + * Pretty printer for expecations. Takes any object and turns it into a human-readable string. + * + * @param value {Object} an object to be outputted + * @returns {String} + */ +jasmine.pp = function(value) { + var stringPrettyPrinter = new jasmine.StringPrettyPrinter(); + stringPrettyPrinter.format(value); + return stringPrettyPrinter.string; +}; + +/** + * Returns true if the object is a DOM Node. + * + * @param {Object} obj object to check + * @returns {Boolean} + */ +jasmine.isDomNode = function(obj) { + return obj.nodeType > 0; +}; + +/** + * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter. + * + * @example + * // don't care about which function is passed in, as long as it's a function + * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function)); + * + * @param {Class} clazz + * @returns matchable object of the type clazz + */ +jasmine.any = function(clazz) { + return new jasmine.Matchers.Any(clazz); +}; + +/** + * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the + * attributes on the object. + * + * @example + * // don't care about any other attributes than foo. + * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"}); + * + * @param sample {Object} sample + * @returns matchable object for the sample + */ +jasmine.objectContaining = function (sample) { + return new jasmine.Matchers.ObjectContaining(sample); +}; + +/** + * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. + * + * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine + * expectation syntax. Spies can be checked if they were called or not and what the calling params were. + * + * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs). + * + * Spies are torn down at the end of every spec. + * + * Note: Do not call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj. + * + * @example + * // a stub + * var myStub = jasmine.createSpy('myStub'); // can be used anywhere + * + * // spy example + * var foo = { + * not: function(bool) { return !bool; } + * } + * + * // actual foo.not will not be called, execution stops + * spyOn(foo, 'not'); + + // foo.not spied upon, execution will continue to implementation + * spyOn(foo, 'not').andCallThrough(); + * + * // fake example + * var foo = { + * not: function(bool) { return !bool; } + * } + * + * // foo.not(val) will return val + * spyOn(foo, 'not').andCallFake(function(value) {return value;}); + * + * // mock example + * foo.not(7 == 7); + * expect(foo.not).toHaveBeenCalled(); + * expect(foo.not).toHaveBeenCalledWith(true); + * + * @constructor + * @see spyOn, jasmine.createSpy, jasmine.createSpyObj + * @param {String} name + */ +jasmine.Spy = function(name) { + /** + * The name of the spy, if provided. + */ + this.identity = name || 'unknown'; + /** + * Is this Object a spy? + */ + this.isSpy = true; + /** + * The actual function this spy stubs. + */ + this.plan = function() { + }; + /** + * Tracking of the most recent call to the spy. + * @example + * var mySpy = jasmine.createSpy('foo'); + * mySpy(1, 2); + * mySpy.mostRecentCall.args = [1, 2]; + */ + this.mostRecentCall = {}; + + /** + * Holds arguments for each call to the spy, indexed by call count + * @example + * var mySpy = jasmine.createSpy('foo'); + * mySpy(1, 2); + * mySpy(7, 8); + * mySpy.mostRecentCall.args = [7, 8]; + * mySpy.argsForCall[0] = [1, 2]; + * mySpy.argsForCall[1] = [7, 8]; + */ + this.argsForCall = []; + this.calls = []; +}; + +/** + * Tells a spy to call through to the actual implemenatation. + * + * @example + * var foo = { + * bar: function() { // do some stuff } + * } + * + * // defining a spy on an existing property: foo.bar + * spyOn(foo, 'bar').andCallThrough(); + */ +jasmine.Spy.prototype.andCallThrough = function() { + this.plan = this.originalValue; + return this; +}; + +/** + * For setting the return value of a spy. + * + * @example + * // defining a spy from scratch: foo() returns 'baz' + * var foo = jasmine.createSpy('spy on foo').andReturn('baz'); + * + * // defining a spy on an existing property: foo.bar() returns 'baz' + * spyOn(foo, 'bar').andReturn('baz'); + * + * @param {Object} value + */ +jasmine.Spy.prototype.andReturn = function(value) { + this.plan = function() { + return value; + }; + return this; +}; + +/** + * For throwing an exception when a spy is called. + * + * @example + * // defining a spy from scratch: foo() throws an exception w/ message 'ouch' + * var foo = jasmine.createSpy('spy on foo').andThrow('baz'); + * + * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch' + * spyOn(foo, 'bar').andThrow('baz'); + * + * @param {String} exceptionMsg + */ +jasmine.Spy.prototype.andThrow = function(exceptionMsg) { + this.plan = function() { + throw exceptionMsg; + }; + return this; +}; + +/** + * Calls an alternate implementation when a spy is called. + * + * @example + * var baz = function() { + * // do some stuff, return something + * } + * // defining a spy from scratch: foo() calls the function baz + * var foo = jasmine.createSpy('spy on foo').andCall(baz); + * + * // defining a spy on an existing property: foo.bar() calls an anonymnous function + * spyOn(foo, 'bar').andCall(function() { return 'baz';} ); + * + * @param {Function} fakeFunc + */ +jasmine.Spy.prototype.andCallFake = function(fakeFunc) { + this.plan = fakeFunc; + return this; +}; + +/** + * Resets all of a spy's the tracking variables so that it can be used again. + * + * @example + * spyOn(foo, 'bar'); + * + * foo.bar(); + * + * expect(foo.bar.callCount).toEqual(1); + * + * foo.bar.reset(); + * + * expect(foo.bar.callCount).toEqual(0); + */ +jasmine.Spy.prototype.reset = function() { + this.wasCalled = false; + this.callCount = 0; + this.argsForCall = []; + this.calls = []; + this.mostRecentCall = {}; +}; + +jasmine.createSpy = function(name) { + + var spyObj = function() { + spyObj.wasCalled = true; + spyObj.callCount++; + var args = jasmine.util.argsToArray(arguments); + spyObj.mostRecentCall.object = this; + spyObj.mostRecentCall.args = args; + spyObj.argsForCall.push(args); + spyObj.calls.push({object: this, args: args}); + return spyObj.plan.apply(this, arguments); + }; + + var spy = new jasmine.Spy(name); + + for (var prop in spy) { + spyObj[prop] = spy[prop]; + } + + spyObj.reset(); + + return spyObj; +}; + +/** + * Determines whether an object is a spy. + * + * @param {jasmine.Spy|Object} putativeSpy + * @returns {Boolean} + */ +jasmine.isSpy = function(putativeSpy) { + return putativeSpy && putativeSpy.isSpy; +}; + +/** + * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something + * large in one call. + * + * @param {String} baseName name of spy class + * @param {Array} methodNames array of names of methods to make spies + */ +jasmine.createSpyObj = function(baseName, methodNames) { + if (!jasmine.isArray_(methodNames) || methodNames.length === 0) { + throw new Error('createSpyObj requires a non-empty array of method names to create spies for'); + } + var obj = {}; + for (var i = 0; i < methodNames.length; i++) { + obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]); + } + return obj; +}; + +/** + * All parameters are pretty-printed and concatenated together, then written to the current spec's output. + * + * Be careful not to leave calls to jasmine.log in production code. + */ +jasmine.log = function() { + var spec = jasmine.getEnv().currentSpec; + spec.log.apply(spec, arguments); +}; + +/** + * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy. + * + * @example + * // spy example + * var foo = { + * not: function(bool) { return !bool; } + * } + * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops + * + * @see jasmine.createSpy + * @param obj + * @param methodName + * @return {jasmine.Spy} a Jasmine spy that can be chained with all spy methods + */ +var spyOn = function(obj, methodName) { + return jasmine.getEnv().currentSpec.spyOn(obj, methodName); +}; +if (isCommonJS) exports.spyOn = spyOn; + +/** + * Creates a Jasmine spec that will be added to the current suite. + * + * // TODO: pending tests + * + * @example + * it('should be true', function() { + * expect(true).toEqual(true); + * }); + * + * @param {String} desc description of this specification + * @param {Function} func defines the preconditions and expectations of the spec + */ +var it = function(desc, func) { + return jasmine.getEnv().it(desc, func); +}; +if (isCommonJS) exports.it = it; + +/** + * Creates a disabled Jasmine spec. + * + * A convenience method that allows existing specs to be disabled temporarily during development. + * + * @param {String} desc description of this specification + * @param {Function} func defines the preconditions and expectations of the spec + */ +var xit = function(desc, func) { + return jasmine.getEnv().xit(desc, func); +}; +if (isCommonJS) exports.xit = xit; + +/** + * Starts a chain for a Jasmine expectation. + * + * It is passed an Object that is the actual value and should chain to one of the many + * jasmine.Matchers functions. + * + * @param {Object} actual Actual value to test against and expected value + * @return {jasmine.Matchers} + */ +var expect = function(actual) { + return jasmine.getEnv().currentSpec.expect(actual); +}; +if (isCommonJS) exports.expect = expect; + +/** + * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs. + * + * @param {Function} func Function that defines part of a jasmine spec. + */ +var runs = function(func) { + jasmine.getEnv().currentSpec.runs(func); +}; +if (isCommonJS) exports.runs = runs; + +/** + * Waits a fixed time period before moving to the next block. + * + * @deprecated Use waitsFor() instead + * @param {Number} timeout milliseconds to wait + */ +var waits = function(timeout) { + jasmine.getEnv().currentSpec.waits(timeout); +}; +if (isCommonJS) exports.waits = waits; + +/** + * Waits for the latchFunction to return true before proceeding to the next block. + * + * @param {Function} latchFunction + * @param {String} optional_timeoutMessage + * @param {Number} optional_timeout + */ +var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { + jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments); +}; +if (isCommonJS) exports.waitsFor = waitsFor; + +/** + * A function that is called before each spec in a suite. + * + * Used for spec setup, including validating assumptions. + * + * @param {Function} beforeEachFunction + */ +var beforeEach = function(beforeEachFunction) { + jasmine.getEnv().beforeEach(beforeEachFunction); +}; +if (isCommonJS) exports.beforeEach = beforeEach; + +/** + * A function that is called after each spec in a suite. + * + * Used for restoring any state that is hijacked during spec execution. + * + * @param {Function} afterEachFunction + */ +var afterEach = function(afterEachFunction) { + jasmine.getEnv().afterEach(afterEachFunction); +}; +if (isCommonJS) exports.afterEach = afterEach; + +/** + * Defines a suite of specifications. + * + * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared + * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization + * of setup in some tests. + * + * @example + * // TODO: a simple suite + * + * // TODO: a simple suite with a nested describe block + * + * @param {String} description A string, usually the class under test. + * @param {Function} specDefinitions function that defines several specs. + */ +var describe = function(description, specDefinitions) { + return jasmine.getEnv().describe(description, specDefinitions); +}; +if (isCommonJS) exports.describe = describe; + +/** + * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development. + * + * @param {String} description A string, usually the class under test. + * @param {Function} specDefinitions function that defines several specs. + */ +var xdescribe = function(description, specDefinitions) { + return jasmine.getEnv().xdescribe(description, specDefinitions); +}; +if (isCommonJS) exports.xdescribe = xdescribe; + + +// Provide the XMLHttpRequest class for IE 5.x-6.x: +jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { + function tryIt(f) { + try { + return f(); + } catch(e) { + } + return null; + } + + var xhr = tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP.6.0"); + }) || + tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP.3.0"); + }) || + tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP"); + }) || + tryIt(function() { + return new ActiveXObject("Microsoft.XMLHTTP"); + }); + + if (!xhr) throw new Error("This browser does not support XMLHttpRequest."); + + return xhr; +} : XMLHttpRequest; +/** + * @namespace + */ +jasmine.util = {}; + +/** + * Declare that a child class inherit it's prototype from the parent class. + * + * @private + * @param {Function} childClass + * @param {Function} parentClass + */ +jasmine.util.inherit = function(childClass, parentClass) { + /** + * @private + */ + var subclass = function() { + }; + subclass.prototype = parentClass.prototype; + childClass.prototype = new subclass(); +}; + +jasmine.util.formatException = function(e) { + var lineNumber; + if (e.line) { + lineNumber = e.line; + } + else if (e.lineNumber) { + lineNumber = e.lineNumber; + } + + var file; + + if (e.sourceURL) { + file = e.sourceURL; + } + else if (e.fileName) { + file = e.fileName; + } + + var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString(); + + if (file && lineNumber) { + message += ' in ' + file + ' (line ' + lineNumber + ')'; + } + + return message; +}; + +jasmine.util.htmlEscape = function(str) { + if (!str) return str; + return str.replace(/&/g, '&') + .replace(//g, '>'); +}; + +jasmine.util.argsToArray = function(args) { + var arrayOfArgs = []; + for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); + return arrayOfArgs; +}; + +jasmine.util.extend = function(destination, source) { + for (var property in source) destination[property] = source[property]; + return destination; +}; + +/** + * Environment for Jasmine + * + * @constructor + */ +jasmine.Env = function() { + this.currentSpec = null; + this.currentSuite = null; + this.currentRunner_ = new jasmine.Runner(this); + + this.reporter = new jasmine.MultiReporter(); + + this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL; + this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL; + this.lastUpdate = 0; + this.specFilter = function() { + return true; + }; + + this.nextSpecId_ = 0; + this.nextSuiteId_ = 0; + this.equalityTesters_ = []; + + // wrap matchers + this.matchersClass = function() { + jasmine.Matchers.apply(this, arguments); + }; + jasmine.util.inherit(this.matchersClass, jasmine.Matchers); + + jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass); +}; + + +jasmine.Env.prototype.setTimeout = jasmine.setTimeout; +jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout; +jasmine.Env.prototype.setInterval = jasmine.setInterval; +jasmine.Env.prototype.clearInterval = jasmine.clearInterval; + +/** + * @returns an object containing jasmine version build info, if set. + */ +jasmine.Env.prototype.version = function () { + if (jasmine.version_) { + return jasmine.version_; + } else { + throw new Error('Version not set'); + } +}; + +/** + * @returns string containing jasmine version build info, if set. + */ +jasmine.Env.prototype.versionString = function() { + if (!jasmine.version_) { + return "version unknown"; + } + + var version = this.version(); + var versionString = version.major + "." + version.minor + "." + version.build; + if (version.release_candidate) { + versionString += ".rc" + version.release_candidate; + } + versionString += " revision " + version.revision; + return versionString; +}; + +/** + * @returns a sequential integer starting at 0 + */ +jasmine.Env.prototype.nextSpecId = function () { + return this.nextSpecId_++; +}; + +/** + * @returns a sequential integer starting at 0 + */ +jasmine.Env.prototype.nextSuiteId = function () { + return this.nextSuiteId_++; +}; + +/** + * Register a reporter to receive status updates from Jasmine. + * @param {jasmine.Reporter} reporter An object which will receive status updates. + */ +jasmine.Env.prototype.addReporter = function(reporter) { + this.reporter.addReporter(reporter); +}; + +jasmine.Env.prototype.execute = function() { + this.currentRunner_.execute(); +}; + +jasmine.Env.prototype.describe = function(description, specDefinitions) { + var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite); + + var parentSuite = this.currentSuite; + if (parentSuite) { + parentSuite.add(suite); + } else { + this.currentRunner_.add(suite); + } + + this.currentSuite = suite; + + var declarationError = null; + try { + specDefinitions.call(suite); + } catch(e) { + declarationError = e; + } + + if (declarationError) { + this.it("encountered a declaration exception", function() { + throw declarationError; + }); + } + + this.currentSuite = parentSuite; + + return suite; +}; + +jasmine.Env.prototype.beforeEach = function(beforeEachFunction) { + if (this.currentSuite) { + this.currentSuite.beforeEach(beforeEachFunction); + } else { + this.currentRunner_.beforeEach(beforeEachFunction); + } +}; + +jasmine.Env.prototype.currentRunner = function () { + return this.currentRunner_; +}; + +jasmine.Env.prototype.afterEach = function(afterEachFunction) { + if (this.currentSuite) { + this.currentSuite.afterEach(afterEachFunction); + } else { + this.currentRunner_.afterEach(afterEachFunction); + } + +}; + +jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) { + return { + execute: function() { + } + }; +}; + +jasmine.Env.prototype.it = function(description, func) { + var spec = new jasmine.Spec(this, this.currentSuite, description); + this.currentSuite.add(spec); + this.currentSpec = spec; + + if (func) { + spec.runs(func); + } + + return spec; +}; + +jasmine.Env.prototype.xit = function(desc, func) { + return { + id: this.nextSpecId(), + runs: function() { + } + }; +}; + +jasmine.Env.prototype.compareRegExps_ = function(a, b, mismatchKeys, mismatchValues) { + if (a.source != b.source) + mismatchValues.push("expected pattern /" + b.source + "/ is not equal to the pattern /" + a.source + "/"); + + if (a.ignoreCase != b.ignoreCase) + mismatchValues.push("expected modifier i was" + (b.ignoreCase ? " " : " not ") + "set and does not equal the origin modifier"); + + if (a.global != b.global) + mismatchValues.push("expected modifier g was" + (b.global ? " " : " not ") + "set and does not equal the origin modifier"); + + if (a.multiline != b.multiline) + mismatchValues.push("expected modifier m was" + (b.multiline ? " " : " not ") + "set and does not equal the origin modifier"); + + if (a.sticky != b.sticky) + mismatchValues.push("expected modifier y was" + (b.sticky ? " " : " not ") + "set and does not equal the origin modifier"); + + return (mismatchValues.length === 0); +}; + +jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) { + if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) { + return true; + } + + a.__Jasmine_been_here_before__ = b; + b.__Jasmine_been_here_before__ = a; + + var hasKey = function(obj, keyName) { + return obj !== null && obj[keyName] !== jasmine.undefined; + }; + + for (var property in b) { + if (!hasKey(a, property) && hasKey(b, property)) { + mismatchKeys.push("expected has key '" + property + "', but missing from actual."); + } + } + for (property in a) { + if (!hasKey(b, property) && hasKey(a, property)) { + mismatchKeys.push("expected missing key '" + property + "', but present in actual."); + } + } + for (property in b) { + if (property == '__Jasmine_been_here_before__') continue; + if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) { + 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."); + } + } + + if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) { + mismatchValues.push("arrays were not the same length"); + } + + delete a.__Jasmine_been_here_before__; + delete b.__Jasmine_been_here_before__; + return (mismatchKeys.length === 0 && mismatchValues.length === 0); +}; + +jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { + mismatchKeys = mismatchKeys || []; + mismatchValues = mismatchValues || []; + + for (var i = 0; i < this.equalityTesters_.length; i++) { + var equalityTester = this.equalityTesters_[i]; + var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); + if (result !== jasmine.undefined) return result; + } + + if (a === b) return true; + + if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { + return (a == jasmine.undefined && b == jasmine.undefined); + } + + if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) { + return a === b; + } + + if (a instanceof Date && b instanceof Date) { + return a.getTime() == b.getTime(); + } + + if (a.jasmineMatches) { + return a.jasmineMatches(b); + } + + if (b.jasmineMatches) { + return b.jasmineMatches(a); + } + + if (a instanceof jasmine.Matchers.ObjectContaining) { + return a.matches(b); + } + + if (b instanceof jasmine.Matchers.ObjectContaining) { + return b.matches(a); + } + + if (jasmine.isString_(a) && jasmine.isString_(b)) { + return (a == b); + } + + if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) { + return (a == b); + } + + if (a instanceof RegExp && b instanceof RegExp) { + return this.compareRegExps_(a, b, mismatchKeys, mismatchValues); + } + + if (typeof a === "object" && typeof b === "object") { + return this.compareObjects_(a, b, mismatchKeys, mismatchValues); + } + + //Straight check + return (a === b); +}; + +jasmine.Env.prototype.contains_ = function(haystack, needle) { + if (jasmine.isArray_(haystack)) { + for (var i = 0; i < haystack.length; i++) { + if (this.equals_(haystack[i], needle)) return true; + } + return false; + } + return haystack.indexOf(needle) >= 0; +}; + +jasmine.Env.prototype.addEqualityTester = function(equalityTester) { + this.equalityTesters_.push(equalityTester); +}; +/** No-op base class for Jasmine reporters. + * + * @constructor + */ +jasmine.Reporter = function() { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportRunnerStarting = function(runner) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportRunnerResults = function(runner) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSuiteResults = function(suite) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSpecStarting = function(spec) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSpecResults = function(spec) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.log = function(str) { +}; + +/** + * Blocks are functions with executable code that make up a spec. + * + * @constructor + * @param {jasmine.Env} env + * @param {Function} func + * @param {jasmine.Spec} spec + */ +jasmine.Block = function(env, func, spec) { + this.env = env; + this.func = func; + this.spec = spec; +}; + +jasmine.Block.prototype.execute = function(onComplete) { + if (!jasmine.CATCH_EXCEPTIONS) { + this.func.apply(this.spec); + } + else { + try { + this.func.apply(this.spec); + } catch (e) { + this.spec.fail(e); + } + } + onComplete(); +}; +/** JavaScript API reporter. + * + * @constructor + */ +jasmine.JsApiReporter = function() { + this.started = false; + this.finished = false; + this.suites_ = []; + this.results_ = {}; +}; + +jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) { + this.started = true; + var suites = runner.topLevelSuites(); + for (var i = 0; i < suites.length; i++) { + var suite = suites[i]; + this.suites_.push(this.summarize_(suite)); + } +}; + +jasmine.JsApiReporter.prototype.suites = function() { + return this.suites_; +}; + +jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) { + var isSuite = suiteOrSpec instanceof jasmine.Suite; + var summary = { + id: suiteOrSpec.id, + name: suiteOrSpec.description, + type: isSuite ? 'suite' : 'spec', + children: [] + }; + + if (isSuite) { + var children = suiteOrSpec.children(); + for (var i = 0; i < children.length; i++) { + summary.children.push(this.summarize_(children[i])); + } + } + return summary; +}; + +jasmine.JsApiReporter.prototype.results = function() { + return this.results_; +}; + +jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) { + return this.results_[specId]; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) { + this.finished = true; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) { + this.results_[spec.id] = { + messages: spec.results().getItems(), + result: spec.results().failedCount > 0 ? "failed" : "passed" + }; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.log = function(str) { +}; + +jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){ + var results = {}; + for (var i = 0; i < specIds.length; i++) { + var specId = specIds[i]; + results[specId] = this.summarizeResult_(this.results_[specId]); + } + return results; +}; + +jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){ + var summaryMessages = []; + var messagesLength = result.messages.length; + for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { + var resultMessage = result.messages[messageIndex]; + summaryMessages.push({ + text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined, + passed: resultMessage.passed ? resultMessage.passed() : true, + type: resultMessage.type, + message: resultMessage.message, + trace: { + stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined + } + }); + } + + return { + result : result.result, + messages : summaryMessages + }; +}; + +/** + * @constructor + * @param {jasmine.Env} env + * @param actual + * @param {jasmine.Spec} spec + */ +jasmine.Matchers = function(env, actual, spec, opt_isNot) { + this.env = env; + this.actual = actual; + this.spec = spec; + this.isNot = opt_isNot || false; + this.reportWasCalled_ = false; +}; + +// todo: @deprecated as of Jasmine 0.11, remove soon [xw] +jasmine.Matchers.pp = function(str) { + throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); +}; + +// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw] +jasmine.Matchers.prototype.report = function(result, failing_message, details) { + throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"); +}; + +jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) { + for (var methodName in prototype) { + if (methodName == 'report') continue; + var orig = prototype[methodName]; + matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig); + } +}; + +jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) { + return function() { + var matcherArgs = jasmine.util.argsToArray(arguments); + var result = matcherFunction.apply(this, arguments); + + if (this.isNot) { + result = !result; + } + + if (this.reportWasCalled_) return result; + + var message; + if (!result) { + if (this.message) { + message = this.message.apply(this, arguments); + if (jasmine.isArray_(message)) { + message = message[this.isNot ? 1 : 0]; + } + } else { + var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); + message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate; + if (matcherArgs.length > 0) { + for (var i = 0; i < matcherArgs.length; i++) { + if (i > 0) message += ","; + message += " " + jasmine.pp(matcherArgs[i]); + } + } + message += "."; + } + } + var expectationResult = new jasmine.ExpectationResult({ + matcherName: matcherName, + passed: result, + expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0], + actual: this.actual, + message: message + }); + this.spec.addMatcherResult(expectationResult); + return jasmine.undefined; + }; +}; + + + + +/** + * toBe: compares the actual to the expected using === + * @param expected + */ +jasmine.Matchers.prototype.toBe = function(expected) { + return this.actual === expected; +}; + +/** + * toNotBe: compares the actual to the expected using !== + * @param expected + * @deprecated as of 1.0. Use not.toBe() instead. + */ +jasmine.Matchers.prototype.toNotBe = function(expected) { + return this.actual !== expected; +}; + +/** + * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc. + * + * @param expected + */ +jasmine.Matchers.prototype.toEqual = function(expected) { + return this.env.equals_(this.actual, expected); +}; + +/** + * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual + * @param expected + * @deprecated as of 1.0. Use not.toEqual() instead. + */ +jasmine.Matchers.prototype.toNotEqual = function(expected) { + return !this.env.equals_(this.actual, expected); +}; + +/** + * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes + * a pattern or a String. + * + * @param expected + */ +jasmine.Matchers.prototype.toMatch = function(expected) { + return new RegExp(expected).test(this.actual); +}; + +/** + * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch + * @param expected + * @deprecated as of 1.0. Use not.toMatch() instead. + */ +jasmine.Matchers.prototype.toNotMatch = function(expected) { + return !(new RegExp(expected).test(this.actual)); +}; + +/** + * Matcher that compares the actual to jasmine.undefined. + */ +jasmine.Matchers.prototype.toBeDefined = function() { + return (this.actual !== jasmine.undefined); +}; + +/** + * Matcher that compares the actual to jasmine.undefined. + */ +jasmine.Matchers.prototype.toBeUndefined = function() { + return (this.actual === jasmine.undefined); +}; + +/** + * Matcher that compares the actual to null. + */ +jasmine.Matchers.prototype.toBeNull = function() { + return (this.actual === null); +}; + +/** + * Matcher that compares the actual to NaN. + */ +jasmine.Matchers.prototype.toBeNaN = function() { + this.message = function() { + return [ "Expected " + jasmine.pp(this.actual) + " to be NaN." ]; + }; + + return (this.actual !== this.actual); +}; + +/** + * Matcher that boolean not-nots the actual. + */ +jasmine.Matchers.prototype.toBeTruthy = function() { + return !!this.actual; +}; + + +/** + * Matcher that boolean nots the actual. + */ +jasmine.Matchers.prototype.toBeFalsy = function() { + return !this.actual; +}; + + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was called. + */ +jasmine.Matchers.prototype.toHaveBeenCalled = function() { + if (arguments.length > 0) { + throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); + } + + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy " + this.actual.identity + " to have been called.", + "Expected spy " + this.actual.identity + " not to have been called." + ]; + }; + + return this.actual.wasCalled; +}; + +/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */ +jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled; + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was not called. + * + * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead + */ +jasmine.Matchers.prototype.wasNotCalled = function() { + if (arguments.length > 0) { + throw new Error('wasNotCalled does not take arguments'); + } + + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy " + this.actual.identity + " to not have been called.", + "Expected spy " + this.actual.identity + " to have been called." + ]; + }; + + return !this.actual.wasCalled; +}; + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters. + * + * @example + * + */ +jasmine.Matchers.prototype.toHaveBeenCalledWith = function() { + var expectedArgs = jasmine.util.argsToArray(arguments); + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + this.message = function() { + var invertedMessage = "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was."; + var positiveMessage = ""; + if (this.actual.callCount === 0) { + positiveMessage = "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called."; + } else { + 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, '') + } + return [positiveMessage, invertedMessage]; + }; + + return this.env.contains_(this.actual.argsForCall, expectedArgs); +}; + +/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */ +jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith; + +/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */ +jasmine.Matchers.prototype.wasNotCalledWith = function() { + var expectedArgs = jasmine.util.argsToArray(arguments); + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was", + "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was" + ]; + }; + + return !this.env.contains_(this.actual.argsForCall, expectedArgs); +}; + +/** + * Matcher that checks that the expected item is an element in the actual Array. + * + * @param {Object} expected + */ +jasmine.Matchers.prototype.toContain = function(expected) { + return this.env.contains_(this.actual, expected); +}; + +/** + * Matcher that checks that the expected item is NOT an element in the actual Array. + * + * @param {Object} expected + * @deprecated as of 1.0. Use not.toContain() instead. + */ +jasmine.Matchers.prototype.toNotContain = function(expected) { + return !this.env.contains_(this.actual, expected); +}; + +jasmine.Matchers.prototype.toBeLessThan = function(expected) { + return this.actual < expected; +}; + +jasmine.Matchers.prototype.toBeGreaterThan = function(expected) { + return this.actual > expected; +}; + +/** + * Matcher that checks that the expected item is equal to the actual item + * up to a given level of decimal precision (default 2). + * + * @param {Number} expected + * @param {Number} precision, as number of decimal places + */ +jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) { + if (!(precision === 0)) { + precision = precision || 2; + } + return Math.abs(expected - this.actual) < (Math.pow(10, -precision) / 2); +}; + +/** + * Matcher that checks that the expected exception was thrown by the actual. + * + * @param {String} [expected] + */ +jasmine.Matchers.prototype.toThrow = function(expected) { + var result = false; + var exception; + if (typeof this.actual != 'function') { + throw new Error('Actual is not a function'); + } + try { + this.actual(); + } catch (e) { + exception = e; + } + if (exception) { + result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected)); + } + + var not = this.isNot ? "not " : ""; + + this.message = function() { + if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) { + return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); + } else { + return "Expected function to throw an exception."; + } + }; + + return result; +}; + +jasmine.Matchers.Any = function(expectedClass) { + this.expectedClass = expectedClass; +}; + +jasmine.Matchers.Any.prototype.jasmineMatches = function(other) { + if (this.expectedClass == String) { + return typeof other == 'string' || other instanceof String; + } + + if (this.expectedClass == Number) { + return typeof other == 'number' || other instanceof Number; + } + + if (this.expectedClass == Function) { + return typeof other == 'function' || other instanceof Function; + } + + if (this.expectedClass == Object) { + return typeof other == 'object'; + } + + return other instanceof this.expectedClass; +}; + +jasmine.Matchers.Any.prototype.jasmineToString = function() { + return ''; +}; + +jasmine.Matchers.ObjectContaining = function (sample) { + this.sample = sample; +}; + +jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) { + mismatchKeys = mismatchKeys || []; + mismatchValues = mismatchValues || []; + + var env = jasmine.getEnv(); + + var hasKey = function(obj, keyName) { + return obj != null && obj[keyName] !== jasmine.undefined; + }; + + for (var property in this.sample) { + if (!hasKey(other, property) && hasKey(this.sample, property)) { + mismatchKeys.push("expected has key '" + property + "', but missing from actual."); + } + else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) { + 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."); + } + } + + return (mismatchKeys.length === 0 && mismatchValues.length === 0); +}; + +jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () { + return ""; +}; +// Mock setTimeout, clearTimeout +// Contributed by Pivotal Computer Systems, www.pivotalsf.com + +jasmine.FakeTimer = function() { + this.reset(); + + var self = this; + self.setTimeout = function(funcToCall, millis) { + self.timeoutsMade++; + self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false); + return self.timeoutsMade; + }; + + self.setInterval = function(funcToCall, millis) { + self.timeoutsMade++; + self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true); + return self.timeoutsMade; + }; + + self.clearTimeout = function(timeoutKey) { + self.scheduledFunctions[timeoutKey] = jasmine.undefined; + }; + + self.clearInterval = function(timeoutKey) { + self.scheduledFunctions[timeoutKey] = jasmine.undefined; + }; + +}; + +jasmine.FakeTimer.prototype.reset = function() { + this.timeoutsMade = 0; + this.scheduledFunctions = {}; + this.nowMillis = 0; +}; + +jasmine.FakeTimer.prototype.tick = function(millis) { + var oldMillis = this.nowMillis; + var newMillis = oldMillis + millis; + this.runFunctionsWithinRange(oldMillis, newMillis); + this.nowMillis = newMillis; +}; + +jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) { + var scheduledFunc; + var funcsToRun = []; + for (var timeoutKey in this.scheduledFunctions) { + scheduledFunc = this.scheduledFunctions[timeoutKey]; + if (scheduledFunc != jasmine.undefined && + scheduledFunc.runAtMillis >= oldMillis && + scheduledFunc.runAtMillis <= nowMillis) { + funcsToRun.push(scheduledFunc); + this.scheduledFunctions[timeoutKey] = jasmine.undefined; + } + } + + if (funcsToRun.length > 0) { + funcsToRun.sort(function(a, b) { + return a.runAtMillis - b.runAtMillis; + }); + for (var i = 0; i < funcsToRun.length; ++i) { + try { + var funcToRun = funcsToRun[i]; + this.nowMillis = funcToRun.runAtMillis; + funcToRun.funcToCall(); + if (funcToRun.recurring) { + this.scheduleFunction(funcToRun.timeoutKey, + funcToRun.funcToCall, + funcToRun.millis, + true); + } + } catch(e) { + } + } + this.runFunctionsWithinRange(oldMillis, nowMillis); + } +}; + +jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) { + this.scheduledFunctions[timeoutKey] = { + runAtMillis: this.nowMillis + millis, + funcToCall: funcToCall, + recurring: recurring, + timeoutKey: timeoutKey, + millis: millis + }; +}; + +/** + * @namespace + */ +jasmine.Clock = { + defaultFakeTimer: new jasmine.FakeTimer(), + + reset: function() { + jasmine.Clock.assertInstalled(); + jasmine.Clock.defaultFakeTimer.reset(); + }, + + tick: function(millis) { + jasmine.Clock.assertInstalled(); + jasmine.Clock.defaultFakeTimer.tick(millis); + }, + + runFunctionsWithinRange: function(oldMillis, nowMillis) { + jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis); + }, + + scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) { + jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring); + }, + + useMock: function() { + if (!jasmine.Clock.isInstalled()) { + var spec = jasmine.getEnv().currentSpec; + spec.after(jasmine.Clock.uninstallMock); + + jasmine.Clock.installMock(); + } + }, + + installMock: function() { + jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer; + }, + + uninstallMock: function() { + jasmine.Clock.assertInstalled(); + jasmine.Clock.installed = jasmine.Clock.real; + }, + + real: { + setTimeout: jasmine.getGlobal().setTimeout, + clearTimeout: jasmine.getGlobal().clearTimeout, + setInterval: jasmine.getGlobal().setInterval, + clearInterval: jasmine.getGlobal().clearInterval + }, + + assertInstalled: function() { + if (!jasmine.Clock.isInstalled()) { + throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()"); + } + }, + + isInstalled: function() { + return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer; + }, + + installed: null +}; +jasmine.Clock.installed = jasmine.Clock.real; + +//else for IE support +jasmine.getGlobal().setTimeout = function(funcToCall, millis) { + if (jasmine.Clock.installed.setTimeout.apply) { + return jasmine.Clock.installed.setTimeout.apply(this, arguments); + } else { + return jasmine.Clock.installed.setTimeout(funcToCall, millis); + } +}; + +jasmine.getGlobal().setInterval = function(funcToCall, millis) { + if (jasmine.Clock.installed.setInterval.apply) { + return jasmine.Clock.installed.setInterval.apply(this, arguments); + } else { + return jasmine.Clock.installed.setInterval(funcToCall, millis); + } +}; + +jasmine.getGlobal().clearTimeout = function(timeoutKey) { + if (jasmine.Clock.installed.clearTimeout.apply) { + return jasmine.Clock.installed.clearTimeout.apply(this, arguments); + } else { + return jasmine.Clock.installed.clearTimeout(timeoutKey); + } +}; + +jasmine.getGlobal().clearInterval = function(timeoutKey) { + if (jasmine.Clock.installed.clearTimeout.apply) { + return jasmine.Clock.installed.clearInterval.apply(this, arguments); + } else { + return jasmine.Clock.installed.clearInterval(timeoutKey); + } +}; + +/** + * @constructor + */ +jasmine.MultiReporter = function() { + this.subReporters_ = []; +}; +jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); + +jasmine.MultiReporter.prototype.addReporter = function(reporter) { + this.subReporters_.push(reporter); +}; + +(function() { + var functionNames = [ + "reportRunnerStarting", + "reportRunnerResults", + "reportSuiteResults", + "reportSpecStarting", + "reportSpecResults", + "log" + ]; + for (var i = 0; i < functionNames.length; i++) { + var functionName = functionNames[i]; + jasmine.MultiReporter.prototype[functionName] = (function(functionName) { + return function() { + for (var j = 0; j < this.subReporters_.length; j++) { + var subReporter = this.subReporters_[j]; + if (subReporter[functionName]) { + subReporter[functionName].apply(subReporter, arguments); + } + } + }; + })(functionName); + } +})(); +/** + * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults + * + * @constructor + */ +jasmine.NestedResults = function() { + /** + * The total count of results + */ + this.totalCount = 0; + /** + * Number of passed results + */ + this.passedCount = 0; + /** + * Number of failed results + */ + this.failedCount = 0; + /** + * Was this suite/spec skipped? + */ + this.skipped = false; + /** + * @ignore + */ + this.items_ = []; +}; + +/** + * Roll up the result counts. + * + * @param result + */ +jasmine.NestedResults.prototype.rollupCounts = function(result) { + this.totalCount += result.totalCount; + this.passedCount += result.passedCount; + this.failedCount += result.failedCount; +}; + +/** + * Adds a log message. + * @param values Array of message parts which will be concatenated later. + */ +jasmine.NestedResults.prototype.log = function(values) { + this.items_.push(new jasmine.MessageResult(values)); +}; + +/** + * Getter for the results: message & results. + */ +jasmine.NestedResults.prototype.getItems = function() { + return this.items_; +}; + +/** + * Adds a result, tracking counts (total, passed, & failed) + * @param {jasmine.ExpectationResult|jasmine.NestedResults} result + */ +jasmine.NestedResults.prototype.addResult = function(result) { + if (result.type != 'log') { + if (result.items_) { + this.rollupCounts(result); + } else { + this.totalCount++; + if (result.passed()) { + this.passedCount++; + } else { + this.failedCount++; + } + } + } + this.items_.push(result); +}; + +/** + * @returns {Boolean} True if everything below passed + */ +jasmine.NestedResults.prototype.passed = function() { + return this.passedCount === this.totalCount; +}; +/** + * Base class for pretty printing for expectation results. + */ +jasmine.PrettyPrinter = function() { + this.ppNestLevel_ = 0; +}; + +/** + * Formats a value in a nice, human-readable string. + * + * @param value + */ +jasmine.PrettyPrinter.prototype.format = function(value) { + this.ppNestLevel_++; + try { + if (value === jasmine.undefined) { + this.emitScalar('undefined'); + } else if (value === null) { + this.emitScalar('null'); + } else if (value === jasmine.getGlobal()) { + this.emitScalar(''); + } else if (value.jasmineToString) { + this.emitScalar(value.jasmineToString()); + } else if (typeof value === 'string') { + this.emitString(value); + } else if (jasmine.isSpy(value)) { + this.emitScalar("spy on " + value.identity); + } else if (value instanceof RegExp) { + this.emitScalar(value.toString()); + } else if (typeof value === 'function') { + this.emitScalar('Function'); + } else if (typeof value.nodeType === 'number') { + this.emitScalar('HTMLNode'); + } else if (value instanceof Date) { + this.emitScalar('Date(' + value + ')'); + } else if (value.__Jasmine_been_here_before__) { + this.emitScalar(''); + } else if (jasmine.isArray_(value) || typeof value == 'object') { + value.__Jasmine_been_here_before__ = true; + if (jasmine.isArray_(value)) { + this.emitArray(value); + } else { + this.emitObject(value); + } + delete value.__Jasmine_been_here_before__; + } else { + this.emitScalar(value.toString()); + } + } finally { + this.ppNestLevel_--; + } +}; + +jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) { + for (var property in obj) { + if (!obj.hasOwnProperty(property)) continue; + if (property == '__Jasmine_been_here_before__') continue; + fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && + obj.__lookupGetter__(property) !== null) : false); + } +}; + +jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_; + +jasmine.StringPrettyPrinter = function() { + jasmine.PrettyPrinter.call(this); + + this.string = ''; +}; +jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter); + +jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) { + this.append(value); +}; + +jasmine.StringPrettyPrinter.prototype.emitString = function(value) { + this.append("'" + value + "'"); +}; + +jasmine.StringPrettyPrinter.prototype.emitArray = function(array) { + if (this.ppNestLevel_ > jasmine.MAX_PRETTY_PRINT_DEPTH) { + this.append("Array"); + return; + } + + this.append('[ '); + for (var i = 0; i < array.length; i++) { + if (i > 0) { + this.append(', '); + } + this.format(array[i]); + } + this.append(' ]'); +}; + +jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) { + if (this.ppNestLevel_ > jasmine.MAX_PRETTY_PRINT_DEPTH) { + this.append("Object"); + return; + } + + var self = this; + this.append('{ '); + var first = true; + + this.iterateObject(obj, function(property, isGetter) { + if (first) { + first = false; + } else { + self.append(', '); + } + + self.append(property); + self.append(' : '); + if (isGetter) { + self.append(''); + } else { + self.format(obj[property]); + } + }); + + this.append(' }'); +}; + +jasmine.StringPrettyPrinter.prototype.append = function(value) { + this.string += value; +}; +jasmine.Queue = function(env) { + this.env = env; + + // parallel to blocks. each true value in this array means the block will + // get executed even if we abort + this.ensured = []; + this.blocks = []; + this.running = false; + this.index = 0; + this.offset = 0; + this.abort = false; +}; + +jasmine.Queue.prototype.addBefore = function(block, ensure) { + if (ensure === jasmine.undefined) { + ensure = false; + } + + this.blocks.unshift(block); + this.ensured.unshift(ensure); +}; + +jasmine.Queue.prototype.add = function(block, ensure) { + if (ensure === jasmine.undefined) { + ensure = false; + } + + this.blocks.push(block); + this.ensured.push(ensure); +}; + +jasmine.Queue.prototype.insertNext = function(block, ensure) { + if (ensure === jasmine.undefined) { + ensure = false; + } + + this.ensured.splice((this.index + this.offset + 1), 0, ensure); + this.blocks.splice((this.index + this.offset + 1), 0, block); + this.offset++; +}; + +jasmine.Queue.prototype.start = function(onComplete) { + this.running = true; + this.onComplete = onComplete; + this.next_(); +}; + +jasmine.Queue.prototype.isRunning = function() { + return this.running; +}; + +jasmine.Queue.LOOP_DONT_RECURSE = true; + +jasmine.Queue.prototype.next_ = function() { + var self = this; + var goAgain = true; + + while (goAgain) { + goAgain = false; + + if (self.index < self.blocks.length && !(this.abort && !this.ensured[self.index])) { + var calledSynchronously = true; + var completedSynchronously = false; + + var onComplete = function () { + if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) { + completedSynchronously = true; + return; + } + + if (self.blocks[self.index].abort) { + self.abort = true; + } + + self.offset = 0; + self.index++; + + var now = new Date().getTime(); + if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { + self.env.lastUpdate = now; + self.env.setTimeout(function() { + self.next_(); + }, 0); + } else { + if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { + goAgain = true; + } else { + self.next_(); + } + } + }; + self.blocks[self.index].execute(onComplete); + + calledSynchronously = false; + if (completedSynchronously) { + onComplete(); + } + + } else { + self.running = false; + if (self.onComplete) { + self.onComplete(); + } + } + } +}; + +jasmine.Queue.prototype.results = function() { + var results = new jasmine.NestedResults(); + for (var i = 0; i < this.blocks.length; i++) { + if (this.blocks[i].results) { + results.addResult(this.blocks[i].results()); + } + } + return results; +}; + + +/** + * Runner + * + * @constructor + * @param {jasmine.Env} env + */ +jasmine.Runner = function(env) { + var self = this; + self.env = env; + self.queue = new jasmine.Queue(env); + self.before_ = []; + self.after_ = []; + self.suites_ = []; +}; + +jasmine.Runner.prototype.execute = function() { + var self = this; + if (self.env.reporter.reportRunnerStarting) { + self.env.reporter.reportRunnerStarting(this); + } + self.queue.start(function () { + self.finishCallback(); + }); +}; + +jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) { + beforeEachFunction.typeName = 'beforeEach'; + this.before_.splice(0,0,beforeEachFunction); +}; + +jasmine.Runner.prototype.afterEach = function(afterEachFunction) { + afterEachFunction.typeName = 'afterEach'; + this.after_.splice(0,0,afterEachFunction); +}; + + +jasmine.Runner.prototype.finishCallback = function() { + this.env.reporter.reportRunnerResults(this); +}; + +jasmine.Runner.prototype.addSuite = function(suite) { + this.suites_.push(suite); +}; + +jasmine.Runner.prototype.add = function(block) { + if (block instanceof jasmine.Suite) { + this.addSuite(block); + } + this.queue.add(block); +}; + +jasmine.Runner.prototype.specs = function () { + var suites = this.suites(); + var specs = []; + for (var i = 0; i < suites.length; i++) { + specs = specs.concat(suites[i].specs()); + } + return specs; +}; + +jasmine.Runner.prototype.suites = function() { + return this.suites_; +}; + +jasmine.Runner.prototype.topLevelSuites = function() { + var topLevelSuites = []; + for (var i = 0; i < this.suites_.length; i++) { + if (!this.suites_[i].parentSuite) { + topLevelSuites.push(this.suites_[i]); + } + } + return topLevelSuites; +}; + +jasmine.Runner.prototype.results = function() { + return this.queue.results(); +}; +/** + * Internal representation of a Jasmine specification, or test. + * + * @constructor + * @param {jasmine.Env} env + * @param {jasmine.Suite} suite + * @param {String} description + */ +jasmine.Spec = function(env, suite, description) { + if (!env) { + throw new Error('jasmine.Env() required'); + } + if (!suite) { + throw new Error('jasmine.Suite() required'); + } + var spec = this; + spec.id = env.nextSpecId ? env.nextSpecId() : null; + spec.env = env; + spec.suite = suite; + spec.description = description; + spec.queue = new jasmine.Queue(env); + + spec.afterCallbacks = []; + spec.spies_ = []; + + spec.results_ = new jasmine.NestedResults(); + spec.results_.description = description; + spec.matchersClass = null; +}; + +jasmine.Spec.prototype.getFullName = function() { + return this.suite.getFullName() + ' ' + this.description + '.'; +}; + + +jasmine.Spec.prototype.results = function() { + return this.results_; +}; + +/** + * All parameters are pretty-printed and concatenated together, then written to the spec's output. + * + * Be careful not to leave calls to jasmine.log in production code. + */ +jasmine.Spec.prototype.log = function() { + return this.results_.log(arguments); +}; + +jasmine.Spec.prototype.runs = function (func) { + var block = new jasmine.Block(this.env, func, this); + this.addToQueue(block); + return this; +}; + +jasmine.Spec.prototype.addToQueue = function (block) { + if (this.queue.isRunning()) { + this.queue.insertNext(block); + } else { + this.queue.add(block); + } +}; + +/** + * @param {jasmine.ExpectationResult} result + */ +jasmine.Spec.prototype.addMatcherResult = function(result) { + this.results_.addResult(result); +}; + +jasmine.Spec.prototype.expect = function(actual) { + var positive = new (this.getMatchersClass_())(this.env, actual, this); + positive.not = new (this.getMatchersClass_())(this.env, actual, this, true); + return positive; +}; + +/** + * Waits a fixed time period before moving to the next block. + * + * @deprecated Use waitsFor() instead + * @param {Number} timeout milliseconds to wait + */ +jasmine.Spec.prototype.waits = function(timeout) { + var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this); + this.addToQueue(waitsFunc); + return this; +}; + +/** + * Waits for the latchFunction to return true before proceeding to the next block. + * + * @param {Function} latchFunction + * @param {String} optional_timeoutMessage + * @param {Number} optional_timeout + */ +jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { + var latchFunction_ = null; + var optional_timeoutMessage_ = null; + var optional_timeout_ = null; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + switch (typeof arg) { + case 'function': + latchFunction_ = arg; + break; + case 'string': + optional_timeoutMessage_ = arg; + break; + case 'number': + optional_timeout_ = arg; + break; + } + } + + var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this); + this.addToQueue(waitsForFunc); + return this; +}; + +jasmine.Spec.prototype.fail = function (e) { + var expectationResult = new jasmine.ExpectationResult({ + passed: false, + message: e ? jasmine.util.formatException(e) : 'Exception', + trace: { stack: e.stack } + }); + this.results_.addResult(expectationResult); +}; + +jasmine.Spec.prototype.getMatchersClass_ = function() { + return this.matchersClass || this.env.matchersClass; +}; + +jasmine.Spec.prototype.addMatchers = function(matchersPrototype) { + var parent = this.getMatchersClass_(); + var newMatchersClass = function() { + parent.apply(this, arguments); + }; + jasmine.util.inherit(newMatchersClass, parent); + jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass); + this.matchersClass = newMatchersClass; +}; + +jasmine.Spec.prototype.finishCallback = function() { + this.env.reporter.reportSpecResults(this); +}; + +jasmine.Spec.prototype.finish = function(onComplete) { + this.removeAllSpies(); + this.finishCallback(); + if (onComplete) { + onComplete(); + } +}; + +jasmine.Spec.prototype.after = function(doAfter) { + if (this.queue.isRunning()) { + this.queue.add(new jasmine.Block(this.env, doAfter, this), true); + } else { + this.afterCallbacks.unshift(doAfter); + } +}; + +jasmine.Spec.prototype.execute = function(onComplete) { + var spec = this; + if (!spec.env.specFilter(spec)) { + spec.results_.skipped = true; + spec.finish(onComplete); + return; + } + + this.env.reporter.reportSpecStarting(this); + + spec.env.currentSpec = spec; + + spec.addBeforesAndAftersToQueue(); + + spec.queue.start(function () { + spec.finish(onComplete); + }); +}; + +jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { + var runner = this.env.currentRunner(); + var i; + + for (var suite = this.suite; suite; suite = suite.parentSuite) { + for (i = 0; i < suite.before_.length; i++) { + this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); + } + } + for (i = 0; i < runner.before_.length; i++) { + this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); + } + for (i = 0; i < this.afterCallbacks.length; i++) { + this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this), true); + } + for (suite = this.suite; suite; suite = suite.parentSuite) { + for (i = 0; i < suite.after_.length; i++) { + this.queue.add(new jasmine.Block(this.env, suite.after_[i], this), true); + } + } + for (i = 0; i < runner.after_.length; i++) { + this.queue.add(new jasmine.Block(this.env, runner.after_[i], this), true); + } +}; + +jasmine.Spec.prototype.explodes = function() { + throw 'explodes function should not have been called'; +}; + +jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) { + if (obj == jasmine.undefined) { + throw "spyOn could not find an object to spy upon for " + methodName + "()"; + } + + if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) { + throw methodName + '() method does not exist'; + } + + if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) { + throw new Error(methodName + ' has already been spied upon'); + } + + var spyObj = jasmine.createSpy(methodName); + + this.spies_.push(spyObj); + spyObj.baseObj = obj; + spyObj.methodName = methodName; + spyObj.originalValue = obj[methodName]; + + obj[methodName] = spyObj; + + return spyObj; +}; + +jasmine.Spec.prototype.removeAllSpies = function() { + for (var i = 0; i < this.spies_.length; i++) { + var spy = this.spies_[i]; + spy.baseObj[spy.methodName] = spy.originalValue; + } + this.spies_ = []; +}; + +/** + * Internal representation of a Jasmine suite. + * + * @constructor + * @param {jasmine.Env} env + * @param {String} description + * @param {Function} specDefinitions + * @param {jasmine.Suite} parentSuite + */ +jasmine.Suite = function(env, description, specDefinitions, parentSuite) { + var self = this; + self.id = env.nextSuiteId ? env.nextSuiteId() : null; + self.description = description; + self.queue = new jasmine.Queue(env); + self.parentSuite = parentSuite; + self.env = env; + self.before_ = []; + self.after_ = []; + self.children_ = []; + self.suites_ = []; + self.specs_ = []; +}; + +jasmine.Suite.prototype.getFullName = function() { + var fullName = this.description; + for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { + fullName = parentSuite.description + ' ' + fullName; + } + return fullName; +}; + +jasmine.Suite.prototype.finish = function(onComplete) { + this.env.reporter.reportSuiteResults(this); + this.finished = true; + if (typeof(onComplete) == 'function') { + onComplete(); + } +}; + +jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) { + beforeEachFunction.typeName = 'beforeEach'; + this.before_.unshift(beforeEachFunction); +}; + +jasmine.Suite.prototype.afterEach = function(afterEachFunction) { + afterEachFunction.typeName = 'afterEach'; + this.after_.unshift(afterEachFunction); +}; + +jasmine.Suite.prototype.results = function() { + return this.queue.results(); +}; + +jasmine.Suite.prototype.add = function(suiteOrSpec) { + this.children_.push(suiteOrSpec); + if (suiteOrSpec instanceof jasmine.Suite) { + this.suites_.push(suiteOrSpec); + this.env.currentRunner().addSuite(suiteOrSpec); + } else { + this.specs_.push(suiteOrSpec); + } + this.queue.add(suiteOrSpec); +}; + +jasmine.Suite.prototype.specs = function() { + return this.specs_; +}; + +jasmine.Suite.prototype.suites = function() { + return this.suites_; +}; + +jasmine.Suite.prototype.children = function() { + return this.children_; +}; + +jasmine.Suite.prototype.execute = function(onComplete) { + var self = this; + this.queue.start(function () { + self.finish(onComplete); + }); +}; +jasmine.WaitsBlock = function(env, timeout, spec) { + this.timeout = timeout; + jasmine.Block.call(this, env, null, spec); +}; + +jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block); + +jasmine.WaitsBlock.prototype.execute = function (onComplete) { + if (jasmine.VERBOSE) { + this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...'); + } + this.env.setTimeout(function () { + onComplete(); + }, this.timeout); +}; +/** + * A block which waits for some condition to become true, with timeout. + * + * @constructor + * @extends jasmine.Block + * @param {jasmine.Env} env The Jasmine environment. + * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true. + * @param {Function} latchFunction A function which returns true when the desired condition has been met. + * @param {String} message The message to display if the desired condition hasn't been met within the given time period. + * @param {jasmine.Spec} spec The Jasmine spec. + */ +jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) { + this.timeout = timeout || env.defaultTimeoutInterval; + this.latchFunction = latchFunction; + this.message = message; + this.totalTimeSpentWaitingForLatch = 0; + jasmine.Block.call(this, env, null, spec); +}; +jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block); + +jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10; + +jasmine.WaitsForBlock.prototype.execute = function(onComplete) { + if (jasmine.VERBOSE) { + this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen')); + } + var latchFunctionResult; + try { + latchFunctionResult = this.latchFunction.apply(this.spec); + } catch (e) { + this.spec.fail(e); + onComplete(); + return; + } + + if (latchFunctionResult) { + onComplete(); + } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) { + var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen'); + this.spec.fail({ + name: 'timeout', + message: message + }); + + this.abort = true; + onComplete(); + } else { + this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT; + var self = this; + this.env.setTimeout(function() { + self.execute(onComplete); + }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT); + } +}; + +jasmine.version_= { + "major": 1, + "minor": 3, + "build": 1, + "revision": 1354556913 +}; diff --git a/.grunt/grunt-contrib-jasmine/phantom-polyfill.js b/.grunt/grunt-contrib-jasmine/phantom-polyfill.js new file mode 100644 index 0000000..80a9f73 --- /dev/null +++ b/.grunt/grunt-contrib-jasmine/phantom-polyfill.js @@ -0,0 +1,24 @@ + + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind + +if (!Function.prototype.bind) { + Function.prototype.bind = function (oThis) { + if (typeof this !== "function") { + // closest thing possible to the ECMAScript 5 internal IsCallable function + throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); + } + + var aArgs = Array.prototype.slice.call(arguments, 1), + fToBind = this, + FNOP = function () {}, + fBound = function () { + return fToBind.apply(this instanceof FNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); + }; + + FNOP.prototype = this.prototype; + fBound.prototype = new FNOP(); + + return fBound; + }; +} diff --git a/.grunt/grunt-contrib-jasmine/reporter.js b/.grunt/grunt-contrib-jasmine/reporter.js new file mode 100644 index 0000000..5a400af --- /dev/null +++ b/.grunt/grunt-contrib-jasmine/reporter.js @@ -0,0 +1,287 @@ +/*global window:false, alert:false, jasmine:false, Node:false, */ +/*jshint curly:false*/ + +'use strict'; + +var phantom = {}; + +if (window._phantom) { + console.log = function(){ + phantom.sendMessage('verbose',Array.prototype.slice.apply(arguments).join(', ')); + }; +} + +phantom.sendMessage = function() { + var args = [].slice.call( arguments ); + var payload = JSON.stringify( args ); + if (window._phantom) { + // alerts are the communication bridge to grunt + alert( payload ); + } +}; + +(function(){ + + function PhantomReporter() { + this.started = false; + this.finished = false; + this.suites_ = []; + this.results_ = {}; + this.buffer = ''; + } + + PhantomReporter.prototype.reportRunnerStarting = function(runner) { + this.started = true; + + var suites = runner.topLevelSuites(); + for (var i = 0; i < suites.length; i++) { + var suite = suites[i]; + this.suites_.push(this.summarize_(suite)); + } + phantom.sendMessage('jasmine.reportRunnerStarting', this.suites_); + }; + + PhantomReporter.prototype.reportSpecStarting = function(spec) { + spec.startTime = (new Date()).getTime(); + var message = { + suite : { + description : spec.suite.description + }, + description : spec.description + }; + phantom.sendMessage('jasmine.reportSpecStarting', message); + }; + + PhantomReporter.prototype.suites = function() { + return this.suites_; + }; + + PhantomReporter.prototype.summarize_ = function(suiteOrSpec) { + var isSuite = suiteOrSpec instanceof jasmine.Suite; + var summary = { + id: suiteOrSpec.id, + name: suiteOrSpec.description, + type: isSuite ? 'suite' : 'spec', + children: [] + }; + + if (isSuite) { + var children = suiteOrSpec.children(); + for (var i = 0; i < children.length; i++) { + summary.children.push(this.summarize_(children[i])); + } + } + return summary; + }; + + PhantomReporter.prototype.results = function() { + return this.results_; + }; + + PhantomReporter.prototype.resultsForSpec = function(specId) { + return this.results_[specId]; + }; + + function map(values, f) { + var result = []; + for (var ii = 0; ii < values.length; ii++) { + result.push(f(values[ii])); + } + return result; + } + + PhantomReporter.prototype.reportRunnerResults = function(runner) { + this.finished = true; + var specIds = map(runner.specs(), function(a){return a.id;}); + var summary = this.resultsForSpecs(specIds); + phantom.sendMessage('jasmine.reportRunnerResults',summary); + phantom.sendMessage('jasmine.reportJUnitResults', this.generateJUnitSummary(runner)); + phantom.sendMessage('jasmine.done.PhantomReporter'); + }; + + PhantomReporter.prototype.reportSuiteResults = function(suite) { + if (suite.specs().length) { + suite.timestamp = new Date(); + suite.duration = suite.timestamp.getTime() - suite.specs()[0].startTime; + phantom.sendMessage('jasmine.reportSuiteResults',{ + description : suite.description, + results : suite.results() + }); + } + }; + + function stringify(obj) { + if (typeof obj !== 'object') return obj; + + var cache = [], keyMap = [], index; + + var string = JSON.stringify(obj, function(key, value) { + // Let json stringify falsy values + if (!value) return value; + + // If we're a node + if (typeof(Node) !== 'undefined' && value instanceof Node) return '[ Node ]'; + + // jasmine-given has expectations on Specs. We intercept to return a + // String to avoid stringifying the entire Jasmine environment, which + // results in exponential string growth + if (value instanceof jasmine.Spec) return '[ Spec: ' + value.description + ' ]'; + + // If we're a window (logic stolen from jQuery) + if (value.window && value.window === value.window.window) return '[ Window ]'; + + // Simple function reporting + if (typeof value === 'function') return '[ Function ]'; + + if (typeof value === 'object' && value !== null) { + + if (index = cache.indexOf(value) !== -1) { + // If we have it in cache, report the circle with the key we first found it in + return '[ Circular {' + (keyMap[index] || 'root') + '} ]'; + } + cache.push(value); + keyMap.push(key); + } + return value; + }); + return string; + } + + PhantomReporter.prototype.reportSpecResults = function(spec) { + spec.duration = (new Date()).getTime() - spec.startTime; + var _results = spec.results(); + var results = { + description : _results.description, + messages : _results.getItems(), + failedCount : _results.failedCount, + totalCount : _results.totalCount, + passedCount : _results.passedCount, + skipped : _results.skipped, + passed : _results.passed(), + msg : _results.failedCount > 0 ? "failed" : "passed" + }; + this.results_[spec.id] = results; + + // Quick hack to alleviate cyclical object breaking JSONification. + for (var ii = 0; ii < results.messages.length; ii++) { + var item = results.messages[ii]; + if (item.expected) { + item.expected = stringify(item.expected); + } + if (item.actual) { + item.actual = stringify(item.actual); + } + } + + phantom.sendMessage( 'jasmine.reportSpecResults', spec.id, results, this.getFullName(spec)); + }; + + PhantomReporter.prototype.getFullName = function(spec) { + return getNestedSuiteName(spec.suite, ':: ') + ':: ' + spec.description; + }; + + PhantomReporter.prototype.resultsForSpecs = function(specIds){ + var results = {}; + for (var i = 0; i < specIds.length; i++) { + var specId = specIds[i]; + results[specId] = this.summarizeResult_(this.results_[specId]); + } + return results; + }; + + PhantomReporter.prototype.summarizeResult_ = function(result){ + var summaryMessages = []; + var messagesLength = result.messages.length; + for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { + var resultMessage = result.messages[messageIndex]; + summaryMessages.push({ + text: resultMessage.type === 'log' ? resultMessage.toString() : jasmine.undefined, + passed: resultMessage.passed ? resultMessage.passed() : true, + type: resultMessage.type, + message: resultMessage.message, + trace: { + stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined + } + }); + } + + return { + result : result.result, + messages : summaryMessages + }; + }; + + function getNestedSuiteName(suite, sep) { + var names = []; + while (suite) { + names.unshift(suite.description); + suite = suite.parentSuite; + } + return names.join(sep ? sep : ' '); + } + + function getTopLevelSuiteId(suite) { + var id; + while (suite) { + id = suite.id; + suite = suite.parentSuite; + } + return id; + } + + PhantomReporter.prototype.generateJUnitSummary = function(runner) { + var consolidatedSuites = {}, + suites = map(runner.suites(), function(suite) { + var failures = 0; + + var testcases = map(suite.specs(), function(spec) { + var failureMessages = []; + var specResults = spec.results(); + var resultsItems = specResults.items_; + var resultsItemCount = resultsItems.length; + + if (specResults.failedCount) { + failures++; + + for (var ii = 0; ii < resultsItemCount; ii++) { + var expectation = resultsItems[ii]; + if (!expectation.passed()) { + failureMessages.push(expectation.message); + } + } + } + return { + assertions: resultsItemCount, + className: getNestedSuiteName(spec.suite), + name: spec.description, + time: spec.duration / 1000, + failureMessages: failureMessages + }; + }); + + var data = { + name: getNestedSuiteName(suite), + time: suite.duration / 1000, + timestamp: suite.timestamp, + tests: suite.specs().length, + errors: 0, // TODO: These exist in the JUnit XML but not sure how they map to jasmine things + testcases: testcases, + failures: failures + }; + + if (suite.parentSuite) { + consolidatedSuites[getTopLevelSuiteId(suite)].push(data); + } else { + consolidatedSuites[suite.id] = [data]; + } + return data; + }); + + return { + suites: suites, + consolidatedSuites: consolidatedSuites + }; + }; + + jasmine.getEnv().addReporter( new PhantomReporter() ); +}()); diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b7e7c8f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,41 @@ +#Change Log + +##1.6.4 + +##1.6.3 +- Fix: Add Albanian i18n to dist folder + +##1.6.2 +- Fix: Now button giving Na:Na +- Fix: tz offset calculation +- Fix: "Today" fails on plain datepicker control +- Fix: getDate() returns time (hh:mm) even when plugin is applied on "non-input" elements +- Fix: setSelectionRange for older IE +- Fix: Hellenic i18n +- Fix: window.log in older IE +- Add: Albanian i18n +- Remove: partial support for alpha timezones + +##1.6.1 +- Fix: Add non-dist files to bower.json ignore property +- Fix: \#836 - fixes "invalid-meta" warning for bower +- Fix: correct version in package.json +- Fix: \#829 - Update input after pressing now button. Calls onSelectHandler in \_gotoToday. +- Fix: Update input field after pressing Now button +- Fix: version number in bower.json +- Add: \#838 - Macedonian localization by \@ristovskiv +- Add: Allow direct time input from widget + +## 1.6.0 +- Fix: bower.json main file entries +- Add: Persian language to i18n +- Improve: README.json + +##1.5.0 +- Improve: Check for existence of properties when determining which value to use instead of just truthiness to avoid o.min evaulating to false when its value is 0. +- Improve: $.timepicker.log to accept multiple arguments. +- Fix: to not override inline property. +- Fix: a big bug on the “go to today” functionality. When the month is not the current month, the date change didn’t work. +- Add: examples for $.timepicker.datetimeRange(), $.timepicker.timeRange(), and $.timepicker.dateRange(). +- Add: jQueryUI style classes to select controls. +- Update and test with latest jQuery and jQueryUI. diff --git a/_SpecRunner.html b/_SpecRunner.html new file mode 100644 index 0000000..fb08153 --- /dev/null +++ b/_SpecRunner.html @@ -0,0 +1,35 @@ + + + + + Jasmine Spec Runner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dist/i18n/jquery-ui-timepicker-addon-i18n.js b/dist/i18n/jquery-ui-timepicker-addon-i18n.js index 3ced863..537dca3 100644 --- a/dist/i18n/jquery-ui-timepicker-addon-i18n.js +++ b/dist/i18n/jquery-ui-timepicker-addon-i18n.js @@ -1,9 +1,9 @@ -/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20 -* http://trentrichardson.com/examples/timepicker -* Copyright (c) 2016 Trent Richardson; Licensed MIT */ - -(function($){ - +/*! jQuery Timepicker Addon - v1.6.4 - 2017-02-08 +* http://trentrichardson.com/examples/timepicker +* Copyright (c) 2020 Trent Richardson; Licensed MIT */ + +(function($){ + // source: src/i18n/jquery-ui-timepicker-af.js /* Afrikaans translation for the jQuery Timepicker Addon */ /* Written by Deon Heyns */ @@ -25,950 +25,994 @@ pmNames: ['PM', 'P'], isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-am.js -/* Armenian translation for the jQuery Timepicker Addon */ -/* Written by Artavazd Avetisyan artavazda@hotmail.com */ - - $.timepicker.regional['am'] = { - timeOnlyTitle: 'Ընտրեք ժամանակը', - timeText: 'Ժամանակը', - hourText: 'Ժամ', - minuteText: 'Րոպե', - secondText: 'Վարկյան', - millisecText: 'Միլիվարկյան', - microsecText: 'Միկրովարկյան', - timezoneText: 'Ժամային գոտին', - currentText: 'Այժմ', - closeText: 'Փակել', +/* Armenian translation for the jQuery Timepicker Addon */ +/* Written by Artavazd Avetisyan artavazda@hotmail.com */ + + $.timepicker.regional['am'] = { + timeOnlyTitle: 'Ընտրեք ժամանակը', + timeText: 'Ժամանակը', + hourText: 'Ժամ', + minuteText: 'Րոպե', + secondText: 'Վարկյան', + millisecText: 'Միլիվարկյան', + microsecText: 'Միկրովարկյան', + timezoneText: 'Ժամային գոտին', + currentText: 'Այժմ', + closeText: 'Փակել', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + +// source: src/i18n/jquery-ui-timepicker-ar.js +/* Arabic translation for the jQuery Timepicker Addon */ +/* Written by Hamza Rashid hamza1886@gmail.com */ + + $.timepicker.regional['ar'] = { + timeOnlyTitle: 'اختر الوقت', + timeText: 'ساعة', + hourText: 'ساعات', + minuteText: 'الدقائق', + secondText: 'الثواني', + millisecText: 'مللي ثانية', + microsecText: 'ميكروثانية', + timezoneText: 'وحدة زمنية', + currentText: 'الآن', + closeText: 'منجز', timeFormat: 'HH:mm', timeSuffix: '', amNames: ['AM', 'A'], pmNames: ['PM', 'P'], - isRTL: false + isRTL: true }; - + // source: src/i18n/jquery-ui-timepicker-bg.js -/* Bulgarian translation for the jQuery Timepicker Addon */ -/* Written by Plamen Kovandjiev */ - - $.timepicker.regional['bg'] = { - timeOnlyTitle: 'Изберете време', - timeText: 'Време', - hourText: 'Час', - minuteText: 'Минути', - secondText: 'Секунди', - millisecText: 'Милисекунди', - microsecText: 'Микросекунди', - timezoneText: 'Часови пояс', - currentText: 'Сега', - closeText: 'Затвори', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Bulgarian translation for the jQuery Timepicker Addon */ +/* Written by Plamen Kovandjiev */ + + $.timepicker.regional['bg'] = { + timeOnlyTitle: 'Изберете време', + timeText: 'Време', + hourText: 'Час', + minuteText: 'Минути', + secondText: 'Секунди', + millisecText: 'Милисекунди', + microsecText: 'Микросекунди', + timezoneText: 'Часови пояс', + currentText: 'Сега', + closeText: 'Затвори', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-ca.js -/* Catalan translation for the jQuery Timepicker Addon */ -/* Written by Sergi Faber */ - - $.timepicker.regional['ca'] = { - timeOnlyTitle: 'Escollir una hora', - timeText: 'Hora', - hourText: 'Hores', - minuteText: 'Minuts', - secondText: 'Segons', - millisecText: 'Milisegons', - microsecText: 'Microsegons', - timezoneText: 'Fus horari', - currentText: 'Ara', - closeText: 'Tancar', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Catalan translation for the jQuery Timepicker Addon */ +/* Written by Sergi Faber */ + + $.timepicker.regional['ca'] = { + timeOnlyTitle: 'Escollir una hora', + timeText: 'Hora', + hourText: 'Hores', + minuteText: 'Minuts', + secondText: 'Segons', + millisecText: 'Milisegons', + microsecText: 'Microsegons', + timezoneText: 'Fus horari', + currentText: 'Ara', + closeText: 'Tancar', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-cs.js -/* Czech translation for the jQuery Timepicker Addon */ -/* Written by Ondřej Vodáček */ - - $.timepicker.regional['cs'] = { - timeOnlyTitle: 'Vyberte čas', - timeText: 'Čas', - hourText: 'Hodiny', - minuteText: 'Minuty', - secondText: 'Vteřiny', - millisecText: 'Milisekundy', - microsecText: 'Mikrosekundy', - timezoneText: 'Časové pásmo', - currentText: 'Nyní', - closeText: 'Zavřít', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['dop.', 'AM', 'A'], - pmNames: ['odp.', 'PM', 'P'], - isRTL: false +/* Czech translation for the jQuery Timepicker Addon */ +/* Written by Ondřej Vodáček */ + + $.timepicker.regional['cs'] = { + timeOnlyTitle: 'Vyberte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minuty', + secondText: 'Vteřiny', + millisecText: 'Milisekundy', + microsecText: 'Mikrosekundy', + timezoneText: 'Časové pásmo', + currentText: 'Nyní', + closeText: 'Zavřít', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['odp.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-da.js -/* Danish translation for the jQuery Timepicker Addon */ -/* Written by Lars H. Jensen (http://www.larshj.dk) */ - - $.timepicker.regional['da'] = { - timeOnlyTitle: 'Vælg tid', - timeText: 'Tid', - hourText: 'Time', - minuteText: 'Minut', - secondText: 'Sekund', - millisecText: 'Millisekund', - microsecText: 'Mikrosekund', - timezoneText: 'Tidszone', - currentText: 'Nu', - closeText: 'Luk', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['am', 'AM', 'A'], - pmNames: ['pm', 'PM', 'P'], - isRTL: false +/* Danish translation for the jQuery Timepicker Addon */ +/* Written by Lars H. Jensen (http://www.larshj.dk) */ + + $.timepicker.regional['da'] = { + timeOnlyTitle: 'Vælg tid', + timeText: 'Tid', + hourText: 'Time', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'Mikrosekund', + timezoneText: 'Tidszone', + currentText: 'Nu', + closeText: 'Luk', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-de.js -/* German translation for the jQuery Timepicker Addon */ -/* Written by Marvin */ - - $.timepicker.regional['de'] = { - timeOnlyTitle: 'Zeit wählen', - timeText: 'Zeit', - hourText: 'Stunde', - minuteText: 'Minute', - secondText: 'Sekunde', - millisecText: 'Millisekunde', - microsecText: 'Mikrosekunde', - timezoneText: 'Zeitzone', - currentText: 'Jetzt', - closeText: 'Fertig', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['vorm.', 'AM', 'A'], - pmNames: ['nachm.', 'PM', 'P'], - isRTL: false +/* German translation for the jQuery Timepicker Addon */ +/* Written by Marvin */ + + $.timepicker.regional['de'] = { + timeOnlyTitle: 'Zeit wählen', + timeText: 'Zeit', + hourText: 'Stunde', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Millisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Zeitzone', + currentText: 'Jetzt', + closeText: 'Fertig', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['vorm.', 'AM', 'A'], + pmNames: ['nachm.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-el.js -/* Hellenic translation for the jQuery Timepicker Addon */ -/* Written by Christos Pontikis */ - - $.timepicker.regional['el'] = { - timeOnlyTitle: 'Επιλογή ώρας', - timeText: 'Ώρα', - hourText: 'Ώρες', - minuteText: 'Λεπτά', - secondText: 'Δευτερόλεπτα', - millisecText: 'Χιλιοστοδευτερόλεπτα', - microsecText: 'Μικροδευτερόλεπτα', - timezoneText: 'Ζώνη ώρας', - currentText: 'Τώρα', - closeText: 'Κλείσιμο', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['π.μ.', 'AM', 'A'], - pmNames: ['μ.μ.', 'PM', 'P'], - isRTL: false +/* Hellenic translation for the jQuery Timepicker Addon */ +/* Written by Christos Pontikis */ + + $.timepicker.regional['el'] = { + timeOnlyTitle: 'Επιλογή ώρας', + timeText: 'Ώρα', + hourText: 'Ώρες', + minuteText: 'Λεπτά', + secondText: 'Δευτερόλεπτα', + millisecText: 'Χιλιοστοδευτερόλεπτα', + microsecText: 'Μικροδευτερόλεπτα', + timezoneText: 'Ζώνη ώρας', + currentText: 'Τώρα', + closeText: 'Κλείσιμο', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['π.μ.', 'AM', 'A'], + pmNames: ['μ.μ.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-es.js -/* Spanish translation for the jQuery Timepicker Addon */ -/* Written by Ianaré Sévi */ -/* Modified by Carlos Martínez */ - - $.timepicker.regional['es'] = { - timeOnlyTitle: 'Elegir una hora', - timeText: 'Hora', - hourText: 'Horas', - minuteText: 'Minutos', - secondText: 'Segundos', - millisecText: 'Milisegundos', - microsecText: 'Microsegundos', - timezoneText: 'Uso horario', - currentText: 'Hoy', - closeText: 'Cerrar', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - isRTL: false +/* Spanish translation for the jQuery Timepicker Addon */ +/* Written by Ianaré Sévi */ +/* Modified by Carlos Martínez */ + + $.timepicker.regional['es'] = { + timeOnlyTitle: 'Elegir una hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milisegundos', + microsecText: 'Microsegundos', + timezoneText: 'Uso horario', + currentText: 'Hoy', + closeText: 'Cerrar', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-et.js -/* Estonian translation for the jQuery Timepicker Addon */ -/* Written by Karl Sutt (karl@sutt.ee) */ - - $.timepicker.regional['et'] = { - timeOnlyTitle: 'Vali aeg', - timeText: 'Aeg', - hourText: 'Tund', - minuteText: 'Minut', - secondText: 'Sekund', - millisecText: 'Millisekundis', - microsecText: 'Mikrosekundis', - timezoneText: 'Ajavöönd', - currentText: 'Praegu', - closeText: 'Valmis', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Estonian translation for the jQuery Timepicker Addon */ +/* Written by Karl Sutt (karl@sutt.ee) */ + + $.timepicker.regional['et'] = { + timeOnlyTitle: 'Vali aeg', + timeText: 'Aeg', + hourText: 'Tund', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekundis', + microsecText: 'Mikrosekundis', + timezoneText: 'Ajavöönd', + currentText: 'Praegu', + closeText: 'Valmis', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-eu.js -/* Basque trannslation for JQuery Timepicker Addon */ -/* Translated by Xabi Fer */ -/* Fixed by Asier Iturralde Sarasola - iametza interaktiboa */ - - $.timepicker.regional['eu'] = { - timeOnlyTitle: 'Aukeratu ordua', - timeText: 'Ordua', - hourText: 'Orduak', - minuteText: 'Minutuak', - secondText: 'Segundoak', - millisecText: 'Milisegundoak', - microsecText: 'Mikrosegundoak', - timezoneText: 'Ordu-eremua', - currentText: 'Orain', - closeText: 'Itxi', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - isRTL: false +/* Basque trannslation for JQuery Timepicker Addon */ +/* Translated by Xabi Fer */ +/* Fixed by Asier Iturralde Sarasola - iametza interaktiboa */ + + $.timepicker.regional['eu'] = { + timeOnlyTitle: 'Aukeratu ordua', + timeText: 'Ordua', + hourText: 'Orduak', + minuteText: 'Minutuak', + secondText: 'Segundoak', + millisecText: 'Milisegundoak', + microsecText: 'Mikrosegundoak', + timezoneText: 'Ordu-eremua', + currentText: 'Orain', + closeText: 'Itxi', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-fa.js -/* Persian translation for the jQuery Timepicker Addon */ -/* Written by Meysam Pour Ganji */ - - $.timepicker.regional['fa'] = { - timeOnlyTitle: 'انتخاب زمان', - timeText: 'زمان', - hourText: 'ساعت', - minuteText: 'دقیقه', - secondText: 'ثانیه', - millisecText: 'میلی ثانیه', - microsecText: 'میکرو ثانیه', - timezoneText: 'منطقه زمانی', - currentText: 'الان', - closeText: 'انتخاب', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['قبل ظهر', 'AM', 'A'], - pmNames: ['بعد ظهر', 'PM', 'P'], - isRTL: true +/* Persian translation for the jQuery Timepicker Addon */ +/* Written by Meysam Pour Ganji */ + + $.timepicker.regional['fa'] = { + timeOnlyTitle: 'انتخاب زمان', + timeText: 'زمان', + hourText: 'ساعت', + minuteText: 'دقیقه', + secondText: 'ثانیه', + millisecText: 'میلی ثانیه', + microsecText: 'میکرو ثانیه', + timezoneText: 'منطقه زمانی', + currentText: 'الان', + closeText: 'انتخاب', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['قبل ظهر', 'AM', 'A'], + pmNames: ['بعد ظهر', 'PM', 'P'], + isRTL: true }; - + // source: src/i18n/jquery-ui-timepicker-fi.js -/* Finnish translation for the jQuery Timepicker Addon */ -/* Written by Juga Paazmaya (http://github.com/paazmaya) */ - - $.timepicker.regional['fi'] = { - timeOnlyTitle: 'Valitse aika', - timeText: 'Aika', - hourText: 'Tunti', - minuteText: 'Minuutti', - secondText: 'Sekunti', - millisecText: 'Millisekunnin', - microsecText: 'Mikrosekuntia', - timezoneText: 'Aikavyöhyke', - currentText: 'Nyt', - closeText: 'Sulje', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['ap.', 'AM', 'A'], - pmNames: ['ip.', 'PM', 'P'], - isRTL: false +/* Finnish translation for the jQuery Timepicker Addon */ +/* Written by Juga Paazmaya (http://github.com/paazmaya) */ + + $.timepicker.regional['fi'] = { + timeOnlyTitle: 'Valitse aika', + timeText: 'Aika', + hourText: 'Tunti', + minuteText: 'Minuutti', + secondText: 'Sekunti', + millisecText: 'Millisekunnin', + microsecText: 'Mikrosekuntia', + timezoneText: 'Aikavyöhyke', + currentText: 'Nyt', + closeText: 'Sulje', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['ap.', 'AM', 'A'], + pmNames: ['ip.', 'PM', 'P'], + isRTL: false }; - + +// source: src/i18n/jquery-ui-timepicker-fo.js +/* Faroese translation for the jQuery Timepicker Addon */ +/* Written by Torkil Zachariassen */ + + $.timepicker.regional['fo'] = { + timeOnlyTitle: 'Vel tíð', + timeText: 'Tíð', + hourText: 'Tími', + minuteText: 'Minuttur', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'Mikrosekund', + timezoneText: 'Tíðarsona', + currentText: 'Nú', + closeText: 'Lat aftur', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false + }; + // source: src/i18n/jquery-ui-timepicker-fr.js -/* French translation for the jQuery Timepicker Addon */ -/* Written by Thomas Lété */ - - $.timepicker.regional['fr'] = { - timeOnlyTitle: 'Choisir une heure', - timeText: 'Heure', - hourText: 'Heures', - minuteText: 'Minutes', - secondText: 'Secondes', - millisecText: 'Millisecondes', - microsecText: 'Microsecondes', - timezoneText: 'Fuseau horaire', - currentText: 'Maintenant', - closeText: 'Terminé', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* French translation for the jQuery Timepicker Addon */ +/* Written by Thomas Lété */ + + $.timepicker.regional['fr'] = { + timeOnlyTitle: 'Choisir une heure', + timeText: 'Heure', + hourText: 'Heures', + minuteText: 'Minutes', + secondText: 'Secondes', + millisecText: 'Millisecondes', + microsecText: 'Microsecondes', + timezoneText: 'Fuseau horaire', + currentText: 'Maintenant', + closeText: 'Terminé', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-gl.js -/* Galician translation for the jQuery Timepicker Addon */ -/* Written by David Barral */ - - $.timepicker.regional['gl'] = { - timeOnlyTitle: 'Elixir unha hora', - timeText: 'Hora', - hourText: 'Horas', - minuteText: 'Minutos', - secondText: 'Segundos', - millisecText: 'Milisegundos', - microsecText: 'Microssegundos', - timezoneText: 'Fuso horario', - currentText: 'Agora', - closeText: 'Pechar', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - isRTL: false +/* Galician translation for the jQuery Timepicker Addon */ +/* Written by David Barral */ + + $.timepicker.regional['gl'] = { + timeOnlyTitle: 'Elixir unha hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milisegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horario', + currentText: 'Agora', + closeText: 'Pechar', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-he.js -/* Hebrew translation for the jQuery Timepicker Addon */ -/* Written by Lior Lapid */ - - $.timepicker.regional["he"] = { - timeOnlyTitle: "בחירת זמן", - timeText: "שעה", - hourText: "שעות", - minuteText: "דקות", - secondText: "שניות", - millisecText: "אלפית השנייה", - microsecText: "מיקרו", - timezoneText: "אזור זמן", - currentText: "עכשיו", - closeText:"סגור", - timeFormat: "HH:mm", - timeSuffix: '', - amNames: ['לפנה"צ', 'AM', 'A'], - pmNames: ['אחה"צ', 'PM', 'P'], - isRTL: true +/* Hebrew translation for the jQuery Timepicker Addon */ +/* Written by Lior Lapid */ + + $.timepicker.regional["he"] = { + timeOnlyTitle: "בחירת זמן", + timeText: "שעה", + hourText: "שעות", + minuteText: "דקות", + secondText: "שניות", + millisecText: "אלפית השנייה", + microsecText: "מיקרו", + timezoneText: "אזור זמן", + currentText: "עכשיו", + closeText:"סגור", + timeFormat: "HH:mm", + timeSuffix: '', + amNames: ['לפנה"צ', 'AM', 'A'], + pmNames: ['אחה"צ', 'PM', 'P'], + isRTL: true }; - + // source: src/i18n/jquery-ui-timepicker-hr.js -/* Croatian translation for the jQuery Timepicker Addon */ -/* Written by Mladen */ - - $.timepicker.regional['hr'] = { - timeOnlyTitle: 'Odaberi vrijeme', - timeText: 'Vrijeme', - hourText: 'Sati', - minuteText: 'Minute', - secondText: 'Sekunde', - millisecText: 'Milisekunde', - microsecText: 'Mikrosekunde', - timezoneText: 'Vremenska zona', - currentText: 'Sada', - closeText: 'Gotovo', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - isRTL: false +/* Croatian translation for the jQuery Timepicker Addon */ +/* Written by Mladen */ + + $.timepicker.regional['hr'] = { + timeOnlyTitle: 'Odaberi vrijeme', + timeText: 'Vrijeme', + hourText: 'Sati', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Vremenska zona', + currentText: 'Sada', + closeText: 'Gotovo', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-hu.js -/* Hungarian translation for the jQuery Timepicker Addon */ -/* Written by Vas Gábor */ - - $.timepicker.regional['hu'] = { - timeOnlyTitle: 'Válasszon időpontot', - timeText: 'Idő', - hourText: 'Óra', - minuteText: 'Perc', - secondText: 'Másodperc', - millisecText: 'Milliszekundumos', - microsecText: 'Ezredmásodperc', - timezoneText: 'Időzóna', - currentText: 'Most', - closeText: 'Kész', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['de.', 'AM', 'A'], - pmNames: ['du.', 'PM', 'P'], - isRTL: false +/* Hungarian translation for the jQuery Timepicker Addon */ +/* Written by Vas Gábor */ + + $.timepicker.regional['hu'] = { + timeOnlyTitle: 'Válasszon időpontot', + timeText: 'Idő', + hourText: 'Óra', + minuteText: 'Perc', + secondText: 'Másodperc', + millisecText: 'Milliszekundumos', + microsecText: 'Ezredmásodperc', + timezoneText: 'Időzóna', + currentText: 'Most', + closeText: 'Kész', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['de.', 'AM', 'A'], + pmNames: ['du.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-id.js -/* Indonesian translation for the jQuery Timepicker Addon */ -/* Written by Nia */ - - $.timepicker.regional['id'] = { - timeOnlyTitle: 'Pilih Waktu', - timeText: 'Waktu', - hourText: 'Pukul', - minuteText: 'Menit', - secondText: 'Detik', - millisecText: 'Milidetik', - microsecText: 'Mikrodetik', - timezoneText: 'Zona Waktu', - currentText: 'Sekarang', - closeText: 'OK', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Indonesian translation for the jQuery Timepicker Addon */ +/* Written by Nia */ + + $.timepicker.regional['id'] = { + timeOnlyTitle: 'Pilih Waktu', + timeText: 'Waktu', + hourText: 'Pukul', + minuteText: 'Menit', + secondText: 'Detik', + millisecText: 'Milidetik', + microsecText: 'Mikrodetik', + timezoneText: 'Zona Waktu', + currentText: 'Sekarang', + closeText: 'OK', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-it.js -/* Italian translation for the jQuery Timepicker Addon */ -/* Written by Marco "logicoder" Del Tongo */ - - $.timepicker.regional['it'] = { - timeOnlyTitle: 'Scegli orario', - timeText: 'Orario', - hourText: 'Ora', - minuteText: 'Minuti', - secondText: 'Secondi', - millisecText: 'Millisecondi', - microsecText: 'Microsecondi', - timezoneText: 'Fuso orario', - currentText: 'Adesso', - closeText: 'Chiudi', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['m.', 'AM', 'A'], - pmNames: ['p.', 'PM', 'P'], - isRTL: false +/* Italian translation for the jQuery Timepicker Addon */ +/* Written by Marco "logicoder" Del Tongo */ + + $.timepicker.regional['it'] = { + timeOnlyTitle: 'Scegli orario', + timeText: 'Orario', + hourText: 'Ora', + minuteText: 'Minuti', + secondText: 'Secondi', + millisecText: 'Millisecondi', + microsecText: 'Microsecondi', + timezoneText: 'Fuso orario', + currentText: 'Adesso', + closeText: 'Chiudi', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['m.', 'AM', 'A'], + pmNames: ['p.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-ja.js -/* Japanese translation for the jQuery Timepicker Addon */ -/* Written by Jun Omae */ - - $.timepicker.regional['ja'] = { - timeOnlyTitle: '時間を選択', - timeText: '時間', - hourText: '時', - minuteText: '分', - secondText: '秒', - millisecText: 'ミリ秒', - microsecText: 'マイクロ秒', - timezoneText: 'タイムゾーン', - currentText: '現時刻', - closeText: '閉じる', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['午前', 'AM', 'A'], - pmNames: ['午後', 'PM', 'P'], - isRTL: false +/* Japanese translation for the jQuery Timepicker Addon */ +/* Written by Jun Omae */ + + $.timepicker.regional['ja'] = { + timeOnlyTitle: '時間を選択', + timeText: '時間', + hourText: '時', + minuteText: '分', + secondText: '秒', + millisecText: 'ミリ秒', + microsecText: 'マイクロ秒', + timezoneText: 'タイムゾーン', + currentText: '現時刻', + closeText: '閉じる', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['午前', 'AM', 'A'], + pmNames: ['午後', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-ko.js -/* Korean translation for the jQuery Timepicker Addon */ -/* Written by Genie */ - - $.timepicker.regional['ko'] = { - timeOnlyTitle: '시간 선택', - timeText: '시간', - hourText: '시', - minuteText: '분', - secondText: '초', - millisecText: '밀리초', - microsecText: '마이크로', - timezoneText: '표준 시간대', - currentText: '현재 시각', - closeText: '닫기', - timeFormat: 'tt h:mm', - timeSuffix: '', - amNames: ['오전', 'AM', 'A'], - pmNames: ['오후', 'PM', 'P'], - isRTL: false +/* Korean translation for the jQuery Timepicker Addon */ +/* Written by Genie */ + + $.timepicker.regional['ko'] = { + timeOnlyTitle: '시간 선택', + timeText: '시간', + hourText: '시', + minuteText: '분', + secondText: '초', + millisecText: '밀리초', + microsecText: '마이크로', + timezoneText: '표준 시간대', + currentText: '현재 시각', + closeText: '닫기', + timeFormat: 'tt h:mm', + timeSuffix: '', + amNames: ['오전', 'AM', 'A'], + pmNames: ['오후', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-lt.js -/* Lithuanian translation for the jQuery Timepicker Addon */ -/* Written by Irmantas Šiupšinskas */ - - $.timepicker.regional['lt'] = { - timeOnlyTitle: 'Pasirinkite laiką', - timeText: 'Laikas', - hourText: 'Valandos', - minuteText: 'Minutės', - secondText: 'Sekundės', - millisecText: 'Milisekundės', - microsecText: 'Mikrosekundės', - timezoneText: 'Laiko zona', - currentText: 'Dabar', - closeText: 'Uždaryti', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['priešpiet', 'AM', 'A'], - pmNames: ['popiet', 'PM', 'P'], - isRTL: false +/* Lithuanian translation for the jQuery Timepicker Addon */ +/* Written by Irmantas Šiupšinskas */ + + $.timepicker.regional['lt'] = { + timeOnlyTitle: 'Pasirinkite laiką', + timeText: 'Laikas', + hourText: 'Valandos', + minuteText: 'Minutės', + secondText: 'Sekundės', + millisecText: 'Milisekundės', + microsecText: 'Mikrosekundės', + timezoneText: 'Laiko zona', + currentText: 'Dabar', + closeText: 'Uždaryti', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['priešpiet', 'AM', 'A'], + pmNames: ['popiet', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-lv.js -/* Latvian translation for the jQuery Timepicker Addon */ -/* Written by Dmitry Bogatykh */ - - $.timepicker.regional['lv'] = { - timeOnlyTitle: 'Ievadiet laiku', - timeText: 'Laiks', - hourText: 'Stundas', - minuteText: 'Minūtes', - secondText: 'Sekundes', - millisecText: 'Milisekundes', - microsecText: 'Mikrosekundes', - timezoneText: 'Laika josla', - currentText: 'Tagad', - closeText: 'Aizvērt', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'AM', 'A'], - pmNames: ['PM', 'PM', 'P'], - isRTL: false +/* Latvian translation for the jQuery Timepicker Addon */ +/* Written by Dmitry Bogatykh */ + + $.timepicker.regional['lv'] = { + timeOnlyTitle: 'Ievadiet laiku', + timeText: 'Laiks', + hourText: 'Stundas', + minuteText: 'Minūtes', + secondText: 'Sekundes', + millisecText: 'Milisekundes', + microsecText: 'Mikrosekundes', + timezoneText: 'Laika josla', + currentText: 'Tagad', + closeText: 'Aizvērt', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'AM', 'A'], + pmNames: ['PM', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-mk.js -/* Macedonian cyrilic translation for the jQuery Timepicker Addon */ -/* Written by Vlatko Ristovski */ - - $.timepicker.regional['mk'] = { - timeOnlyTitle: 'Одберете време', - timeText: 'Време', - hourText: 'Час', - minuteText: 'Минути', - secondText: 'Секунди', - millisecText: 'Милисекунди', - microsecText: 'Микросекунди', - timezoneText: 'Временска зона', - currentText: 'Сега', - closeText: 'Затвори', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Macedonian cyrilic translation for the jQuery Timepicker Addon */ +/* Written by Vlatko Ristovski */ + + $.timepicker.regional['mk'] = { + timeOnlyTitle: 'Одберете време', + timeText: 'Време', + hourText: 'Час', + minuteText: 'Минути', + secondText: 'Секунди', + millisecText: 'Милисекунди', + microsecText: 'Микросекунди', + timezoneText: 'Временска зона', + currentText: 'Сега', + closeText: 'Затвори', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-nl.js -/* Dutch translation for the jQuery Timepicker Addon */ -/* Written by Martijn van der Lee */ - - $.timepicker.regional['nl'] = { - timeOnlyTitle: 'Tijdstip', - timeText: 'Tijd', - hourText: 'Uur', - minuteText: 'Minuut', - secondText: 'Seconde', - millisecText: 'Milliseconde', - microsecText: 'Microseconde', - timezoneText: 'Tijdzone', - currentText: 'Vandaag', - closeText: 'Sluiten', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Dutch translation for the jQuery Timepicker Addon */ +/* Written by Martijn van der Lee */ + + $.timepicker.regional['nl'] = { + timeOnlyTitle: 'Tijdstip', + timeText: 'Tijd', + hourText: 'Uur', + minuteText: 'Minuut', + secondText: 'Seconde', + millisecText: 'Milliseconde', + microsecText: 'Microseconde', + timezoneText: 'Tijdzone', + currentText: 'Nu', + closeText: 'Sluiten', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-no.js -/* Norwegian translation for the jQuery Timepicker Addon */ -/* Written by Morten Hauan (http://hauan.me) */ - - $.timepicker.regional['no'] = { - timeOnlyTitle: 'Velg tid', - timeText: 'Tid', - hourText: 'Time', - minuteText: 'Minutt', - secondText: 'Sekund', - millisecText: 'Millisekund', - microsecText: 'mikrosekund', - timezoneText: 'Tidssone', - currentText: 'Nå', - closeText: 'Lukk', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['am', 'AM', 'A'], - pmNames: ['pm', 'PM', 'P'], - isRTL: false +/* Norwegian translation for the jQuery Timepicker Addon */ +/* Written by Morten Hauan (http://hauan.me) */ + + $.timepicker.regional['no'] = { + timeOnlyTitle: 'Velg tid', + timeText: 'Tid', + hourText: 'Time', + minuteText: 'Minutt', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'mikrosekund', + timezoneText: 'Tidssone', + currentText: 'Nå', + closeText: 'Lukk', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-pl.js -/* Polish translation for the jQuery Timepicker Addon */ -/* Written by Michał Pena */ - - $.timepicker.regional['pl'] = { - timeOnlyTitle: 'Wybierz godzinę', - timeText: 'Czas', - hourText: 'Godzina', - minuteText: 'Minuta', - secondText: 'Sekunda', - millisecText: 'Milisekunda', - microsecText: 'Mikrosekunda', - timezoneText: 'Strefa czasowa', - currentText: 'Teraz', - closeText: 'Gotowe', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Polish translation for the jQuery Timepicker Addon */ +/* Written by Michał Pena */ + + $.timepicker.regional['pl'] = { + timeOnlyTitle: 'Wybierz godzinę', + timeText: 'Czas', + hourText: 'Godzina', + minuteText: 'Minuta', + secondText: 'Sekunda', + millisecText: 'Milisekunda', + microsecText: 'Mikrosekunda', + timezoneText: 'Strefa czasowa', + currentText: 'Teraz', + closeText: 'Gotowe', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-pt-BR.js -/* Brazilian Portuguese translation for the jQuery Timepicker Addon */ -/* Written by Diogo Damiani (diogodamiani@gmail.com) */ - - $.timepicker.regional['pt-BR'] = { - timeOnlyTitle: 'Escolha o horário', - timeText: 'Horário', - hourText: 'Hora', - minuteText: 'Minutos', - secondText: 'Segundos', - millisecText: 'Milissegundos', - microsecText: 'Microssegundos', - timezoneText: 'Fuso horário', - currentText: 'Agora', - closeText: 'Fechar', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - isRTL: false +/* Brazilian Portuguese translation for the jQuery Timepicker Addon */ +/* Written by Diogo Damiani (diogodamiani@gmail.com) */ + + $.timepicker.regional['pt-BR'] = { + timeOnlyTitle: 'Escolha o horário', + timeText: 'Horário', + hourText: 'Hora', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milissegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horário', + currentText: 'Agora', + closeText: 'Fechar', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-pt.js -/* Portuguese translation for the jQuery Timepicker Addon */ -/* Written by Luan Almeida */ - - $.timepicker.regional['pt'] = { - timeOnlyTitle: 'Escolha uma hora', - timeText: 'Hora', - hourText: 'Horas', - minuteText: 'Minutos', - secondText: 'Segundos', - millisecText: 'Milissegundos', - microsecText: 'Microssegundos', - timezoneText: 'Fuso horário', - currentText: 'Agora', - closeText: 'Fechar', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - isRTL: false +/* Portuguese translation for the jQuery Timepicker Addon */ +/* Written by Luan Almeida */ + + $.timepicker.regional['pt'] = { + timeOnlyTitle: 'Escolha uma hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milissegundos', + microsecText: 'Microssegundos', + timezoneText: 'Fuso horário', + currentText: 'Agora', + closeText: 'Fechar', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-ro.js -/* Romanian translation for the jQuery Timepicker Addon */ -/* Written by Romeo Adrian Cioaba */ - - $.timepicker.regional['ro'] = { - timeOnlyTitle: 'Alegeţi o oră', - timeText: 'Timp', - hourText: 'Ore', - minuteText: 'Minute', - secondText: 'Secunde', - millisecText: 'Milisecunde', - microsecText: 'Microsecunde', - timezoneText: 'Fus orar', - currentText: 'Acum', - closeText: 'Închide', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Romanian translation for the jQuery Timepicker Addon */ +/* Written by Romeo Adrian Cioaba */ + + $.timepicker.regional['ro'] = { + timeOnlyTitle: 'Alegeţi o oră', + timeText: 'Timp', + hourText: 'Ore', + minuteText: 'Minute', + secondText: 'Secunde', + millisecText: 'Milisecunde', + microsecText: 'Microsecunde', + timezoneText: 'Fus orar', + currentText: 'Acum', + closeText: 'Închide', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-ru.js -/* Russian translation for the jQuery Timepicker Addon */ -/* Written by Trent Richardson */ - - $.timepicker.regional['ru'] = { - timeOnlyTitle: 'Выберите время', - timeText: 'Время', - hourText: 'Часы', - minuteText: 'Минуты', - secondText: 'Секунды', - millisecText: 'Миллисекунды', - microsecText: 'Микросекунды', - timezoneText: 'Часовой пояс', - currentText: 'Сейчас', - closeText: 'Закрыть', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Russian translation for the jQuery Timepicker Addon */ +/* Written by Trent Richardson */ + + $.timepicker.regional['ru'] = { + timeOnlyTitle: 'Выберите время', + timeText: 'Время', + hourText: 'Часы', + minuteText: 'Минуты', + secondText: 'Секунды', + millisecText: 'Миллисекунды', + microsecText: 'Микросекунды', + timezoneText: 'Часовой пояс', + currentText: 'Сейчас', + closeText: 'Закрыть', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-sk.js -/* Slovak translation for the jQuery Timepicker Addon */ -/* Written by David Vallner */ - - $.timepicker.regional['sk'] = { - timeOnlyTitle: 'Zvoľte čas', - timeText: 'Čas', - hourText: 'Hodiny', - minuteText: 'Minúty', - secondText: 'Sekundy', - millisecText: 'Milisekundy', - microsecText: 'Mikrosekundy', - timezoneText: 'Časové pásmo', - currentText: 'Teraz', - closeText: 'Zavrieť', - timeFormat: 'H:m', - timeSuffix: '', - amNames: ['dop.', 'AM', 'A'], - pmNames: ['pop.', 'PM', 'P'], - isRTL: false +/* Slovak translation for the jQuery Timepicker Addon */ +/* Written by David Vallner */ + + $.timepicker.regional['sk'] = { + timeOnlyTitle: 'Zvoľte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minúty', + secondText: 'Sekundy', + millisecText: 'Milisekundy', + microsecText: 'Mikrosekundy', + timezoneText: 'Časové pásmo', + currentText: 'Teraz', + closeText: 'Zavrieť', + timeFormat: 'H:m', + timeSuffix: '', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['pop.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-sl.js -/* Slovenian translation for the jQuery Timepicker Addon */ -/* Written by Hadalin (https://github.com/hadalin) */ - - $.timepicker.regional['sl'] = { - timeOnlyTitle: 'Izberite čas', - timeText: 'Čas', - hourText: 'Ura', - minuteText: 'Minute', - secondText: 'Sekunde', - millisecText: 'Milisekunde', - microsecText: 'Mikrosekunde', - timezoneText: 'Časovni pas', - currentText: 'Sedaj', - closeText: 'Zapri', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['dop.', 'AM', 'A'], - pmNames: ['pop.', 'PM', 'P'], - isRTL: false +/* Slovenian translation for the jQuery Timepicker Addon */ +/* Written by Hadalin (https://github.com/hadalin) */ + + $.timepicker.regional['sl'] = { + timeOnlyTitle: 'Izberite čas', + timeText: 'Čas', + hourText: 'Ura', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Časovni pas', + currentText: 'Sedaj', + closeText: 'Zapri', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['pop.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-sq.js -/* Albanian translation for the jQuery Timepicker Addon */ -/* Written by Olti Buzi */ - - $.timepicker.regional['sq'] = { - timeOnlyTitle: 'Zgjidh orarin', - timeText: 'Orari', - hourText: 'Ora', - minuteText: 'Minuta', - secondText: 'Sekonda', - millisecText: 'Minisekonda', - microsecText: 'Mikrosekonda', - timezoneText: 'Zona kohore', - currentText: 'Tani', - closeText: 'Mbyll', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['m.', 'AM', 'A'], - pmNames: ['p.', 'PM', 'P'], - isRTL: false +/* Albanian translation for the jQuery Timepicker Addon */ +/* Written by Olti Buzi */ + + $.timepicker.regional['sq'] = { + timeOnlyTitle: 'Zgjidh orarin', + timeText: 'Orari', + hourText: 'Ora', + minuteText: 'Minuta', + secondText: 'Sekonda', + millisecText: 'Minisekonda', + microsecText: 'Mikrosekonda', + timezoneText: 'Zona kohore', + currentText: 'Tani', + closeText: 'Mbyll', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['m.', 'AM', 'A'], + pmNames: ['p.', 'PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-sr-RS.js -/* Serbian cyrilic translation for the jQuery Timepicker Addon */ -/* Written by Vladimir Jelovac */ - - $.timepicker.regional['sr-RS'] = { - timeOnlyTitle: 'Одаберите време', - timeText: 'Време', - hourText: 'Сати', - minuteText: 'Минути', - secondText: 'Секунде', - millisecText: 'Милисекунде', - microsecText: 'Микросекунде', - timezoneText: 'Временска зона', - currentText: 'Сада', - closeText: 'Затвори', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Serbian cyrilic translation for the jQuery Timepicker Addon */ +/* Written by Vladimir Jelovac */ + + $.timepicker.regional['sr-RS'] = { + timeOnlyTitle: 'Одаберите време', + timeText: 'Време', + hourText: 'Сати', + minuteText: 'Минути', + secondText: 'Секунде', + millisecText: 'Милисекунде', + microsecText: 'Микросекунде', + timezoneText: 'Временска зона', + currentText: 'Сада', + closeText: 'Затвори', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-sr-YU.js -/* Serbian latin translation for the jQuery Timepicker Addon */ -/* Written by Vladimir Jelovac */ - - $.timepicker.regional['sr-YU'] = { - timeOnlyTitle: 'Odaberite vreme', - timeText: 'Vreme', - hourText: 'Sati', - minuteText: 'Minuti', - secondText: 'Sekunde', - millisecText: 'Milisekunde', - microsecText: 'Mikrosekunde', - timezoneText: 'Vremenska zona', - currentText: 'Sada', - closeText: 'Zatvori', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Serbian latin translation for the jQuery Timepicker Addon */ +/* Written by Vladimir Jelovac */ + + $.timepicker.regional['sr-YU'] = { + timeOnlyTitle: 'Odaberite vreme', + timeText: 'Vreme', + hourText: 'Sati', + minuteText: 'Minuti', + secondText: 'Sekunde', + millisecText: 'Milisekunde', + microsecText: 'Mikrosekunde', + timezoneText: 'Vremenska zona', + currentText: 'Sada', + closeText: 'Zatvori', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-sv.js -/* Swedish translation for the jQuery Timepicker Addon */ -/* Written by Nevon */ - - $.timepicker.regional['sv'] = { - timeOnlyTitle: 'Välj en tid', - timeText: 'Tid', - hourText: 'Timme', - minuteText: 'Minut', - secondText: 'Sekund', - millisecText: 'Millisekund', - microsecText: 'Mikrosekund', - timezoneText: 'Tidszon', - currentText: 'Nu', - closeText: 'Stäng', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Swedish translation for the jQuery Timepicker Addon */ +/* Written by Nevon */ + + $.timepicker.regional['sv'] = { + timeOnlyTitle: 'Välj en tid', + timeText: 'Tid', + hourText: 'Timme', + minuteText: 'Minut', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'Mikrosekund', + timezoneText: 'Tidszon', + currentText: 'Nu', + closeText: 'Stäng', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-th.js -/* Thai translation for the jQuery Timepicker Addon */ -/* Written by Yote Wachirapornpongsa */ - - $.timepicker.regional['th'] = { - timeOnlyTitle: 'เลือกเวลา', - timeText: 'เวลา ', - hourText: 'ชั่วโมง ', - minuteText: 'นาที', - secondText: 'วินาที', - millisecText: 'มิลลิวินาที', - microsecText: 'ไมโคริวินาที', - timezoneText: 'เขตเวลา', - currentText: 'เวลาปัจจุบัน', - closeText: 'ปิด', - timeFormat: 'hh:mm tt', - timeSuffix: '' +/* Thai translation for the jQuery Timepicker Addon */ +/* Written by Yote Wachirapornpongsa */ + + $.timepicker.regional['th'] = { + timeOnlyTitle: 'เลือกเวลา', + timeText: 'เวลา ', + hourText: 'ชั่วโมง ', + minuteText: 'นาที', + secondText: 'วินาที', + millisecText: 'มิลลิวินาที', + microsecText: 'ไมโคริวินาที', + timezoneText: 'เขตเวลา', + currentText: 'เวลาปัจจุบัน', + closeText: 'ปิด', + timeFormat: 'hh:mm tt', + timeSuffix: '' }; - + // source: src/i18n/jquery-ui-timepicker-tr.js -/* Turkish translation for the jQuery Timepicker Addon */ -/* Written by Fehmi Can Saglam, Edited by Goktug Ozturk */ - - $.timepicker.regional['tr'] = { - timeOnlyTitle: 'Zaman Seçiniz', - timeText: 'Zaman', - hourText: 'Saat', - minuteText: 'Dakika', - secondText: 'Saniye', - millisecText: 'Milisaniye', - microsecText: 'Mikrosaniye', - timezoneText: 'Zaman Dilimi', - currentText: 'Şu an', - closeText: 'Tamam', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['ÖÖ', 'Ö'], - pmNames: ['ÖS', 'S'], - isRTL: false +/* Turkish translation for the jQuery Timepicker Addon */ +/* Written by Fehmi Can Saglam, Edited by Goktug Ozturk */ + + $.timepicker.regional['tr'] = { + timeOnlyTitle: 'Zaman Seçiniz', + timeText: 'Zaman', + hourText: 'Saat', + minuteText: 'Dakika', + secondText: 'Saniye', + millisecText: 'Milisaniye', + microsecText: 'Mikrosaniye', + timezoneText: 'Zaman Dilimi', + currentText: 'Şu an', + closeText: 'Tamam', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['ÖÖ', 'Ö'], + pmNames: ['ÖS', 'S'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-uk.js -/* Ukrainian translation for the jQuery Timepicker Addon */ -/* Written by Sergey Noskov */ - - $.timepicker.regional['uk'] = { - timeOnlyTitle: 'Виберіть час', - timeText: 'Час', - hourText: 'Години', - minuteText: 'Хвилини', - secondText: 'Секунди', - millisecText: 'Мілісекунди', - microsecText: 'Мікросекунди', - timezoneText: 'Часовий пояс', - currentText: 'Зараз', - closeText: 'Закрити', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Ukrainian translation for the jQuery Timepicker Addon */ +/* Written by Sergey Noskov */ + + $.timepicker.regional['uk'] = { + timeOnlyTitle: 'Виберіть час', + timeText: 'Час', + hourText: 'Години', + minuteText: 'Хвилини', + secondText: 'Секунди', + millisecText: 'Мілісекунди', + microsecText: 'Мікросекунди', + timezoneText: 'Часовий пояс', + currentText: 'Зараз', + closeText: 'Закрити', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-vi.js -/* Vietnamese translation for the jQuery Timepicker Addon */ -/* Written by Nguyen Dinh Trung */ - - $.timepicker.regional['vi'] = { - timeOnlyTitle: 'Chọn giờ', - timeText: 'Thời gian', - hourText: 'Giờ', - minuteText: 'Phút', - secondText: 'Giây', - millisecText: 'Mili giây', - microsecText: 'Micrô giây', - timezoneText: 'Múi giờ', - currentText: 'Hiện thời', - closeText: 'Đóng', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['SA', 'S'], - pmNames: ['CH', 'C'], - isRTL: false +/* Vietnamese translation for the jQuery Timepicker Addon */ +/* Written by Nguyen Dinh Trung */ + + $.timepicker.regional['vi'] = { + timeOnlyTitle: 'Chọn giờ', + timeText: 'Thời gian', + hourText: 'Giờ', + minuteText: 'Phút', + secondText: 'Giây', + millisecText: 'Mili giây', + microsecText: 'Micrô giây', + timezoneText: 'Múi giờ', + currentText: 'Hiện thời', + closeText: 'Đóng', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['SA', 'S'], + pmNames: ['CH', 'C'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-zh-CN.js -/* Simplified Chinese translation for the jQuery Timepicker Addon / -/ Written by Will Lu */ - - $.timepicker.regional['zh-CN'] = { - timeOnlyTitle: '选择时间', - timeText: '时间', - hourText: '小时', - minuteText: '分钟', - secondText: '秒钟', - millisecText: '毫秒', - microsecText: '微秒', - timezoneText: '时区', - currentText: '现在时间', - closeText: '关闭', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - isRTL: false +/* Simplified Chinese translation for the jQuery Timepicker Addon / +/ Written by Will Lu */ + + $.timepicker.regional['zh-CN'] = { + timeOnlyTitle: '选择时间', + timeText: '时间', + hourText: '小时', + minuteText: '分钟', + secondText: '秒钟', + millisecText: '毫秒', + microsecText: '微秒', + timezoneText: '时区', + currentText: '现在时间', + closeText: '关闭', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false }; - + // source: src/i18n/jquery-ui-timepicker-zh-TW.js -/* Chinese translation for the jQuery Timepicker Addon */ -/* Written by Alang.lin */ - - $.timepicker.regional['zh-TW'] = { - timeOnlyTitle: '選擇時分秒', - timeText: '時間', - hourText: '時', - minuteText: '分', - secondText: '秒', - millisecText: '毫秒', - microsecText: '微秒', - timezoneText: '時區', - currentText: '現在時間', - closeText: '確定', - timeFormat: 'HH:mm', - timeSuffix: '', - amNames: ['上午', 'AM', 'A'], - pmNames: ['下午', 'PM', 'P'], - isRTL: false +/* Chinese translation for the jQuery Timepicker Addon */ +/* Written by Alang.lin */ + + $.timepicker.regional['zh-TW'] = { + timeOnlyTitle: '選擇時分秒', + timeText: '時間', + hourText: '時', + minuteText: '分', + secondText: '秒', + millisecText: '毫秒', + microsecText: '微秒', + timezoneText: '時區', + currentText: '現在時間', + closeText: '確定', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['上午', 'AM', 'A'], + pmNames: ['下午', 'PM', 'P'], + isRTL: false }; - -})(jQuery); + +})(jQuery); diff --git a/dist/i18n/jquery-ui-timepicker-addon-i18n.min.js b/dist/i18n/jquery-ui-timepicker-addon-i18n.min.js index 0f6f4be..bd4deb4 100644 --- a/dist/i18n/jquery-ui-timepicker-addon-i18n.min.js +++ b/dist/i18n/jquery-ui-timepicker-addon-i18n.min.js @@ -1,4 +1,4 @@ -/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20 +/*! jQuery Timepicker Addon - v1.6.4 - 2017-02-08 * http://trentrichardson.com/examples/timepicker -* Copyright (c) 2016 Trent Richardson; Licensed MIT */ -!function(a){a.timepicker.regional.af={timeOnlyTitle:"Kies Tyd",timeText:"Tyd ",hourText:"Ure ",minuteText:"Minute",secondText:"Sekondes",millisecText:"Millisekondes",microsecText:"Mikrosekondes",timezoneText:"Tydsone",currentText:"Huidige Tyd",closeText:"Klaar",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.am={timeOnlyTitle:"Ընտրեք ժամանակը",timeText:"Ժամանակը",hourText:"Ժամ",minuteText:"Րոպե",secondText:"Վարկյան",millisecText:"Միլիվարկյան",microsecText:"Միկրովարկյան",timezoneText:"Ժամային գոտին",currentText:"Այժմ",closeText:"Փակել",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.bg={timeOnlyTitle:"Изберете време",timeText:"Време",hourText:"Час",minuteText:"Минути",secondText:"Секунди",millisecText:"Милисекунди",microsecText:"Микросекунди",timezoneText:"Часови пояс",currentText:"Сега",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.ca={timeOnlyTitle:"Escollir una hora",timeText:"Hora",hourText:"Hores",minuteText:"Minuts",secondText:"Segons",millisecText:"Milisegons",microsecText:"Microsegons",timezoneText:"Fus horari",currentText:"Ara",closeText:"Tancar",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.cs={timeOnlyTitle:"Vyberte čas",timeText:"Čas",hourText:"Hodiny",minuteText:"Minuty",secondText:"Vteřiny",millisecText:"Milisekundy",microsecText:"Mikrosekundy",timezoneText:"Časové pásmo",currentText:"Nyní",closeText:"Zavřít",timeFormat:"HH:mm",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["odp.","PM","P"],isRTL:!1},a.timepicker.regional.da={timeOnlyTitle:"Vælg tid",timeText:"Tid",hourText:"Time",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tidszone",currentText:"Nu",closeText:"Luk",timeFormat:"HH:mm",timeSuffix:"",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},a.timepicker.regional.de={timeOnlyTitle:"Zeit wählen",timeText:"Zeit",hourText:"Stunde",minuteText:"Minute",secondText:"Sekunde",millisecText:"Millisekunde",microsecText:"Mikrosekunde",timezoneText:"Zeitzone",currentText:"Jetzt",closeText:"Fertig",timeFormat:"HH:mm",timeSuffix:"",amNames:["vorm.","AM","A"],pmNames:["nachm.","PM","P"],isRTL:!1},a.timepicker.regional.el={timeOnlyTitle:"Επιλογή ώρας",timeText:"Ώρα",hourText:"Ώρες",minuteText:"Λεπτά",secondText:"Δευτερόλεπτα",millisecText:"Χιλιοστοδευτερόλεπτα",microsecText:"Μικροδευτερόλεπτα",timezoneText:"Ζώνη ώρας",currentText:"Τώρα",closeText:"Κλείσιμο",timeFormat:"HH:mm",timeSuffix:"",amNames:["π.μ.","AM","A"],pmNames:["μ.μ.","PM","P"],isRTL:!1},a.timepicker.regional.es={timeOnlyTitle:"Elegir una hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milisegundos",microsecText:"Microsegundos",timezoneText:"Uso horario",currentText:"Hoy",closeText:"Cerrar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.et={timeOnlyTitle:"Vali aeg",timeText:"Aeg",hourText:"Tund",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekundis",microsecText:"Mikrosekundis",timezoneText:"Ajavöönd",currentText:"Praegu",closeText:"Valmis",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.eu={timeOnlyTitle:"Aukeratu ordua",timeText:"Ordua",hourText:"Orduak",minuteText:"Minutuak",secondText:"Segundoak",millisecText:"Milisegundoak",microsecText:"Mikrosegundoak",timezoneText:"Ordu-eremua",currentText:"Orain",closeText:"Itxi",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.fa={timeOnlyTitle:"انتخاب زمان",timeText:"زمان",hourText:"ساعت",minuteText:"دقیقه",secondText:"ثانیه",millisecText:"میلی ثانیه",microsecText:"میکرو ثانیه",timezoneText:"منطقه زمانی",currentText:"الان",closeText:"انتخاب",timeFormat:"HH:mm",timeSuffix:"",amNames:["قبل ظهر","AM","A"],pmNames:["بعد ظهر","PM","P"],isRTL:!0},a.timepicker.regional.fi={timeOnlyTitle:"Valitse aika",timeText:"Aika",hourText:"Tunti",minuteText:"Minuutti",secondText:"Sekunti",millisecText:"Millisekunnin",microsecText:"Mikrosekuntia",timezoneText:"Aikavyöhyke",currentText:"Nyt",closeText:"Sulje",timeFormat:"HH:mm",timeSuffix:"",amNames:["ap.","AM","A"],pmNames:["ip.","PM","P"],isRTL:!1},a.timepicker.regional.fr={timeOnlyTitle:"Choisir une heure",timeText:"Heure",hourText:"Heures",minuteText:"Minutes",secondText:"Secondes",millisecText:"Millisecondes",microsecText:"Microsecondes",timezoneText:"Fuseau horaire",currentText:"Maintenant",closeText:"Terminé",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.gl={timeOnlyTitle:"Elixir unha hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milisegundos",microsecText:"Microssegundos",timezoneText:"Fuso horario",currentText:"Agora",closeText:"Pechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.he={timeOnlyTitle:"בחירת זמן",timeText:"שעה",hourText:"שעות",minuteText:"דקות",secondText:"שניות",millisecText:"אלפית השנייה",microsecText:"מיקרו",timezoneText:"אזור זמן",currentText:"עכשיו",closeText:"סגור",timeFormat:"HH:mm",timeSuffix:"",amNames:['לפנה"צ',"AM","A"],pmNames:['אחה"צ',"PM","P"],isRTL:!0},a.timepicker.regional.hr={timeOnlyTitle:"Odaberi vrijeme",timeText:"Vrijeme",hourText:"Sati",minuteText:"Minute",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Vremenska zona",currentText:"Sada",closeText:"Gotovo",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.hu={timeOnlyTitle:"Válasszon időpontot",timeText:"Idő",hourText:"Óra",minuteText:"Perc",secondText:"Másodperc",millisecText:"Milliszekundumos",microsecText:"Ezredmásodperc",timezoneText:"Időzóna",currentText:"Most",closeText:"Kész",timeFormat:"HH:mm",timeSuffix:"",amNames:["de.","AM","A"],pmNames:["du.","PM","P"],isRTL:!1},a.timepicker.regional.id={timeOnlyTitle:"Pilih Waktu",timeText:"Waktu",hourText:"Pukul",minuteText:"Menit",secondText:"Detik",millisecText:"Milidetik",microsecText:"Mikrodetik",timezoneText:"Zona Waktu",currentText:"Sekarang",closeText:"OK",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.it={timeOnlyTitle:"Scegli orario",timeText:"Orario",hourText:"Ora",minuteText:"Minuti",secondText:"Secondi",millisecText:"Millisecondi",microsecText:"Microsecondi",timezoneText:"Fuso orario",currentText:"Adesso",closeText:"Chiudi",timeFormat:"HH:mm",timeSuffix:"",amNames:["m.","AM","A"],pmNames:["p.","PM","P"],isRTL:!1},a.timepicker.regional.ja={timeOnlyTitle:"時間を選択",timeText:"時間",hourText:"時",minuteText:"分",secondText:"秒",millisecText:"ミリ秒",microsecText:"マイクロ秒",timezoneText:"タイムゾーン",currentText:"現時刻",closeText:"閉じる",timeFormat:"HH:mm",timeSuffix:"",amNames:["午前","AM","A"],pmNames:["午後","PM","P"],isRTL:!1},a.timepicker.regional.ko={timeOnlyTitle:"시간 선택",timeText:"시간",hourText:"시",minuteText:"분",secondText:"초",millisecText:"밀리초",microsecText:"마이크로",timezoneText:"표준 시간대",currentText:"현재 시각",closeText:"닫기",timeFormat:"tt h:mm",timeSuffix:"",amNames:["오전","AM","A"],pmNames:["오후","PM","P"],isRTL:!1},a.timepicker.regional.lt={timeOnlyTitle:"Pasirinkite laiką",timeText:"Laikas",hourText:"Valandos",minuteText:"Minutės",secondText:"Sekundės",millisecText:"Milisekundės",microsecText:"Mikrosekundės",timezoneText:"Laiko zona",currentText:"Dabar",closeText:"Uždaryti",timeFormat:"HH:mm",timeSuffix:"",amNames:["priešpiet","AM","A"],pmNames:["popiet","PM","P"],isRTL:!1},a.timepicker.regional.lv={timeOnlyTitle:"Ievadiet laiku",timeText:"Laiks",hourText:"Stundas",minuteText:"Minūtes",secondText:"Sekundes",millisecText:"Milisekundes",microsecText:"Mikrosekundes",timezoneText:"Laika josla",currentText:"Tagad",closeText:"Aizvērt",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","AM","A"],pmNames:["PM","PM","P"],isRTL:!1},a.timepicker.regional.mk={timeOnlyTitle:"Одберете време",timeText:"Време",hourText:"Час",minuteText:"Минути",secondText:"Секунди",millisecText:"Милисекунди",microsecText:"Микросекунди",timezoneText:"Временска зона",currentText:"Сега",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.nl={timeOnlyTitle:"Tijdstip",timeText:"Tijd",hourText:"Uur",minuteText:"Minuut",secondText:"Seconde",millisecText:"Milliseconde",microsecText:"Microseconde",timezoneText:"Tijdzone",currentText:"Vandaag",closeText:"Sluiten",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.no={timeOnlyTitle:"Velg tid",timeText:"Tid",hourText:"Time",minuteText:"Minutt",secondText:"Sekund",millisecText:"Millisekund",microsecText:"mikrosekund",timezoneText:"Tidssone",currentText:"Nå",closeText:"Lukk",timeFormat:"HH:mm",timeSuffix:"",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},a.timepicker.regional.pl={timeOnlyTitle:"Wybierz godzinę",timeText:"Czas",hourText:"Godzina",minuteText:"Minuta",secondText:"Sekunda",millisecText:"Milisekunda",microsecText:"Mikrosekunda",timezoneText:"Strefa czasowa",currentText:"Teraz",closeText:"Gotowe",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["pt-BR"]={timeOnlyTitle:"Escolha o horário",timeText:"Horário",hourText:"Hora",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milissegundos",microsecText:"Microssegundos",timezoneText:"Fuso horário",currentText:"Agora",closeText:"Fechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.pt={timeOnlyTitle:"Escolha uma hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milissegundos",microsecText:"Microssegundos",timezoneText:"Fuso horário",currentText:"Agora",closeText:"Fechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.ro={timeOnlyTitle:"Alegeţi o oră",timeText:"Timp",hourText:"Ore",minuteText:"Minute",secondText:"Secunde",millisecText:"Milisecunde",microsecText:"Microsecunde",timezoneText:"Fus orar",currentText:"Acum",closeText:"Închide",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.ru={timeOnlyTitle:"Выберите время",timeText:"Время",hourText:"Часы",minuteText:"Минуты",secondText:"Секунды",millisecText:"Миллисекунды",microsecText:"Микросекунды",timezoneText:"Часовой пояс",currentText:"Сейчас",closeText:"Закрыть",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.sk={timeOnlyTitle:"Zvoľte čas",timeText:"Čas",hourText:"Hodiny",minuteText:"Minúty",secondText:"Sekundy",millisecText:"Milisekundy",microsecText:"Mikrosekundy",timezoneText:"Časové pásmo",currentText:"Teraz",closeText:"Zavrieť",timeFormat:"H:m",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["pop.","PM","P"],isRTL:!1},a.timepicker.regional.sl={timeOnlyTitle:"Izberite čas",timeText:"Čas",hourText:"Ura",minuteText:"Minute",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Časovni pas",currentText:"Sedaj",closeText:"Zapri",timeFormat:"HH:mm",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["pop.","PM","P"],isRTL:!1},a.timepicker.regional.sq={timeOnlyTitle:"Zgjidh orarin",timeText:"Orari",hourText:"Ora",minuteText:"Minuta",secondText:"Sekonda",millisecText:"Minisekonda",microsecText:"Mikrosekonda",timezoneText:"Zona kohore",currentText:"Tani",closeText:"Mbyll",timeFormat:"HH:mm",timeSuffix:"",amNames:["m.","AM","A"],pmNames:["p.","PM","P"],isRTL:!1},a.timepicker.regional["sr-RS"]={timeOnlyTitle:"Одаберите време",timeText:"Време",hourText:"Сати",minuteText:"Минути",secondText:"Секунде",millisecText:"Милисекунде",microsecText:"Микросекунде",timezoneText:"Временска зона",currentText:"Сада",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["sr-YU"]={timeOnlyTitle:"Odaberite vreme",timeText:"Vreme",hourText:"Sati",minuteText:"Minuti",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Vremenska zona",currentText:"Sada",closeText:"Zatvori",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.sv={timeOnlyTitle:"Välj en tid",timeText:"Tid",hourText:"Timme",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tidszon",currentText:"Nu",closeText:"Stäng",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.th={timeOnlyTitle:"เลือกเวลา",timeText:"เวลา ",hourText:"ชั่วโมง ",minuteText:"นาที",secondText:"วินาที",millisecText:"มิลลิวินาที",microsecText:"ไมโคริวินาที",timezoneText:"เขตเวลา",currentText:"เวลาปัจจุบัน",closeText:"ปิด",timeFormat:"hh:mm tt",timeSuffix:""},a.timepicker.regional.tr={timeOnlyTitle:"Zaman Seçiniz",timeText:"Zaman",hourText:"Saat",minuteText:"Dakika",secondText:"Saniye",millisecText:"Milisaniye",microsecText:"Mikrosaniye",timezoneText:"Zaman Dilimi",currentText:"Şu an",closeText:"Tamam",timeFormat:"HH:mm",timeSuffix:"",amNames:["ÖÖ","Ö"],pmNames:["ÖS","S"],isRTL:!1},a.timepicker.regional.uk={timeOnlyTitle:"Виберіть час",timeText:"Час",hourText:"Години",minuteText:"Хвилини",secondText:"Секунди",millisecText:"Мілісекунди",microsecText:"Мікросекунди",timezoneText:"Часовий пояс",currentText:"Зараз",closeText:"Закрити",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.vi={timeOnlyTitle:"Chọn giờ",timeText:"Thời gian",hourText:"Giờ",minuteText:"Phút",secondText:"Giây",millisecText:"Mili giây",microsecText:"Micrô giây",timezoneText:"Múi giờ",currentText:"Hiện thời",closeText:"Đóng",timeFormat:"HH:mm",timeSuffix:"",amNames:["SA","S"],pmNames:["CH","C"],isRTL:!1},a.timepicker.regional["zh-CN"]={timeOnlyTitle:"选择时间",timeText:"时间",hourText:"小时",minuteText:"分钟",secondText:"秒钟",millisecText:"毫秒",microsecText:"微秒",timezoneText:"时区",currentText:"现在时间",closeText:"关闭",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["zh-TW"]={timeOnlyTitle:"選擇時分秒",timeText:"時間",hourText:"時",minuteText:"分",secondText:"秒",millisecText:"毫秒",microsecText:"微秒",timezoneText:"時區",currentText:"現在時間",closeText:"確定",timeFormat:"HH:mm",timeSuffix:"",amNames:["上午","AM","A"],pmNames:["下午","PM","P"],isRTL:!1}}(jQuery); \ No newline at end of file +* Copyright (c) 2020 Trent Richardson; Licensed MIT */ +!function(a){a.timepicker.regional.af={timeOnlyTitle:"Kies Tyd",timeText:"Tyd ",hourText:"Ure ",minuteText:"Minute",secondText:"Sekondes",millisecText:"Millisekondes",microsecText:"Mikrosekondes",timezoneText:"Tydsone",currentText:"Huidige Tyd",closeText:"Klaar",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.am={timeOnlyTitle:"Ընտրեք ժամանակը",timeText:"Ժամանակը",hourText:"Ժամ",minuteText:"Րոպե",secondText:"Վարկյան",millisecText:"Միլիվարկյան",microsecText:"Միկրովարկյան",timezoneText:"Ժամային գոտին",currentText:"Այժմ",closeText:"Փակել",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.ar={timeOnlyTitle:"اختر الوقت",timeText:"ساعة",hourText:"ساعات",minuteText:"الدقائق",secondText:"الثواني",millisecText:"مللي ثانية",microsecText:"ميكروثانية",timezoneText:"وحدة زمنية",currentText:"الآن",closeText:"منجز",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!0},a.timepicker.regional.bg={timeOnlyTitle:"Изберете време",timeText:"Време",hourText:"Час",minuteText:"Минути",secondText:"Секунди",millisecText:"Милисекунди",microsecText:"Микросекунди",timezoneText:"Часови пояс",currentText:"Сега",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.ca={timeOnlyTitle:"Escollir una hora",timeText:"Hora",hourText:"Hores",minuteText:"Minuts",secondText:"Segons",millisecText:"Milisegons",microsecText:"Microsegons",timezoneText:"Fus horari",currentText:"Ara",closeText:"Tancar",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.cs={timeOnlyTitle:"Vyberte čas",timeText:"Čas",hourText:"Hodiny",minuteText:"Minuty",secondText:"Vteřiny",millisecText:"Milisekundy",microsecText:"Mikrosekundy",timezoneText:"Časové pásmo",currentText:"Nyní",closeText:"Zavřít",timeFormat:"HH:mm",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["odp.","PM","P"],isRTL:!1},a.timepicker.regional.da={timeOnlyTitle:"Vælg tid",timeText:"Tid",hourText:"Time",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tidszone",currentText:"Nu",closeText:"Luk",timeFormat:"HH:mm",timeSuffix:"",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},a.timepicker.regional.de={timeOnlyTitle:"Zeit wählen",timeText:"Zeit",hourText:"Stunde",minuteText:"Minute",secondText:"Sekunde",millisecText:"Millisekunde",microsecText:"Mikrosekunde",timezoneText:"Zeitzone",currentText:"Jetzt",closeText:"Fertig",timeFormat:"HH:mm",timeSuffix:"",amNames:["vorm.","AM","A"],pmNames:["nachm.","PM","P"],isRTL:!1},a.timepicker.regional.el={timeOnlyTitle:"Επιλογή ώρας",timeText:"Ώρα",hourText:"Ώρες",minuteText:"Λεπτά",secondText:"Δευτερόλεπτα",millisecText:"Χιλιοστοδευτερόλεπτα",microsecText:"Μικροδευτερόλεπτα",timezoneText:"Ζώνη ώρας",currentText:"Τώρα",closeText:"Κλείσιμο",timeFormat:"HH:mm",timeSuffix:"",amNames:["π.μ.","AM","A"],pmNames:["μ.μ.","PM","P"],isRTL:!1},a.timepicker.regional.es={timeOnlyTitle:"Elegir una hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milisegundos",microsecText:"Microsegundos",timezoneText:"Uso horario",currentText:"Hoy",closeText:"Cerrar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.et={timeOnlyTitle:"Vali aeg",timeText:"Aeg",hourText:"Tund",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekundis",microsecText:"Mikrosekundis",timezoneText:"Ajavöönd",currentText:"Praegu",closeText:"Valmis",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.eu={timeOnlyTitle:"Aukeratu ordua",timeText:"Ordua",hourText:"Orduak",minuteText:"Minutuak",secondText:"Segundoak",millisecText:"Milisegundoak",microsecText:"Mikrosegundoak",timezoneText:"Ordu-eremua",currentText:"Orain",closeText:"Itxi",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.fa={timeOnlyTitle:"انتخاب زمان",timeText:"زمان",hourText:"ساعت",minuteText:"دقیقه",secondText:"ثانیه",millisecText:"میلی ثانیه",microsecText:"میکرو ثانیه",timezoneText:"منطقه زمانی",currentText:"الان",closeText:"انتخاب",timeFormat:"HH:mm",timeSuffix:"",amNames:["قبل ظهر","AM","A"],pmNames:["بعد ظهر","PM","P"],isRTL:!0},a.timepicker.regional.fi={timeOnlyTitle:"Valitse aika",timeText:"Aika",hourText:"Tunti",minuteText:"Minuutti",secondText:"Sekunti",millisecText:"Millisekunnin",microsecText:"Mikrosekuntia",timezoneText:"Aikavyöhyke",currentText:"Nyt",closeText:"Sulje",timeFormat:"HH:mm",timeSuffix:"",amNames:["ap.","AM","A"],pmNames:["ip.","PM","P"],isRTL:!1},a.timepicker.regional.fo={timeOnlyTitle:"Vel tíð",timeText:"Tíð",hourText:"Tími",minuteText:"Minuttur",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tíðarsona",currentText:"Nú",closeText:"Lat aftur",timeFormat:"HH:mm",timeSuffix:"",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},a.timepicker.regional.fr={timeOnlyTitle:"Choisir une heure",timeText:"Heure",hourText:"Heures",minuteText:"Minutes",secondText:"Secondes",millisecText:"Millisecondes",microsecText:"Microsecondes",timezoneText:"Fuseau horaire",currentText:"Maintenant",closeText:"Terminé",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.gl={timeOnlyTitle:"Elixir unha hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milisegundos",microsecText:"Microssegundos",timezoneText:"Fuso horario",currentText:"Agora",closeText:"Pechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.he={timeOnlyTitle:"בחירת זמן",timeText:"שעה",hourText:"שעות",minuteText:"דקות",secondText:"שניות",millisecText:"אלפית השנייה",microsecText:"מיקרו",timezoneText:"אזור זמן",currentText:"עכשיו",closeText:"סגור",timeFormat:"HH:mm",timeSuffix:"",amNames:['לפנה"צ',"AM","A"],pmNames:['אחה"צ',"PM","P"],isRTL:!0},a.timepicker.regional.hr={timeOnlyTitle:"Odaberi vrijeme",timeText:"Vrijeme",hourText:"Sati",minuteText:"Minute",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Vremenska zona",currentText:"Sada",closeText:"Gotovo",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.hu={timeOnlyTitle:"Válasszon időpontot",timeText:"Idő",hourText:"Óra",minuteText:"Perc",secondText:"Másodperc",millisecText:"Milliszekundumos",microsecText:"Ezredmásodperc",timezoneText:"Időzóna",currentText:"Most",closeText:"Kész",timeFormat:"HH:mm",timeSuffix:"",amNames:["de.","AM","A"],pmNames:["du.","PM","P"],isRTL:!1},a.timepicker.regional.id={timeOnlyTitle:"Pilih Waktu",timeText:"Waktu",hourText:"Pukul",minuteText:"Menit",secondText:"Detik",millisecText:"Milidetik",microsecText:"Mikrodetik",timezoneText:"Zona Waktu",currentText:"Sekarang",closeText:"OK",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.it={timeOnlyTitle:"Scegli orario",timeText:"Orario",hourText:"Ora",minuteText:"Minuti",secondText:"Secondi",millisecText:"Millisecondi",microsecText:"Microsecondi",timezoneText:"Fuso orario",currentText:"Adesso",closeText:"Chiudi",timeFormat:"HH:mm",timeSuffix:"",amNames:["m.","AM","A"],pmNames:["p.","PM","P"],isRTL:!1},a.timepicker.regional.ja={timeOnlyTitle:"時間を選択",timeText:"時間",hourText:"時",minuteText:"分",secondText:"秒",millisecText:"ミリ秒",microsecText:"マイクロ秒",timezoneText:"タイムゾーン",currentText:"現時刻",closeText:"閉じる",timeFormat:"HH:mm",timeSuffix:"",amNames:["午前","AM","A"],pmNames:["午後","PM","P"],isRTL:!1},a.timepicker.regional.ko={timeOnlyTitle:"시간 선택",timeText:"시간",hourText:"시",minuteText:"분",secondText:"초",millisecText:"밀리초",microsecText:"마이크로",timezoneText:"표준 시간대",currentText:"현재 시각",closeText:"닫기",timeFormat:"tt h:mm",timeSuffix:"",amNames:["오전","AM","A"],pmNames:["오후","PM","P"],isRTL:!1},a.timepicker.regional.lt={timeOnlyTitle:"Pasirinkite laiką",timeText:"Laikas",hourText:"Valandos",minuteText:"Minutės",secondText:"Sekundės",millisecText:"Milisekundės",microsecText:"Mikrosekundės",timezoneText:"Laiko zona",currentText:"Dabar",closeText:"Uždaryti",timeFormat:"HH:mm",timeSuffix:"",amNames:["priešpiet","AM","A"],pmNames:["popiet","PM","P"],isRTL:!1},a.timepicker.regional.lv={timeOnlyTitle:"Ievadiet laiku",timeText:"Laiks",hourText:"Stundas",minuteText:"Minūtes",secondText:"Sekundes",millisecText:"Milisekundes",microsecText:"Mikrosekundes",timezoneText:"Laika josla",currentText:"Tagad",closeText:"Aizvērt",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","AM","A"],pmNames:["PM","PM","P"],isRTL:!1},a.timepicker.regional.mk={timeOnlyTitle:"Одберете време",timeText:"Време",hourText:"Час",minuteText:"Минути",secondText:"Секунди",millisecText:"Милисекунди",microsecText:"Микросекунди",timezoneText:"Временска зона",currentText:"Сега",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.nl={timeOnlyTitle:"Tijdstip",timeText:"Tijd",hourText:"Uur",minuteText:"Minuut",secondText:"Seconde",millisecText:"Milliseconde",microsecText:"Microseconde",timezoneText:"Tijdzone",currentText:"Nu",closeText:"Sluiten",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.no={timeOnlyTitle:"Velg tid",timeText:"Tid",hourText:"Time",minuteText:"Minutt",secondText:"Sekund",millisecText:"Millisekund",microsecText:"mikrosekund",timezoneText:"Tidssone",currentText:"Nå",closeText:"Lukk",timeFormat:"HH:mm",timeSuffix:"",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},a.timepicker.regional.pl={timeOnlyTitle:"Wybierz godzinę",timeText:"Czas",hourText:"Godzina",minuteText:"Minuta",secondText:"Sekunda",millisecText:"Milisekunda",microsecText:"Mikrosekunda",timezoneText:"Strefa czasowa",currentText:"Teraz",closeText:"Gotowe",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["pt-BR"]={timeOnlyTitle:"Escolha o horário",timeText:"Horário",hourText:"Hora",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milissegundos",microsecText:"Microssegundos",timezoneText:"Fuso horário",currentText:"Agora",closeText:"Fechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.pt={timeOnlyTitle:"Escolha uma hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milissegundos",microsecText:"Microssegundos",timezoneText:"Fuso horário",currentText:"Agora",closeText:"Fechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.ro={timeOnlyTitle:"Alegeţi o oră",timeText:"Timp",hourText:"Ore",minuteText:"Minute",secondText:"Secunde",millisecText:"Milisecunde",microsecText:"Microsecunde",timezoneText:"Fus orar",currentText:"Acum",closeText:"Închide",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.ru={timeOnlyTitle:"Выберите время",timeText:"Время",hourText:"Часы",minuteText:"Минуты",secondText:"Секунды",millisecText:"Миллисекунды",microsecText:"Микросекунды",timezoneText:"Часовой пояс",currentText:"Сейчас",closeText:"Закрыть",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.sk={timeOnlyTitle:"Zvoľte čas",timeText:"Čas",hourText:"Hodiny",minuteText:"Minúty",secondText:"Sekundy",millisecText:"Milisekundy",microsecText:"Mikrosekundy",timezoneText:"Časové pásmo",currentText:"Teraz",closeText:"Zavrieť",timeFormat:"H:m",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["pop.","PM","P"],isRTL:!1},a.timepicker.regional.sl={timeOnlyTitle:"Izberite čas",timeText:"Čas",hourText:"Ura",minuteText:"Minute",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Časovni pas",currentText:"Sedaj",closeText:"Zapri",timeFormat:"HH:mm",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["pop.","PM","P"],isRTL:!1},a.timepicker.regional.sq={timeOnlyTitle:"Zgjidh orarin",timeText:"Orari",hourText:"Ora",minuteText:"Minuta",secondText:"Sekonda",millisecText:"Minisekonda",microsecText:"Mikrosekonda",timezoneText:"Zona kohore",currentText:"Tani",closeText:"Mbyll",timeFormat:"HH:mm",timeSuffix:"",amNames:["m.","AM","A"],pmNames:["p.","PM","P"],isRTL:!1},a.timepicker.regional["sr-RS"]={timeOnlyTitle:"Одаберите време",timeText:"Време",hourText:"Сати",minuteText:"Минути",secondText:"Секунде",millisecText:"Милисекунде",microsecText:"Микросекунде",timezoneText:"Временска зона",currentText:"Сада",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["sr-YU"]={timeOnlyTitle:"Odaberite vreme",timeText:"Vreme",hourText:"Sati",minuteText:"Minuti",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Vremenska zona",currentText:"Sada",closeText:"Zatvori",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.sv={timeOnlyTitle:"Välj en tid",timeText:"Tid",hourText:"Timme",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tidszon",currentText:"Nu",closeText:"Stäng",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.th={timeOnlyTitle:"เลือกเวลา",timeText:"เวลา ",hourText:"ชั่วโมง ",minuteText:"นาที",secondText:"วินาที",millisecText:"มิลลิวินาที",microsecText:"ไมโคริวินาที",timezoneText:"เขตเวลา",currentText:"เวลาปัจจุบัน",closeText:"ปิด",timeFormat:"hh:mm tt",timeSuffix:""},a.timepicker.regional.tr={timeOnlyTitle:"Zaman Seçiniz",timeText:"Zaman",hourText:"Saat",minuteText:"Dakika",secondText:"Saniye",millisecText:"Milisaniye",microsecText:"Mikrosaniye",timezoneText:"Zaman Dilimi",currentText:"Şu an",closeText:"Tamam",timeFormat:"HH:mm",timeSuffix:"",amNames:["ÖÖ","Ö"],pmNames:["ÖS","S"],isRTL:!1},a.timepicker.regional.uk={timeOnlyTitle:"Виберіть час",timeText:"Час",hourText:"Години",minuteText:"Хвилини",secondText:"Секунди",millisecText:"Мілісекунди",microsecText:"Мікросекунди",timezoneText:"Часовий пояс",currentText:"Зараз",closeText:"Закрити",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.vi={timeOnlyTitle:"Chọn giờ",timeText:"Thời gian",hourText:"Giờ",minuteText:"Phút",secondText:"Giây",millisecText:"Mili giây",microsecText:"Micrô giây",timezoneText:"Múi giờ",currentText:"Hiện thời",closeText:"Đóng",timeFormat:"HH:mm",timeSuffix:"",amNames:["SA","S"],pmNames:["CH","C"],isRTL:!1},a.timepicker.regional["zh-CN"]={timeOnlyTitle:"选择时间",timeText:"时间",hourText:"小时",minuteText:"分钟",secondText:"秒钟",millisecText:"毫秒",microsecText:"微秒",timezoneText:"时区",currentText:"现在时间",closeText:"关闭",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["zh-TW"]={timeOnlyTitle:"選擇時分秒",timeText:"時間",hourText:"時",minuteText:"分",secondText:"秒",millisecText:"毫秒",microsecText:"微秒",timezoneText:"時區",currentText:"現在時間",closeText:"確定",timeFormat:"HH:mm",timeSuffix:"",amNames:["上午","AM","A"],pmNames:["下午","PM","P"],isRTL:!1}}(jQuery); \ No newline at end of file diff --git a/dist/i18n/jquery-ui-timepicker-ar.js b/dist/i18n/jquery-ui-timepicker-ar.js new file mode 100644 index 0000000..d803e85 --- /dev/null +++ b/dist/i18n/jquery-ui-timepicker-ar.js @@ -0,0 +1,22 @@ +/* Arabic translation for the jQuery Timepicker Addon */ +/* Written by Hamza Rashid hamza1886@gmail.com */ +(function($) { + $.timepicker.regional['ar'] = { + timeOnlyTitle: 'اختر الوقت', + timeText: 'ساعة', + hourText: 'ساعات', + minuteText: 'الدقائق', + secondText: 'الثواني', + millisecText: 'مللي ثانية', + microsecText: 'ميكروثانية', + timezoneText: 'وحدة زمنية', + currentText: 'الآن', + closeText: 'منجز', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: true + }; + $.timepicker.setDefaults($.timepicker.regional['ar']); +})(jQuery); diff --git a/dist/i18n/jquery-ui-timepicker-fo.js b/dist/i18n/jquery-ui-timepicker-fo.js new file mode 100644 index 0000000..7d21d92 --- /dev/null +++ b/dist/i18n/jquery-ui-timepicker-fo.js @@ -0,0 +1,22 @@ +/* Faroese translation for the jQuery Timepicker Addon */ +/* Written by Torkil Zachariassen */ +(function ($) { + $.timepicker.regional['fo'] = { + timeOnlyTitle: 'Vel tíð', + timeText: 'Tíð', + hourText: 'Tími', + minuteText: 'Minuttur', + secondText: 'Sekund', + millisecText: 'Millisekund', + microsecText: 'Mikrosekund', + timezoneText: 'Tíðarsona', + currentText: 'Nú', + closeText: 'Lat aftur', + timeFormat: 'HH:mm', + timeSuffix: '', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['fo']); +})(jQuery); diff --git a/dist/i18n/jquery-ui-timepicker-nl.js b/dist/i18n/jquery-ui-timepicker-nl.js index bc71fc1..d4863e4 100644 --- a/dist/i18n/jquery-ui-timepicker-nl.js +++ b/dist/i18n/jquery-ui-timepicker-nl.js @@ -10,7 +10,7 @@ millisecText: 'Milliseconde', microsecText: 'Microseconde', timezoneText: 'Tijdzone', - currentText: 'Vandaag', + currentText: 'Nu', closeText: 'Sluiten', timeFormat: 'HH:mm', timeSuffix: '', diff --git a/dist/index.html b/dist/index.html index 8e9f36d..d43ca93 100644 --- a/dist/index.html +++ b/dist/index.html @@ -73,13 +73,13 @@

Donation

-

Getting Started

- +

Highly Recommended

- +

Handling Time eBook

Check out the Handling Time eBook to learn from the basic setup to advanced i18n usage, and from client's javascript to the server's database.

@@ -88,7 +88,7 @@

Handling Time eBook

buy eBook

- +

Subscribe to Blog and Twitter

Subscribe to my blog via email and follow @PracticalWeb on Twitter. I post for nearly every new version, so you know about updates.

@@ -96,9 +96,9 @@

Subscribe to Blog and Twitter

Download

Download Timepicker Addon and the required CSS.

- +

Download/Contribute on GitHub (Need the entire repo? Find a bug? See if its fixed here)

- +

If you prefer a hosted CDN there are a couple available: CDNJS, jsDelivr.


@@ -112,16 +112,16 @@

Requirements


Version

-

Version 1.6.3

+

Version 1.6.4

-

Last updated on 2016-04-20

+

Last updated on 2017-02-08

jQuery Timepicker Addon is currently available for use in all personal or commercial projects under the MIT license.

MIT License

-

Options

@@ -208,7 +208,7 @@

Time Field Options

controlType
Default: 'slider' - 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.
{
-	create: function(tp_inst, obj, unit, val, min, max, step){	
+	create: function(tp_inst, obj, unit, val, min, max, step){
 		// generate whatever controls you want here, just return obj
 	},
 	options: function(tp_inst, obj, unit, opts, val){
@@ -324,10 +324,10 @@ 

Other Options

showButtonPanel
Default: true - Whether to show the button panel at the bottom. This is generally needed.
- +
timeInput
Default: false - Allows direct input in time field
- +
timeOnly
Default: false - Hide the datepicker and only provide a time interface.
@@ -348,7 +348,7 @@

Other Options

pickerTimeFormat
Default: (timeFormat option) - How to format the time displayed within the timepicker.
- +
pickerTimeSuffix
Default: (timeSuffix option) - String to place after the formatted time within the timepicker.
@@ -380,7 +380,7 @@

Other Options

Default: null - String of the maximum time allowed. '8:00 pm' will restrict to times before 8pm
parse
-
Default: 'strict' - 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: +
Default: 'strict' - 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:
{
 	hour: 19,
 	minute: 10,
@@ -395,7 +395,7 @@ 

Other Options

-
@@ -436,12 +436,12 @@

Formatting Your Time

-

Working with Localizations

- +

Timepicker comes with many translations and localizations, thanks to all the contributors. They can be found in the i18n folder in the git repo.

The quick and cheap way to use localizations is to pass in options to a timepicker instance:

@@ -509,7 +509,7 @@

Working with Localizations

-

Examples

@@ -532,7 +532,7 @@

Basic Initializations

Add a simple datetimepicker to jQuery UI's datepicker

-
+
 $('#basic_example_1').datetimepicker();
 
@@ -544,7 +544,7 @@

Basic Initializations

Add only a timepicker:

-
+
 $('#basic_example_2').timepicker();
 
@@ -555,7 +555,7 @@

Basic Initializations

Format the time:

-
+
 $('#basic_example_3').datetimepicker({
 	timeFormat: "hh:mm tt"
@@ -569,7 +569,7 @@ 

Basic Initializations

Timepicker comes with a collection of localization files and one combined file with all available localizations. $.timepicker.regional["your localization code here"] is a simple object with preset options:

-
+
 $('#basic_example_4').timepicker(
 	$.timepicker.regional['es']
@@ -584,7 +584,7 @@ 

Using Timezones

Simplest timezone usage:

-
+
 $('#timezone_example_1').datetimepicker({
 	timeFormat: 'hh:mm tt z'
@@ -597,15 +597,15 @@ 

Using Timezones

Define your own timezone options:

-
+
 $('#timezone_example_2').datetimepicker({
 	timeFormat: 'HH:mm z',
-	timezoneList: [ 
-			{ value: -300, label: 'Eastern'}, 
-			{ value: -360, label: 'Central' }, 
-			{ value: -420, label: 'Mountain' }, 
-			{ value: -480, label: 'Pacific' } 
+	timezoneList: [
+			{ value: -300, label: 'Eastern'},
+			{ value: -360, label: 'Central' },
+			{ value: -420, label: 'Mountain' },
+			{ value: -480, label: 'Pacific' }
 		]
 });
 
@@ -618,7 +618,7 @@

Slider Modifications

Add a grid to each slider:

-
+
 $('#slider_example_1').timepicker({
 	hourGrid: 4,
@@ -633,7 +633,7 @@ 

Slider Modifications

Set the interval step of sliders:

-
+
 $('#slider_example_2').datetimepicker({
 	timeFormat: 'HH:mm:ss',
@@ -649,7 +649,7 @@ 

Slider Modifications

Add sliderAccess plugin for touch devices:

-
+
 $('#slider_example_3').datetimepicker({
 	addSliderAccess: true,
@@ -662,7 +662,7 @@ 

Slider Modifications

Use dropdowns instead of sliders. By default if slider is not available dropdowns will be used.

-
+
 $('#slider_example_4').datetimepicker({
 	controlType: 'select',
@@ -689,7 +689,7 @@ 

Slider Modifications

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+).

-
+
var myControl=  {
 	create: function(tp_inst, obj, unit, val, min, max, step){
 		$('<input class="ui-timepicker-input" value="'+val+'" style="width:50%">')
@@ -737,7 +737,7 @@ 

Alternate Fields

-
+
 $('#alt_example_1').datetimepicker({
 	altField: "#alt_example_1_alt"
@@ -751,7 +751,7 @@ 

Alternate Fields

-
+
 $('#alt_example_2').datetimepicker({
 	altField: "#alt_example_2_alt",
@@ -766,7 +766,7 @@ 

Alternate Fields

-
+
 $('#alt_example_3').datetimepicker({
 	altField: "#alt_example_3_alt",
@@ -777,14 +777,14 @@ 

Alternate Fields

});
- +

With inline mode using altField:

-
+
 $('#alt_example_4').datetimepicker({
 	altField: "#alt_example_4_alt",
@@ -792,7 +792,7 @@ 

Alternate Fields

});
- +

Time Input

@@ -832,7 +832,7 @@

Time Restraints

Set the min/max hour of every date:

-
+
 $('#rest_example_1').timepicker({
 	hourMin: 8,
@@ -846,7 +846,7 @@ 

Time Restraints

Set the min/max date numerically:

-
+
 $('#rest_example_2').datetimepicker({
 	numberOfMonths: 2,
@@ -854,14 +854,14 @@ 

Time Restraints

maxDate: 30 });
- +

Set the min/max date and time with a Date object:

-
+
 $('#rest_example_3').datetimepicker({
 	minDate: new Date(2010, 11, 20, 8, 30),
@@ -878,14 +878,14 @@ 

Time Ranges

Restrict a start and end date by using onSelect and onClose events for more control over functionality:

For more examples and advanced usage grab the Handling Time eBook.

- + -
+
 var startDateTextBox = $('#range_example_1_start');
 var endDateTextBox = $('#range_example_1_end');
 
-startDateTextBox.datetimepicker({ 
+startDateTextBox.datetimepicker({
 	timeFormat: 'HH:mm z',
 	onClose: function(dateText, inst) {
 		if (endDateTextBox.val() != '') {
@@ -902,7 +902,7 @@ 

Time Ranges

endDateTextBox.datetimepicker('option', 'minDate', startDateTextBox.datetimepicker('getDate') ); } }); -endDateTextBox.datetimepicker({ +endDateTextBox.datetimepicker({ timeFormat: 'HH:mm z', onClose: function(dateText, inst) { if (startDateTextBox.val() != '') { @@ -926,9 +926,9 @@

Time Ranges

Timepicker also includes some shortcut methods for ranges:

- + -
+
 var startDateTextBox = $('#range_example_2_start');
 var endDateTextBox = $('#range_example_2_end');
@@ -938,10 +938,10 @@ 

Time Ranges

endDateTextBox, { minInterval: (1000*60*60), // 1hr - dateFormat: 'dd M yy', + dateFormat: 'dd M yy', timeFormat: 'HH:mm', start: {}, // start picker options - end: {} // end picker options + end: {} // end picker options } );
@@ -951,9 +951,9 @@

Time Ranges

To use only times for a time range use $.timepicker.timeRange():

- + -
+
 var startTimeTextBox = $('#range_example_3_start');
 var endTimeTextBox = $('#range_example_3_end');
@@ -975,9 +975,9 @@ 

Time Ranges

Even though this plugin focuses on datetime, it also provides a dateRange function:

- + -
+
 var startDateTextBox = $('#range_example_4_start');
 var endDateTextBox = $('#range_example_4_end');
@@ -1001,11 +1001,11 @@ 

Utilities

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.

- - - + + +
- +
 var ex13 = $('#utility_example_1');
 
@@ -1037,7 +1037,7 @@ 

Utilities

- +
 $('#utility_example_2').text(
 	$.datepicker.formatTime('HH:mm z', { hour: 14, minute: 36, timezone: '+2000' }, {})
@@ -1057,10 +1057,10 @@ 

Utilities

- +
-$('#utility_example_3').text(JSON.stringify( 
-	$.datepicker.parseTime('HH:mm:ss:l z', "14:36:21:765 +2000", {}) 
+$('#utility_example_3').text(JSON.stringify(
+	$.datepicker.parseTime('HH:mm:ss:l z', "14:36:21:765 +2000", {})
 ));
 
diff --git a/dist/jquery-ui-timepicker-addon.js b/dist/jquery-ui-timepicker-addon.js index d37bc02..8d3db22 100644 --- a/dist/jquery-ui-timepicker-addon.js +++ b/dist/jquery-ui-timepicker-addon.js @@ -1,2291 +1,2291 @@ -/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20 +/*! jQuery Timepicker Addon - v1.6.4 - 2017-02-08 * http://trentrichardson.com/examples/timepicker -* Copyright (c) 2016 Trent Richardson; Licensed MIT */ +* Copyright (c) 2020 Trent Richardson; Licensed MIT */ (function (factory) { - if (typeof define === 'function' && define.amd) { - define(['jquery', 'jquery-ui'], factory); - } else { - factory(jQuery); - } + if (typeof define === 'function' && define.amd) { + define(['jquery', 'jquery-ui'], factory); + } else { + factory(jQuery); + } }(function ($) { - /* - * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded" - */ - $.ui.timepicker = $.ui.timepicker || {}; - if ($.ui.timepicker.version) { - return; - } - - /* - * Extend jQueryUI, get it started with our version number - */ - $.extend($.ui, { - timepicker: { - version: "1.6.3" - } - }); - - /* - * Timepicker manager. - * Use the singleton instance of this class, $.timepicker, to interact with the time picker. - * Settings for (groups of) time pickers are maintained in an instance object, - * allowing multiple different settings on the same page. - */ - var Timepicker = function () { - this.regional = []; // Available regional settings, indexed by language code - this.regional[''] = { // Default regional settings - currentText: 'Now', - closeText: 'Done', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - timeFormat: 'HH:mm', - timeSuffix: '', - timeOnlyTitle: 'Choose Time', - timeText: 'Time', - hourText: 'Hour', - minuteText: 'Minute', - secondText: 'Second', - millisecText: 'Millisecond', - microsecText: 'Microsecond', - timezoneText: 'Time Zone', - isRTL: false - }; - this._defaults = { // Global defaults for all the datetime picker instances - showButtonPanel: true, - timeOnly: false, - timeOnlyShowDate: false, - showHour: null, - showMinute: null, - showSecond: null, - showMillisec: null, - showMicrosec: null, - showTimezone: null, - showTime: true, - stepHour: 1, - stepMinute: 1, - stepSecond: 1, - stepMillisec: 1, - stepMicrosec: 1, - hour: 0, - minute: 0, - second: 0, - millisec: 0, - microsec: 0, - timezone: null, - hourMin: 0, - minuteMin: 0, - secondMin: 0, - millisecMin: 0, - microsecMin: 0, - hourMax: 23, - minuteMax: 59, - secondMax: 59, - millisecMax: 999, - microsecMax: 999, - minDateTime: null, - maxDateTime: null, - maxTime: null, - minTime: null, - onSelect: null, - hourGrid: 0, - minuteGrid: 0, - secondGrid: 0, - millisecGrid: 0, - microsecGrid: 0, - alwaysSetTime: true, - separator: ' ', - altFieldTimeOnly: true, - altTimeFormat: null, - altSeparator: null, - altTimeSuffix: null, - altRedirectFocus: true, - pickerTimeFormat: null, - pickerTimeSuffix: null, - showTimepicker: true, - timezoneList: null, - addSliderAccess: false, - sliderAccessArgs: null, - controlType: 'slider', - oneLine: false, - defaultValue: null, - parse: 'strict', - afterInject: null - }; - $.extend(this._defaults, this.regional['']); - }; - - $.extend(Timepicker.prototype, { - $input: null, - $altInput: null, - $timeObj: null, - inst: null, - hour_slider: null, - minute_slider: null, - second_slider: null, - millisec_slider: null, - microsec_slider: null, - timezone_select: null, - maxTime: null, - minTime: null, - hour: 0, - minute: 0, - second: 0, - millisec: 0, - microsec: 0, - timezone: null, - hourMinOriginal: null, - minuteMinOriginal: null, - secondMinOriginal: null, - millisecMinOriginal: null, - microsecMinOriginal: null, - hourMaxOriginal: null, - minuteMaxOriginal: null, - secondMaxOriginal: null, - millisecMaxOriginal: null, - microsecMaxOriginal: null, - ampm: '', - formattedDate: '', - formattedTime: '', - formattedDateTime: '', - timezoneList: null, - units: ['hour', 'minute', 'second', 'millisec', 'microsec'], - support: {}, - control: null, - - /* - * Override the default settings for all instances of the time picker. - * @param {Object} settings object - the new settings to use as defaults (anonymous object) - * @return {Object} the manager object - */ - setDefaults: function (settings) { - extendRemove(this._defaults, settings || {}); - return this; - }, - - /* - * Create a new Timepicker instance - */ - _newInst: function ($input, opts) { - var tp_inst = new Timepicker(), - inlineSettings = {}, - fns = {}, - overrides, i; - - for (var attrName in this._defaults) { - if (this._defaults.hasOwnProperty(attrName)) { - var attrValue = $input.attr('time:' + attrName); - if (attrValue) { - try { - inlineSettings[attrName] = eval(attrValue); - } catch (err) { - inlineSettings[attrName] = attrValue; - } - } - } - } - - overrides = { - beforeShow: function (input, dp_inst) { - if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) { - return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst); - } - }, - onChangeMonthYear: function (year, month, dp_inst) { - // Update the time as well : this prevents the time from disappearing from the $input field. - // tp_inst._updateDateTime(dp_inst); - if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) { - tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); - } - }, - onClose: function (dateText, dp_inst) { - if (tp_inst.timeDefined === true && $input.val() !== '') { - tp_inst._updateDateTime(dp_inst); - } - if ($.isFunction(tp_inst._defaults.evnts.onClose)) { - tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst); - } - } - }; - for (i in overrides) { - if (overrides.hasOwnProperty(i)) { - fns[i] = opts[i] || this._defaults[i] || null; - } - } - - tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, { - evnts: fns, - timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); - }); - tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) { - return val.toUpperCase(); - }); - tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) { - return val.toUpperCase(); - }); - - // detect which units are supported - tp_inst.support = detectSupport( - tp_inst._defaults.timeFormat + - (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') + - (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : '')); - - // controlType is string - key to our this._controls - if (typeof(tp_inst._defaults.controlType) === 'string') { - if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') { - tp_inst._defaults.controlType = 'select'; - } - tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType]; - } - // controlType is an object and must implement create, options, value methods - else { - tp_inst.control = tp_inst._defaults.controlType; - } - - // prep the timezone options - var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60, - 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840]; - if (tp_inst._defaults.timezoneList !== null) { - timezoneList = tp_inst._defaults.timezoneList; - } - var tzl = timezoneList.length, tzi = 0, tzv = null; - if (tzl > 0 && typeof timezoneList[0] !== 'object') { - for (; tzi < tzl; tzi++) { - tzv = timezoneList[tzi]; - timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) }; - } - } - tp_inst._defaults.timezoneList = timezoneList; - - // set the default units - tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) : - ((new Date()).getTimezoneOffset() * -1); - tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : - tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour; - tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : - tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute; - tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : - tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second; - tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : - tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec; - tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin : - tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec; - tp_inst.ampm = ''; - tp_inst.$input = $input; - - if (tp_inst._defaults.altField) { - tp_inst.$altInput = $(tp_inst._defaults.altField); - if (tp_inst._defaults.altRedirectFocus === true) { - tp_inst.$altInput.css({ - cursor: 'pointer' - }).focus(function () { - $input.trigger("focus"); - }); - } - } - - if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) { - tp_inst._defaults.minDate = new Date(); - } - if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) { - tp_inst._defaults.maxDate = new Date(); - } - - // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. - if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) { - tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); - } - if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) { - tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); - } - if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) { - tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); - } - if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) { - tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); - } - tp_inst.$input.bind('focus', function () { - tp_inst._onFocus(); - }); - - return tp_inst; - }, - - /* - * add our sliders to the calendar - */ - _addTimePicker: function (dp_inst) { - var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val()); - - this.timeDefined = this._parseTime(currDT); - this._limitMinMaxDateTime(dp_inst, false); - this._injectTimePicker(); - this._afterInject(); - }, - - /* - * parse the time string from input value or _setTime - */ - _parseTime: function (timeString, withDate) { - if (!this.inst) { - this.inst = $.datepicker._getInst(this.$input[0]); - } - - if (withDate || !this._defaults.timeOnly) { - var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); - try { - var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults); - if (!parseRes.timeObj) { - return false; - } - $.extend(this, parseRes.timeObj); - } catch (err) { - $.timepicker.log("Error parsing the date/time string: " + err + - "\ndate/time string = " + timeString + - "\ntimeFormat = " + this._defaults.timeFormat + - "\ndateFormat = " + dp_dateFormat); - return false; - } - return true; - } else { - var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults); - if (!timeObj) { - return false; - } - $.extend(this, timeObj); - return true; - } - }, - - /* - * Handle callback option after injecting timepicker - */ - _afterInject: function() { - var o = this.inst.settings; - if ($.isFunction(o.afterInject)) { - o.afterInject.call(this); - } - }, - - /* - * generate and inject html for timepicker into ui datepicker - */ - _injectTimePicker: function () { - var $dp = this.inst.dpDiv, - o = this.inst.settings, - tp_inst = this, - litem = '', - uitem = '', - show = null, - max = {}, - gridSize = {}, - size = null, - i = 0, - l = 0; - - // Prevent displaying twice - if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) { - var noDisplay = ' ui_tpicker_unit_hide', - html = '
' + '
' + o.timeText + '
' + - '
'; - - // Create the markup - for (i = 0, l = this.units.length; i < l; i++) { - litem = this.units[i]; - uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); - show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; - - // Added by Peter Medeiros: - // - Figure out what the hour/minute/second max should be based on the step values. - // - Example: if stepMinute is 15, then minMax is 45. - max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10); - gridSize[litem] = 0; - - html += '
' + o[litem + 'Text'] + '
' + - '
'; - - if (show && o[litem + 'Grid'] > 0) { - html += '
'; - - if (litem === 'hour') { - for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) { - gridSize[litem]++; - var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o); - html += ''; - } - } - else { - for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) { - gridSize[litem]++; - html += ''; - } - } - - html += '
' + tmph + '' + ((m < 10) ? '0' : '') + m + '
'; - } - html += '
'; - } - - // Timezone - var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone; - html += '
' + o.timezoneText + '
'; - html += '
'; - - // Create the elements from string - html += '
'; - var $tp = $(html); - - // if we only want time picker... - if (o.timeOnly === true) { - $tp.prepend('
' + '
' + o.timeOnlyTitle + '
' + '
'); - $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); - } - - // add sliders, adjust grids, add events - for (i = 0, l = tp_inst.units.length; i < l; i++) { - litem = tp_inst.units[i]; - uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); - show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; - - // add the slider - tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]); - - // adjust the grid and add click event - if (show && o[litem + 'Grid'] > 0) { - size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']); - $tp.find('.ui_tpicker_' + litem + ' table').css({ - width: size + "%", - marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"), - marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0', - borderCollapse: 'collapse' - }).find("td").click(function (e) { - var $t = $(this), - h = $t.html(), - n = parseInt(h.replace(/[^0-9]/g), 10), - ap = h.replace(/[^apm]/ig), - f = $t.data('for'); // loses scope, so we use data-for - - if (f === 'hour') { - if (ap.indexOf('p') !== -1 && n < 12) { - n += 12; - } - else { - if (ap.indexOf('a') !== -1 && n === 12) { - n = 0; - } - } - } - - tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n); - - tp_inst._onTimeChange(); - tp_inst._onSelectHandler(); - }).css({ - cursor: 'pointer', - width: (100 / gridSize[litem]) + '%', - textAlign: 'center', - overflow: 'hidden' - }); - } // end if grid > 0 - } // end for loop - - // Add timezone options - this.timezone_select = $tp.find('.ui_tpicker_timezone').append('').find("select"); - $.fn.append.apply(this.timezone_select, - $.map(o.timezoneList, function (val, idx) { - return $("