How to use HeaderDetail method in tracetest

Best JavaScript code snippet using tracetest

com.sealedair.mobile.xTemplates.js

Source:com.sealedair.mobile.xTemplates.js Github

copy

Full Screen

1// # ver 2652// Namespace Declarations3Ext.ns('SACCRM', 'mobilens', 'Ext.ux');4Date.prototype.adjust = function(yr,mn,dy,hr,mi,se) {5 var m,t;6 this.setYear(this.getFullYear() + yr);7 m = this.getMonth() + mn;8 if(m !== 0) this.setYear(this.getFullYear() + Math.floor(m/12));9 if(m < 0)10 { this.setMonth(12 + (m%12)); } 11 else12 if(m > 0) 13 { this.setMonth(m%12); }14 t = this.getTime();15 t += (dy * 86400000);16 t += (hr * 3600000);17 t += (mi * 60000);18 t += (se * 1000);19 this.setTime(t);20};21function stringSegmentation( sourceData, segLen, sepChar ){22 var segmentedReturn = '';23 var counter = 1;24 25 for ( var x=0;x<sourceData.length;x++)26 {27 var myC = sourceData.slice(x,x+1);28 29 if ( myC == sepChar )30 { counter = 1; }31 else32 { if( counter==segLen)33 {34 myC += sepChar;35 counter = 1;36 }37 else38 { counter += 1; }39 }40 segmentedReturn += myC;41 }42 43 return segmentedReturn;44}45function removeTrailingDecimalZero( sourceData ){46 if( sourceData.indexOf('.') > -1 )47 {48 var trimZeros = sourceData.replace(/0+$/, '');49 var trimDecimal = trimZeros.replace(/\.+$/, '');50 var finalOut = '';51 if( trimDecimal==='')52 { finalOut = '0'; }53 else54 { finalOut = trimDecimal; }55 return trimDecimal;56 }57 else58 { // if there is no decimal in the string do no remove any trailing zeros 59 return sourceData;60 }61}62function removeLeadingZero( sourceData ){63 var trimZeros = sourceData.replace(/^[0]+/g,"");64 return trimZeros;65}66function htmlSpacePadding( cLen, rSym ){67 var myR = '';68 69 for( var i=0;i<=cLen;i++)70 {71// myR += '&nbsp;';72 myR += rSym;73 }74 75 if (myR === '' )76 { return myR; }77 else78 { return myR + '<br>'; }79}80mobilens.xTplOrdersPrimaryLandscapeExpand = '<tpl for="."><div class="colmask doublepage"><div class="colleft">'+81'<div class="col1">'+ 82'<!-- Column 1 start -->'+83'<table table align=center width=100% border=0><tr><td width=40%>'+84'<div class="itemCount">'+85' <tpl if="isSelected==1"><div class="headerItemCounterSelected">{itemCount}</div></tpl>'+86' <tpl if="hasItems!=1 && isSelected!=1"><div class="headerItemCounter">{itemCount}</div></tpl>'+87' <tpl if="hasItems==1 && isSelected!=1"><div class="headerItemCounterHasItems">{itemCount}</div></tpl>'+88'</div>'+89'</td><td align=right width=60% >'+90'<tpl if="orderDisclose!=1">'+91'<tpl if="orderDisclose!=3">'+92'<div class="expand"></div></tpl>'+93'<tpl if="orderDisclose==3"><div class="expandUpdate"></div></tpl></tpl>'+94'<tpl if="orderDisclose==1"><div class="expanded"></div></tpl>'+95'</td></tr></table>'+96'<p class="orderNumber">{documentNumberTrim}</p>'+97'<tpl if="orderDisclose==1">'+98'<div class="item-detail-radius">'+99' <p class="refreshLabel">Refreshed:<br>{refreshed}</p>'+100' <p class="headerLabel">Payer(Number):&nbsp;&nbsp</p><p class="headerDetail">&nbsp {payerAddress}</p>'+101' <p class="headerLabel">Deliver Address:&nbsp;&nbsp</p><p class="headerDetail">&nbsp {deliveryAddress}</p>'+102' <p class="headerLabel">Payment Terms:&nbsp;&nbsp</p><p class="headerDetail">&nbsp {paymentTerms} </p>'+103' <p class="headerLabel">Total Net Price:&nbsp;&nbsp</p><p class="headerDetail">&nbsp {netValue}</p>'+104' <p class="headerLabel">Shipping Conditions:&nbsp;&nbsp</p><p class="headerDetail">&nbsp {shipCond}</p>'+105'</div>'+106'</tpl>'+107'<!-- Column 1 end -->'+108'</div><div class="col2">'+109'<!-- Column 2 start -->'+ 110' <p><span class="headerLabel">Ship To:&nbsp;&nbsp;&nbsp;</span><span class="xTplShipTo">{shipToName} [{shipToNo}] [{salesOrg}][{division}], {shipToCity}</span></p>'+111' <p><span class="headerLabel">Sold To:&nbsp;&nbsp;&nbsp;</span><span class="xTplSoldTo">{soldToName} [{soldTo}] [{salesOrg}][{division}], {soldToCity}</span></p>'+112' <p><span class="headerLabel">Doc Type:&nbsp;&nbsp;&nbsp;</span><span class="headerDetail">{salesDocumentType}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+ //{custPONumber}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+113' <span class="headerLabel">Req Delivery:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{requestedDeliveryDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+114' <span class="headerLabel">Doc Date:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{documentDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+115' <span class="headerLabel">Page:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{page}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+116'<tpl if="orderDisclose==1">'+117'<div class="item-detail-radius">'+118'<left><table class="detailT detailTBLwide" summary="">'+119'<caption class="detailC"><table>'+120'<tpl if="itemUpdate==1"><tr><td class="detailTD" width=100%><center><div class="SAMprogress"></div></td></tr></tpl>'+121'<tpl if="itemUpdate!=1">'+122' <tpl if="hasItems!=1"><tr><td class="detailTD" width=60%><p class="itemRefreshLabel"> No Items Have Been Downloaded </p></td></tpl>'+123' <tpl if="hasItems==1"><tr><td class="detailTD" width=60%><p class="itemRefreshLabel">Refreshed:&nbsp;&nbsp {itemsRefreshed}</p></td></tpl>'+124' <td class="detailTD" width=39%><div class="detailText">Refresh Item Detail - </div></td><td class="detailTD" width=1%><div class="detail" onClick="refreshOrderLine([\'{parent.documentNumber}\']);"></div></td></tr>'+125'</tpl>'+126'</table></caption><thead>'+127'<tr>'+128'<th scope="col" class="detailTH wideCOLa">'+htmlSpacePadding(1,'')+'</th>'+129'<th scope="col" class="detailTH wideCOLb">'+htmlSpacePadding(1,'')+'</th>'+130'<th scope="col" class="detailTH wideCOLc">'+htmlSpacePadding(6,'')+'Product</th>'+131'<th scope="col" class="detailTH wideCOLd">'+htmlSpacePadding(9,'')+'Cust Prod</th>'+132'<th scope="col" class="detailTH wideCOLe">'+htmlSpacePadding(3,'')+'Qty</th>'+133'<th scope="col" class="detailTH wideCOLf">'+htmlSpacePadding(20,'')+'Description</th>'+134'<th scope="col" class="detailTH wideCOLg">'+htmlSpacePadding(4,'')+'Avail</th>'+135'<th scope="col" class="detailTH wideCOLh">'+htmlSpacePadding(9,'')+'Total Price <br> Unit Price</th>'+136'<th scope="col" class="detailTH wideCOLi">'+htmlSpacePadding(5,'')+'Status</th>'+137'<th scope="col" class="detailTH wideCOLj">'+htmlSpacePadding(7,'')+'Shipped / Remain Qty</th>'+138'</tr>'+139'</thead>'+140'<tbody>'+141'<tpl for="orderItems">'+142'<tr>'+143'<td class="detailTD"><div class="delivery" onClick="displayOrderItemDelivery(\'{parent.documentNumber}\',\'{product}\',\'{shippedFrom}\',\'{totalLineVolume} {unitOfVolume}\', \'{totalLineWeight} {unitOfWeight}\');"></div></td>'+144'<td class="detailTD">{numberIntTrim}</td>'+145'<td class="detailTD">{productNoTrim}</td>'+146'<td class="detailTD">{customerProductTrim}</td>'+147'<td class="detailTD">{quantityTrim} {unit}</td>'+148'<td class="detailTD">{descriptionTrim}</td>'+149'<td class="detailTD">{confirmedQuantityTrim}</td>'+150'<td class="detailTD">{itemValueTrim} {currency}<br>{netPriceTrim} /{netQuantPriceUnit} {netPriceUnit}</td>'+151'<td class="detailTD">{status}</td>'+152'<td class="detailTD">{deliveredQty}/{Quantitytodeliver}</td>'+153'</tr>'+154'</tpl>'+155'</tbody>'+156'</table></left>'+157'</div>'+158'</tpl>'+159'<!-- Column 2 end -->'+ 160'</div></div></div>';161mobilens.xTplOrdersPrimary = ''+162 '<tpl for=".">'+163 '<div class="colmask doublepage"><div class="colleft">'+164'<div class="col1">'+ 165'<!-- Column 1 start -->'+166'<table table align=center width=100% border=0><tr><td width=40%>'+167'<div class="itemCount">'+168' <tpl if="isSelected==1"><div class="headerItemCounterSelected">{itemCount}</div></tpl>'+169' <tpl if="hasItems!=1 && isSelected!=1"><div class="headerItemCounter">{itemCount}</div></tpl>'+170' <tpl if="hasItems==1 && isSelected!=1"><div class="headerItemCounterHasItems">{itemCount}</div></tpl>'+171'</div>'+172'</td><td align=right width=60% >'+173'<tpl if="orderDisclose!=1">'+174'<tpl if="orderDisclose!=3">'+175'<div class="expand"></div></tpl>'+176'<tpl if="orderDisclose==3"><div class="expandUpdate"></div></tpl></tpl>'+177'</td></tr></table>'+178'<p class="orderNumber">{documentNumberTrim}</p>'+179'<!-- Column 1 end -->'+180'</div><div class="col2">'+181'<!-- Column 2 start -->'+ 182' <p><span class="headerLabel">Ship To:&nbsp;&nbsp;&nbsp;</span><span class="xTplShipTo">{shipToName} [{shipToNo}] [{salesOrg}][{division}], {shipToCity}</span></p>'+183' <p><span class="headerLabel">Sold To:&nbsp;&nbsp;&nbsp;</span><span class="xTplSoldTo">{soldToName} [{soldTo}] [{salesOrg}][{division}], {soldToCity}</span></p>'+184' <p><span class="headerLabel">Doc Type:&nbsp;&nbsp;&nbsp;</span><span class="headerDetail">{salesDocumentType}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+ //{custPONumber}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+185' <span class="headerLabel">Req Delivery:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{requestedDeliveryDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+186' <span class="headerLabel">Doc Date:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{documentDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+187' <span class="headerLabel">Page:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{page}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+188'<!-- Column 2 end -->'+ 189'</div></div></div>';190mobilens.xTplOrdersTest_old = ''+191 '<tpl for=".">'+192' <div class="itemCount">'+193 '<div class="headerItemCounterHasItemsTest">&nbsp;&nbsp;&nbsp; {itemCount} &nbsp;&nbsp;&nbsp;</div>'+194 '<div><p><span class="headerLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Order:&nbsp;&nbsp;&nbsp;</span><span class="xTplShipTo">{documentNumberTrim}</span></p></div>'+195 '<div class="expandTest">&nbsp;&nbsp; + &nbsp;&nbsp;</div><br></div>'+196' <!-- Column 1 end -->'+197//' <div><p><span class="headerLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Order:&nbsp;&nbsp;&nbsp;</span><span class="xTplShipTo">{documentNumberTrim}</span></p>'+198' <div><p><span class="headerLabel">Ship To:&nbsp;&nbsp;&nbsp;</span><span class="xTplShipTo">{shipToName} [{shipToNo}] [{salesOrg}][{division}], {shipToCity}</span></p>'+199' <p><span class="headerLabel">Sold To:&nbsp;&nbsp;&nbsp;</span><span class="xTplSoldTo">{soldToName} [{soldTo}] [{salesOrg}][{division}], {soldToCity}</span></p>'+200' <p><span class="headerLabel">Doc Type:&nbsp;&nbsp;&nbsp;</span><span class="headerDetail">{salesDocumentType}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+ //{custPONumber}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+201' <span class="headerLabel">Req Delivery:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{requestedDeliveryDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+202' <span class="headerLabel">Doc Date:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{documentDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span></div>';203mobilens.xTplOrdersTest = ''+204 '<tpl for=".">'+205' <table><tr><td><span class="headerLabel">Order:&nbsp;&nbsp;&nbsp; </span></td><td class="expandTest">{documentNumberTrim}</td>'+206' <td><span class="headerLabel">&nbsp;&nbsp;&nbsp;Downloaded Items:&nbsp;&nbsp;&nbsp; </span></td>'+207 '<td class="itemCountTestISS{isSelected}HI{hasItems}"> &nbsp;&nbsp;{itemCount}&nbsp;&nbsp; </td>'+208' </tr></table> ' +209' <table><tr><td><span class="headerLabel">Ship To:&nbsp;&nbsp;&nbsp;</span><span class="headerDetail">{shipToName} [{shipToNo}] [{salesOrg}][{division}], {shipToCity}</span><br>'+210' <span class="headerLabel">Sold To:&nbsp;&nbsp;&nbsp;</span><span class="headerDetail">{soldToName} [{soldTo}] [{salesOrg}][{division}], {soldToCity}</span><br>'+211' <span class="headerLabel">Doc Type:&nbsp;&nbsp;&nbsp;</span><span class="headerDetail">{salesDocumentType}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;'+212' <span class="headerLabel">Req Delivery:&nbsp;&nbsp;&nbsp;</span><span class="headerDetail">{requestedDeliveryDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;'+213' <span class="headerLabel">Doc Date:&nbsp;&nbsp;&nbsp;{documentDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span><span class="headerDetail">'+214' <span class="headerLabel">Page:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{page}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+215 '</td></tr></table></tpl>';216mobilens.xTplOrdersPrimaryPortraitExpand = '<tpl for="."><div class="colmask doublepage"><div class="colleft">'+217'<div class="col1">'+ 218'<!-- Column 1 start -->'+219'<table table align=center width=100% border=0><tr><td width=40%>'+220'<div class="itemCount">'+221' <tpl if="isSelected==1"><div class="headerItemCounterSelected">{itemCount}</div></tpl>'+222' <tpl if="hasItems!=1 && isSelected!=1"><div class="headerItemCounter">{itemCount}</div></tpl>'+223' <tpl if="hasItems==1 && isSelected!=1"><div class="headerItemCounterHasItems">{itemCount}</div></tpl>'+224'</div>'+225'</td><td align=right width=60%>'+226'<tpl if="orderDisclose!=1">'+227'<tpl if="orderDisclose!=3">'+228'<div class="expand"></div></tpl>'+229'<tpl if="orderDisclose==3"><div class="expandUpdate"></div></tpl></tpl>'+230'<tpl if="orderDisclose==1"><div class="expanded"></div></tpl>'+231'</td></tr></table>'+232'<p class="orderNumber">{documentNumberTrim}</p>'+233'<tpl if="orderDisclose==1">'+234'<div class="item-detail-radius">'+235' <p class="refreshLabel">Refreshed:<br>{refreshed}</p>'+236' <p class="headerLabel">Payer(Number):&nbsp;&nbsp</p><p class="headerDetail">&nbsp {payerAddress}</p>'+237' <p class="headerLabel">Deliver Address:&nbsp;&nbsp</p><p class="headerDetail">&nbsp {deliveryAddress}</p>'+238' <p class="headerLabel">Payment Terms:&nbsp;&nbsp</p><p class="headerDetail">&nbsp {paymentTerms} </p>'+239' <p class="headerLabel">Total Net Price:&nbsp;&nbsp</p><p class="headerDetail">&nbsp {netValue}</p>'+240' <p class="headerLabel">Shipping Conditions:&nbsp;&nbsp</p><p class="headerDetail">&nbsp {shipCond}</p>'+241'</div>'+242'</tpl>'+243'<!-- Column 1 end -->'+244'</div><div class="col2">'+245'<!-- Column 2 start -->'+ 246' <p><span class="headerLabel">Ship To:&nbsp;&nbsp;&nbsp;</span><span class="xTplShipTo">{shipToName} [{shipToNo}] [{salesOrg}][{division}], {shipToCity}</span></p>'+247' <p><span class="headerLabel">Sold To:&nbsp;&nbsp;&nbsp;</span><span class="xTplSoldTo">{soldToName} [{soldTo}] [{salesOrg}][{division}], {soldToCity}</span></p>'+248' <p><span class="headerLabel">Doc Type:&nbsp;&nbsp;&nbsp;</span><span class="headerDetail">{salesDocumentType}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+ //{custPONumber}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+249' <span class="headerLabel">Req Delivery:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{requestedDeliveryDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+250' <span class="headerLabel">Document Date:&nbsp;&nbsp;&nbsp;</span><span class=headerDetail>{documentDate}&nbsp;&nbsp;&nbsp&nbsp;&nbsp;</span>'+251'<tpl if="orderDisclose==1">'+252'<div class="item-detail-radius">'+253//'<tpl if="hasItems==1>'+254//'<tpl for="orderItems">'+255'<left><table class="detailT detailTBLport" summary="">'+256'<caption class="detailC"><table><tr>'+257'<tpl if="itemUpdate==1"><td width=60%><div class="SAMprogress"></div></td> </tpl>'+258'<tpl if="itemUpdate!=1">'+259' <tpl if="hasItems!=1"><td width=60%><p class="itemRefreshLabel"> No Items Have Been Downloaded </p></td></tpl>'+260' <tpl if="hasItems==1"><td width=60%><p class="itemRefreshLabel">Refreshed:&nbsp;&nbsp {itemsRefreshed}</p></td></tpl>'+261'</tpl>'+262'<td width=39%><div class="detailText">Refresh Item Detail - </div></td><td width=1%><div class="detail" onClick="refreshOrderLine([\'{parent.documentNumber}\']);"></div></td>'+263'</tr></table></caption><thead>'+264'<tr>'+265'<th scope="col" class="detailTH portCOLa">'+htmlSpacePadding(1,'')+'</th>'+266'<th scope="col" class="detailTH portCOLb">'+htmlSpacePadding(1,'')+'</th>'+267'<th scope="col" class="detailTH portCOLc">'+htmlSpacePadding(6,'')+'Product</th>'+268'<th scope="col" class="detailTH portCOLd">'+htmlSpacePadding(3,'')+'Qty</th>'+269'<th scope="col" class="detailTH portCOLe">'+htmlSpacePadding(23,'')+'Description</th>'+270'<th scope="col" class="detailTH portCOLf">'+htmlSpacePadding(9,'')+'Total Price <br> Unit Price</th>'+271'<th scope="col" class="detailTH portCOLg">'+htmlSpacePadding(5,'')+'Status</th>'+272'<th scope="col" class="detailTH portCOLh">'+htmlSpacePadding(7,'')+'Shipped / Remain Qty</th>'+273'</tr>'+274'</thead>'+275'<tbody>'+276'<tpl for="orderItems">'+277'<tr>'+278'<td class="detailTD"><div class="delivery" onClick="displayOrderItemDelivery(\'{parent.documentNumber}\',\'{product}\',\'{shippedFrom}\',\'{totalLineVolume} {unitOfVolume}\', \'{totalLineWeight} {unitOfWeight}\');"></div></td>'+279'<td class="detailTD">{numberIntTrim}</td>'+280'<td class="detailTD">{productNoTrim}</td>'+281'<td class="detailTD">{quantityTrim} {unit}</td>'+282'<td class="detailTD">{descriptionTrim}</td>'+283'<td class="detailTD">{itemValueTrim} {currency}<br>{netPriceTrim} /{netQuantPriceUnit} {netPriceUnit}</td>'+284'<td class="detailTD">{status}</td>'+285'<td class="detailTD">{deliveredQty}/{Quantitytodeliver}</td>'+286'</tr>'+287'</tpl>'+288'</tbody>'+289'</table></left><p class="refreshLabel">Rotate To Landscape For Additional Information</p>'+290//'<tpl if="hasItems!=1">'+291//'<p class="itemReloadIndicator">This order has no downloaded items click here to get them</p><p>&nbsp</p>'+292//'<center><div class="detail" onClick="refreshOrderLine([\'{parent.documentNumber}\']);"></div></center>'+293//'</tpl>'+294'</div>'+295'</tpl>'+296'<!-- Column 2 end -->'+ 297'</div></div></div>';298mobilens.xTplItemDelivery = '<tpl for="."><table class="xTplItemDelivery" border=1 align=center width=100%>'+299'<table table align=center width=100% border=0 class="detailT" >'+300'<caption class="detailC">'+301'<div><br><p class="xTplItemDelivery">'+302'<tpl if="trackingNo != \'\'">Tracking Number: <span class="xTplItemDeliveryLink" onClick="displayTargetURL( \'{trackingURL}\', \'Tracking Info\');"> {trackingNo} </span></tpl>'+303'</div></caption><thead>'+304'<tr>'+305'<th scope="col" class="detailTH">DeliveryNo</td>'+306'<th scope="col" class="detailTH">Position</td>'+307'<th scope="col" class="detailTH">ObjectId</td>'+308'<th scope="col" class="detailTH">Carrier</td>'+309'<th scope="col" class="detailTH">Actual Ship Date</td>'+310'<th scope="col" class="detailTH">Planned Ship Date</td>'+311'<th scope="col" class="detailTH">Qty UOM</td>'+312'</tr>'+313'</thead>'+314'<tr>'+315'<td class="detailTD">{deliveryNo}</td>'+316'<td class="detailTD">{deliveryPosition}</td>'+317'<td class="detailTD">{objectId}</td>'+318'<td class="detailTD">{carrier}</td>'+319'<td class="detailTD">{actualShippingDate}</td>'+320'<td class="detailTD">{plannedSippingtDate}</td>'+321'<td class="detailTD">{quantity} {unitOfMeasurement}</td>'+322'</tr></table>'+323'</tpl>';324mobilens.xTplShipToPrimary = '<tpl for=".">'+325'<p class="xTplShipTo">'+326'<tpl if="isSelected==1"><b> X &nbsp &nbsp </b></tpl>'+327'{firstName} [ {customerId} ][{salesOrg}][{division}] {city}</p>'+328'</tpl>';329mobilens.xTplDaysOfHistory = '<tpl for="."><p class="xTplDaysOfHistory">{isSelected} Days Of History</p>'+330'<tpl if="customerName==\'Success\'"><p class="tplLastLoginLabel"> &nbsp </p><p class="tplLastLoginSuccess">Last Login Status: {customerName} </p></tpl>'+331'<tpl if="customerName!=\'Success\'"><p class="tplLastLoginLabel">Last Login Status: </p><p class="tplLastLoginFail">{customerName} </p></tpl>'+332'</tpl>';333mobilens.xTplSoldToPrimary = '<p class="xTplSoldTo"><tpl for=".">{customerName} [ {customerNo} ] {customerCity}</tpl></p>';334mobilens.xTplOrderTypePrimary = '<tpl for="."><span class="xTplShipTo"><tpl if="recordStatus==\'Active\'"> &nbsp;&nbsp;&nbsp;X&nbsp;&nbsp;&nbsp; </tpl>{value2} ( {value1} )</span></tpl>';335mobilens.xTplMsgWait = '<p class="xTplMsgWait"><tpl for=".">{msg1}</tpl></p><div class="SAMprogress"></div>';...

Full Screen

Full Screen

app.js

Source:app.js Github

copy

Full Screen

1class App extends React.Component {2 state = {3 team_name: '',4 player_name: '',5 parent_name: '',6 phone1: '',7 textok: '',8 phoneok: '',9 job_name: '',10 job_recs: 0,11 items: [],12 billing: [],13 screenToShow: ''14}15teamClick = () => {16 axios['get']('/teams').then(17 (response) => {18 console.log(response.data, 'get data response');19 this.setState({20 items: response.data,21 screenToShow: 'Team'22 }23 )24 })25}26messageClick = () => {27 axios['get']('/teams').then(28 (response) => {29 console.log(response.data, 'get data response from messageClick');30 this.setState({31 items: response.data,32 screenToShow: 'Message'33 }34 )35 })36}37billingClick = () => {38 axios['get']('/billing').then(39 (response) => {40 console.log(response.data, 'get data response');41 this.setState({42 billing: response.data,43 screenToShow: 'Billing'44 }45 )46})47}48// UPDATE Team Information49 updateTeamClick = () => {50 event.preventDefault()51 console.log('in update team' , this.state.currentItem)52 axios.put(`/teams/${this.state.currentItem.id}`,this.state.currentItem)53 .then(response => {54 this.setState({55 items: response.data,56 screenToShow: 'Team'57 })58 })59}60addPlayerClick = () => {61 event.preventDefault()62 console.log(this.state.currentItem.team_name)63 axios.post(`/teams`,this.state.currentItem)64 .then(response => {65 this.setState({66 items: response.data,67 screenToShow: 'Team'68 })69 })70 }71addTeamClick = () => {72 axios['get']('/teams').then(73 (response) => {74 console.log(response.data, 'get data response');75 this.setState({76 items: response.data,77 screenToShow: 'AddPlayer'78 }79 )80 })81}82///// this shows the edit form83editTeamClick = (index) => {84 this.setState({85 currentItem: {...this.state.items[index]},86 screenToShow: 'EditTeam'87 })88}89msgPlayer = () => {90 event.preventDefault()91 let updateBilling ={}92 //loop through players. Write a billing record then send an sms93 for(let x=0;x<this.state.items.length;x++){94 updateBilling =95 {96 jobname: this.state.currentItem.job_name,97 target_phone1: this.state.items[x].phone1,98 target_datetime: (new Date().toLocaleString())99 }100 axios.post(`/billing`,updateBilling)101 .then(response => {102 this.setState({103 screenToShow: 'Sent',104 job_recs: this.state.items.length105 })106 })107 axios.post(`/sms`,{msg:this.state.currentItem.msgToSend})108 .then(response => {109 this.setState({110 screenToShow: 'Sent'111 })112 }).then(this.teamClick)113 } //end of loop114}115deleteTeamClick= () => {116 axios.delete(`/teams/${this.state.currentItem.id}`).then(response => {117 this.setState({118 screenToShow: 'Team'119 })120 }).then(this.teamClick)121}122 onInputChange = (event) => { ///target is supplied by the software - you have to trust the software123 /// this copies all the items. this is done to separate the state value of items from the function value of items124 this.setState({125 currentItem: {126 ...this.state.currentItem, // we use expansion notation because it makes the object key available127 [event.target.name] : event.target.value128 } // technically the assignment to currentItem is unnecessary. currentItem would have done the assignment129 })130 }131 render = () => {132 let screen = null;133 switch(this.state.screenToShow){134 case 'Team':135 screen =136 <div>137 <div className = 'playertitle'>138 <h1 className = 'screen'>Your Players </h1>139 <a href='#' onClick={this.addTeamClick}>140 <div className='addbtn'>Add a Player</div>141 </a>142 </div>143 <div className ='headerContainer'>144 <div id='teamName' className='headerDetail'>Team Name</div>145 <div id='playerName' className='headerDetail'>Player Name</div>146 <div id='parentName'className='headerDetail'>Parent Name</div>147 <div id='preferredPhone'className='headerDetail'>Preferred Phone</div>148 <div className='headerDetail'>Text OK</div>149 <div className='headerDetail'>Phone OK</div>150 </div>151 <ul>152 {this.state.items.map(153 (item, index) =>{154 let playerList= (155 <a className="playerContainer" href="#" key={item.id} onClick={()=>{this.editTeamClick(index);}}>156 <div className='playerElement'>157 {item['team_name']}158 </div>159 <div className='playerElement'>160 {item.player_name}161 </div>162 <div className='playerElement'>163 {item.parent_name}164 </div>165 <div className='playerElement'>166 {item.phone1}167 </div>168 <div className='playerElement'>169 {item.textok}170 </div>171 <div className='playerElement'>172 {item.phoneok}173 </div>174 </a>175 )176 return playerList177 }178 )}179 </ul>180 </div>181 break;182 case 'Message':183 screen = (184 <div className = 'messaging'>185 <div className = 'playertitle'>186 <h1 className = 'screen'>Send Messages </h1>187 </div>188 <form onSubmit={this.msgPlayer} className='form'>189 <div className ='jobname'>190 <div className = 'jntitle'>Enter Name of Msg</div>191 <input onChange={this.onInputChange} name="job_name" placeholder='Enter Job Name' type="text" className = 'jnbox'/>192 </div>193 <div className ='jobname'>194 <div className = 'jntitle'>Enter your message</div>195 <textarea onChange={this.onInputChange} name="msgToSend" rows="4" cols="50" placeholder='Enter 140 char msg here'>196 </textarea>197 </div>198 <input type="submit" className="submsg" value="Send SMS Messages"/>199 </form>200 <div className ='headerContainer'>201 <div id='teamName' className='headerDetail'>Team Name</div>202 <div id='playerName' className='headerDetail'>Player Name</div>203 <div id='parentName'className='headerDetail'>Parent Name</div>204 <div id='preferredPhone'className='headerDetail'>Preferred Phone</div>205 <div className='headerDetail'>Text OK</div>206 <div className='headerDetail'>Phone OK</div>207 </div>208 <ul>209 {this.state.items.map(210 (item, index) =>{211 let msgplayerList= (212 <div className='playerContainer'>213 <div className='playerElement'>214 {item['team_name']}215 </div>216 <div className='playerElement'>217 {item.player_name}218 </div>219 <div className='playerElement'>220 {item.parent_name}221 </div>222 <div className='playerElement'>223 {item.phone1}224 </div>225 <div className='playerElement'>226 {item.textok}227 </div>228 <div className='playerElement'>229 {item.phoneok}230 </div>231 </div>232 )233 return msgplayerList234 }235 )}236 </ul>237 </div>238 )239 break;240 case 'AddPlayer':241 screen = (242 <div>243 <div className="screen">244 <h1 className='editTeam'> Add Player Screen </h1>245 <div className="editForm">246 <h3>247 <form onSubmit={this.addPlayerClick} className='form'>248 <div className='formlabeltop'>249 <div className='formlabel'>Team Name</div>250 <input onChange={this.onInputChange} name="team_name" placeholder='Team Name' type="text"/>251 </div>252 <div className='formlabeltop'>253 <div className='formlabel'>Player Name</div>254 <input onChange={this.onInputChange} name="player_name" placeholder='Player Name' type="text" /><br/>255 </div>256 <div className='formlabeltop'>257 <div className='formlabel'>Parent Name</div>258 <input onChange={this.onInputChange} name="parent_name" placeholder='Parent Name' type="text" /><br/>259 </div>260 <div className='formlabeltop'>261 <div className='formlabel'>Phone Number</div>262 <input onChange={this.onInputChange} name="phone1" placeholder='Phone Number' type="text" /><br/>263 </div>264 <div className='formlabeltop'>265 <div className='formlabel'>Text OK</div>266 <input onChange={this.onInputChange} name="textok" placeholder='OK to text? y or n' type="text" /><br/>267 </div>268 <div className='formlabeltop'>269 <div className='formlabel'>Phone OK</div>270 <input onChange={this.onInputChange} name="phoneok" placeholder='OK to Phone? y or n' type="text" /><br/>271 </div>272 <input type="submit" className="btn btn-secondary" value="Add Player"/>273 </form>274 </h3>275 </div>276 </div>277 </div>278 )279 break;280 case 'EditTeam':281 screen = <div>282 <div className="editTeam">283 <h1 className='editTeam'> Edit Team Screen </h1>284 <div className="editForm">285 <h3>286 <form onSubmit={this.updateTeamClick} className='form'>287 <div className='formlabeltop'>288 <div className='formlabel'>Team Name</div>289 <input onChange={this.onInputChange} name="team_name" value={this.state.currentItem.team_name} type="text"/>290 </div>291 <div className='formlabeltop'>292 <div className='formlabel'>Player Name</div>293 <input onChange={this.onInputChange} name="player_name" value={this.state.currentItem.player_name} type="text" /><br/>294 </div>295 <div className='formlabeltop'>296 <div className='formlabel'>Parent Name</div>297 <input onChange={this.onInputChange} name="parent_name" value={this.state.currentItem.parent_name} type="text" /><br/>298 </div>299 <div className='formlabeltop'>300 <div className='formlabel'>Phone Number</div>301 <input onChange={this.onInputChange} name="phone1" value={this.state.currentItem.phone1} type="text" /><br/>302 </div>303 <div className='formlabeltop'>304 <div className='formlabel'>Text OK</div>305 <input onChange={this.onInputChange} name="textok" value={this.state.currentItem.textok} type="text" /><br/>306 </div>307 <div className='formlabeltop'>308 <div className='formlabel'>Phone OK</div>309 <input onChange={this.onInputChange} name="phoneok" value={this.state.currentItem.phoneok} type="text" /><br/>310 </div>311 <input type="submit" className="btn btn-secondary" value="Update Player"/>312 </form>313 </h3>314 </div>315 <a href='#' onClick={this.deleteTeamClick}> <div className='deletebtn'>Delete Player</div></a>316 </div>317 </div>318 break;319 case 'Billing':320 let totalcost=0321 screen = <div>322 <h1 className ='billdetail'>Billing Detail</h1>323 <div className ='billingHeaderContainer'>324 <div id='jobname' className='headerDetail'>Job Name</div>325 <div id='playername' className='headerDetail'>Player Name</div>326 <div id='targetPhone' className='headerDetail'>Target Phone</div>327 <div id='datetime'className='headerDetail'>Date</div>328 </div>329 <ul>330 {this.state.billing.map(331 (item, index) =>{332 totalcost += .05333 let billingScreen = (334 <div className="billingContainer" key={item.id}>335 <div className='billingElement'>336 {item.jobname}337 </div>338 <div className='billingElement'>339 {item.player_name}340 </div>341 <div className='billingElement'>342 {item.target_phone1}343 </div>344 <div className='billingElement'>345 {item.target_datetime}346 </div>347 </div>348 )349 return billingScreen350 }351 )}352 </ul>353 <div className = 'totalcost'>354 <div>Total Cost</div>355 <div>${totalcost = totalcost.toFixed(2)}</div>356 </div>357 </div>358 break;359 case 'Sent':360 screen =361 <div>362 <div className = 'EditTeam'>363 <h1 className = 'sentdiv'>Records Sent </h1>364 <div className='sentdiv'>365 <div className='sentel'>{this.state.job_recs}</div>366 <div className='sentel'>text messages sent on </div>367 <div className='sentel'>{new Date().toLocaleString()} </div>368 </div>369 </div>370 </div>371 break;372 default:373 }374 return (375 <div className='container'>376 <nav className="navbar">377 <div className="navbar-nav">378 <a className="nav-item nav-link active" href="#" onClick={()=>{location.reload();}}><h1>ConnecTeam Sports Messaging</h1> </a>379 <a className="nav-item nav-link active" href="#"380 onClick={()=>{this.teamClick();}}><span>Players</span></a>381 <a className="nav-item nav-link" href="#"382 onClick={()=>{this.messageClick();}}><span>Message</span></a>383 <a className="nav-item nav-link" href="#"384 onClick={()=>{this.billingClick();}}><span>Billing Detail</span></a>385 </div>386 </nav>387 {screen}388 <footer>389 <div>390 <ul>391 <li className="list-inline-item">392 <i className="fab fa-react"></i>393 <i className="fab fa-html5"></i>394 <i className="fab fa-js"></i>395 <i className="fab fa-css3"></i>396 <i class="fab fa-node-js"></i>397 </li>398 </ul>399 </div>400 </footer>401 </div>402 )403 }404}405ReactDOM.render(406 <App></App>,407 document.querySelector('main')...

Full Screen

Full Screen

Feedback.jsx

Source:Feedback.jsx Github

copy

Full Screen

1import PropTypes from 'prop-types';2import React, { useState } from 'react';3import { useHistory } from 'react-router-dom';4import { connect } from 'react-redux';5import { clearPlayes, logout } from '../redux/actions';6import {7 container,8 user,9 score,10 feedBetter,11 feedDone,12 questionFeed,13 play,14 ranking,15 buttonGroup } from './feedback.module.scss';1617const tres = 3;18// const menosUm = -1;19function Feedback({ headerDetail, login, token, clearPlayer }) {20 const [redirectLogin, setRedirectLogin] = useState(false);21 const history = useHistory();2223 function savePlayer() {24 const getLocal = JSON.parse(localStorage.getItem('Players'));25 const player = {26 name: headerDetail.name,27 score: headerDetail.score,28 gravatar: headerDetail.gravatarEmail,29 token: token.token,30 };31 const arrPlayes = [...(getLocal || []), player];32 // arrPlayes.sort((a, b) => {33 // if (b.score < a.score) return menosUm;34 // if (b.score > a.score) return 1;35 // return 0;36 // });37 localStorage.setItem('Players', JSON.stringify(arrPlayes));38 clearPlayer();39 }4041 return (42 <main className={ container }>4344 <header>45 { redirectLogin && history.push('/') }46 <div className={ user }>4748 <img49 data-testid="header-profile-picture"50 src={ `https://www.gravatar.com/avatar/${headerDetail.gravatarEmail}` }51 alt="Gravatar"52 width="40px"53 />54 <h355 data-testid="header-player-name"56 >57 {headerDetail.name}58 </h3>59 </div>60 <section data-testid="feedback-total-score">61 <p62 data-testid="header-score"63 className={ score }64 >65 {Number(headerDetail.score)}66 </p>67 </section>68 </header>69 <section data-testid="feedback-total-question" className={ questionFeed }>70 <p71 data-testid="header-assertions"72 >73 {Number(headerDetail.assertions)}74 </p>75 {headerDetail.assertions < tres && (76 <p data-testid="feedback-text" className={ feedBetter }>Could be better...</p>77 )}78 {headerDetail.assertions >= tres && (79 <p data-testid="feedback-text" className={ feedDone }>Well Done!</p>80 )}81 </section>82 <section className={ buttonGroup }>8384 <button85 className={ play }86 type="button"87 data-testid="btn-play-again"88 onClick={ () => {89 savePlayer();90 login();91 setRedirectLogin(true);92 } }93 >94 Play Again95 </button>96 <button97 className={ ranking }98 data-testid="btn-ranking"99 type="button"100 onClick={ () => {101 savePlayer();102 login();103 history.push('/ranking');104 } }105 >106 Ranking107 </button>108 </section>109 </main>110 );111}112113Feedback.propTypes = {114 headerDetail: PropTypes.shape({115 name: PropTypes.string,116 assertions: PropTypes.number,117 score: PropTypes.number,118 gravatarEmail: PropTypes.string,119 }),120 login: PropTypes.func.isRequired,121}.isRequired;122123const mapStateToProps = (state) => ({124 headerDetail: state.player,125 token: state.token,126});127128const mapDispatchToProps = (dispatch) => ({129 login: () => dispatch(logout()),130 clearPlayer: () => dispatch(clearPlayes()),131});132 ...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var tracetest = require('tracetest');2var header = tracetest.HeaderDetail();3console.log(header);4var tracetest = require('tracetest');5var header = tracetest.HeaderDetail();6console.log(header);7var tracetest = require('tracetest');8var header = tracetest.HeaderDetail();9console.log(header);10var tracetest = require('tracetest');11var header = tracetest.HeaderDetail();12console.log(header);13var tracetest = require('tracetest');14var header = tracetest.HeaderDetail();15console.log(header);16var tracetest = require('tracetest');17var header = tracetest.HeaderDetail();18console.log(header);19var tracetest = require('tracetest');20var header = tracetest.HeaderDetail();21console.log(header);22var tracetest = require('tracetest');23var header = tracetest.HeaderDetail();24console.log(header);25var tracetest = require('tracetest');26var header = tracetest.HeaderDetail();27console.log(header);28var tracetest = require('tracetest');29var header = tracetest.HeaderDetail();30console.log(header);31var tracetest = require('tracetest');32var header = tracetest.HeaderDetail();33console.log(header);34var tracetest = require('tracetest');35var header = tracetest.HeaderDetail();36console.log(header);37var tracetest = require('tracetest');38var header = tracetest.HeaderDetail();39console.log(header);40var tracetest = require('tracetest');41var header = tracetest.HeaderDetail();42console.log(header);

Full Screen

Using AI Code Generation

copy

Full Screen

1var tracetest = require('tracetest');2var trace = new tracetest.TraceTest();3trace.HeaderDetail();4var trace = require('trace');5var TraceTest = function() {6 this.HeaderDetail = function() {7 trace.HeaderDetail('Test Header', 'Test Detail');8 }9}10module.exports.TraceTest = TraceTest;11var trace = require('trace');12var Trace = function() {13 this.HeaderDetail = function(header, detail) {14 trace.HeaderDetail(header, detail);15 }16}17module.exports.Trace = Trace;18var tracetest = require('tracetest');19tracetest.HeaderDetail('Test Header', 'Test Detail');20var tracetest = require('tracetest');21tracetest.HeaderDetail('Test Header', 'Test Detail');22var tracetest = require('tracetest');23tracetest.HeaderDetail('Test Header', 'Test Detail');

Full Screen

Using AI Code Generation

copy

Full Screen

1var tracetest = require('./tracetest');2tracetest.HeaderDetail();3exports.HeaderDetail = function() {4 console.log("HeaderDetail Method");5}6var tracetest = require('./tracetest');7tracetest.HeaderDetail();8exports.HeaderDetail = function() {9 console.log("HeaderDetail Method");10}11var tracetest = require('./tracetest');12tracetest.HeaderDetail();13exports.HeaderDetail = function() {14 console.log("HeaderDetail Method");15}16var tracetest = require('./tracetest');17tracetest.HeaderDetail();18exports.HeaderDetail = function() {19 console.log("HeaderDetail Method");20}21var tracetest = require('./tracetest');22var header = new tracetest.HeaderDetail();23header.HeaderDetail();24exports.HeaderDetail = function() {25 this.HeaderDetail = function() {26 console.log("HeaderDetail Method

Full Screen

Using AI Code Generation

copy

Full Screen

1var trace = require('./tracetest');2trace.HeaderDetail('test.js');3exports.HeaderDetail = function (filename) {4 console.log('*** Header Detail for ' + filename + ' ***');5};6module.exports = {7 HeaderDetail: function (filename) {8 console.log('*** Header Detail for ' + filename + ' ***');9 }10};

Full Screen

Using AI Code Generation

copy

Full Screen

1var tracetest = require('./tracetest.js');2console.log(tracetest.HeaderDetail('test'));3exports.HeaderDetail = function (header) {4 return header;5};6module.exports = function (header) {7 return header;8};9var tracetest = require('./tracetest.js');10console.log(tracetest('test'));11module.exports.HeaderDetail = function (header) {12 return header;13};14var tracetest = require('./tracetest.js');15console.log(tracetest.HeaderDetail('test'));16module.exports = {17 HeaderDetail: function (header) {18 return header;19 }20};21var tracetest = require('./tracetest.js');22console.log(tracetest.HeaderDetail('test'));23module.exports = {24 HeaderDetail: function (header) {25 return header;26 }27};28var tracetest = require('./tracetest.js');29console.log(tracetest.HeaderDetail('test'));30module.exports = {31 HeaderDetail: function (header) {32 return header;33 }34};35var tracetest = require('./tracetest.js');36console.log(tracetest.HeaderDetail('test'));

Full Screen

Using AI Code Generation

copy

Full Screen

1var tracetesting = require('tracetesting');2var header = tracetesting.HeaderDetail("D:\\test\\test.txt","D:\\test\\test1.txt");3console.log(header);4var tracetesting = require('tracetesting');5var header = tracetesting.HeaderDetail("D:\\test\\test.txt","D:\\test\\test1.txt");6console.log(header);7var tracetesting = require('tracetesting');8var header = tracetesting.HeaderDetail("D:\\test\\test.txt","D:\\test\\test1.txt");9console.log(header);10var tracetesting = require('tracetesting');11var header = tracetesting.HeaderDetail("D:\\test\\test.txt","D:\\test\\test1.txt");12console.log(header);13var tracetesting = require('tracetesting');14var header = tracetesting.HeaderDetail("D:\\test\\test.txt","D:\\test\\test1.txt");15console.log(header);16var tracetesting = require('tracetesting');17var header = tracetesting.HeaderDetail("D:\\test\\test.txt","D:\\test\\test1.txt");18console.log(header);19var tracetesting = require('tracetesting');20var header = tracetesting.HeaderDetail("D:\\test\\test.txt","D:\\test\\test1.txt");21console.log(header);22var tracetesting = require('tracetesting');23var header = tracetesting.HeaderDetail("D:\\test\\test.txt","D:\\test\\test1.txt");24console.log(header);

Full Screen

Using AI Code Generation

copy

Full Screen

1var trace = require('trace');2trace.HeaderDetail('before');3setTimeout(function() {4 trace.HeaderDetail('after');5}, 1000);6trace.HeaderDetail('between');

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tracetest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful