Produced by Araxis Merge on 12/7/2018 11:36:04 AM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\SCRUB\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\new-appointment-request\views\direct\preferred-date | preferred-date-layout.js | Mon Oct 22 23:25:20 2018 UTC |
| 2 | C:\MHED-scrubbed\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\new-appointment-request\views\direct\preferred-date | preferred-date-layout.js | Fri Dec 7 13:07:40 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 5 | 558 |
| Changed | 4 | 8 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | // normall y the mode l is passe d to the v iew instea d of the v iew creati ng the mod el | |
| 2 | define([ | |
| 3 | 'under score', | |
| 4 | 'backb one', | |
| 5 | 'mario nette', | |
| 6 | 'momen t', | |
| 7 | 'Vent' , | |
| 8 | 'text! modules/ne w-appointm ent-reques t/views/di rect/prefe rred-date/ templates/ preferred- date-layou t.html', | |
| 9 | ||
| 10 | 'modul es/new-app ointment-r equest/res ources/dir ect/prefer red-date/t ime-slots- by-date-co llection', | |
| 11 | 'modul es/new-app ointment-r equest/res ources/dir ect/prefer red-date/t ime-slots- collection ', | |
| 12 | ||
| 13 | 'modul es/form/qu estion-mod el', | |
| 14 | 'modul es/form/qu estion-vie w', | |
| 15 | 'text! modules/ne w-appointm ent-reques t/views/di rect/prefe rred-date/ templates/ _preferred -date-desc ription.ht ml', | |
| 16 | 'modul es/new-app ointment-r equest/vie ws/direct/ preferred- date/prefe rred-date- available' , | |
| 17 | 'modul es/new-app ointment-r equest/vie ws/direct/ preferred- date/close st-dates', | |
| 18 | 'modul es/new-app ointment-r equest/vie ws/direct/ preferred- date/all-d ates', | |
| 19 | 'modul es/new-app ointment-r equest/vie ws/direct/ preferred- date/selec ted-date-t ime', | |
| 20 | 'text! modules/ne w-appointm ent-reques t/views/di rect/prefe rred-date/ templates/ _selected- date-time- aria-messa ge.html', | |
| 21 | ], | |
| 22 | function( | |
| 23 | _, | |
| 24 | Backbo ne, | |
| 25 | Marion ette, | |
| 26 | moment , | |
| 27 | radio, | |
| 28 | templa te, | |
| 29 | TimeSl otsByDateC ollection, | |
| 30 | TimeSl otsCollect ion, | |
| 31 | Questi onModel, Q uestionVie w, | |
| 32 | _prefe rredDateDe scriptionT emplate, | |
| 33 | Prefer redDateAva ilableView , | |
| 34 | Closes tDatesView , | |
| 35 | AllDat esView, | |
| 36 | Select edDateTime View, | |
| 37 | _ariaL iveMessage Template | |
| 38 | ) { | |
| 39 | 'use s trict'; | |
| 40 | ||
| 41 | // whe n a button is clicke d ('time-s lot:select ed'), save the date to this.mo del (form model) | |
| 42 | return Backbone. Marionette .View.exte nd({ | |
| 43 | te mplate: te mplate, | |
| 44 | re gions: { | |
| 45 | preferre dDateRegio n: '.form- section', | |
| 46 | availabl eDatesTime sRegion: ' .available -dates-tim es-section ', | |
| 47 | selected DateTimeSl otRegion: '.selected -date-time -slot-sect ion', | |
| 48 | ariaLive Region: '. content-li ve-region' , | |
| 49 | }, | |
| 50 | $a ctiveButto n: $(), // a TimeBut tonView | |
| 51 | mo delEvents: { | |
| 52 | 'change: desiredDat e': 'toggl eAvailabil ityButton resetAvail ableDatesT imeRegion hideAllDat esButton', | |
| 53 | }, | |
| 54 | ev ents: { | |
| 55 | 'click # show-avail ability-bt n': 'showA vailabilit y', | |
| 56 | 'click # show-all-d ates-btn': 'showAllD atesView', | |
| 57 | }, | |
| 58 | in itialize: function() { | |
| 59 | this.pre ferredDate Model = ne w Question Model({ | |
| 60 | 'id' : 'desired Date', | |
| 61 | 'cla ss': 'pref erred-date -question' , | |
| 62 | 'typ e': 'text- datepicker ', | |
| 63 | 'lab el': 'Pref erred Date :', | |
| 64 | 'des criptionTe mplate': _ preferredD ateDescrip tionTempla te, | |
| 65 | 'req uired': tr ue, | |
| 66 | 'val idate': { | |
| 67 | 'rules': { | |
| 68 | 'forma ttedDate': true, | |
| 69 | 'dateI nRange': t rue, | |
| 70 | }, | |
| 71 | }, | |
| 72 | }); | |
| 73 | }, | |
| 74 | // given a s orted time slots col lection, g roup time slots by d ate | |
| 75 | gr oupTimeSlo tsByDate: function(t imeSlotsCo llection) { | |
| 76 | var grou pedTimeSlo ts = new T imeSlotsBy DateCollec tion(); | |
| 77 | var date Length = 1 0; | |
| 78 | ||
| 79 | timeSlot sCollectio n.each(fun ction(time Slot) { | |
| 80 | var dateString = timeSlo t.get('sta rtDateTime ').substri ng(0, date Length); | |
| 81 | var currentGro up = group edTimeSlot s.at(group edTimeSlot s.length - 1); | |
| 82 | if ( _.isUndefi ned(curren tGroup) || currentGr oup.get('d ate') !== dateString ) { | |
| 83 | groupedTim eSlots.add ({ | |
| 84 | date: dateString , | |
| 85 | timeSl ots: new T imeSlotsCo llection([ timeSlot]) , | |
| 86 | }, {silent : true}); | |
| 87 | } el se { | |
| 88 | // add sil ently, eve nting not needed yet | |
| 89 | currentGro up.get('ti meSlots'). add(timeSl ot, {silen t: true}); | |
| 90 | } | |
| 91 | }); | |
| 92 | ||
| 93 | return g roupedTime Slots; | |
| 94 | }, | |
| 95 | updateF DNS elPreferre dDate: fun ction(pref erredDateM odel) { | |
| 96 | var date String = ' '; | |
| 97 | var desi redDate = preferredD ateModel.g et('value' ); | |
| 98 | if (desi redDate != = '' && !_ .isUndefin ed(desired Date)) { | |
| 99 | desi redDate.se tHours(0, 0, 0, 0); | |
| 100 | date String = m oment(pref erredDateM odel.get(' value')).f ormat('MM/ DD/YYYY 00 :00:00'); | |
| 101 | } | |
| 102 | if (date String !== '') { | |
| 103 | this .model.set ('desiredD ate', date String); | |
| 104 | } else { | |
| 105 | this .model.uns et('desire dDate'); | |
| 106 | } | |
| 107 | if (this .model.has ('dateTime ')) { | |
| 108 | this .model.uns et('dateTi me'); | |
| 109 | } | |
| 110 | }, | |
| 111 | updateF DNS elDateTime : function (timeSlotM odel) { | |
| 112 | var oneM inInMs = 6 0000; | |
| 113 | var sTim e = new Da te(timeSlo tModel.get ('startDat eTime')); | |
| 114 | var eTim e = new Da te(timeSlo tModel.get ('endDateT ime')); | |
| 115 | this.mod el.set({ | |
| 116 | date Time: time SlotModel. get('start DateTime') , | |
| 117 | appt Length: (e Time - sTi me) / oneM inInMs, | |
| 118 | }); | |
| 119 | }, | |
| 120 | ||
| 121 | on Render: fu nction() { | |
| 122 | this.sho wPreferred DateQuesti onView(); | |
| 123 | this.sho wSelectedD ateTimeVie w(); | |
| 124 | this.upd ateSelecte dDateTimeA riaMessage (); | |
| 125 | ||
| 126 | this.tim eSlotsByDa teCollecti on = this. groupTimeS lotsByDate (this.coll ection); | |
| 127 | ||
| 128 | this.tog gleAvailab ilityButto n(); | |
| 129 | this.hid eAllDatesB utton(); | |
| 130 | ||
| 131 | radio.of f('time-sl ot:selecte d', undefi ned, this) ; | |
| 132 | radio.on ('time-slo t:selected ', functio n(timeButt onView, ti meSlotMode l) { | |
| 133 | this.updat eF DNS elDateTime (timeSlotM odel); | |
| 134 | this .updateAct iveButton( timeButton View); | |
| 135 | }, this) ; | |
| 136 | }, | |
| 137 | on Destroy: f unction() { | |
| 138 | radio.of f('time-sl ot:selecte d', undefi ned, this) ; | |
| 139 | this.sto pListening (this.pref erredDateM odel, 'cha nge:value' , undefine d); | |
| 140 | delete t his.prefer redDateMod el; | |
| 141 | delete t his.$activ eButton; | |
| 142 | }, | |
| 143 | to ggleAvaila bilityButt on: functi on() { | |
| 144 | if (this .model.has ('desiredD ate')) { | |
| 145 | this .$el.find( '#show-ava ilability- btn') | |
| 146 | .prop('dis abled', fa lse) | |
| 147 | .attr('ari a-disabled ', false) | |
| 148 | .removeCla ss('ui-sta te-disable d') | |
| 149 | .removeAtt r('aria-la bel'); | |
| 150 | } else { | |
| 151 | this .$el.find( '#show-ava ilability- btn') | |
| 152 | .prop('dis abled', tr ue) | |
| 153 | .attr('ari a-disabled ', true) | |
| 154 | .addClass( 'ui-state- disabled') | |
| 155 | .attr('ari a-label', 'Enter a p referred d ate to ena ble Show A vailabilit y button') ; | |
| 156 | } | |
| 157 | }, | |
| 158 | up dateActive Button: fu nction(tim eButtonVie w) { | |
| 159 | this.$ac tiveButton .removeCla ss('ui-btn -active'); | |
| 160 | this.$ac tiveButton .attr('ari a-label', this.$acti veButton.t ext()); | |
| 161 | ||
| 162 | this.$ac tiveButton = timeBut tonView.$e l; | |
| 163 | this.$ac tiveButton .addClass( 'ui-btn-ac tive'); | |
| 164 | this.$ac tiveButton .attr('ari a-label', this.$acti veButton.t ext() + ' selected') ; | |
| 165 | }, | |
| 166 | sh owPreferre dDateQuest ionView: f unction() { | |
| 167 | var pref erredDateR egion = th is.getRegi on('prefer redDateReg ion'); | |
| 168 | ||
| 169 | if (!thi s.isDestro yed()) { | |
| 170 | this .setMinMax Dates(this .preferred DateModel) ; | |
| 171 | ||
| 172 | pref erredDateR egion.show (new Quest ionView({m odel: this .preferred DateModel} )); | |
| 173 | ||
| 174 | this .stopListe ning(this. preferredD ateModel, 'change:va lue', unde fined); | |
| 175 | this.liste nTo(this.p referredDa teModel, ' change:val ue', this. updateF DNS elPreferre dDate); | |
| 176 | } | |
| 177 | }, | |
| 178 | se tMinMaxDat es: functi on(dateQue stionModel ) { | |
| 179 | var toda y = new Da te(); | |
| 180 | var maxR ange = 90; | |
| 181 | var minD ate; | |
| 182 | var maxD ate; | |
| 183 | ||
| 184 | today.se tHours(0, 0, 0, 0); | |
| 185 | minDate = new Date (today); | |
| 186 | maxDate = new Date (today); | |
| 187 | minDate. setDate(mi nDate.getD ate() + 1) ; | |
| 188 | maxDate. setDate(ma xDate.getD ate() + ma xRange); | |
| 189 | ||
| 190 | dateQues tionModel. set({ | |
| 191 | min: minDate, | |
| 192 | max: maxDate, | |
| 193 | }); | |
| 194 | }, | |
| 195 | sh owAvailabi lity: func tion() { | |
| 196 | var date Length = 1 0; | |
| 197 | if (type of gas !== 'undefine d') { | |
| 198 | gas( 'send', 'e vent', 've teran-appo intment', 'user-requ ested-show -availabil ity'); | |
| 199 | } | |
| 200 | ||
| 201 | if (this .timeSlots ByDateColl ection.has Date(this. model.get( 'desiredDa te').subst ring(0, da teLength)) ) { | |
| 202 | this .showPrefe rredDateAv ailableVie w(); | |
| 203 | this .showAllDa tesButton( ); | |
| 204 | } else { | |
| 205 | this .showClose stDatesVie w(); | |
| 206 | this .showAllDa tesButton( ); | |
| 207 | } | |
| 208 | ||
| 209 | if (type of gas !== 'undefine d') { | |
| 210 | gas( 'send', 'e vent', 've teran-appo intment', 'appointme nt-date-an d-times-di splayed'); | |
| 211 | } | |
| 212 | }, | |
| 213 | sh owPreferre dDateAvail ableView: function() { | |
| 214 | var avai lableDates TimesRegio n = this.g etRegion(' availableD atesTimesR egion'); | |
| 215 | if (!thi s.isDestro yed()) { | |
| 216 | avai lableDates TimesRegio n.show(new Preferred DateAvaila bleView({ | |
| 217 | model: thi s.model, | |
| 218 | timeSlotsB yDateColle ction: thi s.timeSlot sByDateCol lection, | |
| 219 | })); | |
| 220 | } | |
| 221 | }, | |
| 222 | sh owClosestD atesView: function() { | |
| 223 | var avai lableDates TimesRegio n = this.g etRegion(' availableD atesTimesR egion'); | |
| 224 | if (!thi s.isDestro yed()) { | |
| 225 | avai lableDates TimesRegio n.show(new ClosestDa tesView({ | |
| 226 | model: thi s.model, | |
| 227 | timeSlotsB yDateColle ction: thi s.timeSlot sByDateCol lection, | |
| 228 | })); | |
| 229 | } | |
| 230 | }, | |
| 231 | sh owAllDates View: func tion() { | |
| 232 | var avai lableDates TimesRegio n = this.g etRegion(' availableD atesTimesR egion'); | |
| 233 | if (!thi s.isDestro yed()) { | |
| 234 | avai lableDates TimesRegio n.show(new AllDatesV iew({ | |
| 235 | model: thi s.model, | |
| 236 | timeSlotsB yDateColle ction: thi s.timeSlot sByDateCol lection, | |
| 237 | customMess age: this. options.cu stomMessag e.get('mes sageText') || '', | |
| 238 | })); | |
| 239 | ||
| 240 | this .hideAllDa tesButton( ); | |
| 241 | } | |
| 242 | }, | |
| 243 | sh owAllDates Button: fu nction() { | |
| 244 | this.$el .find('#sh ow-all-dat es-btn').s how(); | |
| 245 | }, | |
| 246 | hi deAllDates Button: fu nction() { | |
| 247 | this.$el .find('#sh ow-all-dat es-btn').h ide(); | |
| 248 | }, | |
| 249 | re setAvailab leDatesTim eRegion: f unction() { | |
| 250 | var avai lableDates TimesRegio n = this.g etRegion(' availableD atesTimesR egion'); | |
| 251 | ||
| 252 | availabl eDatesTime sRegion.re set(); | |
| 253 | this.res etSelected DateTimeSl otRegion() ; | |
| 254 | }, | |
| 255 | re setSelecte dDateTimeS lotRegion: function( ) { | |
| 256 | var sele ctedDateTi meSlotRegi on = this. getRegion( 'selectedD ateTimeSlo tRegion'); | |
| 257 | ||
| 258 | selected DateTimeSl otRegion.r eset(); | |
| 259 | ||
| 260 | this.sho wSelectedD ateTimeVie w(); | |
| 261 | }, | |
| 262 | sh owSelected DateTimeVi ew: functi on() { | |
| 263 | var sele ctedDateTi meSlotRegi on = this. getRegion( 'selectedD ateTimeSlo tRegion'); | |
| 264 | ||
| 265 | if (!thi s.isDestro yed()) { | |
| 266 | sele ctedDateTi meSlotRegi on.show(ne w Selected DateTimeVi ew({model: this.mode l})); | |
| 267 | } | |
| 268 | }, | |
| 269 | // NOTE: (fo r IE) mess age is a p artial tem plate inst ead of a v iew | |
| 270 | // because t he wrappin g element of the vie w interfer es with IE + NVDA | |
| 271 | // reading t he updated text | |
| 272 | up dateSelect edDateTime AriaMessag e: functio n() { | |
| 273 | var aria LiveRegion = this.ge tRegion('a riaLiveReg ion'); | |
| 274 | ||
| 275 | ariaLive Region.$el = this.$e l.find(ari aLiveRegio n.el); | |
| 276 | this.lis tenTo(this .model, 'c hange:date Time', fun ction() { | |
| 277 | if ( !this.isDe stroyed() && this.mo del.has('d ateTime')) { | |
| 278 | ariaLiveRe gion.$el.e mpty().htm l(_.templa te(_ariaLi veMessageT emplate)(t his.serial izeData()) ); | |
| 279 | } | |
| 280 | }); | |
| 281 | }, | |
| 282 | }); | |
| 283 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.