INNER CODE UNIT · JavaScript

ArticleUploaderPlugin

obgnail/typora_plugin · plugin/article_uploader/index.js:1

class ArticleUploaderPlugin extends BasePlugin {
  staticActions = [
    { act_value: "upload_to_csdn", act_name: this.i18n.t("$label.UPLOAD_CSDN_HOTKEY") },
    { act_value: "upload_to_wordpress", act_name: this.i18n.t("$label.UPLOAD_WORDPRESS_HOTKEY") },
    { act_value: "upload_to_cn_blog", act_name: this.i18n.t("$label.UPLOAD_CNBLOG_HOTKEY") },
    { act_value: "upload_to_all_site", act_name: this.i18n.t("$label.UPLOAD_ALL_HOTKEY") },
  ]

  hotkey = () => [
    { hotkey: this.config.UPLOAD_CSDN_HOTKEY, callback: () => this.call("upload_to_csdn") },
    { hotkey: this.config.UPLOAD_CNBLOG_HOTKEY, callback: () => this.call("upload_to_cn_blog") },
    { hotkey: this.config.UPLOAD_WORDPRESS_HOTKEY, callback: () => this.call("upload_to_wordpress") },
    { hotkey: this.config.UPLOAD_ALL_HOTKEY, callback: () => this.call("upload_to_all_site") },
  ]

  call = async action => {
    const map = {
      upload_to_csdn: "csdn",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…