diff --git a/README.md b/README.md index 79d35c3..af0a887 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[停止更新,正常维护] - # GithubTags 给 Github 项目添加标签的 Chrome 插件,支持按标签搜索,数据支持云同步 @@ -16,7 +14,7 @@ #### 项目详情 - + #### 个人主页 diff --git a/plugin/package.json b/plugin/package.json index ad452a4..a4ea987 100644 --- a/plugin/package.json +++ b/plugin/package.json @@ -1,6 +1,6 @@ { "name": "github-tags", - "version": "1.1.6", + "version": "1.1.7", "description": "A Vue.js web extension", "author": "denghaha ", "scripts": { diff --git a/plugin/src/content_scripts/js/inject.js b/plugin/src/content_scripts/js/inject.js index 64b125a..07cbdde 100644 --- a/plugin/src/content_scripts/js/inject.js +++ b/plugin/src/content_scripts/js/inject.js @@ -144,19 +144,33 @@ var _create_search_dom = function(el) { input.autocomplete = 'off'; input.value = getUrlParams('q'); - var button = document.createElement('button'); - var search_function = function() { - var url = window.location.href; - if (url.indexOf('&q') != -1) { - window.location.href = url.substring(0, url.indexOf('&q')) + '&q=' + input.value; - } else { - window.location.href = url + '&utf8=✓&q=' + input.value; - } - }; - button.onclick = search_function; - button.className = 'btn'; - button.innerHTML = - '搜索'; + var button = new Vue({ + data: {}, + render: function(h) { + var that = this; + return h('button', { + attrs: { + class: 'btn', + href: 'button', + style: 'margin-right:8px;', + }, + domProps: { + innerHTML: + '搜索', + }, + on: { + click: function(event) { + var url = window.location.href; + if (url.indexOf('&q') != -1) { + window.location.href = url.substring(0, url.indexOf('&q')) + '&q=' + input.value; + } else { + window.location.href = url + '&utf8=✓&q=' + input.value; + } + }, + }, + }); + }, + }); input.addEventListener('keypress', function() { if (event.keyCode == 13) { @@ -189,7 +203,7 @@ var _create_search_dom = function(el) { div.appendChild(input); div.appendChild(vue.$mount().$el); div.appendChild(vue_all.$mount().$el); - div.appendChild(button); + div.appendChild(button.$mount().$el); el.parentNode.insertBefore(div, el); return false; @@ -213,7 +227,12 @@ var _create_search_list_dom = function(keyword) { var that = this; searchTags(keyword, function(rsp) { console.log('搜索结果:\n' + JSON.stringify(rsp, null, 2)); - that.items = rsp; + that.items = rsp.map(it => { + if (it.project_name.indexOf('/') === 0) { + it.project_name = it.project_name.substring(1); + } + return it; + }); }); }, render: function(h) { @@ -356,7 +375,7 @@ var _bind_project_remarks = function() { } requestTagsByRepo(project_name, function(rsp) { - _create_project_remark_dom(project.parentNode.parentNode, rsp ? rsp : { _id: project_name }, 'git_remarks_plugin__input git_remarks_plugin__detail container-lg px-3', false); + _create_project_remark_dom(project.parentNode.parentNode, rsp ? rsp : { _id: project_name }, 'git_remarks_plugin__input git_remarks_plugin__detail px-3 px-lg-5', false); }); return; } diff --git a/plugin/src/manifest.json b/plugin/src/manifest.json index 41bce91..a634e69 100644 --- a/plugin/src/manifest.json +++ b/plugin/src/manifest.json @@ -1,7 +1,7 @@ { "name": "GithubTags", "description": "给Github项目添加标签,支持按标签搜索,支持数据云同步", - "version": "1.1.6", + "version": "1.1.7", "manifest_version": 2, "icons": { "48": "icons/icon.png", diff --git a/screenshot/10.jpg b/screenshot/10.jpg index 8ea1af5..aae2de6 100644 Binary files a/screenshot/10.jpg and b/screenshot/10.jpg differ diff --git a/screenshot/2.jpg b/screenshot/2.jpg new file mode 100644 index 0000000..84fe541 Binary files /dev/null and b/screenshot/2.jpg differ diff --git a/screenshot/2.png b/screenshot/2.png deleted file mode 100644 index 101a666..0000000 Binary files a/screenshot/2.png and /dev/null differ diff --git a/screenshot/3.png b/screenshot/3.png deleted file mode 100644 index bbffdb2..0000000 Binary files a/screenshot/3.png and /dev/null differ diff --git a/screenshot/4.png b/screenshot/4.png deleted file mode 100644 index af94ba6..0000000 Binary files a/screenshot/4.png and /dev/null differ diff --git a/screenshot/5.png b/screenshot/5.png deleted file mode 100644 index f4efde0..0000000 Binary files a/screenshot/5.png and /dev/null differ diff --git a/screenshot/6.png b/screenshot/6.png deleted file mode 100644 index 06922f0..0000000 Binary files a/screenshot/6.png and /dev/null differ diff --git a/screenshot/7.png b/screenshot/7.png deleted file mode 100644 index 98ddb10..0000000 Binary files a/screenshot/7.png and /dev/null differ diff --git a/update.json b/update.json index f6fd851..2ca71d7 100644 --- a/update.json +++ b/update.json @@ -1,5 +1,5 @@ { - "version": "1.1.6", - "message": "修复样式异常", + "version": "1.1.7", + "message": "适配最新版页面", "link": "https://github.com/xiandanin/github-tags#%E6%9B%B4%E6%96%B0%E8%AF%B4%E6%98%8E" }