1 2(function($) { 3 4 var PageModule = function (options) { 5 this.setPageName = function ( pageName){ 6 options.pageName = pageName; 7 this.setPageStep(pageName); 8 }; 9 this.setPageStep = function ( pageName){ 10 options.pageLastStep = options.pageStep; 11 switch (pageName){ 12 case "RESULTS_PAGE": 13 options.pageStep = 1; 14 break; 15 case "DETAILS_PAGE": 16 options.pageStep = 2; 17 break; 18 case "ORDER_PAGE": 19 options.pageStep = 3; 20 break; 21 case "PAYMENT_PAGE": 22 options.pageStep = 4; 23 break; 24 case "CONFIRMATION_PAGE": 25 options.pageStep = 5; 26 break; 27 default: 28 options.pageStep = 0; 29 } 30 sessionStorage.pageStep = options.pageStep; 31 }; 32 33 this.isBackUsed = function ( ) { 34 return parseInt(options.pageLastStep) > parseInt(options.pageStep) && options.pageStep > 0; 35 } 36 37 this.getPageName = function ( ){ 38 return options.pageName || null; 39 }; 40 41 this.setComponentName = function ( compoentName){ 42 options.compoentName = compoentName; 43 }; 44 45 this.getComponentName = function ( ){ 46 return options.compoentName; 47 }; 48 49 this.isOrderPage = function (){ 50 return options.pageName == 'ORDER_PAGE'; 51 }; 52 53 this.isDetailsPage = function (){ 54 return options.pageName == 'DETAILS_PAGE'; 55 }; 56 57 this.isResultPage = function (){ 58 return options.pageName == 'RESULTS_PAGE'; 59 }; 60 61 this.isHomePage = function (){ 62 return options.pageName == 'HOME_PAGE'; 63 }; 64 this.isConfirmationPage = function (){ 65 return options.pageName == 'CONFIRMATION_PAGE'; 66 }; 67 this.isPaymentPage = function (){ 68 return options.pageName == 'PAYMENT_PAGE'; 69 }; 70 this.isPzWizard = function (){ 71 return options.pageName == 'PZ_WIZARD'; 72 }; 73 74 // Make sure options exists 75 options = options || {}; 76 // Set default values for required options 77 options.pageName = options.pageName || ''; 78 options.pageStep = sessionStorage.pageStep || 0; 79 options.pageLastStep = options.pageLastStep || ''; 80 }; 81 82 $.PageModule = { 83 ORDER_PAGE : function() { 84 return "ORDER_PAGE"; 85 }, 86 RESULTS_PAGE : function() { 87 return "RESULTS_PAGE"; 88 }, 89 CONFIRMATION_PAGE : function() { 90 return "CONFIRMATION_PAGE"; 91 }, 92 HOME_PAGE : function() { 93 return "HOME_PAGE"; 94 }, 95 DETAILS_PAGE : function() { 96 return "DETAILS_PAGE"; 97 }, 98 PAYMENT_PAGE : function() { 99 return "PAYMENT_PAGE"; 100 }, 101 SMALL_SEARCH_ENGINE_COMP_NAME : function() { 102 return "smallSearchEngine"; 103 }, 104 PZ_WIZARD : function() { 105 return "PZ_WIZARD"; 106 } 107 }; 108 109 pageModuleInstance = new PageModule(); 110 111})(jQuery); 112/** 113 * store page object , default empty one and should override 114 * e.g. pageModuleInstance = new PageModule({pageName: $.PageModule.RESULTS_PAGE()}) 115 */ 116var pageModuleInstance;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.