Miss any of our Open RFC calls?Watch the recordings here! »

minivaline

2.8.0 • Public • Published

This is MiniValine version 3.0 Alpha


version NPM GPL Licence npm downloads gzip-size FOSSA Status

Build Status Build Status Mergify Status codecov Codacy Badge DeepScan grade

MiniValine is a simple and minimalist comment system based on Leancloud


Live Demo

Awesome MiniValine

MiniValine FAQs

Features

Install

Two ways.

  • links
<script src="https://unpkg.com/minivaline@2/dist/MiniValine.min.js"></script>
 
<!-- or -->
 
<script src="https://cdn.jsdelivr.net/npm/minivaline@2/dist/MiniValine.min.js"></script>
 
<!-- or -->
 
<script src="https://cdn.jsdelivr.net/gh/MiniValine/MiniValine@2/dist/MiniValine.min.js"></script>
  • npm install
# Install minivaline
npm install minivaline --save
// Use import
import MiniValine from 'minivaline';
// or Use require
const MiniValine = require('minivaline');
 
new MiniValine({
    el:'#vcomments',
    // other config
})

Get App ID/App Key

Get App ID/App Key from LeanCloud
Click here to register or login in LeanCloud.
Click here Create new application in LeanCloud, and you will get appId/appKey.

Usage

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>MiniValine - A simple comment system based on Leancloud.</title>
    <!--Load js and insert it before </ body>-->
    <script src="https://unpkg.com/minivaline/dist/MiniValine.min.js"></script> 
</head>
<body>
    <div class="comment"></div>
    <script>
      new MiniValine({
          el: '.comment',
          appId: 'Your App ID',
          appKey: 'Your Key',
          placeholder: 'Write a Comment O(∩_∩)O~~'
      });
    </script> 
</body>
</html>

Options

  • el String

    Required. [object HTMLDivElement]

  • appId String

    Required. Your App ID

  • appKey String

    Required. Your App Key

  • mode String

    Default: DesertsP

    Options:

    • DesertsP DesertsP Style mode.
    • xCss xCss Style mode.
  • placeholder String

    Input Placeholder

  • pathname String

    Default: location.pathname.replace(/\/$/, '')

    The pathname of the page.

  • adminEmailMd5 String [ Just Only DesertsP Style mode]

    The MD5 of Admin Email to show Admin Flag.

  • master String Array [ Just Only xCss Style mode]

    Default: []

    The MD5 String Array of master Email to show master Flag.

  • friends String Array [ Just Only xCss Style mode]

    Default: []

    The MD5 String Array of friends Email to show friends Flag.

  • tagMeta String Array [ Just Only xCss Style mode]

    Default: []

    The String Array of Words to show Flag.

    For Example: tagMeta: ["管理员", "小伙伴", "访客"]

  • math Boolean

    Default: true

    Options:

    • false Close MathJax.
    • true Support MathJax@3 initialization.

    The above is the initialization operation of integrating MathJax in MiniValine. If MathJax is loaded on the page, MiniValine will use the MathJax version on the page.

  • md Boolean

    Default: true

    Support Markdown.

  • lang String

    Default: navigator.language || navigator.userLanguage.

    Localization language key, en and zh-CN are currently available.

    More i18n info: minivaline-i18n

    How to Add or Improve translation?

  • emoticonUrl String Array

    Default: ['https://cdn.jsdelivr.net/npm/alus@latest','https://cdn.jsdelivr.net/gh/MiniValine/qq@latest','https://cdn.jsdelivr.net/gh/MiniValine/Bilibilis@latest','https://cdn.jsdelivr.net/gh/MiniValine/tieba@latest','https://cdn.jsdelivr.net/gh/MiniValine/twemoji@latest','https://cdn.jsdelivr.net/gh/MiniValine/weibo@latest']

    Expression Url.

    How to customize emoticons?

  • NoRecordIP Boolean

    Default: false

    Do not record commenter IP.

  • maxNest Number

    Default: 6

    Sub-comment maximum nesting depth.

  • pageSize Number

    Default: 6

    Pagination size.

  • enableQQ Boolean

    Default: false

    Enable QQ avatar API.

  • visitor Boolean

    Default: true

    Only article reading access statisticsand whole site access statistics are provided. For other functions, please set it to "false" and configure MiniValine Counterby yourself.

    MiniValine Counter

  • serverURLs String

    Default: http[s]://[tab/us].avoscloud.com

    This configuration is suitable for domestic custom domain name users, the overseas version will be automatically detected (no need to fill in manually).

Experimental

  • barrager Number

    Default: 1

    Options:

    • 0 Close Comment barrage.
    • 1 Load a round of Comment barrage.
    • 2 Load all round of Comment barrage

    Comment barrage. [Load only when the page is first loaded]

ToDo

  • Extraction from the core library to reduce volume.

  • Project engineering

  • Component modularity

  • And more.

Feedback

About

  • This project is always open source and free.
  • This project does not have any competitive relationship with any other project.
  • This project is a collection of inspiration from the Valine family. Thanks to every developer for their inspiration and contribution.
  • The project is open source only for sharing, developers are not obliged to provide after-sales service.

Contributing

We welcome you to join the development of MiniValine. Please see contributing document. 🤗

Also, we welcome Issue or PR to MiniValine.

Contributors

Code Contributors

This project exists thanks to all the people who contribute.

contributors-image

Thanks

Tribute to excellent open source! Tribute to excellent sharers!

Tribute to @xCss and @DesertsP!

Powered by MathJax

License

GPL-3.0

FOSSA Status

Install

npm i minivaline

DownloadsWeekly Downloads

1,967

Version

2.8.0

License

GPL-3.0

Unpacked Size

705 kB

Total Files

24

Last publish

Collaborators

  • avatar