1 line
2.0 KiB
JavaScript
1 line
2.0 KiB
JavaScript
(function(){var u=baseInfo.getInstance().info.version,i=Storage.get("currentVersion"),n,r,t;if(i?Storage.get("currentVersion")!=u&&(Statistics.trigger(0,"2",Storage.get("currentVersion")),Storage.set("currentVersion",u)):(Statistics.trigger(0,"1"),Storage.set("currentVersion",u)),!i||/^1\./.test(i)||/^2\.0\./.test(i)){Storage.get("monitoring")=="on"?(n=parseInt(Storage.get("flightDate"),10),r=new Flight({from:Storage.get("flightFrom"),to:Storage.get("flightTo"),date:Storage.get("flightFiveDays")=="true"?[n-1728e5,n+1728e5]:[n,n],extra:Storage.get("flightFiveDays")=="true"?[n-1728e5,n+1728e5]:[n-1728e5,n+1728e5]}),Storage.set(r.getId(),JSON.stringify({flight:{main:JSON.parse(Storage.get("rightDateTicket")),extra:JSON.parse(Storage.get("otherTicketsInfo")),lowestPrice:parseInt(Storage.get("lowestPrice"))},monitor:{lastTime:parseInt(Storage.get("lastMonitorTime"),10),time:parseInt(Storage.get("lastMonitorTime"),10),type:Storage.get("monitorType"),price:Storage.get("absolutePrice")},lastShowedPrice:parseInt(Storage.get("lastShowedPrice"),10)})),Storage.set("monitorBox",JSON.stringify([r.getId()])),Storage.set("monitorHistory",JSON.stringify([r.getId()]))):Storage.set("lastInput",{from:Storage.get("flightFrom"),to:Storage.get("flightTo"),date:parseInt(Storage.get("flightDate"),10),extra:Storage.get("flightFiveDays")=="true"});Storage.remove("flightFrom");Storage.remove("flightTo");Storage.remove("flightDate");Storage.remove("flightFiveDays");Storage.remove("monitorType");Storage.remove("absolutePrice");Storage.remove("rightDateTicket");Storage.remove("otherTicketsInfo");Storage.remove("lowestPrice");Storage.remove("lastShowedPrice");Storage.remove("lastMonitorTime");switch(Storage.get("myStage")){case"ticketRoot":t="root";break;case"monitorGroup":t=Storage.get("monitoring")=="on"?"monitorBox":"flightSetting";break;case"cheapTicketList":t="bargainList";break;case"setting":t="commonSetting";break;default:t="root"}Storage.set("lastStage",t);Storage.remove("monitoring");Storage.remove("myStage")}})() |