3 window._w.historyview = {
18 onHistoryViewTemplateReady : function( template, event, eventData )
20 console.log('onHistoryViewTemplateReady');
21 _w.historyview.ti = _t[template];
22 _w.historyview.limited = ('limitedhistoryview' == template)
26 _w.historyview.setStockViewFormMeta();
27 _w.historyview.ti.hydrate(_w.historyview.formMeta);
29 // Retrieve initial view data.
31 _w.historyview.itemId = App.Util.getUrlParam('id');
32 _w.historyview.bidId = null;
35 var task = 'Auction.View';
37 'viewAuction:' + _w.historyview.itemId, 'Auction', task, _w.historyview.itemId,
38 {}, $.proxy( _w.historyview._onStockViewDataReceived, this ), _w.taskContractError
42 onHistoryViewPublished : function( template, event, eventData )
44 console.log('onHistoryViewPublished');
45 if (!_w.historyview.basketId)
47 $('#btnAddToBasket').prop('disabled', false);
48 $('#btnAddToBasket').removeClass('addtobasketbtntrue');
49 $('#btnAddToBasket').addClass('addtobasketbtn');
53 $('#btnRequestHPI').click(function () {
55 if ('' == $('#HPIusername').val() || '' == $('#HPIpin').val())
57 alert('Please enter a valid username and password.');
61 $('#HPIdropConfirm').slideToggle();
62 $('#HPIresponse').html('');
66 App.Util.updateCheckboxStyle($('#acceptHPIdisclaimer'));
67 $('#HPIbtnConfirm').click(function () {
68 if ( $('#engineNumber').html() == '' || $('#vinNumber').html() == '' ) {
69 alert('Cannot request report without Vehicle Engine Number and VIN Number.');
72 if (!$('#acceptHPIdisclaimer').is(':checked'))
74 alert('Please accept the conditions before sending.');
78 var user = $('#HPIusername').val();
79 var pass = $('#HPIpin').val();
82 'TransUnionForHPI', 'Stock', 'Utility.TransUnionForHPI', null,
83 {'Filter' : {'username' : user ,'pass' : pass , 'stock' : _w.stock.Id}},
86 'TransUnionForHPI',{}, {},
89 $('#HPIdropConfirm').hide();
90 if ('Success' == data.Status)
92 $('#HPIresponse').html('Success on HPI Report');
93 alert('Success on HPI Report');
94 App.DataStore.loadSelectListData(
95 'tuhpi', false, 'Stock', 'Tuhpi.List', null,{"Filter":
97 "stock" : _w.historyview.itemData.stock.id,
98 "company" : App.companyData.id
101 var tuHpiData = App.DataStore.getData('tuhpi');
102 for (var i = 0; i < tuHpiData.length; i++)
104 var tuHpiId = tuHpiData[i].id
105 var tuHpiCreated = tuHpiData[i].created
108 $('#tuhpiDate').html(tuHpiCreated);
109 $('#downloadTuhpi').show();
110 $('#HPIbtnConfirm').prop('disabled', true);
115 $('#tuhpiDate').html('Not Requested Yet');
116 $('#downloadTuhpi').hide();
117 $('#HPIbtnConfirm').prop('disabled', false);
124 $('#HPIresponse').html('API call to remote host failed. No data could be retrieved from remote service.');
126 }, function(response)
128 $('#HPIbtnConfirm').prop('disabled', false);
130 undefined != response.StatusReason
131 ? response.StatusReason
132 : 'API call to remote host failed. No data could be retrieved from remote service.'
139 , _w.taskContractError
144 $('#downloadTuhpi').click(function () {
145 //console.log("stock id", _w.stock.Id);
147 'printTuhpi:' + _w.stock.Id, 'Stock', 'Tuhpi.Print', _w.stock.Id,
150 'printTuhpi:' + _w.stock.Id, {}, {},
151 function () {}, _w.taskExecError,
154 }, _w.taskContractError
159 $('#btnAddToBasket').click(function () {
160 $('#btnAddToBasket').prop('disabled', true);
161 if (_w.historyview.basketId)
164 'updateBasket:' + _w.historyview.itemId, {Basket:{archived: false}}, {},
166 alert('Item added to basket.');
167 $('#btnAddToBasket').removeClass('addtobasketbtn');
168 $('#btnAddToBasket').addClass('addtobasketbtntrue');
175 'createBasket:' + _w.historyview.itemId, {Basket:{auction:_w.historyview.itemId}}, {},
177 alert('Item added to basket.');
178 $('#btnAddToBasket').removeClass('addtobasketbtn');
179 $('#btnAddToBasket').addClass('addtobasketbtntrue');
184 $('#btnMakeBid').click(function () {
185 $('#confirm_dynamic').show();
186 $('#confirmation_msg').hide();
187 _w.historyview.ti.hydrateParam('infAmount', _w.historyview.nextBid);
188 $('#dropCmp').hide();
189 $('#dropConfirm').show();
190 _w.historyview.bidType = 'bid';
192 $('#btnAskQuestion').click(function () {
193 if ('' == $('#question').val())
195 alert('Please specify your question.');
199 'askQuestion:' + _w.historyview.itemId, 'Auction', 'Question.Create', _w.historyview.itemId,
203 "auction": _w.historyview.itemId,
204 "question": $('#question').val()
208 'askQuestion:' + _w.historyview.itemId, data, {},
209 _w.historyview._onBidUpdated, function () {
210 alert('Your question have been submitted.');
211 $('#dropCmp3').slideToggle();
214 }, _w.taskContractError
217 $('#btnMakeAutoBid').click(function () {
218 $('#confirm_dynamic').show();
219 $('#confirmation_msg').hide();
220 var amount = $('#autoamount').val();
221 if ('' != amount && isNaN(amount))
223 alert('Please enter a numeric value.');
228 _w.historyview.ti.hydrateParam('infAmount', _w.historyview.nextBid);
229 $('#dropCmp').hide();
230 $('#dropConfirm').show();
231 _w.historyview.bidType = 'bid';
235 var parts = amount.split('.');
236 if (parts.length > 1)
239 $('#autoamount').val(amount);
241 if (amount < _w.historyview.nextBid)
243 $('#dropConfirm').show();
244 $('#confirm_dynamic').hide();
245 $('#confirmation_msg').show();
246 $('#confirmation_msg').html('Autobid amount must be more than R ' + _w.historyview.nextBid);
249 _w.historyview.ti.hydrateParam('infAmount', amount);
251 $('#dropConfirm').show();
252 _w.historyview.bidType = 'autobid';
256 $('#btnConfirm').click(function () {
257 if ('bid' == _w.historyview.bidType)
261 "amount": _w.historyview.nextBid
265 'createBid', data, {},
266 _w.historyview._onBidUpdated, function (response) {
267 $('#bidSection').hide();
268 console.log(response);
269 if (response.StatusReason && 'Your' == response.StatusReason.substring(0,4))
271 alert(response.StatusReason);
275 alert('Your bid was placed but you were just outbid. You can make another bid.');
278 'viewAuction:' + _w.historyview.itemId, 'Auction', 'Auction.View', _w.historyview.itemId,
279 {}, $.proxy( _w.historyview._onStockViewDataReceived, this ), _w.taskContractError
288 "amount": $('#autoamount').val()
292 'createAutoBid', data, {},
293 _w.historyview._onBidUpdated, function (response) {
294 console.log(response);
295 if (response.StatusReason && 'Your' == response.StatusReason.substring(0,4))
297 alert(response.StatusReason);
301 alert('Your bid was placed but you were just outbid. You can make another bid.');
304 'viewAuction:' + _w.historyview.itemId, 'Auction', 'Auction.View', _w.historyview.itemId,
305 {}, $.proxy( _w.historyview._onStockViewDataReceived, this ), _w.taskContractError
312 App.Util.updateCheckboxStyle($('#terms_accepted'));
313 App.Util.updateCheckboxStyle($('#terms_accepted2'));
314 $('.showTerms').hover(
316 $('.moreTerms').show();
319 $('.moreTerms').hide();
322 $('#terms_accepted').click(function() {
323 $('#btnMakeBid').prop('disabled', $(this).prop('checked') ? false : true);
325 $('#terms_accepted2').click(function() {
326 $('#btnMakeAutoBid').prop('disabled', $(this).prop('checked') ? false : true);
329 $('.mobile-header-bottom .bottom-heading').text('BID DETAILS');
331 if (null != _w.historyview.itemData)
333 _w.historyview._onStockDataAndTemplate();
335 if (null != _w.historyview.basketData)
337 _w.historyview._onBasketDataAndTemplate();
343 setStockViewFormMeta : function( data )
345 data = (undefined == data)
351 _w.stock.Id = data.stock.id;
353 var damagesHtml = '';
354 var accessoriesHtml = '';
355 if (undefined != data && undefined != data.stock && undefined != data.stock.damages)
357 for (var i = 0; i < data.stock.damages.length; i++)
359 damagesHtml += '<div class="control-group row' + i + '">';
360 damagesHtml += '<label class="control-label bid-information-label">' + data.stock.damages[i].damage.name + ':</label>';
361 damagesHtml += '<div class="controls">';
362 damagesHtml += '<p class="bid-information">R ' + data.stock.damages[i].amount + '</p>';
363 damagesHtml += '</div>';
364 damagesHtml += '</div>';
367 if (undefined != data && undefined != data.stock && undefined != data.stock.accessories)
369 for (var i = 0; i < data.stock.accessories.length; i+=2)
371 var acc1 = data.stock.accessories[i]
372 ? data.stock.accessories[i].accessory.name
374 var acc2 = data.stock.accessories[i+1]
375 ? data.stock.accessories[i+1].accessory.name
377 accessoriesHtml += '<div class="row-fluid">';
378 accessoriesHtml += '<div class="span6 textshow-black">' + acc1 + '</div>';
379 accessoriesHtml += '<div class="span6 textshow-black">' + acc2 + '</div>';
380 accessoriesHtml += '</div>';
387 if (data.currentBidPrice)
389 _w.historyview.nextBid = 0.0 == data.currentBidPrice
390 ? parseFloat(data.reservePrice) + parseFloat(data.bidIncrement)
391 : parseFloat(data.currentBidPrice) + parseFloat(data.bidIncrement);
395 _w.historyview.nextBid = 0.0;
397 _w.historyview.formMeta = {
398 'auctionId' : data.id ? '<div class="row-fluid"><div class="span12"><b>Auction ID: </b> ' + data.id + '</div></div>' : '',
399 'b4cRefNo' : data.stock.referenceNumber ? '<div class="row-fluid"><div class="span12"><b>B4C reference no. ref# </b> ' + data.stock.referenceNumber + '</div></div>' : '',
400 'mmCode' : data.stock.type ? '<div class="row-fluid"><div class="span12"><b>M & M Code: </b> ' + data.stock.type.mmCode + '</div></div>' : '',
401 'vehicle' : data.stock.type
402 ? '<div class="row-fluid"><div class="span3"><h5><b>Vehicle Details:</b></h5></div><div class="span9"><h5>'
403 + data.stock.vehicleYear.name + ', '
404 + data.stock.type.category.name + ', '
405 + data.stock.type.model.make.name + ', '
406 + data.stock.type.model.name + ', '
407 + data.stock.type.name + '</h5></div>'
410 'seller' : data.stock.type
411 ? '<div class="row-fluid"><div class="span4"><h5><b>Seller Details:</b></h5></div><div class="span8"><h5>'
412 + data.company.contact.firstName + ' ' + data.company.contact.familyName + ', '
413 + data.company.contact.mobile + ', ' + data.company.name + '<br/>'
414 + data.company.street + ', '
415 + data.company.city.name + ', ' + data.company.region.name + ', '
416 + data.company.postalCode + '</h5></div>'
420 style : 'bid-information',
421 labelStyle : 'bid-information-label',
422 value : data.stock.vehicleYear ? data.stock.vehicleYear.name : ''
426 style : 'bid-information',
427 labelStyle : 'bid-information-label',
428 value : data.stock.type ? data.stock.type.category.name : ''
431 title : 'Vehicle Make',
432 style : 'bid-information',
433 labelStyle : 'bid-information-label',
434 value : data.stock.type ? data.stock.type.model.make.name : ''
438 title : 'Vehicle Model',
439 style : 'bid-information',
440 labelStyle : 'bid-information-label',
441 value : data.stock.type ? data.stock.type.model.name : ''
444 title : 'Vehicle Type',
445 style : 'bid-information',
446 labelStyle : 'bid-information-label',
447 value : data.stock.type ? data.stock.type.name : ''
451 value : data.stock.fuelType ? data.stock.fuelType.name : '',
452 style : 'bid-information',
453 labelStyle : 'bid-information-label'
456 'transmissionType' : {
457 title : 'Transmission Type',
458 style : 'bid-information',
459 labelStyle : 'bid-information-label',
460 value : data.stock.transmissionType ? data.stock.transmissionType.name : ''
464 style : 'bid-information',
465 labelStyle : 'bid-information-label',
466 value : data.stock.condition ? data.stock.condition.name : ''
469 title : 'Main ext. colour',
470 style : 'bid-information',
471 labelStyle : 'bid-information-label',
472 value : data.stock.exteriorColour ? data.stock.exteriorColour.name : ''
475 title : 'Main int. colour',
476 style : 'bid-information',
477 labelStyle : 'bid-information-label',
478 value : data.stock.interiorColour ? data.stock.interiorColour.name : ''
481 title : 'Upholstery',
482 style : 'bid-information',
483 labelStyle : 'bid-information-label',
484 value : data.stock.upholstery ? data.stock.upholstery.name : ''
488 style : 'bid-information',
489 labelStyle : 'bid-information-label',
490 value : data.stock.papers ? data.stock.papers.name : ''
494 value : data.stock.natis ? data.stock.natis.name : '',
495 style : 'bid-information',
496 labelStyle : 'bid-information-label'
499 title : 'Spare keys',
500 value : undefined == data.stock.spareKeys
502 : (data.stock.spareKeys ? 'Yes' : 'No'),
503 style : 'bid-information',
504 labelStyle : 'bid-information-label'
506 'fullServiceHistory' : {
507 title : 'Full service history',
508 value : undefined == data.stock.fullServiceHistory
510 : data.stock.fullServiceHistory.name,
511 style : 'bid-information',
512 labelStyle : 'bid-information-label'
514 'registrationNumber' : {
515 title : 'Registration no',
516 value : data.stock.registrationNumber ? data.stock.registrationNumber : '',
517 style : 'bid-information',
518 labelStyle : 'bid-information-label'
522 value : data.stock.vinNumber ? data.stock.vinNumber : '',
523 style : 'bid-information',
524 labelStyle : 'bid-information-label'
528 value : data.stock.engineNumber ? data.stock.engineNumber : '',
529 style : 'bid-information',
530 labelStyle : 'bid-information-label'
534 value : data.stock.km ? data.stock.km : '',
535 style : 'bid-information',
536 labelStyle : 'bid-information-label'
540 value : data.stock.fshNotes ? data.stock.fshNotes : ''
544 style : 'bid-information',
545 labelStyle : 'bid-information-label'
548 style : 'bid-information',
549 labelStyle : 'bid-information-label',
550 value : data.stock.fshNotes ? data.stock.fshNotes : ''
552 'damages' : damagesHtml,
554 title : 'Total estimated repair price',
555 value : 'R ' + (data.stock ? data.stock.damageTotal : '0.00'),
556 style : 'bid-information',
557 labelStyle : 'bid-information-label'
560 title : 'Damages comments',
561 value : data.stock.damageNotes ? data.stock.damageNotes : '',
562 style : 'bid-information',
563 labelStyle : 'bid-information-label'
565 'damageNotes_title' : {
566 style : 'bid-information',
567 labelStyle : 'bid-information-label',
568 title : 'Damages comments',
571 'damageNotes_data' : {
572 style : 'bid-information',
573 labelStyle : 'bid-information-label',
574 value : data.stock.damageNotes ? data.stock.damageNotes : ''
576 'previousRepairsNoted' : {
577 title : 'Previous repairs noted',
578 value : data.stock.previousRepairsNoted ? 'Yes' : 'No',
579 style : 'bid-information',
580 labelStyle : 'bid-information-label'
582 'previousRepairsNotes' : {
583 title : 'Previous repairs comments',
584 value : data.stock.previousRepairsNotes ? data.stock.previousRepairsNotes : '',
585 style : 'bid-information',
586 labelStyle : 'bid-information-label'
588 'previousRepairsNotes_title' : {
589 style : 'bid-information',
590 labelStyle : 'bid-information-label',
591 title : 'Previous repairs comments',
593 'previousRepairsNotes_data' : {
594 style : 'bid-information',
595 labelStyle : 'bid-information-label',
596 value : data.stock.previousRepairsNotes ? data.stock.previousRepairsNotes : ''
599 'accessories' : accessoriesHtml,
603 value : data.stock.accessoryNotes ? data.stock.accessoryNotes : '',
604 style : 'bid-information',
605 labelStyle : 'bid-information-label hidden'
611 value : data.stock.accessoryNotes ? data.stock.accessoryNotes : '',
612 style : 'bid-information',
613 labelStyle : 'bid-information-label'
615 'accessoryNotes_title' : {
616 style : 'bid-information',
617 labelStyle : 'bid-information-label',
618 title : 'Accessories Comments',
621 'accessoryNotes_data' : {
622 style : 'bid-information',
623 labelStyle : 'bid-information-label',
624 value : data.stock.accessoryNotes ? data.stock.accessoryNotes : ''
629 'accessoriesMobi' : accessoriesHtml,
630 'accessoryNotesMobi' : {
632 value : data.stock.accessoryNotes ? data.stock.accessoryNotes : '',
633 style : 'bid-information',
634 labelStyle : 'bid-information-label'
636 'accessoryNotes_titleMobi' : {
637 style : 'bid-information',
638 labelStyle : 'bid-information-label',
639 title : 'Accessories Comments',
642 'accessoryNotes_dataMobi' : {
643 style : 'bid-information',
644 labelStyle : 'bid-information-label',
645 title : 'Accessories Notes',
646 value : data.stock.accessoryNotes ? data.stock.accessoryNotes : ''
649 'accessoryNewMobi' : {
650 value : data.stock.accessoryNotes ? data.stock.accessoryNotes : '',
651 style : 'bid-information',
652 labelStyle : 'bid-information-label'
658 type : 'bidMainImage',
661 baseImage : 'main_img_car.jpg',
662 value : data.stock.mainImage ? data.stock.mainImage : ''
668 baseImage : 'main_img_car.jpg',
669 value : data.stock.mainImage ? data.stock.mainImage : ''
675 baseImage : 'front_car.jpg',
676 value : data.stock.frontImage ? data.stock.frontImage : ''
682 baseImage : 'left_car.jpg',
683 value : data.stock.leftImage ? data.stock.leftImage : ''
689 baseImage : 'right_car.jpg',
690 value : data.stock.rightImage ? data.stock.rightImage : ''
696 baseImage : 'back_car.jpg',
697 value : data.stock.backImage ? data.stock.backImage : ''
702 id : 'interiorImage',
703 baseImage : 'interior_car.jpg',
704 value : data.stock.interiorImage ? data.stock.interiorImage : ''
710 baseImage : 'engine_car.jpg',
711 value : data.stock.engineImage ? data.stock.engineImage : ''
717 baseImage : 'copy_of_natis_car.jpg',
718 value : data.stock.natisImage ? data.stock.natisImage : ''
721 'infCreated': data.created ? ((data.created).split(' '))[0] : '',
722 'infLoadedOnAuction': data.stock.loadedOnAuction
723 ? ((data.stock.loadedOnAuction).split(' '))[0] : '',
725 title : '<b>Trade</b>',
726 value : data.stock.tradePrice ? ' R ' + data.stock.tradePrice : ' R 0.00',
727 style : 'bid-information',
728 labelStyle : 'bid-information-label'
731 title : '<b>Retail</b>',
732 value : data.stock.retailPrice ? ' R ' + data.stock.retailPrice : ' 0.00',
733 style : 'bid-information',
734 labelStyle : 'bid-information-label'
737 title : '<b>New list price</b>',
738 value : data.stock.listPrice ? ' R ' + data.stock.listPrice : ' R 0.00',
739 style : 'bid-information',
740 labelStyle : 'bid-information-label'
744 title : 'Dealership name',
745 value : data.company ? data.company.name : '',
746 style : 'bid-information',
747 labelStyle : 'bid-information-label'
750 title : 'Name and surname',
751 value : data.company && data.company.contact
752 ? data.company.contact.firstName + ' ' + data.company.contact.familyName
754 style : 'bid-information',
755 labelStyle : 'bid-information-label'
759 value : data.company && data.company.contact
760 ? data.company.contact.mobile
762 style : 'bid-information',
763 labelStyle : 'bid-information-label'
767 value : data.company && data.company.contact
768 ? data.company.contact.email
770 style : 'bid-information',
771 labelStyle : 'bid-information-label'
777 value : _w.historyview.nextBid,
781 type : 'amountAuction',
784 value : '' //parseFloat(_w.historyview.nextBid) + parseFloat(data.bidIncrement)
787 type : 'textarea-styled',
794 'infAmount' : _w.historyview.nextBid,
795 'myAutoBid' : data.currentBid && data.currentBid.autoBid
796 && App.companyData.id == data.currentBid.autoBid.company
797 ? '<b>My auto-bid:<br/>R ' + data.currentBid.autoBid.amount + '</b>'
798 : '<b>No current auto-bid.</b>',
801 value : '<b>R ' + _w.historyview.nextBid + '</b>'
807 value : '<b>R ' + _w.historyview.nextBid + '</b>',
808 style : 'text-large-auction'
811 title : 'Winning bid',
812 value : data.currentBid ? '<b>R ' + data.currentBid.amount + '</b>' : '<b>R 0.00</b>'
815 type : 'textarea-styled',
819 areaStyle : 'span12',
823 constructor: 'Button',
827 id: 'printAuctionPdf',
828 handler: _w.historyview.printAuctionPdf
835 printAuctionPdf : function()
838 'printAuctionPdf:' + _w.historyview.itemId, 'Auction', 'Pdf.Print', _w.historyview.itemId,
841 'printAuctionPdf:' + _w.historyview.itemId, {}, {},
842 function() {}, function() {},
845 }, _w.taskContractError
849 _onBidDataAndTemplate : function ()
853 if ('Archived' == _w.historyview.bidData.status)
855 true == App.permissions.pgUnArchive ? $('#btnUnarchive').show() : $('#btnUnarchive').hide();
856 $('#btnArchive').hide();
857 $('#optMakeBid').hide();
861 true == App.permissions.pgArchive ? $('#btnArchive').show() : $('#btnArchive').hide();
862 $('#btnUnarchive').hide();
866 _onBasketDataAndTemplate : function ()
868 if (true == _w.historyview.basketData.archived)
870 $('#btnAddToBasket').prop('disabled', false);
871 $('#btnAddToBasket').removeClass('addtobasketbtntrue');
872 $('#btnAddToBasket').addClass('addtobasketbtn');
876 $('#btnAddToBasket').prop('disabled', true);
877 $('#btnAddToBasket').removeClass('addtobasketbtn');
878 $('#btnAddToBasket').addClass('addtobasketbtntrue');
882 _onStockDataAndTemplate : function ()
884 App.DataStore.loadSelectListData(
885 'tuhpi', false, 'Stock', 'Tuhpi.List', null,{"Filter":
887 "stock" : _w.historyview.itemData.stock.id,
888 "company" : App.companyData.id
891 var tuHpiData = App.DataStore.getData('tuhpi');
892 for (var i = 0; i < tuHpiData.length; i++)
894 var tuHpiId = tuHpiData[i].id
895 var tuHpiCreated = tuHpiData[i].created
897 console.log("tuhpi data Created", tuHpiCreated);
898 console.log("tuhpi data id", tuHpiId);
901 console.log("tuhpi data Created", tuHpiCreated);
902 console.log("tuhpi data id", tuHpiId);
903 $('#tuhpiDate').html(tuHpiCreated);
904 $('#downloadTuhpi').show();
908 console.log("tuhpi no data id");
909 $('#tuhpiDate').html('Not Requested Yet');
910 $('#downloadTuhpi').hide();
914 $('#disputeSection').hide();
916 //if ('Sold' == _w.historyview.itemData.jobState && _w.historyview.itemData.soldToCompany.id == App.companyData.id)
917 if ('Sold' == _w.historyview.itemData.jobState)
919 $('#bidSection').hide();
920 $('#disputeSection').show();
921 $('#btnLogDispute').click(function() {
922 var comp = $('#complaint').val();
925 alert('Please specify the complaint.');
930 againstCompany : _w.historyview.itemData.company.id,
931 auction : _w.historyview.itemId,
936 'createDispute', 'Dispute', 'Dispute.Create',
937 null, {}, function(){
939 'createDispute', data, {},
941 alert('Dispute logged.');
942 _w.historyview._onBidUpdated();
945 }, _w.taskContractError
949 else if ('Active' != _w.historyview.itemData.jobState)
951 $('#optMakeBid').hide();
955 $('#autoamount').focus(function() {
956 $('#dropConfirm').hide();
959 'createBid', 'Auction', 'Bid.Create',
960 _w.historyview.itemId, {}, function(){}, function(){}
963 'createAutoBid', 'Auction', 'AutoBid.Create',
964 _w.historyview.itemId, {}, function(){}, function(){}
968 $("#tS1").thumbnailScroller({
969 /* scroller type based on mouse interaction
970 values: "hoverPrecise", "hoverAccelerate", "clickButtons"
971 default: "hoverPrecise" */
972 scrollerType:"hoverAccelerate",
973 /* scroller orientation
974 values: "horizontal", "vertical"
975 default: "horizontal" */
976 scrollerOrientation:"horizontal",
977 /* scroll easing type only for "hoverPrecise" scrollers
978 available values here: http://jqueryui.com/demos/effect/easing.html
979 default: "easeOutCirc" */
980 scrollEasing:"easeOutCirc",
981 /* scroll easing amount only for "hoverPrecise" and "clickButtons" scrollers (0 for no easing)
984 scrollEasingAmount:300,
985 /* acceleration value only for "hoverAccelerate" scrollers
989 /* scrolling speed only for "clickButtons" scrollers
993 /* scroller null scrolling area only for "hoverAccelerate" scrollers
994 0 being the absolute center of the scroller
997 noScrollCenterSpace:0,
998 /* initial auto-scrolling
999 0 equals no auto-scrolling
1000 values: amount of auto-scrolling loops (integer)
1003 /* initial auto-scrolling speed
1004 values: milliseconds
1006 autoScrollingSpeed:100,
1007 /* initial auto-scrolling easing type
1008 available values here: http://jqueryui.com/demos/effect/easing.html
1009 default: "easeInOutQuad" */
1010 autoScrollingEasing:"easeInOutQuad",
1011 /* initial auto-scrolling delay for each loop
1012 values: milliseconds
1014 autoScrollingDelay:250
1021 if (false == App.permissions.auctionBid)
1023 $('#bidSection').hide();
1026 if (App.permissions.settingsHpiReport == false)
1028 $('#requestHPIreport').hide();
1032 if (App.permissions.settingsHpiReport)
1034 $('#requestHPIreport').show();
1039 _onBasketDataReceived : function( response )
1041 _w.historyview.basketData = response.Data;
1042 if (_w.historyview.ti.published)
1044 _w.historyview._onBasketDataAndTemplate();
1048 _onStockViewDataReceived : function( response )
1051 console.log('response', response);
1052 _w.historyview.itemId = response.Data.id;
1053 _w.historyview.itemData = response.Data;
1054 _w.historyview.setStockViewFormMeta(response.Data);
1055 _w.historyview.ti.hydrate(_w.historyview.formMeta);
1056 if (response.Data.currentBid)
1058 _w.historyview.bidId = response.Data.currentBid.id;
1059 _w.historyview.bidData = response.Data.currentBid;
1060 if (_w.historyview.bidData.company.id != App.companyData.id)
1062 $('#bidSection').show();
1063 $('#winningBid').hide();
1067 $('#bidSection').hide();
1068 $('#winningBid').show();
1073 $('#bidSection').show();
1074 _w.historyview.newItem = true;
1075 _w.historyview.bidData = {};
1077 if (_w.historyview.itemData.company.id == App.companyData.id || _w.historyview.itemData.stock.company.id == App.companyData.id)
1079 $('#bidSection').hide();
1081 if (_w.historyview.ti.published)
1083 _w.historyview._onStockDataAndTemplate();
1087 _onBidUpdated : function( response )
1089 window.location.hash = '/auction';