{"action":"created","comment":{"url":"https://api.github.com/repos/enyojs/moonstone/pulls/comments/25723450","id":25723450,"diff_hunk":"@@ -0,0 +1,733 @@\n+(function (enyo, scope) {\n+\t/**\n+\t* Fires when the value changes.\n+\t*\n+\t* @event moon.DurationPicker#onChange\n+\t* @type {Object}\n+\t* @property {String} name - contains the name of this control.\n+\t* @public\n+\t*/\n+\n+\t/**\n+\t* `moon.DurationPicker` is a [control]{@link enyo.Control} that can display -- or allow the\n+\t* selection of -- a duration expressed in hours, minutes and seconds, the selection\n+\t* display is configurable using template.\n+\t*\n+\t* @class moon.DurationPicker\n+\t* @ui\n+\t* @public\n+\t*/\n+\n+\tenyo.kind(\n+\t\t/** @lends moon.DurationPicker.prototype */ {\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tname: 'moon.DurationPicker',\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tkind: 'moon.ExpandableListItem',\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tdefaultKind: 'enyo.Control',\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tclasses: 'moon-expandable-picker',\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\thandlers: {\n+\t\t\t//* Handler for _onChange_ events coming from constituent controls\n+\t\t\tonChange: 'handleChangeEvent'\n+\t\t},\n+\n+\t\tevents: {\n+\t\t\t/**\n+\t\t\t* {@link moon.DurationPicker#event:onDurationChange}\n+\t\t\t*/\n+\t\t\tonDurationChange: '',\n+\n+\t\t\t/**\n+\t\t\t* {@link moon.DurationPicker#event:onCountdownExpired}\n+\t\t\t*/\n+\t\t\tonPickerExpired: ''\n+\t\t},\n+\n+\t\t/**\n+\t\t* @public\n+\t\t* @lends moon.DurationPicker.prototype\n+\t\t*/\n+\t\tpublished: {\n+\n+\t\t\t/**\n+\t\t\t* Text to be displayed as the current value if no item is currently selected\n+\t\t\t*\n+\t\t\t* @type {String}\n+\t\t\t* @default ''\n+\t\t\t* @public\n+\t\t\t*/\n+\t\t\tnoneText: '',\n+\n+\t\t\t/**\n+\t\t\t* The value of the picker, expressed as a standard JavaScript \n+\t\t\t* object.\n+\t\t\t*\n+\t\t\t* @type {String}\n+\t\t\t* @default null\n+\t\t\t* @public\n+\t\t\t*/\n+\t\t\tvalue: null,\n+\n+\t\t\t/**\n+\t\t\t* Optional label for hour\n+\t\t\t*\n+\t\t\t* @type {String}\n+\t\t\t* @default moon.$L('hour')\n+\t\t\t* @public\n+\t\t\t*/\n+\t\t\thourText: moon.$L('hour'),\t\t// i18n 'HOUR' label in moon.DurationPicker widget\n+\n+\t\t\t/**\n+\t\t\t* Optional label for minute\n+\t\t\t*\n+\t\t\t* @type {String}\n+\t\t\t* @default moon.$L('minute')\n+\t\t\t* @public\n+\t\t\t*/\n+\t\t\tminuteText: moon.$L('minute'),\t\t// i18n 'MINUTE' label in moon.DurationPicker widget\n+\n+\t\t\t/**\n+\t\t\t* Optional label for second\n+\t\t\t*\n+\t\t\t* @type {String}\n+\t\t\t* @default moon.$L('second')\n+\t\t\t* @public\n+\t\t\t*/\n+\t\t\tsecondText: moon.$L('second'),\t\t// i18n 'SECOND' label in moon.DurationPicker widget\n+\n+\t\t\t/**\n+\t\t\t* The template format of the picker\n+\t\t\t*\n+\t\t\t* @type {String}\n+\t\t\t* @default ''\n+\t\t\t* @public\n+\t\t\t*/\n+\t\t\ttemplate: '',\n+\n+\t\t\t/**\n+\t\t\t* Enable and disable the timer feature of duration picker\n+\t\t\t*\n+\t\t\t* @type {Boolean}\n+\t\t\t* @default true\n+\t\t\t* @public\n+\t\t\t*/\n+\t\t\tenableTimer: true\n+\t\t},\n+\n+\t\t/**\n+\t\t* @type {Boolean}\n+\t\t* @default false\n+\t\t* @private\n+\t\t*/\n+\t\tcountdown: false,\n+\n+\t\t/**\n+\t\t* @type {String}\n+\t\t* @default null\n+\t\t* @private\n+\t\t*/\n+\t\ttimer: null,\n+\n+\t\t/**\n+\t\t* @type {Object}\n+\t\t* @default {}\n+\t\t* @private\n+\t\t*/\n+\t\tvalueArray: {},\n+\n+\t\t/**\n+\t\t* @type {Array}\n+\t\t* @default []\n+\t\t* @private\n+\t\t*/\n+\t\ttemplateArray: [],\n+\n+\t\t/**\n+\t\t* Optional label for Start Button\n+\t\t*\n+\t\t* @type {String}\n+\t\t* @default moon.$L('Start')\n+\t\t* @private\n+\t\t*/\n+\t\tstartConent: moon.$L('Start'),\n+\n+\t\t/**\n+\t\t* Optional label for Pause Button\n+\t\t*\n+\t\t* @type {String}\n+\t\t* @default moon.$L('Pause')\n+\t\t* @private\n+\t\t*/\n+\t\tpauseConent: moon.$L('Pause'),\n+\n+\t\t/**\n+\t\t* @type {Boolean}\n+\t\t* @default true\n+\t\t* @private\n+\t\t*/\n+\t\tpauseDisabled: true,\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tobservers: {\n+\t\t\t'changeCountdown': ['countdown']\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tcomponents: [\n+\t\t\t{name: 'headerWrapper', kind: 'moon.Item', classes: 'moon-date-picker-header-wrapper', onSpotlightFocus: 'headerFocus', ontap: 'expandContract', components: [\n+\t\t\t\t// headerContainer required to avoid bad scrollWidth returned in RTL for certain text widths (webkit bug)\n+\t\t\t\t{name: 'headerContainer', classes: 'moon-expandable-list-item-header moon-expandable-picker-header moon-expandable-datetime-header', components: [\n+\t\t\t\t\t{name: 'header', kind: 'moon.MarqueeText'}\n+\t\t\t\t]},\n+\t\t\t\t{name: 'currentValue', kind: 'moon.MarqueeText', classes: 'moon-expandable-picker-current-value'}\n+\t\t\t]},\n+\t\t\t{name: 'drawer', kind: 'enyo.Drawer', resizeContainer: false, classes: 'moon-expandable-list-item-client moon-duration-picker-item', components: [\n+\t\t\t\t{name: 'client', kind: 'enyo.Control', classes: 'enyo-tool-decorator', onSpotlightLeft: 'closePicker', onSpotlightSelect: 'closePicker'},\n+\t\t\t\t{name: 'buttonPlaceHolder', components: [\n+\t\t\t\t\t{kind: 'moon.Button', name: 'startButton', content: this.startConent, small: true, ontap: 'startTapped'},\n+\t\t\t\t\t{kind: 'moon.Button', name: 'pauseButton', content: this.pauseConent, small: true, ontap: 'pauseTapped'}\n+\t\t\t\t]}\n+\t\t\t]}\n+\t\t],\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tbindings: [\n+\t\t\t{from: '.disabled', to: '.$.headerWrapper.disabled'},\n+\t\t\t{from: '.startConent', to: '.$.startButton.content'},\n+\t\t\t{from: '.pauseConent', to: '.$.pauseButton.content'},\n+\t\t\t{from: '.pauseDisabled', to: '.$.pauseButton.disabled'},\n+\t\t\t{from: '.enableTimer', to: '.$.buttonPlaceHolder.showing'}\n+\t\t],\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tconstructor: function () {\n+\t\t\tthis.inherited(arguments);\n+\t\t\tthis.valueArray = {\n+\t\t\t\t'hour': 0,\n+\t\t\t\t'minute': 0,\n+\t\t\t\t'second': 0\n+\t\t\t};\n+\t\t\tthis.templateArray = [];\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tcreate: function () {\n+\t\t\tthis.inherited(arguments);\n+\t\t\tthis.initDefaults();\n+\t\t},\n+\n+\t\t/**\n+\t\t* @fires moon.DurationePicker#onChange\n+\t\t* @private\n+\t\t*/\n+\t\thandleChangeEvent: function (sender, ev) {\n+\t\t\tif (ev && ev.originator === this) {\n+\t\t\t\t// Don't handle our own change events\n+\t\t\t\treturn;\n+\t\t\t} else {\n+\t\t\t\tthis.updateValue(sender, ev);\n+\t\t\t\treturn true;\n+\t\t\t}\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tinitDefaults: function () {\n+\t\t\tthis.currentTemplate();\n+\t\t\tthis.setupPickers();\n+\t\t\tif(this.value !== '') {\n+\t\t\t\tthis.valueChanged();\n+\t\t\t} else {\n+\t\t\t\tthis.noneTextChanged();\n+\t\t\t}\n+\t\t},\n+\n+\t\t/**\n+\t\t* creating the hour, minute and second picker components\n+\t\t*\n+\t\t* @private\n+\t\t*/\n+\t\tsetupPickers: function () {\n+\t\t\tvar len, idx, item;\n+\t\t\tlen = this.templateArray.length;\n+\t\t\tif (len) {\n+\t\t\t\tfor (idx = 0; idx < len; idx++) {\n+\t\t\t\t\titem = this.templateArray[idx];\n+\t\t\t\t\tswitch (item) {\n+\t\t\t\t\tcase 'h':\n+\t\t\t\t\t\tthis.createComponent(\n+\t\t\t\t\t\t\t{name: 'hourPicker', classes: 'moon-date-picker-wrap', components:[\n+\t\t\t\t\t\t\t\t{kind: 'moon.IntegerPicker', name: 'hour', min: 0, max: 23, wrap: true, value: this.valueArray.hour, disabled: this.countdown},\n+\t\t\t\t\t\t\t\t{name: 'hourLabel', content: this.hourText, classes: 'moon-date-picker-label moon-divider-text'}\n+\t\t\t\t\t\t\t]}\n+\t\t\t\t\t\t);\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tcase 'm':\n+\t\t\t\t\t\tthis.createComponent(\n+\t\t\t\t\t\t\t{name: 'minutePicker', classes: 'moon-date-picker-wrap', components:[\n+\t\t\t\t\t\t\t\t{kind: 'moon.IntegerPicker', name: 'minute', classes: 'moon-date-picker-field', min: 0, max: 59, wrap: true, value: this.valueArray.minute, disabled: this.countdown},\n+\t\t\t\t\t\t\t\t{name: 'minuteLabel', content: this.minuteText, classes: 'moon-date-picker-label moon-divider-text'}\n+\t\t\t\t\t\t\t]}\n+\t\t\t\t\t\t);\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tcase 's':\n+\t\t\t\t\t\tthis.createComponent(\n+\t\t\t\t\t\t\t{name: 'secondPicker', classes: 'moon-date-picker-wrap', components:[\n+\t\t\t\t\t\t\t\t{kind: 'moon.IntegerPicker', name: 'second', classes: 'moon-date-picker-field', min: 0, max: 59, wrap: true, value: this.valueArray.second, disabled: this.countdown},\n+\t\t\t\t\t\t\t\t{name: 'secondLabel', content: this.secondText, classes: 'moon-date-picker-label moon-divider-text'}\n+\t\t\t\t\t\t\t]}\n+\t\t\t\t\t\t);\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tthis.createComponent(\n+\t\t\t\t\t{name: 'hourPicker', classes: 'moon-date-picker-wrap', components:[\n+\t\t\t\t\t\t{kind: 'moon.IntegerPicker', name: 'hour', min: 0, max: 23, wrap: true, value: this.valueArray.hour, disabled: this.countdown},\n+\t\t\t\t\t\t{name: 'hourLabel', content: this.hourText, classes: 'moon-date-picker-label moon-divider-text'}\n+\t\t\t\t\t]}\n+\t\t\t\t);\n+\t\t\t\tthis.createComponent(\n+\t\t\t\t\t{name: 'minutePicker', classes: 'moon-date-picker-wrap', components:[\n+\t\t\t\t\t\t{kind: 'moon.IntegerPicker', name: 'minute', classes: 'moon-date-picker-field', min: 0, max: 59, wrap: true, value: this.valueArray.minute, disabled: this.countdown},\n+\t\t\t\t\t\t{name: 'minuteLabel', content: this.minuteText, classes: 'moon-date-picker-label moon-divider-text'}\n+\t\t\t\t\t]}\n+\t\t\t\t);\n+\t\t\t\tthis.createComponent(\n+\t\t\t\t\t{name: 'secondPicker', classes: 'moon-date-picker-wrap', components:[\n+\t\t\t\t\t\t{kind: 'moon.IntegerPicker', name: 'second', classes: 'moon-date-picker-field', min: 0, max: 59, wrap: true, value: this.valueArray.second, disabled: this.countdownSS},\n+\t\t\t\t\t\t{name: 'secondLabel', content: this.secondText, classes: 'moon-date-picker-label moon-divider-text'}\n+\t\t\t\t\t]}\n+\t\t\t\t);\n+\t\t\t}\n+\t\t\tthis.render();\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tcurrentTemplate: function () {\n+\t\t\tif (this.template) {\n+\t\t\t\tvar orderingArr = this.template.toLowerCase().split('');\n+\t\t\t\tvar o,f,l;\n+\t\t\t\tfor (f = 0, l = orderingArr.length; f < l; f++) {\n+\t\t\t\t\to = orderingArr[f].toLowerCase();\n+\t\t\t\t\t//only accepts the hour, minute, second template values 'h', 'm' and 's'\n+\t\t\t\t\tif (this.templateArray.indexOf(o) < 0 && (o == 'h' || o == 'm' || o == 's' )) {\n+\t\t\t\t\t\tthis.templateArray.push(o);\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\tif (!this.templateArray.length) {\n+\t\t\t\t\tthis.templateArray.push('h','m','s');\n+\t\t\t\t}\n+\t\t\t\treturn;\n+\t\t\t}\n+\t\t\tthis.templateArray.push('h','m','s');\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\ttemplateChanged: function () {\n+\t\t\tthis.templateArray = [];\n+\t\t\tthis.deletePickers();\n+\t\t\tthis.currentTemplate();\n+\t\t\tthis.setupPickers();\n+\t\t\tthis.setupArray();\n+\t\t\tthis.setValue(this.formatValue());\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tsetupArray: function () {\n+\t\t\tif (this.template.search('h') < 0)\n+\t\t\t\tthis.valueArray['hour'] = 0;\n+\t\t\tif (this.template.search('m') < 0)\n+\t\t\t\tthis.valueArray['minute'] = 0;\n+\t\t\tif (this.template.search('s') < 0)\n+\t\t\t\tthis.valueArray['second'] = 0;\n+\t\t},\n+\n+\t\t/**\n+\t\t* If no item is selected, uses [`noneText`]{@link moon.DurationPicker#noneText}\n+\t\t* as current value and if nonoText value is not provided, use 'Pick Duration'\n+\t\t* as default.\n+\t\t*\n+\t\t* @private\n+\t\t*/\n+\t\tnoneTextChanged: function () {\n+\t\t\tif (this.value == null || this.value === '') {\n+\t\t\t\tthis.$.currentValue.set('content', moon.$L(this.getNoneText()) || moon.$L('Pick Duration'));\n+\t\t\t}\n+\t\t},\n+\n+\t\t\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tvalueChanged: function () {\n+\t\t\tif (this.value == null || this.value === '') {\n+\t\t\t\tthis.resetPicker();\n+\t\t\t\tthis.noneTextChanged();\n+\t\t\t\tthis.doDurationChange({name: this.name, value: this.$.currentValue.content});\n+\t\t\t} else {\n+\t\t\t\tthis.createValueArray();\n+\t\t\t\tthis.updatePicker();\n+\t\t\t\tthis.$.currentValue.set('content', this.formatText());\n+\t\t\t}\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tcreateValueArray: function () {\n+\t\t\tvar tempValue;\n+\t\t\tif (this.value != null && this.value !== '') {\n+\t\t\t\tvar timeArray = this.value.toString().split(':');\n+\t\t\t\tfor (var idx = 0; idx < this.templateArray.length; idx++) {\n+\t\t\t\t\tvar item = this.templateArray[idx];\n+\t\t\t\t\tswitch (item) {\n+\t\t\t\t\t\tcase 'h':\n+\t\t\t\t\t\tif (this.$.hourPicker || !this.$.hourPicker && timeArray.length > 2) {\n+\t\t\t\t\t\t\ttempValue = Math.round(timeArray.shift());\n+\t\t\t\t\t\t\tif (isNaN(tempValue) || tempValue > 23 || tempValue < 0) {\n+\t\t\t\t\t\t\t\ttempValue = 0;\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\tthis.valueArray['hour'] = tempValue;\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\tcase 'm':\n+\t\t\t\t\t\tif (this.$.minutePicker || !this.$.minutePicker && timeArray.length > 1) {\n+\t\t\t\t\t\t\ttempValue = Math.round(timeArray.shift());\n+\t\t\t\t\t\t\tif (isNaN(tempValue) || tempValue > 59 || tempValue < 0) {\n+\t\t\t\t\t\t\t\ttempValue = 0;\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\tthis.valueArray['minute'] = tempValue;\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\tcase 's':\n+\t\t\t\t\t\tif (this.$.secondPicker || !this.$.secondPicker && timeArray.length > 0) {\n+\t\t\t\t\t\t\ttempValue = Math.round(timeArray.shift());\n+\t\t\t\t\t\t\tif (isNaN(tempValue) || tempValue> 59 || tempValue < 0) {\n+\t\t\t\t\t\t\t\ttempValue = 0;\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\tthis.valueArray['second'] = tempValue;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tupdatePicker: function () {\n+\t\t\tif (this.$.hourPicker && this.$.hour.value != this.valueArray['hour'])\n+\t\t\t\tthis.$.hour.set('value', this.valueArray['hour']);\n+\n+\t\t\tif (this.$.minutePicker && this.$.minute.value != this.valueArray['minute'])\n+\t\t\t\tthis.$.minute.set('value', this.valueArray['minute']);\n+\n+\t\t\tif (this.$.secondPicker && this.$.second.value != this.valueArray['second'])\n+\t\t\t\tthis.$.second.set('value',this.valueArray['second']);\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tformatValue: function () {\n+\t\t\tvar item, idx, val = '';\n+\t\t\tfor (idx = 0; idx < this.templateArray.length; idx++) {\n+\t\t\t\titem = this.templateArray[idx];\n+\t\t\t\tswitch (item) {\n+\t\t\t\t\tcase 'h':\n+\t\t\t\t\t\tval = val + ':' + this.valueArray['hour'];\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tcase 'm':\n+\t\t\t\t\t\tval = val + ':' + this.valueArray['minute'];\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tcase 's':\n+\t\t\t\t\t\tval = val + ':' + this.valueArray['second'];\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\treturn val.substring(1);\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tformatText: function () {\n+\t\t\tvar item, idx, text = '';\n+\t\t\tif (this.valueArray) {\n+\t\t\t\tfor (idx = 0; idx < this.templateArray.length; idx++) {\n+\t\t\t\t\titem = this.templateArray[idx];\n+\t\t\t\t\tswitch (item) {\n+\t\t\t\t\t\tcase 'h':\n+\t\t\t\t\t\t\ttext = text + ' ' + this.valueArray['hour'] + ' ' + moon.$L('Hours');\n+\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\tcase 'm':\n+\t\t\t\t\t\t\ttext = text + ' ' + this.valueArray['minute'] + ' ' + moon.$L('Minutes');\n+\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\tcase 's':\n+\t\t\t\t\t\t\ttext = text + ' ' + this.valueArray['second'] + ' ' + moon.$L('Seconds');\n+\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tthis.doDurationChange({name: this.name, value: text});\n+\t\t\treturn text.trim();\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\ttick: function () {\n+\t\t\tvar hr = this.valueArray['hour'];\n+\t\t\tvar mn = this.valueArray['minute'];\n+\t\t\tvar ss = this.valueArray['second'];\n+\t\t\tif (hr <= 0 && mn <= 0 && ss <= 0) {\n+\t\t\t\tthis.pickerExpired();\n+\t\t\t\treturn;\n+\t\t\t} else {\n+\t\t\t\tif (ss === 0 ) {\n+\t\t\t\t\tss = 59;\n+\t\t\t\t\tthis.valueArray['second'] = ss;\n+\t\t\t\t\tif (mn > 0 ) {\n+\t\t\t\t\t\tmn--;\n+\t\t\t\t\t\tthis.valueArray['minute'] = mn;\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tmn = 59;\n+\t\t\t\t\t\thr--;\n+\t\t\t\t\t\tthis.valueArray['minute'] = mn;\n+\t\t\t\t\t\tthis.valueArray['hour'] = hr;\n+\t\t\t\t\t}\n+\t\t\t\t} else {\n+\t\t\t\t\tss--;\n+\t\t\t\t\tthis.valueArray['second'] = ss;\n+\t\t\t\t}\n+\t\t\t\tthis.set('value', this.formatValue());\n+\t\t\t}\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tupdateValue: function (sender, ev) {\n+\t\t\tvar hour = this.$.hourPicker ? this.$.hour.get('value') : this.valueArray['hour'];\n+\t\t\tvar minute = this.$.minutePicker ? this.$.minute.get('value') : this.valueArray['minute'];\n+\t\t\tvar second = this.$.secondPicker ? this.$.second.get('value') : this.valueArray['second'];\n+\t\t\tif (ev.name == 'second' && this.valueArray['second'] == second) {\n+\t\t\t\treturn;\n+\t\t\t} else if (ev.name == 'minute' &&  this.valueArray['minute'] == minute) {\n+\t\t\t\treturn;\n+\t\t\t} else if (ev.name == 'hour' && this.valueArray['hour'] == hour) {\n+\t\t\t\treturn;\n+\t\t\t}\n+\t\t\tthis.valueArray['second'] = second;\n+\t\t\tthis.valueArray['minute'] = minute;\n+\t\t\tthis.valueArray['hour'] = hour;\n+\t\t\tthis.set('value', this.formatValue());\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tpickerExpired: function () {\n+\t\t\tthis.cancelPicker();\n+\t\t\tthis.doPickerExpired({name:this.name});\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tchangeCountdown: function () {\n+\t\t\tif (this.countdown) {\n+\t\t\t\tif (this.$.hour)\n+\t\t\t\t\tthis.$.hour.set('disabled', true);\n+\t\t\t\tif (this.$.minute)\n+\t\t\t\t\tthis.$.minute.set('disabled', true);\n+\t\t\t\tif (this.$.second)\n+\t\t\t\t\tthis.$.second.set('disabled' , true);\n+\t\t\t} else {\n+\t\t\t\tif (this.$.hour)\n+\t\t\t\t\tthis.$.hour.set('disabled', false);\n+\t\t\t\tif (this.$.minute)\n+\t\t\t\t\tthis.$.minute.set('disabled', false);\n+\t\t\t\tif (this.$.second)\n+\t\t\t\t\tthis.$.second.set('disabled' , false);\n+\t\t\t}\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tstartTapped: function () {\n+\t\t\tif (this.startConent == moon.$L('Start')) {\n+\t\t\t\tif(this.valueArray['hour'] || this.valueArray['minute'] || this.valueArray['second']) {\n+\t\t\t\t\tthis.startPicker();\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tthis.set('value', '');\n+\t\t\t}\n+\t\t},\n+\n+\t\t/**\n+\t\t* @private\n+\t\t*/\n+\t\tpauseTapped: function () {\n+\t\t\tif (this.pauseConent == moon.$L('Pause')) {","path":"source/DurationPicker.js","position":610,"original_position":610,"commit_id":"47af3d418dd48d9631445eecc3d379a08d9d9bac","original_commit_id":"47af3d418dd48d9631445eecc3d379a08d9d9bac","user":{"login":"aarontam","id":463191,"avatar_url":"https://avatars.githubusercontent.com/u/463191?v=3","gravatar_id":"","url":"https://api.github.com/users/aarontam","html_url":"https://github.com/aarontam","followers_url":"https://api.github.com/users/aarontam/followers","following_url":"https://api.github.com/users/aarontam/following{/other_user}","gists_url":"https://api.github.com/users/aarontam/gists{/gist_id}","starred_url":"https://api.github.com/users/aarontam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aarontam/subscriptions","organizations_url":"https://api.github.com/users/aarontam/orgs","repos_url":"https://api.github.com/users/aarontam/repos","events_url":"https://api.github.com/users/aarontam/events{/privacy}","received_events_url":"https://api.github.com/users/aarontam/received_events","type":"User","site_admin":false},"body":"Same as above - makes me uncomfortable to be comparing against an effectively static string as a way of knowing our current state.","created_at":"2015-03-03T20:28:19Z","updated_at":"2015-03-03T20:28:19Z","html_url":"https://github.com/enyojs/moonstone/pull/1978#discussion_r25723450","pull_request_url":"https://api.github.com/repos/enyojs/moonstone/pulls/1978","_links":{"self":{"href":"https://api.github.com/repos/enyojs/moonstone/pulls/comments/25723450"},"html":{"href":"https://github.com/enyojs/moonstone/pull/1978#discussion_r25723450"},"pull_request":{"href":"https://api.github.com/repos/enyojs/moonstone/pulls/1978"}}},"pull_request":{"url":"https://api.github.com/repos/enyojs/moonstone/pulls/1978","id":28909007,"html_url":"https://github.com/enyojs/moonstone/pull/1978","diff_url":"https://github.com/enyojs/moonstone/pull/1978.diff","patch_url":"https://github.com/enyojs/moonstone/pull/1978.patch","issue_url":"https://api.github.com/repos/enyojs/moonstone/issues/1978","number":1978,"state":"open","locked":false,"title":"ENYO-493: Duration Picker(hour, minute, second)","user":{"login":"anishlg","id":4177581,"avatar_url":"https://avatars.githubusercontent.com/u/4177581?v=3","gravatar_id":"","url":"https://api.github.com/users/anishlg","html_url":"https://github.com/anishlg","followers_url":"https://api.github.com/users/anishlg/followers","following_url":"https://api.github.com/users/anishlg/following{/other_user}","gists_url":"https://api.github.com/users/anishlg/gists{/gist_id}","starred_url":"https://api.github.com/users/anishlg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anishlg/subscriptions","organizations_url":"https://api.github.com/users/anishlg/orgs","repos_url":"https://api.github.com/users/anishlg/repos","events_url":"https://api.github.com/users/anishlg/events{/privacy}","received_events_url":"https://api.github.com/users/anishlg/received_events","type":"User","site_admin":false},"body":"updated the old duration picker\r\nhttps://github.com/enyojs/moonstone/pull/1553\r\n\r\nreview comments updated\r\n1. Used single value property than using hour, minute and seconds values separately.\r\n2. Min/max values are removed as it's always constant.\r\n3. Combined DurationPickerBase and DurationPcker into a single file as there won't be any future sub kinds for DurationPcker \r\n4.Made the template property published.\r\n5. Removed DurationPickerBase.openChanged method as it doesn't do anything\r\n6. Updated the sample.","created_at":"2015-02-09T10:18:59Z","updated_at":"2015-03-03T20:28:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fadac1f7ce9dff942eb8b32238704df2f6b70973","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/enyojs/moonstone/pulls/1978/commits","review_comments_url":"https://api.github.com/repos/enyojs/moonstone/pulls/1978/comments","review_comment_url":"https://api.github.com/repos/enyojs/moonstone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enyojs/moonstone/issues/1978/comments","statuses_url":"https://api.github.com/repos/enyojs/moonstone/statuses/47af3d418dd48d9631445eecc3d379a08d9d9bac","head":{"label":"enyojs:enyo-493-anishlg","ref":"enyo-493-anishlg","sha":"47af3d418dd48d9631445eecc3d379a08d9d9bac","user":{"login":"enyojs","id":1266337,"avatar_url":"https://avatars.githubusercontent.com/u/1266337?v=3","gravatar_id":"","url":"https://api.github.com/users/enyojs","html_url":"https://github.com/enyojs","followers_url":"https://api.github.com/users/enyojs/followers","following_url":"https://api.github.com/users/enyojs/following{/other_user}","gists_url":"https://api.github.com/users/enyojs/gists{/gist_id}","starred_url":"https://api.github.com/users/enyojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enyojs/subscriptions","organizations_url":"https://api.github.com/users/enyojs/orgs","repos_url":"https://api.github.com/users/enyojs/repos","events_url":"https://api.github.com/users/enyojs/events{/privacy}","received_events_url":"https://api.github.com/users/enyojs/received_events","type":"Organization","site_admin":false},"repo":{"id":7251076,"name":"moonstone","full_name":"enyojs/moonstone","owner":{"login":"enyojs","id":1266337,"avatar_url":"https://avatars.githubusercontent.com/u/1266337?v=3","gravatar_id":"","url":"https://api.github.com/users/enyojs","html_url":"https://github.com/enyojs","followers_url":"https://api.github.com/users/enyojs/followers","following_url":"https://api.github.com/users/enyojs/following{/other_user}","gists_url":"https://api.github.com/users/enyojs/gists{/gist_id}","starred_url":"https://api.github.com/users/enyojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enyojs/subscriptions","organizations_url":"https://api.github.com/users/enyojs/orgs","repos_url":"https://api.github.com/users/enyojs/repos","events_url":"https://api.github.com/users/enyojs/events{/privacy}","received_events_url":"https://api.github.com/users/enyojs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enyojs/moonstone","description":"Moonstone UI library for TV user interfaces.","fork":false,"url":"https://api.github.com/repos/enyojs/moonstone","forks_url":"https://api.github.com/repos/enyojs/moonstone/forks","keys_url":"https://api.github.com/repos/enyojs/moonstone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enyojs/moonstone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enyojs/moonstone/teams","hooks_url":"https://api.github.com/repos/enyojs/moonstone/hooks","issue_events_url":"https://api.github.com/repos/enyojs/moonstone/issues/events{/number}","events_url":"https://api.github.com/repos/enyojs/moonstone/events","assignees_url":"https://api.github.com/repos/enyojs/moonstone/assignees{/user}","branches_url":"https://api.github.com/repos/enyojs/moonstone/branches{/branch}","tags_url":"https://api.github.com/repos/enyojs/moonstone/tags","blobs_url":"https://api.github.com/repos/enyojs/moonstone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enyojs/moonstone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enyojs/moonstone/git/refs{/sha}","trees_url":"https://api.github.com/repos/enyojs/moonstone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enyojs/moonstone/statuses/{sha}","languages_url":"https://api.github.com/repos/enyojs/moonstone/languages","stargazers_url":"https://api.github.com/repos/enyojs/moonstone/stargazers","contributors_url":"https://api.github.com/repos/enyojs/moonstone/contributors","subscribers_url":"https://api.github.com/repos/enyojs/moonstone/subscribers","subscription_url":"https://api.github.com/repos/enyojs/moonstone/subscription","commits_url":"https://api.github.com/repos/enyojs/moonstone/commits{/sha}","git_commits_url":"https://api.github.com/repos/enyojs/moonstone/git/commits{/sha}","comments_url":"https://api.github.com/repos/enyojs/moonstone/comments{/number}","issue_comment_url":"https://api.github.com/repos/enyojs/moonstone/issues/comments{/number}","contents_url":"https://api.github.com/repos/enyojs/moonstone/contents/{+path}","compare_url":"https://api.github.com/repos/enyojs/moonstone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enyojs/moonstone/merges","archive_url":"https://api.github.com/repos/enyojs/moonstone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enyojs/moonstone/downloads","issues_url":"https://api.github.com/repos/enyojs/moonstone/issues{/number}","pulls_url":"https://api.github.com/repos/enyojs/moonstone/pulls{/number}","milestones_url":"https://api.github.com/repos/enyojs/moonstone/milestones{/number}","notifications_url":"https://api.github.com/repos/enyojs/moonstone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enyojs/moonstone/labels{/name}","releases_url":"https://api.github.com/repos/enyojs/moonstone/releases{/id}","created_at":"2012-12-20T02:41:05Z","updated_at":"2015-03-02T23:05:24Z","pushed_at":"2015-03-03T14:49:58Z","git_url":"git://github.com/enyojs/moonstone.git","ssh_url":"git@github.com:enyojs/moonstone.git","clone_url":"https://github.com/enyojs/moonstone.git","svn_url":"https://github.com/enyojs/moonstone","homepage":"","size":87467,"stargazers_count":29,"watchers_count":29,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":21,"forks":10,"open_issues":21,"watchers":29,"default_branch":"master"}},"base":{"label":"enyojs:master","ref":"master","sha":"1fd0cb94c4db3650bc8ee33f3f48436792b929cf","user":{"login":"enyojs","id":1266337,"avatar_url":"https://avatars.githubusercontent.com/u/1266337?v=3","gravatar_id":"","url":"https://api.github.com/users/enyojs","html_url":"https://github.com/enyojs","followers_url":"https://api.github.com/users/enyojs/followers","following_url":"https://api.github.com/users/enyojs/following{/other_user}","gists_url":"https://api.github.com/users/enyojs/gists{/gist_id}","starred_url":"https://api.github.com/users/enyojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enyojs/subscriptions","organizations_url":"https://api.github.com/users/enyojs/orgs","repos_url":"https://api.github.com/users/enyojs/repos","events_url":"https://api.github.com/users/enyojs/events{/privacy}","received_events_url":"https://api.github.com/users/enyojs/received_events","type":"Organization","site_admin":false},"repo":{"id":7251076,"name":"moonstone","full_name":"enyojs/moonstone","owner":{"login":"enyojs","id":1266337,"avatar_url":"https://avatars.githubusercontent.com/u/1266337?v=3","gravatar_id":"","url":"https://api.github.com/users/enyojs","html_url":"https://github.com/enyojs","followers_url":"https://api.github.com/users/enyojs/followers","following_url":"https://api.github.com/users/enyojs/following{/other_user}","gists_url":"https://api.github.com/users/enyojs/gists{/gist_id}","starred_url":"https://api.github.com/users/enyojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enyojs/subscriptions","organizations_url":"https://api.github.com/users/enyojs/orgs","repos_url":"https://api.github.com/users/enyojs/repos","events_url":"https://api.github.com/users/enyojs/events{/privacy}","received_events_url":"https://api.github.com/users/enyojs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enyojs/moonstone","description":"Moonstone UI library for TV user interfaces.","fork":false,"url":"https://api.github.com/repos/enyojs/moonstone","forks_url":"https://api.github.com/repos/enyojs/moonstone/forks","keys_url":"https://api.github.com/repos/enyojs/moonstone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enyojs/moonstone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enyojs/moonstone/teams","hooks_url":"https://api.github.com/repos/enyojs/moonstone/hooks","issue_events_url":"https://api.github.com/repos/enyojs/moonstone/issues/events{/number}","events_url":"https://api.github.com/repos/enyojs/moonstone/events","assignees_url":"https://api.github.com/repos/enyojs/moonstone/assignees{/user}","branches_url":"https://api.github.com/repos/enyojs/moonstone/branches{/branch}","tags_url":"https://api.github.com/repos/enyojs/moonstone/tags","blobs_url":"https://api.github.com/repos/enyojs/moonstone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enyojs/moonstone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enyojs/moonstone/git/refs{/sha}","trees_url":"https://api.github.com/repos/enyojs/moonstone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enyojs/moonstone/statuses/{sha}","languages_url":"https://api.github.com/repos/enyojs/moonstone/languages","stargazers_url":"https://api.github.com/repos/enyojs/moonstone/stargazers","contributors_url":"https://api.github.com/repos/enyojs/moonstone/contributors","subscribers_url":"https://api.github.com/repos/enyojs/moonstone/subscribers","subscription_url":"https://api.github.com/repos/enyojs/moonstone/subscription","commits_url":"https://api.github.com/repos/enyojs/moonstone/commits{/sha}","git_commits_url":"https://api.github.com/repos/enyojs/moonstone/git/commits{/sha}","comments_url":"https://api.github.com/repos/enyojs/moonstone/comments{/number}","issue_comment_url":"https://api.github.com/repos/enyojs/moonstone/issues/comments{/number}","contents_url":"https://api.github.com/repos/enyojs/moonstone/contents/{+path}","compare_url":"https://api.github.com/repos/enyojs/moonstone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enyojs/moonstone/merges","archive_url":"https://api.github.com/repos/enyojs/moonstone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enyojs/moonstone/downloads","issues_url":"https://api.github.com/repos/enyojs/moonstone/issues{/number}","pulls_url":"https://api.github.com/repos/enyojs/moonstone/pulls{/number}","milestones_url":"https://api.github.com/repos/enyojs/moonstone/milestones{/number}","notifications_url":"https://api.github.com/repos/enyojs/moonstone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enyojs/moonstone/labels{/name}","releases_url":"https://api.github.com/repos/enyojs/moonstone/releases{/id}","created_at":"2012-12-20T02:41:05Z","updated_at":"2015-03-02T23:05:24Z","pushed_at":"2015-03-03T14:49:58Z","git_url":"git://github.com/enyojs/moonstone.git","ssh_url":"git@github.com:enyojs/moonstone.git","clone_url":"https://github.com/enyojs/moonstone.git","svn_url":"https://github.com/enyojs/moonstone","homepage":"","size":87467,"stargazers_count":29,"watchers_count":29,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":21,"forks":10,"open_issues":21,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enyojs/moonstone/pulls/1978"},"html":{"href":"https://github.com/enyojs/moonstone/pull/1978"},"issue":{"href":"https://api.github.com/repos/enyojs/moonstone/issues/1978"},"comments":{"href":"https://api.github.com/repos/enyojs/moonstone/issues/1978/comments"},"review_comments":{"href":"https://api.github.com/repos/enyojs/moonstone/pulls/1978/comments"},"review_comment":{"href":"https://api.github.com/repos/enyojs/moonstone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enyojs/moonstone/pulls/1978/commits"},"statuses":{"href":"https://api.github.com/repos/enyojs/moonstone/statuses/47af3d418dd48d9631445eecc3d379a08d9d9bac"}}}}