From 66c8fd501a80d08343aa6a1dc7634c41a0229bf0 Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Fri, 1 Dec 2017 09:59:14 +0800
Subject: [PATCH] fix: remove codesponsor
---
README.md | 3 --
build/build.js | 1 -
docs/de-de/plugins.md | 16 -------
docs/index.html | 4 +-
docs/plugins.md | 12 ------
docs/zh-cn/plugins.md | 16 -------
src/plugins/codesponsor.js | 87 --------------------------------------
7 files changed, 1 insertion(+), 138 deletions(-)
delete mode 100644 src/plugins/codesponsor.js
diff --git a/README.md b/README.md
index 961b7aa..5003a10 100644
--- a/README.md
+++ b/README.md
@@ -15,9 +15,6 @@
-
-
-
## Links
- [Documentation](https://docsify.js.org)
diff --git a/build/build.js b/build/build.js
index 0f20152..0a35b28 100644
--- a/build/build.js
+++ b/build/build.js
@@ -48,7 +48,6 @@ var plugins = [
{ name: 'external-script', entry: 'external-script.js' },
{ name: 'front-matter', entry: 'front-matter/index.js' },
{ name: 'zoom-image', entry: 'zoom-image.js' },
- { name: 'codesponsor', entry: 'codesponsor.js' },
{ name: 'disqus', entry: 'disqus.js' },
{ name: 'gitalk', entry: 'gitalk.js' }
]
diff --git a/docs/de-de/plugins.md b/docs/de-de/plugins.md
index 24b4e32..dab369a 100644
--- a/docs/de-de/plugins.md
+++ b/docs/de-de/plugins.md
@@ -106,19 +106,3 @@ Exclude the special image
## Edit on github
Add `Edit on github` button on every pages. provided by 3rd party, check [document](https://github.com/njleonzhang/docsify-edit-on-github)
-
-
-## CodeSponsor
-
-See https://codesponsor.io
-
-
-```html
-
-
-```
-
diff --git a/docs/index.html b/docs/index.html
index f8cee54..fc5adf1 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -34,7 +34,6 @@
mergeNavbar: true,
maxLevel: 4,
subMaxLevel: 2,
- codesponsor: '7c9Ms7xRs-j_y_8abU03DA',
ga: 'UA-106147152-1',
name: 'docsify',
search: {
@@ -56,7 +55,7 @@
hook.beforeEach(function (html) {
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs/' + vm.route.file
var editHtml = '[:memo: Edit Document](' + url + ')\n'
-
+
return editHtml
+ html
+ '\n----\n'
@@ -69,7 +68,6 @@
-
diff --git a/docs/plugins.md b/docs/plugins.md
index e94c757..f8469cf 100644
--- a/docs/plugins.md
+++ b/docs/plugins.md
@@ -116,18 +116,6 @@ When readers expand the demo box, the source code and description are shown ther
[Vue](https://njleonzhang.github.io/docsify-demo-box-vue/) and [React](https://njleonzhang.github.io/docsify-demo-box-react/) are both supported.
-## CodeSponsor
-
-See https://codesponsor.io
-
-```html
-
-
-```
## Copy to Clipboard
diff --git a/docs/zh-cn/plugins.md b/docs/zh-cn/plugins.md
index 98ddb97..700c69d 100644
--- a/docs/zh-cn/plugins.md
+++ b/docs/zh-cn/plugins.md
@@ -103,19 +103,3 @@ Medium's 风格的图片缩放插件. 基于 [medium-zoom](https://github.com/fr
## 在 Github 上编辑
在每一页上添加 `Edit on github` 按钮. 由第三方库提供, 查看 [document](https://github.com/njleonzhang/docsify-edit-on-github)
-
-
-## CodeSponsor
-
-参考 https://codesponsor.io
-
-
-```html
-
-
-```
-
diff --git a/src/plugins/codesponsor.js b/src/plugins/codesponsor.js
deleted file mode 100644
index 99f0b9b..0000000
--- a/src/plugins/codesponsor.js
+++ /dev/null
@@ -1,87 +0,0 @@
-const DEFAULT_OPTIONS = {
- theme: 'light',
- image: 'show'
-}
-
-function tpl (id, options) {
- const qs = []
-
- for (const key in options) {
- qs.push(`${key}=${options[key]}`)
- }
-
- const div = Docsify.dom.create('div')
-
- Docsify.dom.toggleClass(div, 'codesponsor')
- div.innerHTML = ``
-
- return div
-}
-
-function appIframe (id, opts) {
- const html = tpl(id, opts)
-
- Docsify.dom.before(Docsify.dom.find('section.content'), html)
-}
-
-function appendStyle () {
- Docsify.dom.style(`
- .codesponsor {
- position: relative;
- float: right;
- right: 10px;
- top: 10px;
- }
-
- @media screen and (min-width: 1600px) {
- body.sticky .codesponsor {
- position: fixed;
- }
-
- .codesponsor {
- position: absolute;
- bottom: 10px;
- top: auto;
- float: none;
- }
- }
- `)
-}
-
-const install = function (hook, vm) {
- let config = vm.config.codesponsor
- let id
-
- if (typeof config === 'string') {
- id = config
- config = {}
- } else {
- id = config.id
- }
-
- const opts = Docsify.util.merge(DEFAULT_OPTIONS, config)
-
- if (!id) {
- throw Error('codesponsor plugin need id')
- }
-
- if (Docsify.util.isMobile) {
- return
- }
-
- // Append style
- hook.ready(() => {
- appendStyle()
- appIframe(id, opts)
- })
-}
-
-window.$docsify.plugins = [].concat(install, window.$docsify.plugins)