220. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/7/2018 11:36:02 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.

220.1 Files compared

# Location File Last Modified
1 C:\SCRUB\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\form form-view-mixin.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\form form-view-mixin.js Fri Dec 7 13:07:22 2018 UTC

220.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 12 564
Changed 11 24
Inserted 0 0
Removed 0 0

220.3 Comparison options

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

220.4 Active regular expressions

No regular expressions were active.

220.5 Comparison detail

  1   /* eslint- disable no -param-rea ssign,vars -on-top */
  2   define([
  3       'under score',
  4       'backb one',
  5       'mario nette',
  6       'modul es/form/fo rm-confirm -navigatio n-popup-vi ew',
  7       'jquer y.validate .config',
  8   ],
  9   function ( _, Backbon e, Marione tte, Confi rmNavigati onPopup) {
  10       'use s trict';
  11  
  12       var _u tils = {};
  13       // TOD O: this co uld be a p roblem
  14       /* htt p://open.b ekk.no/mix ins-in-bac kbone
  15           *  Kim Joar B ekkelund * /
  16       var ex tendMethod  = functio n(to, from , methodNa me) {
  17           if  (!_.isUnd efined(fro m[methodNa me])) {
  18                if (!_.i sUndefined (to[method Name])) {
  19  
  20                    // c reate a ne w function  on to
  21                    // w herein we  first call  the metho d which ex ists on `t o`
  22                    // t hen call t he method  on `from`,
  23                    // r eturning w hat the me thod on 't o' returns
  24                    var  toOrig = t o[methodNa me];
  25                    to[m ethodName]  = functio n() {
  26                         var return Val;
  27                         from[metho dName].app ly(this, a rguments);
  28                         returnVal  = toOrig.a pply(this,  arguments );
  29                         return ret urnVal;
  30                    };
  31                } else {
  32                    to[m ethodName]  = functio n() {
  33                         return fro m[methodNa me].apply( this, argu ments);
  34                    };
  35                }
  36           }
  37       };
  38  
  39       /* htt p://lostec hies.com/d erickbaile y/2012/10/ 07/javascr ipt-mixins -beyond-si mple-objec t-extensio n/
  40           *  Derick Bai ley */
  41  
  42       // bui ld a mixin  function  to take a  target tha t receives  the mixin ,
  43       // a s ource that  is the mi xin, and a  list of m ethods / a ttributes  to
  44       // cop y over to  the target
  45  
  46       _utils .mixinToVi ew = funct ion (targe t, source,  methodNam es) {
  47  
  48           //  ignore th e actual a rgs list a nd build f rom argume nts so we  can
  49           //  be sure t o get all  of the met hod names
  50           va r deepDefa ult = [];
  51           va r args = A rray.proto type.slice .apply(arg uments);
  52  
  53           ta rget = arg s.shift();
  54           so urce = arg s.shift();
  55           me thodNames  = args;
  56  
  57           //  add metho ds and eve nts which  exist on ' source' bu t not 'tar get' over  to 'target '
  58  
  59           //  special c ases to de epDefault
  60           de epDefault  = [
  61                'attribu tes',
  62                'regions ',
  63                'events' ,
  64                'modelEv ents',
  65                'collect ionEvents' ,
  66           ];
  67           _. each(deepD efault, fu nction (pr operty) {
  68                if (type of target[ property]  !== 'undef ined' || t ypeof sour ce[propert y] !== 'un defined')  {
  69                    _.de faults(tar get[proper ty], sourc e[property ]);
  70                }
  71           }) ;
  72           if  (!_.isUnd efined(tar get.classN ame) || !_ .isUndefin ed(source. className) ) {
  73                var targ etClassNam e = target .className  || '';
  74                var sour ceClassNam e = source .className  || '';
  75                target.c lassName =  sourceCla ssName + '  ' + targe tClassName ;
  76           }
  77  
  78           _. defaults(t arget, sou rce);
  79  
  80           _. each(metho dNames, fu nction (me thodName)  {
  81                extendMe thod(targe t, source,  methodNam e);
  82           }) ;
  83  
  84           _. defaults(t arget, sou rce);
  85  
  86           re turn targe t;
  87       };
  88  
  89       var fo rm = {
  90           /*  form vali dation */
  91           in itializeFo rmValidati on: functi on(options ) {
  92                if (this .$el.find( 'form').le ngth === 1 ) {
  93                    this .createVal idator(opt ions);
  94                }
  95           },
  96           cr eateValida tor: funct ion(option s) {
  97                var self  = this;
  98                // if (o ptions &&  options.er rorLabelCo ntainer) {
  99                //  var  errorLabel Container  = options. errorLabel Container;
  100                //  dele te options .errorLabe lContainer ;
  101                // }
  102                this.val idator = t his.$el.fi nd('form') .validate( _.extend({
  103                    focu sinvalid:  true,
  104                    onke yup: false ,
  105                    erro rClass: 'v alidation- error',
  106  
  107                    high light: fun ction (ele ment, erro rClass, va lidClass)  {
  108                         var $targe tElement =  self.getT argetEleme nt(element );
  109                         if ($targe tElement)  {
  110                             $targe tElement.a ddClass('f orm-input- invalid');
  111                             $(elem ent).addCl ass('form- input-inva lid-focus' );
  112                         }
  113                    },
  114                    unhi ghlight: f unction (e lement, er rorClass,  validClass ) {
  115                         var $targe tElement =  self.getT argetEleme nt(element );
  116                         if ($targe tElement)  {
  117                             $targe tElement.r emoveClass ('form-inp ut-invalid ');
  118                             $(elem ent).remov eClass('fo rm-input-i nvalid-foc us');
  119                         }
  120                    },
  121                    wrap per: 'li',
  122                    erro rElement:  'div',
  123                    erro rPlacement : function (error, el ement) {
  124                         var $targe tElement =  self.getT argetEleme nt(element );
  125                         error.inse rtAfter($t argetEleme nt);
  126                         error.attr ('tabindex ', '0');
  127                    },
  128                }, optio ns));
  129                return t his.valida tor;
  130           },
  131  
  132           //  eslint-di sable-next -line comp lexity
  133           ge tTargetEle ment: func tion(eleme nt) {
  134                if (elem ent) {
  135                    var  $inputElem ent = $(el ement);
  136                    var  $targetEle ment = $in putElement ;
  137                    var  tagName =  $targetEle ment[0].ta gName.toLo werCase();
  138  
  139                    if ( tagName == = 'input')  {
  140                         // styled  input, def ault jqm-s tyled text  input
  141                         $targetEle ment = $(e lement).pa rent();
  142  
  143                         if ($targe tElement.h asClass('u i-radio')  || $target Element.ha sClass('ui -checkbox' )) {
  144                             // jqm -styled ra dio or che ckbox
  145                             $targe tElement =  $targetEl ement.pare nt();
  146                         } else if  ($inputEle ment.attr( 'type') == = 'radio'  || $inputE lement.att r('type')  === 'check box') {
  147                             // nor mal radio  or checkbo x but in . wrapping . ui-body
  148                             // $ta rgetElemen t currentl y label
  149                             $targe tElement =  $targetEl ement.pare nt(); // g et wrappin g .ui-body
  150                         } else if  ($targetEl ement.hasC lass('ui-s elect')) {
  151                             // jqm -styled se lect
  152                             $targe tElement =  $targetEl ement.find ('a');
  153                         }
  154                    } //  else sele ct or text area, sele ct element  itself
  155                    retu rn $target Element;
  156                }
  157                return n ull;
  158  
  159           },
  160  
  161           /*  form conf irm naviga tion */
  162             initialize F DNS     firmNaviga tion: func tion(optio ns) {
  163                this.con firmNavOpt ions = _.e xtend({
  164                    $for m: this.$e l.find('fo rm'),
  165                    name space: 'co nfirmNavig ation',
  166                    warn ingMessage : 'You hav e not save d your cha nges.',
  167                    sile nt: false,
  168                }, optio ns); // ov erride con firmNavOpt ions with  passed in  options
  169  
  170                var $for m = this.c onfirmNavO ptions.$fo rm;
  171  
  172                if ($for m.length >  0) {
  173                      this.f DNS     gment = Ba ckbone.his tory.fragm ent;
  174  
  175                    this .resetShow ConfirmNav igation();
  176                    // d isable sho wing confi rmation on ce the for m data is  submitted
  177                    // b y calling  this.reset ShowConfir mNavigatio n(); if fo rm remains  open
  178                    // o r by
  179  
  180                    this .on('destr oy', funct ion() {
  181                         $form.off( 'change.'  + this.con firmNavOpt ions.names pace);
  182                          this.remov eF DNS     firmNaviga tionEvents ();
  183                    }, t his);
  184                }
  185           },
  186           //  event to  handle sho wing confi rmation up on navigat ing away
  187             initialize F DNS     firmNaviga tionEvents : function () {
  188                  this.remov eF DNS     firmNaviga tionEvents ();
  189                if (!thi s._isListe ningToBefo reUnload)  {
  190                    $(wi ndow).one( 'beforeunl oad.confir mNavigatio n', this.s howBrowser ConfirmNav igationPop up.bind(th is));
  191                    this ._isListen ingToBefor eUnload =  true;
  192                }
  193                if (!thi s._isListe ningToHash Change) {
  194                    $(wi ndow).one( 'hashchang e.confirmN avigation' , this.sho wConfirmNa vigationPo pup.bind(t his));
  195                    this ._isListen ingToHashC hange = tr ue;
  196                }
  197           },
  198             removeF DNS     firmNaviga tionEvents : function () {
  199                $(window ).off('has hchange.co nfirmNavig ation');
  200                this._is ListeningT oHashChang e = false;
  201                $(window ).off('bef oreunload. confirmNav igation');
  202                this._is ListeningT oBeforeUnl oad = fals e;
  203           },
  204           re setShowCon firmNaviga tion: func tion() {
  205                var $for m = this.c onfirmNavO ptions.$fo rm;
  206                var even tKey = 'ch ange.' + t his.confir mNavOption s.namespac e;
  207                $form.of f(eventKey );
  208                this.dis ableShowCo nfirmNavig ation();
  209                // enabl e showing  confirmati on once a  change is  made to a  form :inpu t,
  210                // where  ':input'  is a jquer y input se lector
  211                $form.on e(eventKey , ':input' , this.ena bleShowCon firmNaviga tion.bind( this));
  212           },
  213           di sableShowC onfirmNavi gation: fu nction(opt ions) {
  214                var rout erOptions  = _.extend ({silent:  true}, opt ions);
  215  
  216                this.set NeedsToCon firmNaviga tion(false );
  217                  this.remov eF DNS     firmNaviga tionEvents ();
  218                this.con tinueRoute rHistory(r outerOptio ns);
  219           },
  220           en ableShowCo nfirmNavig ation: fun ction() {
  221                this.set NeedsToCon firmNaviga tion(true) ;
  222                this.int erceptRout erHistory( );
  223                  this.initi alizeF DNS     firmNaviga tionEvents ();
  224           },
  225           se tNeedsToCo nfirmNavig ation: fun ction(need sConfirmat ion) {
  226                this._sh owConfirmN avigationP opup = nee dsConfirma tion;
  227           },
  228           in terceptRou terHistory : function () {
  229                if (this ._showConf irmNavigat ionPopup & & Backbone .History.s tarted) {
  230                    Back bone.histo ry.stop();
  231                }
  232           },
  233           co ntinueRout erHistory:  function( options) {
  234                if (!thi s._showCon firmNaviga tionPopup  && !Backbo ne.History .started)  {
  235                    Back bone.histo ry.start(o ptions);
  236                }
  237           },
  238           sh owBrowserC onfirmNavi gationPopu p: functio n (e) {
  239                var WARN ING_MESSAG E = 'You h ave not sa ved your c hanges.';
  240  
  241                (e || wi ndow.event ).returnVa lue = WARN ING_MESSAG E; // Geck o + IE
  242                return W ARNING_MES SAGE; // W ebkit, Saf ari, Chrom e etc.
  243           },
  244           ne edsToConfi rmNavigati on: functi on() {
  245                return t his._showC onfirmNavi gationPopu p;
  246           },
  247           sh owConfirmN avigationP opup: func tion(pushH istory) {
  248                var conf irmNavigat ionPopup;
  249  
  250                if (this ._showConf irmNavigat ionPopup)  {
  251                    conf irmNavigat ionPopup =  new Confi rmNavigati onPopup({
  252                         warningMes sage: this .confirmNa vOptions.w arningMess age,
  253                    });
  254                    conf irmNavigat ionPopup.o penPopup() ;
  255                    this .listenToO nce(confir mNavigatio nPopup, 'c onfirm-nav igate', fu nction() {
  256                         this.stopL istening(c onfirmNavi gationPopu p, 'cancel -navigate' );
  257                         // silent:  true used  in cases  such as a  jQM modal  dialog bei ng closed,
  258                         // else de faults to  false to c ontinue na vigation t o new page
  259                         this.disab leShowConf irmNavigat ion({silen t: this.co nfirmNavOp tions.sile nt});
  260                    }, t his);
  261                    this .listenToO nce(confir mNavigatio nPopup, 'c ancel-navi gate', fun ction() {
  262                         var reinit ializeEven ts = funct ion() {
  263                             var ev entKey = ' change.' +  this.conf irmNavOpti ons.namesp ace;
  264  
  265                             this.$ el.find('f orm').one( eventKey,  ':input',  this.enabl eShowConfi rmNavigati on.bind(th is));
  266                               this.initi alizeF DNS     firmNaviga tionEvents ();
  267                         }.bind(thi s);
  268  
  269                          this.remov eF DNS     firmNaviga tionEvents ();
  270                         if (typeof  pushHisto ry !== 'un defined')  {
  271                             if (wi ndow.histo ry.replace State) {
  272                                   window.his tory.pushS tate(null,  null, '#'  + this.f DNS     gment);
  273                                 re initialize Events();
  274                             } else  {
  275                                 $( window).on e('hashcha nge.confir mNavigatio n', reinit ializeEven ts);
  276                                   window.loc ation.hash  = '#' + t his.f DNS     gment;
  277                             }
  278                         } else {
  279                             reinit ializeEven ts();
  280                         }
  281                         this.stopL istening(c onfirmNavi gationPopu p, 'confir m-navigate ');
  282                    }, t his);
  283                }
  284           },
  285       };
  286  
  287       var mi xin = {
  288           fo rm: functi on(target)  {
  289                return _ utils.mixi nToView(ta rget, form );
  290           },
  291       };
  292  
  293       return  mixin;
  294   });