From c93e66565d72b9ee5c92347d08273e3df294717a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E8=BF=9B?= Date: Fri, 14 Sep 2018 23:19:39 +0800 Subject: [PATCH] Update adminAdapters.js --- src/js/adminAdapters.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/js/adminAdapters.js b/src/js/adminAdapters.js index 41b3451..7e8d053 100644 --- a/src/js/adminAdapters.js +++ b/src/js/adminAdapters.js @@ -396,7 +396,7 @@ function Adapters(main) { for (var o = 0; o < order.length; o++) { var user = that.urls[order[o]].match(/\.com\/([-_$§A-Za-z0-9]+)\/([-._$§A-Za-z0-9]+)\//); if (user && user.length >= 2 && (that.main.config.expertMode || order[o].indexOf('js-controller') === -1)) { - text += ''; + text += ''; } } that.$installDialog.find('#install-github-link').html(text).val(that.main.config.adaptersGithub || ''); @@ -411,7 +411,7 @@ function Adapters(main) { if (isCustom) { url = that.$installDialog.find('#install-url-link').val(); - if (url.startsWith("http") && url.endsWith(".git") url = "git+" _ url; + if (url.startsWith("http") && url.endsWith(".git")) url = "git+" + url; debug = that.$installDialog.find('#install-url-debug').prop('checked') ? ' --debug' : ''; adapter = ''; @@ -1478,18 +1478,10 @@ function Adapters(main) { callback(true); }, 10000); - if (!that.data[adapter].licenseUrl) { - that.data[adapter].licenseUrl = 'https://raw.githubusercontent.com/yunkong2/yunkong2.' + (that.data[adapter].name || adapter) + '/master/LICENSE'; - } if (typeof that.data[adapter].licenseUrl === 'object') { that.data[adapter].licenseUrl = that.data[adapter].licenseUrl[systemLang] || that.data[adapter].licenseUrl.en; } - // Workaround - // https://github.com/yunkong2/yunkong2.vis/blob/master/LICENSE => - // https://raw.githubusercontent.com/yunkong2/yunkong2.vis/master/LICENSE - if (that.data[adapter].licenseUrl.indexOf('github.com') !== -1) { - that.data[adapter].licenseUrl = that.data[adapter].licenseUrl.replace('github.com', 'raw.githubusercontent.com').replace('/blob/', '/'); - } + that.main.socket.emit('httpGet', that.data[adapter].licenseUrl, function (error, response, body) { if (timeout) {