Skip to content

Commit

Permalink
Merge pull request #4 from cycdpo/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
cycjimmy committed Nov 23, 2018
2 parents 2d5809f + 5ec5c00 commit 03cb3b0
Show file tree
Hide file tree
Showing 13 changed files with 227 additions and 46 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Contributing
The repository is released under the MIT license, and follows a standard Github development process, using Github tracker for issues and merging pull requests into master.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Type of Change
<!-- What type of change does your code introduce? -->
- [ ] New feature
- [ ] Bug fix
- [ ] Documentation
- [ ] Refactor
- [ ] Chore

### Resolves
- Fixes #[Add issue number here.]

### Describe Changes
<!-- Describe your changes in detail, if applicable. -->
_Describe what this Pull Request does_

8 changes: 7 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# IDE
.idea
.editorconfig

# doc
.github

# test
test
.travis.yml

# project
src
dist
temp
static
yarn.lock

46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
[license-image]: https://img.shields.io/npm/l/weixin-share.svg?style=flat-square


* Easier way to call Wechat share on web page.
* An easier way to call Wechat share on a web page.
[Releases](https://github.com/cycdpo/weixin-share/releases)

## How to use
Expand All @@ -48,13 +48,15 @@ new WxShare()
.config([wechatJSSDKConfig])
.setReadyCallBack([wechatConfigReadyCallBack])
.setDefaultShare([defaultShare])
.setShareSuccessCallBack([shareSuccessCallBack])
.share([shareConfig]);
```

* Function:
* `config()`: Set Wechat JS-SDK Config.
* `setReadyCallBack()`: Set CallBack function on Wechat Config Ready.
* `setDefaultShare()`: Set Default Share Config.
* `setShareSuccessCallBack()`: Set CallBack function on success of Share. **discard above Wechat 6.7.2 and JSSDK 1.4.0**
* `share()`: Run Main Task of Share.
* `backToDefault()`: Back To Default Share Config.

Expand All @@ -65,17 +67,13 @@ new WxShare()
* `timestamp`: [Require][Number | String]
* `nonceStr`: [Require][String]
* `signature`: [Require][String]
* `jsApiList`: [Option][Array\<String\>] Default `['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareQZone', 'onMenuShareWeibo']`
* `jsApiList`: [Option][Array\<String\>] Default `['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareQZone', 'onMenuShareWeibo', 'updateAppMessageShareData', 'updateTimelineShareData']`
* `wechatConfigReadyCallBack`: [Option][Function] CallBack function on Wechat Config Ready.
* `defaultShare`: [Option][Object] Default Share Config.
* `title`: [Option][String] Set share title.
* `desc`: [Option][String] Set share description.
* `link`: [Option][String] Set share link url.
* `imgUrl`: [Option][String] Set url of Share icon .
* `type`: [Option][String] Set type of `'music'`, `'video'` or `'link'`. Default `'link'`.
* `dataUrl`: [Option][String] Set data url when `type` is `'music'` or `'video'`. Default `''`.
* `success`: [Option][Function] Callback when success.
* `cancel`: [Option][Function] Callback when cancel.
* `link`: [Option][String] Set share link URL.
* `imgUrl`: [Option][String] Set URL of Share icon.
* `shareConfig`: [Option][Object] Share Config.
* See `defaultShare` Params.

Expand All @@ -102,7 +100,7 @@ new WxShare()
```

## CDN
To use via a CDN include this in your html:
To use via a CDN include this in your HTML:
```text
<script src="https://cdn.jsdelivr.net/npm/weixin-share@1/build/WxShare.min.js"></script>
```
Expand Down
51 changes: 38 additions & 13 deletions build/WxShare.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/WxShare.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/WxShare.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 03cb3b0

Please sign in to comment.