├── dist ├── 313f7dacf2076822059d.woff ├── 4520188144a17fb24a6a.ttf └── main.js.LICENSE.txt ├── .gitignore ├── src ├── store.js ├── index.js ├── logo-light.svg └── Main.vue ├── tests ├── test.html └── app.html ├── doc └── api.md ├── package.json ├── README.md ├── webpack.config.js └── yarn.lock /dist/313f7dacf2076822059d.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wechatsync/article-syncjs/HEAD/dist/313f7dacf2076822059d.woff -------------------------------------------------------------------------------- /dist/4520188144a17fb24a6a.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wechatsync/article-syncjs/HEAD/dist/4520188144a17fb24a6a.ttf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | node_modules/ 3 | build/ 4 | md/ 5 | build/devtool/ 6 | .DS_Store 7 | WechatSync.zip 8 | *.iml 9 | yarn-error.log 10 | zip 11 | package-json.lock 12 | -------------------------------------------------------------------------------- /src/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | export const store = new Vuex.Store({ 7 | state: {}, 8 | mutations: {}, 9 | actions: {}, 10 | }) 11 | -------------------------------------------------------------------------------- /tests/test.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/api.md: -------------------------------------------------------------------------------- 1 | ## API 2 | 3 | ```js 4 | window.syncPost({ 5 | title: 'Ractor 下多线程 Ruby 程序指南', 6 | desc: 7 | '什么是 Ractor?Ractor 是 Ruby 3 新引入的特性。Ractor 顾名思义是 Ruby 和', 8 | content: 'hello world', 9 | thumb: 10 | 'http://mmbiz.qpic.cn/mmbiz_jpg/CJcVm4ThlNOeib5w5A6MYk4Eg9ErnzZ73dEicribs3gPPUB4cCxiaeRm2ZfNOibHfl4TIo8h6VlFZeBRmLoMKgibvPdw/0?wx_fmt=jpeg', 11 | }) 12 | ``` 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "syncicon", 4 | "version": "1.0.0", 5 | "description": "The Online Markdown Editor for WechatSync", 6 | "scripts": { 7 | "start": "webpack serve", 8 | "build": "webpack --env production" 9 | }, 10 | "dependencies": { 11 | "mavon-editor": "^2.7.6", 12 | "pouchdb": "^7.1.1", 13 | "pouchdb-find": "^7.1.1", 14 | "vue": "^2.6.12", 15 | "vue-moment": "^4.1.0", 16 | "vue-router": "^3.5.1", 17 | "vue-spinner": "^1.0.4", 18 | "vuex": "^3.6.2" 19 | }, 20 | "license": "ISC" 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 文章同步助手网页SDK 2 | 使用本SDK可以从网页端注入文章内容,并拉起同步任务框 3 | 4 | 5 | ## 使用 6 | 7 | ```html 8 | 9 | 10 | 11 | ``` 12 | 13 | ## API 14 | 拉起同步框 15 | ```js 16 | window.syncPost({ 17 | title: 'Ractor 下多线程 Ruby 程序指南', 18 | desc: 19 | '什么是 Ractor?Ractor 是 Ruby 3 新引入的特性。Ractor 顾名思义是 Ruby 和', 20 | content: 'hello world', 21 | thumb: 22 | 'http://mmbiz.qpic.cn/mmbiz_jpg/CJcVm4ThlNOeib5w5A6MYk4Eg9ErnzZ73dEicribs3gPPUB4cCxiaeRm2ZfNOibHfl4TIo8h6VlFZeBRmLoMKgibvPdw/0?wx_fmt=jpeg', 23 | }) 24 | ``` 25 | -------------------------------------------------------------------------------- /dist/main.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * Vue.js v2.6.12 3 | * (c) 2014-2020 Evan You 4 | * Released under the MIT License. 5 | */ 6 | 7 | /** 8 | * Checks if an event is supported in the current execution environment. 9 | * 10 | * NOTE: This will not work correctly for non-generic events such as `change`, 11 | * `reset`, `load`, `error`, and `select`. 12 | * 13 | * Borrows from Modernizr. 14 | * 15 | * @param {string} eventNameSuffix Event name, e.g. "click". 16 | * @param {?boolean} capture Check if the capture phase is supported. 17 | * @return {boolean} True if the event is supported. 18 | * @internal 19 | * @license Modernizr 3.0.0pre (Custom Build) | MIT 20 | */ 21 | 22 | //! moment.js 23 | 24 | //! moment.js locale configuration 25 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueMoment from 'vue-moment' 3 | import Main from './Main.vue' 4 | 5 | import ElementUI from 'element-ui' 6 | import 'element-ui/lib/theme-chalk/index.css' 7 | 8 | Vue.use(ElementUI) 9 | 10 | Vue.use(VueMoment) 11 | 12 | const app = new Vue(Main) 13 | const appDiv = document.createElement('div') 14 | appDiv.id = 'synciconapp' 15 | document.body.appendChild(appDiv) 16 | app.$mount('#synciconapp') 17 | 18 | // const pendingTasks = [] 19 | // let timer = null 20 | 21 | // window.$syncicon = { 22 | // ready(fn) { 23 | // if (typeof window.syncPost == 'undefined') { 24 | // pendingTasks.push(fn) 25 | // return 26 | // } else { 27 | // fn() 28 | // } 29 | // }, 30 | // } 31 | -------------------------------------------------------------------------------- /tests/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/logo-light.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const HtmlWebpackPlugin = require('html-webpack-plugin') 3 | const { VueLoaderPlugin } = require('vue-loader') 4 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') 5 | const Dotenv = require('dotenv-webpack') 6 | const TerserPlugin = require('terser-webpack-plugin') 7 | const projectRoot = path.resolve(__dirname, '../../') 8 | 9 | module.exports = env => { 10 | const prodMode = env.production 11 | const prodConfigs = { 12 | mode: 'production', 13 | resolve: { 14 | alias: { 15 | vue: 'vue/dist/vue.min.js', 16 | }, 17 | }, 18 | optimization: { 19 | minimize: true, 20 | minimizer: [ 21 | new TerserPlugin({ 22 | test: /\.js(\?.*)?$/i, 23 | }), 24 | ], 25 | }, 26 | } 27 | const devConfigs = { 28 | mode: 'development', 29 | devtool: 'inline-source-map', 30 | devServer: { 31 | contentBase: './dist', 32 | }, 33 | resolve: { 34 | alias: { 35 | vue: 'vue/dist/vue.js', 36 | }, 37 | }, 38 | } 39 | return { 40 | ...(prodMode ? prodConfigs : devConfigs), 41 | entry: './src/index.js', 42 | output: { 43 | filename: 'main.js', 44 | path: path.resolve(__dirname, 'dist'), 45 | clean: true, 46 | }, 47 | module: { 48 | rules: [ 49 | { 50 | test: /\.(sa|sc|c)ss$/i, 51 | use: [ 52 | prodMode ? MiniCssExtractPlugin.loader : 'style-loader', 53 | 'css-loader', 54 | ], 55 | }, 56 | { 57 | test: /\.(png|svg|jpg|jpeg|gif)$/i, 58 | type: 'asset/resource', 59 | }, 60 | { 61 | test: /\.(woff|woff2|eot|ttf|otf)$/i, 62 | type: 'asset/resource', 63 | }, 64 | { 65 | test: /\.js?$/, 66 | loader: 'babel-loader', 67 | exclude: file => /node_modules/.test(file) && !/\.vue\.js/.test(file), 68 | options: { 69 | rootMode: 'upward', 70 | }, 71 | }, 72 | { 73 | test: /\.vue$/, 74 | loader: 'vue-loader', 75 | }, 76 | ], 77 | }, 78 | plugins: [ 79 | new MiniCssExtractPlugin({ 80 | filename: 'styles.css', 81 | }), 82 | // new HtmlWebpackPlugin({ 83 | // template: 'src/index.html', 84 | // }), 85 | new VueLoaderPlugin(), 86 | new Dotenv({ 87 | path: path.resolve( 88 | projectRoot, 89 | prodMode ? '.env.production' : '.env.development' 90 | ), 91 | safe: true, 92 | }), 93 | ], 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/Main.vue: -------------------------------------------------------------------------------- 1 | 2 |35 | {{ currentArtitle.desc }} 36 |
37 |等待发布..
73 |