2023-01-15 20:48:50 +01:00

2 lines
3.2 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{27:function(t,e,a){"use strict";a.r(e),e.default={data:function(){var t=localStorage.getItem("".concat(this.$route.context.game.id,"_cheats")),e=[];return null!=t&&(e=JSON.parse(t)),this.$route.context.cheats=e,this.$route.context},methods:{addCheat:function(){var t=this,e=this;this.$app.dialog.prompt("Please enter a ".concat(this.$app.data.cores[this.$app.methods.game.getSystem(this.$route.context.game.system).toLowerCase()].cheatsType,' cheat code for "').concat(this.$route.context.game.name,'".'),(function(a){if(""==a||null==a)t.$app.dialog.alert("Please enter a valid cheat.");else{var n=localStorage.getItem("".concat(e.$route.context.game.id,"_cheats")),s=[];null!=n&&(s=s=JSON.parse(n)),s.push(a),t.$app.methods.storage.set("".concat(e.$route.context.game.id,"_cheats"),JSON.stringify(s));var i=e.$route.context;i.cheats=s,e.$setState(i)}}))},removeCheat:function(t){var e=this,a=localStorage.getItem("".concat(this.$route.context.game.id,"_cheats")),n=[];null!=a&&(n=n=JSON.parse(a));var s=this;n.forEach((function(a,i){if(a==t.target.dataset.cheat){console.log(a,t.target.dataset.cheat),n.splice(i,1),s.$app.methods.storage.set("".concat(s.$route.context.game.id,"_cheats"),JSON.stringify(n));var c=s.$route.context;c.cheats=n,e.$setState(c)}}))}},id:"822beaff12",render:function(){return'\n <div class="popup">\n <div class="view">\n <div class="page">\n <div class="navbar">\n <div class="navbar-inner">\n <div class="left">\n \x3c!-- Link to close popup --\x3e\n <a class="link popup-close">\n <i class="icon f7-icons ios-only">close</i>\n <i class="icon material-icons md-only">close</i>\n </a>\n </div>\n <div class="title">Cheats</div>\n <div class="right">\n \x3c!-- Link to close popup --\x3e\n <a href="#" class="link icon-only" @click="addCheat">\n <i class="icon f7-icons ios-only">add</i>\n <i class="icon material-icons md-only">add</i>\n </a>\n </div>\n </div>\n </div>\n <div class="page-content">\n '.concat(0<this.cheats.length?'<div class="list">\n <ul>\n '.concat(this.cheats.map((function(t){return'\n <li class="swipeout">\n <div class="item-content swipeout-content">\n <div class="item-inner">\n <div class="item-title">'.concat(t,'</div>\n </div>\n </div>\n <div class="swipeout-actions-right">\n <a href="#" @click="removeCheat" data-cheat="').concat(t,'" class="swipeout-delete">Delete</a>\n </div>\n </li>\n ')})).join(""),"\n </ul>\n </div>"):'\n <div class="games-message">\n <div class="games-message-content">\n <h1>No Cheats</h1>\n <p>You don\'t have any cheats for this game yet.</p>\n </div>\n </div>\n ',"\n </div>\n </div>\n </div>\n </div>\n")},styleScoped:!1}}}]);
//# sourceMappingURL=2.app.js.map