mirror of
https://gitlab.com/octospacc/Web-Archives-Misc
synced 2025-01-15 09:15:49 +01:00
2 lines
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{23:function(t,e,n){"use strict";n.r(e),e.default={data:function(){return console.log(this.$route.context),this.$route.context},methods:{addFeaturedRepo:function(t){var e=t.target;null==e.dataset.repo&&(e=e.parentElement),this.addRepo(e.dataset.repo)},addRepoPrompt:function(){var t=this;this.$app.dialog.prompt("Enter a URL to a repo",(function(e){t.addRepo(e)}))},addRepo:function(t){var e=this,n=this;console.log(t),t=patchXSS(t),this.$app.preloader.show();var a=new URL(t);fetch("localhost"==a.hostname?t:"https://api.zenithdevs.com/eclipse/download/?dl=".concat(encodeURI(t.replace("http://","https://")))).then((function(t){return e.$app.methods.repo.update(t.json())})).then((function(a){if(a=patchXSS(a),n.$app.preloader.hide(),403==a.code)n.$app.dialog.alert(a.message);else{var o=localStorage.getItem("repos"),i=[];null!=o&&(i=JSON.parse(o)),-1==i.indexOf(t)?(i.push(t),e.$app.methods.storage.set("repos",JSON.stringify(i)),n.$app.toast.create({text:'"'.concat(n.$app.methods.repo.update(a).info.name,'" was added to your repos.'),closeTimeout:2e3}).open(),n.updateState()):n.$app.dialog.alert("You already have this repo added.")}})).catch((function(t){console.error(t),n.$app.preloader.hide(),n.$app.dialog.alert("There was an issue while trying to add that repo")}))},removeRepo:function(t){var e=localStorage.getItem("repos"),n=[];null!=e&&(n=JSON.parse(e));var a=this;n.forEach((function(e,o){e.replace("http://","https://")==t.target.dataset.repo&&(n.splice(o,1),a.$app.methods.storage.set("repos",JSON.stringify(n)))}))},repoMenu:function(t){var e=this;t.preventDefault();var n=t.target;null==n.dataset.index&&(n=n.parentElement),null==n.dataset.index&&(n=n.parentElement),null==n.dataset.index&&(n=n.parentElement);var a=patchXSS(n.dataset);this.$app.actions.create({buttons:[[{text:a.name,label:!0},"Unknown Repo"!=a.name&&"Blocked Repo"!=a.name?{text:"View",onClick:function(){e.$router.navigate("/game-hub/repo/".concat(encodeURIComponent(a.url),"/"))}}:null,{text:"Remove",color:"red",onClick:function(){e.removeRepo({target:{dataset:{repo:a.url}}}),e.updateState()}}].filter((function(t){if(t)return t})),[{text:"Cancel",bold:!0}]]}).open()},updateState:function(){var t=this;this.$app.preloader.show(),this.$app.methods.repo.list().then((function(e){t.$app.preloader.hide(),t.$setState(e)}))},openDropbox:function(){this.$app.methods.cloud.dropbox.launch()}},id:"d62081f8db",render:function(){return'\n\t<div class="page">\n\t\t<div class="navbar">\n\t\t\t<div class="navbar-inner sliding">\n\t\t\t\t<div class="left">\n\t\t\t\t\t<a href="#" class="link back">\n\t\t\t\t\t\t<i class="icon icon-back"></i>\n\t\t\t\t\t\t<span class="ios-only">Back</span>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t\t<div class="title">Homebrew</div>\n\t\t\t\t<div class="title-large">\n\t\t\t\t\t<div class="title-large-text">Homebrew</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="page-content">\n\t\t\t<div class="block-title block-title-medium">Featured</div>\n\t\t\t<div class="featured-items-slider">\n\t\t\t\t'.concat(this.featured.map((function(t){return'\n\t\t\t\t<a href="#" @click="addFeaturedRepo" data-repo="'.concat(t.link,'" class="item"\n\t\t\t\t\tstyle="background-image: url(').concat(t.icon,')">\n\t\t\t\t\t<h2>').concat(t.name,"</h2>\n\t\t\t\t</a>\n\t\t\t\t")})).join(""),'\n\t\t\t</div>\n\t\t\t<div class="block">\n\t\t\t\t<h2>What happened to repos?</h2>\n\t\t\t\t<div>Custom sources are officially depreciated. We are not responsible for what shows up\n\t\t\t\t\tand will be depreciating this entirely in a future update.</div>\n\t\t\t</div>\n\t\t\t<div class="block-title block-title-medium">Repos</div>\n\t\t\t').concat(0==this.repos.length?'\n\t\t\t<div class="block block-strong">\n\t\t\t\t<h3>No Repos</h3>\n\t\t\t\t<p>Tap a featured repo above to discover some homebrew games.</p>\n\t\t\t</div>\n\t\t\t':'\n\t\t\t<div class="list">\n\t\t\t\t<ul>\n\t\t\t\t\t'.concat(this.repos.map((function(t,e){return 0==t.info.blocked&&0==t.info.error?'\n\t\t\t\t\t<li class="swipeout">\n\t\t\t\t\t\t<a draggable="false" href="/game-hub/repo/'.concat(encodeURIComponent(t.info.url),'/"\n\t\t\t\t\t\t\t@contextmenu="repoMenu" class="repo-item item-link item-content swipeout-content"\n\t\t\t\t\t\t\tdata-name="').concat(t.info.name,'" data-index="').concat(e,'"\n\t\t\t\t\t\t\tdata-url="').concat(decodeURIComponent(t.info.url),'">\n\t\t\t\t\t\t\t<div class="item-media">\n\t\t\t\t\t\t\t\t<img onerror="javascript:this.src=\'static/img/default-cover.png\'"\n\t\t\t\t\t\t\t\t\tsrc="').concat(t.info.logo,'" width="44px" style="border-radius:44px;">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t<div class="item-title">\n\t\t\t\t\t\t\t\t\t<span>').concat(t.info.name,'</span>\n\t\t\t\t\t\t\t\t\t<div class="item-footer">').concat(t.info.maintainer,'</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<div class="swipeout-actions-right">\n\t\t\t\t\t\t\t<a href="#" class="swipeout-delete" @click="removeRepo"\n\t\t\t\t\t\t\t\tdata-repo="').concat(decodeURIComponent(t.info.url),'">Delete</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t\t'):1==t.info.blocked?'\n\t\t\t\t\t<li class="swipeout">\n\t\t\t\t\t\t<div class="swipeout-content">\n\t\t\t\t\t\t\t<a draggable="false" href="/game-hub/repo/'.concat(encodeURIComponent(t.info.url),'/"\n\t\t\t\t\t\t\t\tclass="repo-item item-link item-content" @contextmenu="repoMenu"\n\t\t\t\t\t\t\t\tdata-name="Blocked Repo" data-index="').concat(e,'"\n\t\t\t\t\t\t\t\tdata-url="').concat(decodeURIComponent(t.info.url),'">\n\t\t\t\t\t\t\t\t<div class="item-media">\n\t\t\t\t\t\t\t\t\t<img src="static/img/default-cover.png">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title">\n\t\t\t\t\t\t\t\t\t\t<span>Blocked Repo</span>\n\t\t\t\t\t\t\t\t\t\t<div class="item-footer">\n\t\t\t\t\t\t\t\t\t\t\t').concat(t.info.url.replace("https://php.eclipseemu.me/dl/dl.php?dl=",""),'\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swipeout-actions-right">\n\t\t\t\t\t\t\t<a href="#" class="swipeout-delete" @click="removeRepo"\n\t\t\t\t\t\t\t\tdata-repo="').concat(decodeURIComponent(t.info.url),'">Delete</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t\t'):1==t.info.error?'\n\t\t\t\t\t<li class="swipeout">\n\t\t\t\t\t\t<div class="swipeout-content item-content" @contextmenu="repoMenu" data-name="Unknown Repo"\n\t\t\t\t\t\t\tdata-index="'.concat(e,'" data-url="').concat(decodeURIComponent(t.info.url),'">\n\t\t\t\t\t\t\t<div class="item-media">\n\t\t\t\t\t\t\t\t<img src="static/img/default-cover.png">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t<div class="item-title">\n\t\t\t\t\t\t\t\t\t<span>Unknown Repo</span>\n\t\t\t\t\t\t\t\t\t<div class="item-footer">\n\t\t\t\t\t\t\t\t\t\t').concat(t.info.url.replace("https://php.eclipseemu.me/dl/dl.php?dl=",""),'</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swipeout-actions-right">\n\t\t\t\t\t\t\t<a href="#" class="swipeout-delete" @click="removeRepo"\n\t\t\t\t\t\t\t\tdata-repo="').concat(decodeURIComponent(t.info.url),'">Delete</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t\t'):void 0})).join(""),"\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\n\t\t"),"\n\t</div>\n")},styleScoped:!1}}}]);
|
|
//# sourceMappingURL=11.app.js.map
|