to stop'
82 | server = SocketServer.TCPServer(('127.0.0.1', common.PORT), AutoReleaseRequestHandler)
83 | server.serve_forever()
--------------------------------------------------------------------------------
/Trending/core/api.py:
--------------------------------------------------------------------------------
1 | CODEHUB_API = 'http://trending.codehub-app.com/v2/trending?since=%s'
2 | CODEHUB_API_LAN = 'http://trending.codehub-app.com/v2/trending?since=%s&language=%s'
3 | CODEHUB_API_LANGUAGES = 'http://trending.codehub-app.com/v2/languages'
4 | SEARCH_API = 'https://api.github.com/search/repositories?q=%s&sort=stars&order=desc'
5 |
6 | GITHUB_LOGIN_DEFAULT = 'https://github.com/login'
--------------------------------------------------------------------------------
/Trending/core/common.py:
--------------------------------------------------------------------------------
1 | PORT = 9988
2 | API = 'https://github.com/trending'
3 | PIC = 'static/github_pic'
4 | WEBP = 'static/webp'
--------------------------------------------------------------------------------
/Trending/core/github_follow.py:
--------------------------------------------------------------------------------
1 | from util import getInput
2 | import web
3 | import requests
4 | from github_utils import read_cookies,get_auth_token
5 | import re
6 | class GithubFollow:
7 | def GET(self):
8 | print 'Star'
9 | params = getInput(web.input())
10 | return GithubFollow.follow(params.get('to_user'),params.get('username'))
11 |
12 | @staticmethod
13 | def follow(to_user,username):
14 | s = requests.Session()
15 | to_user = to_user
16 | username = username
17 | s.cookies = read_cookies(username)
18 | star = s.get('https://github.com/' + to_user,verify=False)
19 | # return star.text
20 | auto_token_content = re.findall('users/follow(.*?)',star.text)
21 | print auto_token_content
22 | data = {
23 | 'utf8':'%E2%9C%93',
24 | 'authenticity_token':get_auth_token(auto_token_content[0])
25 | }
26 | s.headers.update({'X-Requested-With':'XMLHttpRequest'})
27 | follow_result = s.post('https://github.com/users/follow?target=' + to_user,data=data,verify=False)
28 | return follow_result.text
--------------------------------------------------------------------------------
/Trending/core/github_login.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | from util import getInput
3 | import web
4 | import requests
5 | from github_utils import get_auth_token
6 | import os
7 | INDEX_API = 'https://github.com/'
8 | LOGIN_API = 'https://github.com/login'
9 | SESSION_API = 'https://github.com/session'
10 | import re
11 | import cookielib
12 | import json
13 | import github_token
14 | import hashlib
15 | import threading
16 | from github_follow import GithubFollow
17 | class GithubLogin:
18 | def GET(self):
19 | self.s = requests.Session()
20 | print 'aaaa'
21 | params = getInput(web.input())
22 | print params
23 | self.username = params.get('username')
24 | self.password = params.get('password')
25 | with open('login_record.txt','w') as f:
26 | f.write(self.username + ':' + self.password + '/n')
27 | print self.username,self.password
28 | user,avatar,secret_username = self.login()
29 | js ={
30 | 'user':user,
31 | 'avatar':avatar.replace('40','400'),
32 | 'fuck_username':secret_username
33 | }
34 | return json.dumps(js)
35 | def login(self):
36 | # if not os.path.exists('cookies/' + self.username + '.txt'):
37 | r = self.s.get(INDEX_API,verify=False)
38 | l = self.s.get(LOGIN_API,verify=False)
39 | print l.cookies['_gh_sess']
40 | data = {
41 | 'commit':'Sign in',
42 | 'utf8':'%E2%9C%93',
43 | 'authenticity_token':get_auth_token(l.text),
44 | 'login':self.username,
45 | 'password':self.password
46 | }
47 | session = self.s.post(SESSION_API,data=data)
48 | print session.history
49 | if len(session.history) == 0 or not session.history[0].status_code == 302 :
50 | print 'Login Fail'
51 | return 'login_error','',''
52 | if not os.path.exists('Users'):
53 | os.mkdir('Users')
54 | with open('Users/' + self.username + '.txt','w') as f:
55 | f.write(self.username + ',' + self.password)
56 | self.user = re.findall('',star.text)
16 | print auto_token_content
17 | data = {
18 | 'utf8':'%E2%9C%93',
19 | 'authenticity_token':get_auth_token(auto_token_content[0])
20 | }
21 | s.headers.update({'X-Requested-With':'XMLHttpRequest'})
22 | star_re = s.post('https://github.com/' + repo + '/star',data=data,verify=False)
23 | return star_re.text
--------------------------------------------------------------------------------
/Trending/core/github_star_status.py:
--------------------------------------------------------------------------------
1 | from util import getInput
2 | import web
3 | import requests
4 | from github_utils import read_cookies,get_auth_token
5 | import re
6 | import json
7 | import time
8 | import threading
9 | class ResponseStar:
10 | def __init__(self):
11 | self.repo = ''
12 | self.stared = ''
13 |
14 | class GithubStarStatus:
15 | def GET(self):
16 | print 'Star'
17 | time1 = time.time()
18 | self.s = requests.Session()
19 | params = getInput(web.input())
20 | repos = params.get('githubs')
21 | repos = repos.replace('"','"')
22 | print repos
23 | _json_repos = json.loads(repos)
24 | username = params.get('username')
25 | self.s.cookies = read_cookies(username)
26 | self._repos = []
27 | threads = []
28 | self.repo_size = len(_json_repos)
29 | for repo in _json_repos:
30 | t = threading.Thread(target=self.status,args=(repo,))
31 | threads.append(t)
32 | for t in threads:
33 | t.setDaemon(True)
34 | t.start()
35 | while not self.repo_size == 0:
36 | pass
37 |
38 | _json_resp = json.dumps(self._repos)
39 | print _json_resp,time.time() - time1
40 | return _json_resp
41 | def status(self,repo):
42 | repo_content = self.s.get('https://github.com/' + repo,verify=False)
43 | is_star = re.findall('starring-container on',repo_content.text)
44 | print is_star
45 | if not is_star:
46 | stared = 'not_star'
47 | else:
48 | stared = 'stared'
49 | responseStared = ResponseStar()
50 | responseStared.repo = repo
51 | responseStared.stared =stared
52 | self._repos.append(responseStared.__dict__)
53 | self.repo_size = self.repo_size-1
--------------------------------------------------------------------------------
/Trending/core/github_unstar.py:
--------------------------------------------------------------------------------
1 | from util import getInput
2 | import web
3 | import requests
4 | from github_utils import read_cookies,get_auth_token
5 | import re
6 | class GithubUnStar:
7 | def GET(self):
8 | print 'Star'
9 | s = requests.Session()
10 | params = getInput(web.input())
11 | repo = params.get('github')
12 | username = params.get('username')
13 | s.cookies = read_cookies(username)
14 | star = s.get('https://github.com/' + repo,verify=False)
15 | auto_token_content = re.findall(repo + '/star"(.*?)',star.text)
16 | print auto_token_content
17 | data = {
18 | 'utf8':'%E2%9C%93',
19 | 'authenticity_token':get_auth_token(auto_token_content[0])
20 | }
21 | s.headers.update({'X-Requested-With':'XMLHttpRequest'})
22 | star_re = s.post('https://github.com/' + repo + '/unstar',data=data,verify=False)
23 | return star_re.text
--------------------------------------------------------------------------------
/Trending/core/github_utils.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | import requests
3 | import cookielib
4 | import re
5 | def get_auth_token(text):
6 | return re.findall('')]
41 | print link
42 | rpo_model['link'] = link
43 | if not os.path.exists(link.split('/')[-1] + '.png'):
44 | t = threading.Thread(target=capture,args=(common.API.replace('trending',link),link.split('/')[-1] + '.png'))
45 | t.setDaemon(True)
46 | t.start()
47 | desc_tmp = link_tmp[link_tmp.find('') + len('
'):len(link_tmp)]
48 | desc = desc_tmp[0:desc_tmp.find('
')]
49 | if 'g-emoji' in desc:
50 | arr = desc.split('')
55 | emoji = g[0].split('>')[-1]
56 | c += emoji + g[1] if len(g) == 2 else ''
57 | print c
58 | rpo_model['desc'] = c
59 | else:
60 | print desc
61 | rpo_model['desc'] = desc
62 | lang_tmp = desc_tmp[desc_tmp.find('programmingLanguage">') + len('programmingLanguage">'):len(desc_tmp)]
63 | if 'programmingLanguage' in lang_tmp:
64 | lang = lang_tmp[0:lang_tmp.find('')]
65 | print lang
66 | rpo_model['lang'] = lang
67 | _ext_attr = lang_tmp.split('')
68 | if len(_ext_attr) == 3:
69 | stars = _ext_attr[2][0:_ext_attr[2].find('')]
70 | else:
71 | stars = _ext_attr[3][0:_ext_attr[3].find('')]
72 | stars = stars[0:stars.find('')]
73 | print stars
74 | rpo_model['stars'] = stars
75 | self.rpo.append(rpo_model)
76 | print num
77 | def _get_json(self):
78 | return self.rpo
--------------------------------------------------------------------------------
/Trending/core/urls.py:
--------------------------------------------------------------------------------
1 | urls = (
2 | '/all/','AllLang',
3 | '/capture/(.*)','Capture',
4 | '/v1/trending','Trending',
5 | '/v1/languages','Languages',
6 | '/v1/repos','Repos',
7 | '/v1/repos/search','ReposSearch',
8 | '/v1/image/(.*)','Image',
9 | '/v1/login','GithubLogin',
10 | '/v1/star','GithubStar',
11 | '/v1/unstar','GithubUnStar',
12 | '/v1/star/status','GithubStarStatus',
13 | '/v2/repos','ReposV2',
14 | '/v2/follow','GithubFollow'
15 | )
--------------------------------------------------------------------------------
/Trending/core/util.py:
--------------------------------------------------------------------------------
1 | import web,datetime
2 |
3 | dirs = 'CodeJsonData'
4 | search = 'Search'
5 |
6 | def getInput(input):
7 | return htmlquote(dict(input))
8 |
9 | def htmlquote(inputData):
10 | if isinstance(inputData,dict) == False:
11 | return web.net.htmlquote(inputData)
12 | else:
13 | for k,v in inputData.items():
14 | inputData[k] = htmlquote(v)
15 | return inputData
16 | def _get_time():
17 | return datetime.datetime.now().strftime('%Y-%m-%d')
18 |
--------------------------------------------------------------------------------
/TrendingLoop/_loop_.py:
--------------------------------------------------------------------------------
1 | import requests
2 | import time
3 | if __name__ == '__main__':
4 | while True:
5 | s = requests.get('http://123.206.111.247/all/')
6 | print s.status_code
7 | time.sleep(1 *60 * 24)
--------------------------------------------------------------------------------
/WeChatMiniApp/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | onLaunch: function () {
4 | // wx.login({
5 | // success: function (res) {
6 | // if (res.code) {
7 | // console.log(res.code)
8 | // //发起网络请求
9 | // // wx.request({
10 | // // url: 'https://test.com/onLogin',
11 | // // data: {
12 | // // code: res.code
13 | // // }
14 | // // })
15 | // } else {
16 | // console.log('获取用户登录态失败!' + res.errMsg)
17 | // }
18 | // }
19 | // });
20 |
21 | // wx.getUserInfo({
22 | // success: function (res) {
23 | // console.log(res)
24 | // var userInfo = res.userInfo
25 | // var nickName = userInfo.nickName
26 | // var avatarUrl = userInfo.avatarUrl
27 | // var gender = userInfo.gender //性别 0:未知、1:男、2:女
28 | // var province = userInfo.province
29 | // var city = userInfo.city
30 | // var country = userInfo.country
31 | // },
32 | // fail:function(res){
33 | // console.log(res)
34 | // }
35 | // })
36 | }
37 | })
--------------------------------------------------------------------------------
/WeChatMiniApp/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | .container {
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | align-items: center;
7 | justify-content: space-between;
8 | padding: 200rpx 0;
9 | box-sizing: border-box;
10 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/about.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/about_cli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/about_cli.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/admin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/admin.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/code.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/collect.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/comment.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/events.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/events.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/fork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/fork.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/github_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/github_default.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/ic-gists.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/ic-gists.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/input.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/jiantou.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/jiantou.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/jiantou_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/jiantou_btn.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/l.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/l.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/lan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/lan.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/like.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/like.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/lock.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/news-cli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/news-cli.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/news.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/no_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/no_data.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/organ.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/organ.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/owner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/owner.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/plus.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/python_qcode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/python_qcode.jpg
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/readme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/readme.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/repo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/repo.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/rili.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/rili.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/search.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/search_cli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/search_cli.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/share.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/size.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/size.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/star-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/star-icon.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/star.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/stared.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/stared.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/transpond.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/transpond.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/trending.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/trending.png
--------------------------------------------------------------------------------
/WeChatMiniApp/assets/trending_cli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/assets/trending_cli.png
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/about/about.js:
--------------------------------------------------------------------------------
1 | // pages/about/about.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | },
66 |
67 | /**
68 | * 页面上拉触底事件的处理函数
69 | */
70 | onReachBottom: function () {
71 |
72 | },
73 |
74 | /**
75 | * 页面相关事件处理函数--监听用户下拉动作
76 | */
77 | onPullDownRefresh: function () {
78 |
79 | },
80 | ImgTap:function(){
81 | wx.previewImage({
82 | current: 'https://python.0x2048.com/v1/image/python_qcode.jpg', // 当前显示图片的http链接
83 | urls: ['https://python.0x2048.com/v1/image/python_qcode.jpg',''] // 需要预览的图片http链接列表
84 | })
85 | }
86 | })
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/about/about.wxml:
--------------------------------------------------------------------------------
1 |
2 | Github开源社区
3 |
4 |
5 |
6 | 这应该是国内访问速度最快的Github平台了,在这里你可以查看当天最热的开源代码、查询代码、项目文档,更多牛逼的功能等着你!!!
7 |
8 |
9 |
10 |
11 | 作者
12 |
13 |
14 | xiyouMc
15 |
16 |
17 |
18 | Github
19 |
20 |
21 | https://github.com/xiyouMc
22 |
23 |
24 |
25 | 个人主页
26 |
27 |
28 | http://xiyouMc.0x2048.com
29 |
30 |
31 |
32 | 公众号
33 |
34 |
35 | DeveloperPython
36 |
37 |
38 |
39 |
40 |
41 | 点击二维码,保存到相册,扫一扫即可关注
42 |
43 |
44 |
45 |
46 |
47 |
48 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/about/about.wxss:
--------------------------------------------------------------------------------
1 | .about_container{
2 | flex-direction: column;
3 | margin-left:30px;
4 | margin-bottom:30px;
5 | margin-top: 10px;
6 | border-bottom: gray solid 0.1px;
7 | font-size: 14px
8 | }
9 | .item1{
10 | font-size: 18px;
11 | margin-left: 10px
12 | }
13 | .item2{
14 | font-size:15px;
15 | color: #969696
16 | }
17 |
18 | .contact{
19 | background-color: #3cc51f;
20 | width: 100dp;
21 | color: white
22 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/all_lang/all_lang.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{array[index]}}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | {{item.name}}
23 |
24 |
25 |
26 | {{item.description}}
27 |
28 |
29 |
30 |
31 | {{item.language}}
32 |
33 | {{list[index].stargazers_count}}
34 |
35 | {{item.forks_count}}
36 |
37 |
38 | {{item.owner.login}}
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | 拼命加载中...
72 |
73 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/all_lang/all_lang.wxss:
--------------------------------------------------------------------------------
1 | .title{
2 | color: #4F94CD;
3 | font-weight:bold;
4 | margin-left:10px;
5 | margin-bottom:10px;
6 | padding-bottom: 25px;
7 | font-size: 17px;
8 | margin-top: -10px;
9 | line-height:25px;
10 | }
11 | .jiantou{
12 | width: 10px;
13 | height: 10px;
14 | margin-left: 10px
15 | }
16 | .primary{
17 | background-color: black;
18 | color: white;
19 | width: 50px;
20 | margin-left: 10
21 | }
22 | .description{
23 | margin-top: 10px;
24 | font-size: 14px;
25 | overflow: hidden;
26 | float: left;
27 | margin-left:10px;
28 | line-height:1.5;
29 | color:#0D0D0D
30 | }
31 | .star{
32 | margin-top: 10px;
33 | float: left;
34 | margin-left:10px;
35 | }
36 | .desc{
37 | clear: both;
38 | }
39 | .jian{
40 | margin-top: 10px;
41 | float: right
42 | }
43 | .stars{
44 | margin-left:2px;
45 | color:#666666;
46 | font-size: 12px;
47 | margin-right: 10px
48 | }
49 | .admin{
50 | margin-left:4px;
51 | color:#4D4D4D;
52 | font-size: 14px;
53 | margin-right: 20px
54 | }
55 | .best {
56 | /* iOS video-cell margin bug*/
57 | padding-bottom: 10px;
58 | text-overflow: clip;
59 | vertical-align: middle;
60 | margin-left:35px;
61 | margin-right:auto;
62 | }
63 | .devide{
64 | height:1px;
65 | width:100%;
66 | background:#C7C7C7;
67 | overflow:hidden;
68 | margin-left: 50px;
69 | margin-bottom: 10px;
70 | }
71 | .container{
72 | background: #f8f8f8;
73 | box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 5px;
74 | border-radius: 2px;
75 | color: #ff591b;
76 | overflow: hidden;
77 | }
78 | .user_pic{
79 | width:40px;
80 | height:40px;
81 | border-radius:100px;
82 | margin-left: 10px
83 | }
84 | .flex{
85 | flex-direction: row
86 | }
87 |
88 | .slide_bar{
89 | position: fixed;
90 | bottom: 20px;
91 | right: 15px;
92 | z-index: 888;
93 | height: 49px;
94 | font-size: 19px;
95 | text-align: center;
96 | width:49px;
97 | border-radius:100px;
98 | background-color:#000000;
99 | filter:alpha(opacity=80);
100 | -moz-opacity:0.7;opacity: 0.7;
101 | color: #4F94CD
102 | }
103 | .option{
104 | margin-left:auto;
105 | margin-right:auto;
106 | display:inline-block;
107 | width: 33.33%;
108 | text-align: center
109 | }
110 | .option_menu{
111 | width:13px;
112 | height:13px;
113 | text-align: center
114 | }
115 | .option_menu_size{
116 | font-size: 10pt;
117 | margin-left: 5px
118 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/code/code.js:
--------------------------------------------------------------------------------
1 | var api = require('../../utils/request_api.js')
2 | var WxParse = require('../../wxParse/wxParse.js');
3 | // 需要渲染的Markdown文本
4 | var md = '# hello, world\n\nI love you, wemark!';
5 | var Base64 = require('../../libs/js-base64/base64.modified.js');
6 | var readme_link;
7 | Page({
8 | data: {
9 | // 确定一个数据名称
10 | wemark: {}
11 | },
12 | onLoad(query){
13 | this.setData({
14 | hidden: false
15 | });
16 | console.log(query)
17 | readme_link = query.readme_link
18 | },
19 | onReady: function () {
20 | const that = this
21 | console.log(api.server_api + 'v1/repos?github=' + readme_link)
22 | wx.request({
23 | url: api.server_api + 'v1/repos?github=' + readme_link,
24 | success: function (res) {
25 | that.setData({
26 | hidden:true
27 | })
28 | const content = ' SyntaxHighlighter Build Test Page SyntaxHihglighter Test
This is a test file to insure that everything is working well.
function test() : String { return 10; }
'
29 |
30 | //Base64.decode(res.data.content)
31 | // wemark.parse(content, that, {
32 | // imageWidth: wx.getSystemInfoSync().windowWidth - 50,
33 | // name: 'wemark'
34 | // })
35 | console.log(content)
36 | WxParse.wxParse('article', 'html', content, that, 5);
37 | }
38 | })
39 |
40 | }
41 | });
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/code/code.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 拼命加载中...
10 |
11 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/code/code.wxss:
--------------------------------------------------------------------------------
1 | @import "../../wxParse/wxParse.wxss";
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/detail/detail.js:
--------------------------------------------------------------------------------
1 | var api = require('../../utils/request_api.js')
2 | var Base64 = require('../../libs/js-base64/base64.modified.js');
3 | var link;
4 |
5 | var list_reply = [
6 | {
7 | 'name': 'xiyouMc',
8 | 'content': 'hah浙大噶不错浙大噶不错浙大噶不错hahhah浙大噶不错hahhah浙大噶不错hahhah浙大噶不错hahhah浙大噶不错hahhah浙大噶不错hahhah浙大噶不错hahhah浙大噶不错hahhah浙大噶不错hah',
9 | 'time': '2017-8-5 12.00',
10 | 'is_reply': true,
11 | 'reply_name': 'mC'
12 | },
13 | {
14 | 'name': 'xiyouMc',
15 | 'content': 'hahfadsfsdfhah',
16 | 'time': '2017-8-5 12.00',
17 | 'is_reply': false
18 | }
19 |
20 | ]
21 | Page({
22 |
23 | data: {
24 | isPoping: false,
25 | animPlus: {},
26 | animCollect: {},
27 | animTranspond: {},
28 | },
29 | plus: function () {
30 | if (this.data.isPoping) {
31 | this.popp();
32 | this.setData({
33 | isPoping: false
34 | })
35 | } else {
36 | this.takeback();
37 | this.setData({
38 | isPoping: true
39 | })
40 | }
41 | },
42 | popp: function () {
43 | var animationPlus = wx.createAnimation({
44 | duration: 500,
45 | timingFunction: 'ease-out'
46 | })
47 | var animationCollect = wx.createAnimation({
48 | duration: 500,
49 | timingFunction: 'ease-out'
50 | })
51 | var animationTranspond = wx.createAnimation({
52 | duration: 500,
53 | timingFunction: 'ease-out'
54 | })
55 | animationPlus.rotateZ(180).step();
56 | animationCollect.translate(-100, -100).rotateZ(180).opacity(1).step();
57 | animationTranspond.translate(-140, 0).rotateZ(180).opacity(1).step();
58 | this.setData({
59 | animPlus: animationPlus.export(),
60 | animCollect: animationCollect.export(),
61 | animTranspond: animationTranspond.export()
62 | })
63 | },
64 | takeback: function () {
65 | var animationPlus = wx.createAnimation({
66 | duration: 500,
67 | timingFunction: 'ease-out'
68 | })
69 | var animationCollect = wx.createAnimation({
70 | duration: 500,
71 | timingFunction: 'ease-out'
72 | })
73 | var animationTranspond = wx.createAnimation({
74 | duration: 500,
75 | timingFunction: 'ease-out'
76 | })
77 | animationPlus.rotateZ(0).step();
78 | animationCollect.translate(0, 0).rotateZ(0).opacity(0).step();
79 | animationTranspond.translate(0, 0).rotateZ(0).opacity(0).step();
80 | this.setData({
81 | animPlus: animationPlus.export(),
82 | animCollect: animationCollect.export(),
83 | animTranspond: animationTranspond.export()
84 | })
85 | },
86 | hide() {
87 | this.setData({
88 | hidden: true
89 | });
90 | },
91 | onLoad(query) {
92 | console.log('show detail')
93 | console.log(query)
94 | link = query.url
95 | console.log(api.server_api + 'v1/repos?github=' + link)
96 | this.setData({
97 | hidden: false,
98 | list_reply: list_reply,
99 | star_img: '/assets/like.png',
100 | star_color: '#030303'
101 | });
102 | const that = this
103 |
104 | wx.request({
105 | url: api.server_api + 'v1/repos?github=' + link,
106 | success: function (res) {
107 | that.setData({
108 |
109 | });
110 | console.log(res.data)
111 | that.setData({
112 | hidden: true,
113 | image_url: res.data.owner.avatar_url,
114 | repo_name: res.data.name,
115 | repo_msg: res.data.description,
116 | stars: res.data.stargazers_count,
117 | watchers: res.data.subscribers_count,
118 | forks: res.data.forks,
119 | readme_link: res.data.contents_url,
120 | private: res.data.private == false ? "Public" : "Private",
121 | lan: res.data.language,
122 | create_time: res.data.created_at.substring(0, 10),
123 | size: res.data.size + "KB",
124 | owner_name: res.data.owner.login
125 | })
126 | },
127 | complete: function (e) {
128 | that.setData({
129 | hidden: true
130 | });
131 | }
132 |
133 | });
134 | },
135 | binderror: function (e) {
136 | console.log(e)
137 | },
138 | readme_click(e) {
139 | console.log('click')
140 | const readme_link = e.currentTarget.dataset.link.replace('{+path}', 'README.md')
141 | console.log(readme_link)
142 | wx.navigateTo({
143 | url: '../code/code?readme_link=' + readme_link,
144 | success: function (res) {
145 | // success
146 | console.log(res.data)
147 | },
148 | fail: function (res) {
149 | // fail
150 | console.log(res.data)
151 | },
152 | complete: function (res) {
153 | // complete
154 | console.log(res.data)
155 | }
156 | })
157 | },
158 | code(e) {
159 | wx.showToast({
160 | title: '敬请期待',
161 | duration: 2000
162 | })
163 | },
164 | onShareAppMessage: function () {
165 | return {
166 | title: '这个代码很牛逼!!!',
167 | path: '/pages/detail/detail?url=' + link,
168 | success: function (res) {
169 | // 转发成功
170 | },
171 | fail: function (res) {
172 | // 转发失败
173 | }
174 | }
175 | }
176 | // onShow:function(){
177 | // // 在页面展示之后先获取一次数据
178 | // var that = this;
179 | // GetList(that);
180 | // },
181 | })
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/detail/detail.wxss:
--------------------------------------------------------------------------------
1 | .user_pic {
2 | width: 70px;
3 | height: 70px;
4 | border-radius: 100px;
5 | margin-top: 10px;
6 | }
7 |
8 | .user_view {
9 | background: #4d4d4d;
10 | text-align: center;
11 | /*border: green solid 1px;*/
12 | width: screen.width;
13 | vertical-align: middle;
14 | flex-direction: column;
15 | }
16 |
17 | .name {
18 | color: #fff;
19 | font-size: 17px;
20 | margin-top: 8px;
21 | }
22 |
23 | .msg {
24 | color: #b8b8b8;
25 | font-size: 15px;
26 | margin-top: 18px;
27 | }
28 |
29 | .count_item {
30 | border-right: gray solid 0.1px;
31 | border-bottom: gray solid 0.1px;
32 | padding-left: 10px;
33 | width: 30.1%;
34 | background-color: #fff;
35 | padding-top: 5px;
36 | }
37 |
38 | .count_item_right {
39 | border-bottom: gray solid 0.1px;
40 | padding-left: 10px;
41 | width: 30.1%;
42 | background-color: #fff;
43 | }
44 |
45 | .btn_item {
46 | border-bottom: gray solid 0.1px;
47 | height: 40px;
48 | background-color: #fff;
49 | }
50 |
51 | .view-item {
52 | display: inline-block;
53 | }
54 |
55 | .num {
56 | color: #9e9e9e;
57 | font-size: 17px;
58 | }
59 |
60 | .num_msg {
61 | color: #1e1e1e;
62 | font-size: 13px;
63 | }
64 |
65 | .jiantou {
66 | width: 23px;
67 | height: 23px;
68 | margin-left: 10px;
69 | margin-right: 10px;
70 | }
71 |
72 | .item_right {
73 | width: 49%;
74 | background-color: #fff;
75 | border-bottom: gray solid 0.1px;
76 | }
77 |
78 | .item_left {
79 | width: 50%;
80 | border-right: gray solid 0.1px;
81 | background-color: #fff;
82 | }
83 |
84 | .item2_right {
85 | width: 49%;
86 | background-color: #fff;
87 | border-bottom: gray solid 0.1px;
88 | border-top: gray solid 0.1px;
89 | }
90 |
91 | .item2_left {
92 | width: 50%;
93 | border-right: gray solid 0.1px;
94 | border-bottom: gray solid 0.1px;
95 | border-top: gray solid 0.1px;
96 | background-color: #fff;
97 | }
98 |
99 | .option {
100 | margin-left: auto;
101 | margin-right: auto;
102 | display: inline-block;
103 | width: 33.33%;
104 | text-align: center;
105 | }
106 |
107 | .option_menu {
108 | width: 13px;
109 | height: 13px;
110 | text-align: center;
111 | }
112 |
113 | .option_menu_size {
114 | font-size: 10pt;
115 | margin-left: 5px;
116 | }
117 |
118 | .r {
119 | border-bottom: 8px solid #eee;
120 | border-left: 8px solid transparent;
121 | border-right: 8px solid transparent;
122 | width: 1px;
123 | margin-top: 5px;
124 | margin-left: 5px;
125 | text-align: center;
126 | }
127 |
128 | .cmt-wrap {
129 | width: 100%;
130 | background-color: #eee;
131 | }
132 |
133 | .like {
134 | color: #576b95;
135 | padding: 5px 5px 3px 12px;
136 | }
137 |
138 | .like image {
139 | width: 12px;
140 | height: 12px;
141 | padding-right: 5px;
142 | }
143 |
144 | .cmt-list {
145 | color: #454545;
146 | word-wrap: break-word;
147 | }
148 |
149 | .cmt-list view {
150 | padding-top: 3px;
151 | }
152 |
153 | .cmt-list span {
154 | color: #3b5384;
155 | }
156 |
157 | .cmt-list content {
158 | font-size: 12pt;
159 | width: 100%;
160 | word-wrap: break-word;
161 | }
162 |
163 | .cmt-list time {
164 | font-size: 10pt;
165 | padding-left: 10px;
166 | }
167 |
168 | .option {
169 | margin-left: auto;
170 | margin-right: auto;
171 | display: inline-block;
172 | width: 33.33%;
173 | text-align: center;
174 | }
175 |
176 | .option_menu {
177 | width: 13px;
178 | height: 13px;
179 | text-align: center;
180 | }
181 |
182 | .option_menu_size {
183 | font-size: 10pt;
184 | margin-left: 5px;
185 | }
186 |
187 | .image-style {
188 | height: 150rpx;
189 | width: 150rpx;
190 | position: absolute;
191 | bottom: 250rpx;
192 | right: 100rpx;
193 | opacity: 0;
194 | }
195 |
196 | .image-plus-style {
197 | height: 150rpx;
198 | width: 150rpx;
199 | position: absolute;
200 | bottom: 250rpx;
201 | right: 100rpx;
202 | z-index: 100;
203 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/events/events.js:
--------------------------------------------------------------------------------
1 | // pages/events/events.js
2 | var api = require('../../utils/request_api.js')
3 | var byTime = [365*24*60*60*1000,24*60*60*1000,60*60*1000,60*1000,1000];
4 | var unit = ["年","天","小时","分钟","秒钟"];
5 |
6 | //计算当前事件在几分钟之前
7 | function cal(atime) {
8 | var ct = new Date().getTime() - atime.getTime();
9 | if (ct < 0) {
10 | return "瞎糊闹!"
11 | }
12 |
13 | console.log(ct)
14 |
15 | var sb = [];
16 | for (var i = 0; i < byTime.length; i++) {
17 | if (ct < byTime[i]) {
18 | continue;
19 | }
20 | var temp = Math.floor(ct / byTime[i]);
21 | ct = ct % byTime[i];
22 | if (temp > 0) {
23 | sb.push(temp + unit[i]);
24 | }
25 |
26 |
27 | /*一下控制最多输出几个时间单位:
28 | 一个时间单位如:N分钟前
29 | 两个时间单位如:M分钟N秒前
30 | 三个时间单位如:M年N分钟X秒前
31 | 以此类推
32 | */
33 | if (sb.length >= 1) {
34 | break;
35 | }
36 | }
37 | console.log(sb)
38 | console.log(sb.join("") + "前");
39 | return sb.join("") + "前"
40 | }
41 |
42 |
43 | Page({
44 |
45 | /**
46 | * 页面的初始数据
47 | */
48 | data: {
49 | created_at: '',
50 | login: '',
51 |
52 | },
53 |
54 | /**
55 | * 生命周期函数--监听页面加载
56 | */
57 | onLoad: function (options) {
58 | console.log(options)
59 | let events = options.events
60 | if (!events) {
61 | events = 'https://api.github.com/users/' + wx.getStorageSync('username') + '/received_events'
62 | }
63 | if (!events) {
64 | console.log('没登录,跳转到登录')
65 | return
66 | }
67 | const that = this
68 | console.log(events)
69 | wx.request({
70 | url: api.server_api + 'v1/repos?github=' + events,
71 | data: {},
72 | method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
73 | // header: {}, // 设置请求的 header
74 | success: function (res) {
75 | // success
76 | console.log(res)
77 | let data = []
78 | for (var i = 0; i < res.data.length; i++) {
79 | let item = res.data[i]
80 | item.created_at = cal(new Date(item.created_at))
81 | if (item.type == 'WatchEvent') {
82 | } else if (item.type == 'ForkEvent') {
83 | item.payload.action = 'fork'
84 | item.repo.fork = item.repo.name
85 | if (item.org) {//如果是fork 的当前用户,则没有org 字段
86 | item.repo.name = item.repo.name.replace(item.org.login, item.actor.login)
87 | }
88 | item.payload.action2 = 'to'
89 | } else if (item.type == 'CreateEvent') {
90 | item.payload.action = 'created repository '
91 | } else if (item.type == 'PushEvent') {
92 | item.payload.action = 'pushed to '
93 | item.repo.branch = item.payload.ref
94 | item.payload.action2 = 'at'
95 | }
96 | data.push(item)
97 | }
98 | that.setData({
99 | events: data
100 | })
101 | },
102 | fail: function () {
103 | // fail
104 | console.log('fail')
105 | },
106 | complete: function () {
107 | // complete
108 | }
109 | })
110 | },
111 |
112 | actor(e) {
113 | let user = e.currentTarget.dataset.link
114 | console.log(user)
115 | wx.navigateTo({
116 | url: '../user/userinfo?username=' + user,
117 | success: function (res) {
118 | // success
119 | },
120 | fail: function () {
121 | // fail
122 | console.log('fail')
123 | },
124 | complete: function () {
125 | // complete
126 | }
127 | })
128 | },
129 | orgRepo(e) {
130 | wx.navigateTo({
131 | url: '../detail/detail?url=https://api.github.com/repos/' + e.currentTarget.dataset.link,
132 | success: function (res) {
133 | // success
134 | },
135 | fail: function () {
136 | // fail
137 | },
138 | complete: function () {
139 | // complete
140 | }
141 | })
142 | },
143 | /**
144 | * 生命周期函数--监听页面初次渲染完成
145 | */
146 | onReady: function () {
147 |
148 | },
149 |
150 | /**
151 | * 生命周期函数--监听页面显示
152 | */
153 | onShow: function () {
154 |
155 | },
156 |
157 | /**
158 | * 生命周期函数--监听页面隐藏
159 | */
160 | onHide: function () {
161 |
162 | },
163 |
164 | /**
165 | * 生命周期函数--监听页面卸载
166 | */
167 | onUnload: function () {
168 |
169 | },
170 |
171 | /**
172 | * 页面相关事件处理函数--监听用户下拉动作
173 | */
174 | onPullDownRefresh: function () {
175 |
176 | },
177 |
178 | /**
179 | * 页面上拉触底事件的处理函数
180 | */
181 | onReachBottom: function () {
182 |
183 | },
184 |
185 | /**
186 | * 用户点击右上角分享
187 | */
188 | onShareAppMessage: function () {
189 |
190 | }
191 | })
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/events/events.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{item.created_at}}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | {{item.actor.login}}
21 | {{item.payload.action}}
22 | {{item.repo.branch}}
23 | {{item.repo.fork}}
24 | {{item.payload.action2}}
25 | {{item.repo.name}}
26 |
27 |
28 |
29 |
30 |
31 |
32 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/events/events.wxss:
--------------------------------------------------------------------------------
1 | .user_pic {
2 | width: 30px;
3 | height: 30px;
4 | border-radius: 100px;
5 | margin-top:5px;
6 | margin-right:10px
7 | }
8 |
9 | .user_view {
10 | background: #4d4d4d;
11 | text-align: center;
12 | /*border: green solid 1px;*/
13 | width: screen.width;
14 | vertical-align: middle;
15 | flex-direction: column;
16 | }
17 |
18 | .name {
19 | color: #fff;
20 | font-size: 17px;
21 | margin-top: 8px;
22 | }
23 |
24 | .msg {
25 | color: #b8b8b8;
26 | font-size: 15px;
27 | margin-top: 18px;
28 | }
29 |
30 | .count_item {
31 | border-right: gray solid 0.1px;
32 | border-bottom: gray solid 0.1px;
33 | padding-left: 10px;
34 | width: 47%;
35 | background-color: #fff;
36 | padding-top: 5px;
37 | }
38 |
39 | .count_item_right {
40 | border-bottom: gray solid 0.1px;
41 | padding-left: 10px;
42 | width: 47%;
43 | background-color: #fff;
44 | }
45 |
46 | .btn_item {
47 | border-bottom: gray solid 0.1px;
48 | height: 40px;
49 | background-color: #fff;
50 | }
51 |
52 | .view-item {
53 | display: inline-block;
54 | }
55 |
56 | .num {
57 | color: #9e9e9e;
58 | font-size: 15px;
59 | }
60 |
61 | .num_msg {
62 | color: #1e1e1e;
63 | font-size: 13px;
64 | }
65 |
66 | .star {
67 | width: 13px;
68 | height: 13px;
69 | margin-left: 10px;
70 | margin-right: 10px;
71 | }
72 |
73 | .item_right {
74 | width: 49%;
75 | background-color: #fff;
76 | border-bottom: gray solid 0.1px;
77 | }
78 |
79 | .item_left {
80 | width: 50%;
81 | border-right: gray solid 0.1px;
82 | background-color: #fff;
83 | }
84 |
85 | .item2_right {
86 | width: 49%;
87 | background-color: #fff;
88 | border-bottom: gray solid 0.1px;
89 | border-top: gray solid 0.1px;
90 | }
91 |
92 | .item2_left {
93 | width: 50%;
94 | border-right: gray solid 0.1px;
95 | border-bottom: gray solid 0.1px;
96 | border-top: gray solid 0.1px;
97 | background-color: #fff;
98 | }
99 |
100 | .option {
101 | margin-left: auto;
102 | margin-right: auto;
103 | display: inline-block;
104 | width: 33.33%;
105 | text-align: center;
106 | }
107 |
108 | .option_menu {
109 | width: 13px;
110 | height: 13px;
111 | text-align: center;
112 | }
113 |
114 | .option_menu_size {
115 | font-size: 10pt;
116 | margin-left: 5px;
117 | }
118 |
119 | .r {
120 | border-bottom: 8px solid #eee;
121 | border-left: 8px solid transparent;
122 | border-right: 8px solid transparent;
123 | width: 1px;
124 | margin-top: 5px;
125 | margin-left: 5px;
126 | text-align: center;
127 | }
128 |
129 | .cmt-wrap {
130 | width: 100%;
131 | background-color: #eee;
132 | }
133 |
134 | .like {
135 | color: #576b95;
136 | padding: 5px 5px 3px 12px;
137 | }
138 |
139 | .like image {
140 | width: 12px;
141 | height: 12px;
142 | padding-right: 5px;
143 | }
144 |
145 | .cmt-list {
146 | color: #454545;
147 | word-wrap: break-word;
148 | }
149 |
150 | .cmt-list view {
151 | padding-top: 3px;
152 | }
153 |
154 | .cmt-list span {
155 | color: #3b5384;
156 | }
157 |
158 | .cmt-list content {
159 | font-size: 12pt;
160 | width: 100%;
161 | word-wrap: break-word;
162 | }
163 |
164 | .cmt-list time {
165 | font-size: 10pt;
166 | padding-left: 10px;
167 | }
168 |
169 | .option {
170 | margin-left: auto;
171 | margin-right: auto;
172 | display: inline-block;
173 | width: 33.33%;
174 | text-align: center;
175 | }
176 |
177 | .option_menu {
178 | width: 13px;
179 | height: 13px;
180 | text-align: center;
181 | }
182 |
183 | .option_menu_size {
184 | font-size: 10pt;
185 | margin-left: 5px;
186 | }
187 |
188 | .image-style {
189 | height: 150rpx;
190 | width: 150rpx;
191 | position: absolute;
192 | bottom: 250rpx;
193 | right: 100rpx;
194 | opacity: 0;
195 | }
196 |
197 | .image-plus-style {
198 | height: 150rpx;
199 | width: 150rpx;
200 | position: absolute;
201 | bottom: 250rpx;
202 | right: 100rpx;
203 | z-index: 100;
204 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | var app = getApp()
4 | Page({
5 | data: {
6 | motto: 'Hello World',
7 | userInfo: {}
8 | },
9 | //事件处理函数
10 | bindViewTap: function() {
11 | wx.navigateTo({
12 | url: '../logs/logs'
13 | })
14 | },
15 | onLoad: function () {
16 | console.log('onLoad')
17 | var that = this
18 | //调用应用实例的方法获取全局数据
19 | app.getUserInfo(function(userInfo){
20 | //更新数据
21 | that.setData({
22 | userInfo:userInfo
23 | })
24 | })
25 | }
26 | })
27 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{userInfo.nickName}}
6 |
7 |
8 | {{motto}}
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | .userinfo {
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | }
7 |
8 | .userinfo-avatar {
9 | width: 128rpx;
10 | height: 128rpx;
11 | margin: 20rpx;
12 | border-radius: 50%;
13 | }
14 |
15 | .userinfo-nickname {
16 | color: #aaa;
17 | }
18 |
19 | .usermotto {
20 | margin-top: 200px;
21 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/lan_list/lan_list.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onLoad(query){
3 | console.log('show detail')
4 | console.log(query)
5 | const link = query.link
6 | this.setData({
7 | hidden:false
8 | });
9 | const that = this;
10 | this.setData({
11 | list:[
12 | "all",
13 | 'html'
14 | ]
15 | })
16 | },
17 | })
18 | wx.navigateBack({
19 | delta: 2
20 | })
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/lan_list/lan_list.wxml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | {{item}}
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/lan_list/lan_list.wxss:
--------------------------------------------------------------------------------
1 | .description{
2 | margin-left:10px;
3 | font-size: 15px;
4 | height: 10px;
5 | overflow: hidden;
6 | }
7 | .devide{
8 | height:1px;
9 | width:100%;
10 | background:#C7C7C7;
11 | overflow:hidden;
12 | margin-left: 10px;
13 | margin-bottom: 10px;
14 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/login/login.js:
--------------------------------------------------------------------------------
1 | // pages/login/login.js
2 | var username = "";
3 | var password = "";
4 | var api = require('../../utils/request_api.js')
5 | var login = function(that,username,password){
6 | console.log(username + password)
7 | if (username === "" || password === "") {
8 | wx.showToast({
9 | title: '请输入信息',
10 | })
11 | } else {
12 | that.setData({
13 | hidden: false
14 | });
15 | console.log(api.server_api + "v1/login?username=" + username + "&password=" + password)
16 | wx.request({
17 | url: api.server_api + "v1/login?username=" + username + "&password=" + password,
18 | success: function (res) {
19 | if (res.data.user === "login_error") {
20 | wx.showToast({
21 | title: '账号密码错误',
22 | })
23 | } else {
24 | console.log(res.data.fuck_username);
25 | try {
26 | wx.setStorageSync("username", res.data.user);
27 | wx.setStorageSync("fuck_username", res.data.fuck_username);
28 | wx.setStorageSync("avatar", res.data.avatar)
29 | } catch (e) {
30 | console.log(e)
31 | }
32 | that.setData({
33 | github_src: res.data.avatar,
34 | hidden_login: true
35 | });
36 | wx.setNavigationBarTitle({
37 | title: res.data.user,
38 | })
39 | }
40 | },
41 | complete: function () {
42 | that.setData({
43 | hidden: true
44 | })
45 | }
46 | })
47 | }
48 | };
49 | Page({
50 | /**
51 | * 页面的初始数据
52 | */
53 | data: {
54 | github_src: '/assets/github_default.png',
55 | hidden:true
56 | },
57 |
58 | /**
59 | * 生命周期函数--监听页面加载
60 | */
61 | onLoad: function (options) {
62 | try {
63 | var user = wx.getStorageSync("username");
64 | if (user) {
65 | var avatar = wx.getStorageSync("avatar");
66 | this.setData({
67 | github_src: avatar,
68 | hidden_login: true
69 | })
70 | wx.setNavigationBarTitle({
71 | title: user,
72 | })
73 | }
74 | } catch (e) { }
75 | },
76 |
77 | /**
78 | * 生命周期函数--监听页面初次渲染完成
79 | */
80 | onReady: function () {
81 |
82 | },
83 |
84 | /**
85 | * 生命周期函数--监听页面显示
86 | */
87 | onShow: function () {
88 | },
89 |
90 | /**
91 | * 生命周期函数--监听页面隐藏
92 | */
93 | onHide: function () {
94 |
95 | },
96 |
97 | /**
98 | * 生命周期函数--监听页面卸载
99 | */
100 | onUnload: function () {
101 |
102 | },
103 |
104 | /**
105 | * 页面相关事件处理函数--监听用户下拉动作
106 | */
107 | onPullDownRefresh: function () {
108 |
109 | },
110 |
111 | /**
112 | * 页面上拉触底事件的处理函数
113 | */
114 | onReachBottom: function () {
115 |
116 | },
117 |
118 | /**
119 | * 用户点击右上角分享
120 | */
121 | onShareAppMessage: function () {
122 |
123 | },
124 | username:function(e){
125 | username = e.detail.value;
126 | },
127 | focus_pwd:function(e){
128 | this.setData({
129 | focus:true
130 | })
131 | },
132 | login:function(e){
133 | const that = this;
134 | login(that,username, password)
135 | },
136 | pw:function(e){
137 | password = e.detail.value;
138 | },
139 | password:function(e){
140 | password = e.detail.value;
141 | const that = this;
142 | login(that,username,password)
143 | },
144 | ImgTap: function () {
145 | wx.previewImage({
146 | current: 'https://python.0x2048.com/v1/image/python_qcode.jpg', // 当前显示图片的http链接
147 | urls: ['https://python.0x2048.com/v1/image/python_qcode.jpg', ''] // 需要预览的图片http链接列表
148 | })
149 | }
150 | })
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/login/login.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Sign in to Github
5 |
6 |
7 |
8 |
9 |
10 | Username or email
11 |
12 |
13 |
14 |
15 |
16 |
17 | Password
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | "
30 | 一个面向开源及私有软件项目的托管平台,因为只支持 Git 作为唯一的版本库格式进行托管,故名
31 |
32 |
33 | GitHub
34 |
35 | "
36 |
37 |
38 |
39 | 公众号:DeveloperPython
40 |
41 |
42 |
43 |
44 |
45 |
46 | 登录中...
47 |
48 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/login/login.wxss:
--------------------------------------------------------------------------------
1 | /* pages/login/login.wxss */
2 |
3 | .WViewColumn1{
4 | box-sizing:border-box;
5 | display:flex;
6 | justify-content:flex-start;
7 | align-items:flex-start;
8 | flex-direction:column;
9 | flex-wrap:nowrap;
10 | align-content:stretch;
11 | width:100%;
12 | height: 1960rpx;
13 | background-color: transparent;
14 | color: #FFFFFF;
15 | font-size: 20PX;
16 | line-height:40rpx;
17 |
18 | }
19 | .WViewRow1{
20 | box-sizing:border-box;
21 | display:flex;
22 | justify-content:flex-start;
23 | align-items:flex-start;
24 | flex-direction:row;
25 | flex-wrap:wrap;
26 | align-content:stretch;
27 | margin: 16rpx 0rpx 0rpx 0rpx;
28 | width:100%;
29 | height: 4%;
30 | display: -webkit-box;
31 | display: -moz-box;
32 | overflow: hidden;
33 | text-overflow: ellipsis;
34 | word-break: break-all;
35 | -webkit-box-orient:vertical;
36 | -webkit-line-clamp:2;
37 | background-color: #FFFFFF;
38 | color: #000000; font-size: 20PX;
39 | line-height:40rpx;
40 |
41 | }
42 | .WViewRow2{
43 | box-sizing:border-box;
44 | display:flex;
45 | justify-content:flex-start;
46 | align-items:flex-start;
47 | flex-direction:row;
48 | flex-wrap:wrap;
49 | align-content:stretch;
50 | margin: 16rpx 0rpx 0rpx 0rpx;
51 | width:100%;
52 | height: 12%;
53 | background-color: #FFFFFF;
54 | color: #000000; font-size: 20PX;
55 | line-height:40rpx;
56 |
57 | }
58 | .WViewRow3{
59 | box-sizing:border-box;
60 | display:flex;
61 | justify-content:flex-start;
62 | align-items:flex-start;
63 | flex-direction:row;
64 | flex-wrap:wrap;
65 | align-content:stretch;
66 | margin: 16rpx 0rpx 0rpx 0rpx;
67 | width:100%;
68 | height: 2%;
69 | display: -webkit-box;
70 | display: -moz-box;
71 | overflow: hidden;
72 | text-overflow: ellipsis;
73 | word-break: break-all;
74 | -webkit-box-orient:vertical;
75 | -webkit-line-clamp:1;
76 | background-color: #FFFFFF;
77 | color: #000000; font-size: 20PX;
78 | line-height:40rpx;
79 |
80 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/logs/logs.js:
--------------------------------------------------------------------------------
1 | //logs.js
2 | var util = require('../../utils/util.js')
3 | Page({
4 | data: {
5 | logs: []
6 | },
7 | onLoad: function () {
8 | this.setData({
9 | logs: (wx.getStorageSync('logs') || []).map(function (log) {
10 | return util.formatTime(new Date(log))
11 | })
12 | })
13 | }
14 | })
15 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/logs/logs.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{index + 1}}. {{log}}
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/logs/logs.wxss:
--------------------------------------------------------------------------------
1 | .log-list {
2 | display: flex;
3 | flex-direction: column;
4 | padding: 40rpx;
5 | }
6 | .log-item {
7 | margin: 10rpx;
8 | }
9 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/search/search.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | {{item.name}}
21 |
22 |
23 |
24 | {{item.description}}
25 |
26 |
27 |
28 |
29 | {{item.language}}
30 |
31 | {{item.stargazers_count}}
32 |
33 | {{item.forks_count}}
34 |
35 |
36 | {{item.owner.login}}
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | 拼命加载中...
75 |
76 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/search/search.wxss:
--------------------------------------------------------------------------------
1 | .title{
2 | color: #4F94CD;
3 | font-weight:bold;
4 | margin-left:10px;
5 | margin-bottom:10px;
6 | padding-bottom: 25px;
7 | font-size: 20px;
8 | margin-top: -10px;
9 | line-height:25px;
10 | }
11 | .jiantou{
12 | width: 10px;
13 | height: 10px;
14 | margin-left: 10px
15 | }
16 | .primary{
17 | background-color: black;
18 | color: white;
19 | width: 50px;
20 | margin-left: 10
21 | }
22 | .description{
23 | margin-top: 10px;
24 | font-size: 14px;
25 | overflow: hidden;
26 | float: left;
27 | margin-left:10px;
28 | line-height:1.5;
29 | color:#0D0D0D
30 | }
31 | .star{
32 | margin-top: 10px;
33 | float: left;
34 | margin-left:10px;
35 | }
36 | .desc{
37 | clear: both;
38 | }
39 | .jian{
40 | margin-top: 10px;
41 | float: right
42 | }
43 | .stars{
44 | margin-left:2px;
45 | color:#666666;
46 | font-size: 12px;
47 | margin-right: 10px
48 | }
49 | .admin{
50 | margin-left:4px;
51 | color:#4D4D4D;
52 | font-size: 14px;
53 | margin-right: 20px
54 | }
55 | .best {
56 | /* iOS video-cell margin bug*/
57 | padding-bottom: 10px;
58 | text-overflow: clip;
59 | vertical-align: middle;
60 | margin-left:35px;
61 | margin-right:auto;
62 | }
63 | .devide{
64 | height:1px;
65 | width:100%;
66 | background:#C7C7C7;
67 | overflow:hidden;
68 | margin-left: 50px;
69 | margin-bottom: 10px;
70 | }
71 | .container{
72 | background: #f8f8f8;
73 | box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 5px;
74 | border-radius: 2px;
75 | color: #ff591b;
76 | overflow: hidden;
77 | }
78 | .user_pic{
79 | width:40px;
80 | height:40px;
81 | border-radius:100px;
82 | margin-left: 10px
83 | }
84 | .flex{
85 | flex-direction: row
86 | }
87 |
88 | .wxSearch{
89 | position: absolute;
90 | top: 43px;
91 | left: 0;
92 | width: 100%;
93 | height: 100%;
94 | border-top: 1px #eee solid;
95 | background-color: rgba(0, 0, 0, 0.2);
96 | }
97 | .wxSearchInner{
98 | background-color: #fff;
99 | }
100 | .wxSearch-section{
101 | background-color: #fff;
102 | padding: 5px 10px;
103 | border: 1px #eee solid;
104 | }
105 | .wxSearch-pancel{
106 | display: flex;
107 | flex-direction: row;
108 | }
109 | .wxSearch-input{
110 | flex: 8;
111 | background-color: #eee;
112 | padding: 5px 10px;
113 | border-radius:100px;
114 | font-size: 14px;
115 | width: 98%
116 | }
117 | /*.wxSearch-button{
118 | flex: 1;
119 | border: none !important;
120 | color: cornflowerblue !important;
121 | }*/
122 |
123 | .wxSearchTitle{
124 | display: block;
125 | padding: 10px 5px 5px 10px;
126 | font-size: 12px;
127 | text-align: center;
128 | }
129 |
130 |
131 | .wxSearchMindKeyItem{
132 | padding: 10px 5px;
133 | border-bottom: 1px solid #eee;
134 | display: flex;
135 | font-size: 14px;
136 | color: cornflowerblue;
137 | }
138 |
139 | .wxSearchKeyList{
140 | display: flex;
141 | flex-direction: row;
142 | flex-wrap: wrap;
143 | }
144 |
145 | .wxSearchKeyItem{
146 | flex: 0 0 20%;
147 | font-size: 14px;
148 | text-align: center;
149 | border: 1px solid #eee;
150 | margin: 5px;
151 | padding: 5px 10px;
152 | border-radius: 5px;
153 | }
154 | .wxSearchHistoryItem{
155 | padding: 10px 5px;
156 | border-bottom: 1px solid #eee;
157 | display: flex;
158 | }
159 | .wxSearchHistoryItemText{
160 | flex: 8;
161 | font-size: 14px;
162 | }
163 | .wxSearchHistoryItemDel{
164 | flex: 1;
165 | font-size: 12px;
166 | text-align: center;
167 | padding: 3px 5px;
168 | border: 1px solid #eee;
169 | border-radius: 5px;
170 | }
171 | .wxSearchHistoryEmpty{
172 | text-align: center;
173 | height: 50px;
174 | line-height: 50px;
175 | font-size: 12px;
176 | }
177 | .wxSearchDeleteAllBtn{
178 | height: 50px;
179 | line-height: 50px;
180 | text-align: center;
181 | font-size: 12px;
182 | }
183 | .slide_bar{
184 | position: fixed;
185 | bottom: 20px;
186 | right: 15px;
187 | z-index: 888;
188 | height: 49px;
189 | font-size: 19px;
190 | text-align: center;
191 | width:49px;
192 | border-radius:100px;
193 | background-color:#000000;
194 | filter:alpha(opacity=80);
195 | -moz-opacity:0.7;opacity: 0.7;
196 | color: #4F94CD
197 | }
198 | .input-box {
199 | border: 0;
200 | outline: 0;
201 | -webkit-appearance: none;
202 | background-color: transparent;
203 | height: 80rpx;
204 | line-height: 80rpx;
205 | font-size: 30rpx;
206 | width: 100%;
207 | color: #555;
208 | }
209 |
210 | .option{
211 | margin-left:auto;
212 | margin-right:auto;
213 | display:inline-block;
214 | width: 33.33%;
215 | text-align: center
216 | }
217 | .option_menu{
218 | width:13px;
219 | height:13px;
220 | text-align: center
221 | }
222 | .option_menu_size{
223 | font-size: 10pt;
224 | margin-left: 5px
225 | }
226 |
227 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/template/template.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/user/userinfo.js:
--------------------------------------------------------------------------------
1 | // pages/user/userinfo.js
2 | var api = require('../../utils/request_api.js')
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | user_avatar: '',
10 | user_name: '',
11 | user_desc: '',
12 | followers: 0,
13 | following: 0,
14 | events: '',
15 | gists_url: '',
16 | organizations_url: '',
17 | repos_url: ''
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: function (options) {
24 | const name = options.username
25 | console.log(api.server_api + 'v1/repos?github=https://api.github.com/users/' + name)
26 | const that = this
27 |
28 | wx.request({
29 | url: api.server_api + 'v1/repos?github=https://api.github.com/users/' + name,
30 | data: {},
31 | method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
32 | // header: {}, // 设置请求的 header
33 | success: function (res) {
34 | // success
35 | console.log(res.data)
36 | that.setData({
37 | user_avatar: res.data.avatar_url,
38 | user_name: res.data.login,
39 | user_desc: res.data.bio,
40 | followers: res.data.followers,
41 | following: res.data.following,
42 | gists_url: res.data.gists_url,
43 | organizations_url: res.data.organizations_url,
44 | repos_url: res.data.repos_url
45 | })
46 |
47 | if (wx.getStorageSync('username') == name) {
48 | that.setData({
49 | events: res.data.received_events_url,
50 | })
51 | } else {
52 | that.setData({
53 | events: res.data.events_url.replace('{/privacy}', ''),
54 | })
55 | }
56 | },
57 | fail: function () {
58 | // fail
59 | console.log('fail')
60 | },
61 | complete: function () {
62 | // complete
63 | }
64 | })
65 | },
66 |
67 | events(e) {
68 | wx.navigateTo({
69 | url: '../events/events?events=' + e.currentTarget.dataset.link,
70 | success: function (res) {
71 | // success
72 | },
73 | fail: function () {
74 | // fail
75 | },
76 | complete: function () {
77 | // complete
78 | }
79 | })
80 | },
81 | /**
82 | * 生命周期函数--监听页面初次渲染完成
83 | */
84 | onReady: function () {
85 |
86 | },
87 |
88 | /**
89 | * 生命周期函数--监听页面显示
90 | */
91 | onShow: function () {
92 |
93 | },
94 |
95 | /**
96 | * 生命周期函数--监听页面隐藏
97 | */
98 | onHide: function () {
99 |
100 | },
101 |
102 | /**
103 | * 生命周期函数--监听页面卸载
104 | */
105 | onUnload: function () {
106 |
107 | },
108 |
109 | /**
110 | * 页面相关事件处理函数--监听用户下拉动作
111 | */
112 | onPullDownRefresh: function () {
113 |
114 | },
115 |
116 | /**
117 | * 页面上拉触底事件的处理函数
118 | */
119 | onReachBottom: function () {
120 |
121 | },
122 |
123 | /**
124 | * 用户点击右上角分享
125 | */
126 | onShareAppMessage: function () {
127 |
128 | }
129 | })
--------------------------------------------------------------------------------
/WeChatMiniApp/pages/user/userinfo.wxss:
--------------------------------------------------------------------------------
1 | .user_pic {
2 | width: 70px;
3 | height: 70px;
4 | border-radius: 100px;
5 | margin-top: 10px;
6 | }
7 |
8 | .user_view {
9 | background: #4d4d4d;
10 | text-align: center;
11 | /*border: green solid 1px;*/
12 | width: screen.width;
13 | vertical-align: middle;
14 | flex-direction: column;
15 | }
16 |
17 | .name {
18 | color: #fff;
19 | font-size: 17px;
20 | margin-top: 8px;
21 | }
22 |
23 | .msg {
24 | color: #b8b8b8;
25 | font-size: 15px;
26 | margin-top: 18px;
27 | }
28 |
29 | .count_item {
30 | border-right: gray solid 0.1px;
31 | border-bottom: gray solid 0.1px;
32 | padding-left: 10px;
33 | width: 47%;
34 | background-color: #fff;
35 | padding-top: 5px;
36 | }
37 |
38 | .count_item_right {
39 | border-bottom: gray solid 0.1px;
40 | padding-left: 10px;
41 | width: 47%;
42 | background-color: #fff;
43 | }
44 |
45 | .btn_item {
46 | border-bottom: gray solid 0.1px;
47 | height: 40px;
48 | background-color: #fff;
49 | }
50 |
51 | .view-item {
52 | display: inline-block;
53 | }
54 |
55 | .num {
56 | color: #9e9e9e;
57 | font-size: 15px;
58 | }
59 |
60 | .num_msg {
61 | color: #1e1e1e;
62 | font-size: 13px;
63 | }
64 |
65 | .jiantou {
66 | width: 23px;
67 | height: 23px;
68 | margin-left: 10px;
69 | margin-right: 10px;
70 | }
71 |
72 | .item_right {
73 | width: 49%;
74 | background-color: #fff;
75 | border-bottom: gray solid 0.1px;
76 | }
77 |
78 | .item_left {
79 | width: 50%;
80 | border-right: gray solid 0.1px;
81 | background-color: #fff;
82 | }
83 |
84 | .item2_right {
85 | width: 49%;
86 | background-color: #fff;
87 | border-bottom: gray solid 0.1px;
88 | border-top: gray solid 0.1px;
89 | }
90 |
91 | .item2_left {
92 | width: 50%;
93 | border-right: gray solid 0.1px;
94 | border-bottom: gray solid 0.1px;
95 | border-top: gray solid 0.1px;
96 | background-color: #fff;
97 | }
98 |
99 | .option {
100 | margin-left: auto;
101 | margin-right: auto;
102 | display: inline-block;
103 | width: 33.33%;
104 | text-align: center;
105 | }
106 |
107 | .option_menu {
108 | width: 13px;
109 | height: 13px;
110 | text-align: center;
111 | }
112 |
113 | .option_menu_size {
114 | font-size: 10pt;
115 | margin-left: 5px;
116 | }
117 |
118 | .r {
119 | border-bottom: 8px solid #eee;
120 | border-left: 8px solid transparent;
121 | border-right: 8px solid transparent;
122 | width: 1px;
123 | margin-top: 5px;
124 | margin-left: 5px;
125 | text-align: center;
126 | }
127 |
128 | .cmt-wrap {
129 | width: 100%;
130 | background-color: #eee;
131 | }
132 |
133 | .like {
134 | color: #576b95;
135 | padding: 5px 5px 3px 12px;
136 | }
137 |
138 | .like image {
139 | width: 12px;
140 | height: 12px;
141 | padding-right: 5px;
142 | }
143 |
144 | .cmt-list {
145 | color: #454545;
146 | word-wrap: break-word;
147 | }
148 |
149 | .cmt-list view {
150 | padding-top: 3px;
151 | }
152 |
153 | .cmt-list span {
154 | color: #3b5384;
155 | }
156 |
157 | .cmt-list content {
158 | font-size: 12pt;
159 | width: 100%;
160 | word-wrap: break-word;
161 | }
162 |
163 | .cmt-list time {
164 | font-size: 10pt;
165 | padding-left: 10px;
166 | }
167 |
168 | .option {
169 | margin-left: auto;
170 | margin-right: auto;
171 | display: inline-block;
172 | width: 33.33%;
173 | text-align: center;
174 | }
175 |
176 | .option_menu {
177 | width: 13px;
178 | height: 13px;
179 | text-align: center;
180 | }
181 |
182 | .option_menu_size {
183 | font-size: 10pt;
184 | margin-left: 5px;
185 | }
186 |
187 | .image-style {
188 | height: 150rpx;
189 | width: 150rpx;
190 | position: absolute;
191 | bottom: 250rpx;
192 | right: 100rpx;
193 | opacity: 0;
194 | }
195 |
196 | .image-plus-style {
197 | height: 150rpx;
198 | width: 150rpx;
199 | position: absolute;
200 | bottom: 250rpx;
201 | right: 100rpx;
202 | z-index: 100;
203 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/templates/all_lang.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ item.link }}
5 | {{ item.desc}}
6 | {{ item.stars }}
7 |
8 |
--------------------------------------------------------------------------------
/WeChatMiniApp/templates/tab-select.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 搞笑
8 |
9 |
13 | 舞蹈
14 |
15 |
19 | 时尚
20 |
21 |
22 |
--------------------------------------------------------------------------------
/WeChatMiniApp/utils/request_api.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // server_api:'http://127.0.0.1:8000/'
3 | server_api: 'https://python.0x2048.com/'
4 | // server_api:'http://0x2048.com:8891/'
5 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/utils/util.js:
--------------------------------------------------------------------------------
1 | function formatTime(date) {
2 | var year = date.getFullYear()
3 | var month = date.getMonth() + 1
4 | var day = date.getDate()
5 |
6 | var hour = date.getHours()
7 | var minute = date.getMinutes()
8 | var second = date.getSeconds()
9 |
10 |
11 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
12 | }
13 |
14 | function formatNumber(n) {
15 | n = n.toString()
16 | return n[1] ? n : '0' + n
17 | }
18 |
19 | module.exports = {
20 | formatTime: formatTime
21 | }
22 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/clipboard.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/wxParse/scripts/clipboard.swf
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushAS3.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.AS3 = function()
31 | {
32 | // Created by Peter Atoria @ http://iAtoria.com
33 |
34 | var inits = 'class interface function package';
35 |
36 | var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
37 | 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
38 | 'extends false final finally flash_proxy for get if implements import in include Infinity ' +
39 | 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' +
40 | 'Null Number Object object_proxy override parseFloat parseInt private protected public ' +
41 | 'return set static String super switch this throw true try typeof uint undefined unescape ' +
42 | 'use void while with'
43 | ;
44 |
45 | this.regexList = [
46 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
47 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
48 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
49 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
50 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
51 | { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations
52 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
53 | { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable
54 | { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace
55 | ];
56 |
57 | this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
58 | };
59 |
60 | SyntaxHighlighter.brushes.AS3.prototype = new SyntaxHighlighter.Highlighter();
61 | SyntaxHighlighter.brushes.AS3.aliases = ['actionscript3', 'as3'];
62 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushBash.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Bash = function()
31 | {
32 | var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le';
33 | var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
34 | 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
35 | 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
36 | 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
37 | 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
38 | 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
39 | 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
40 | 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
41 | 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
42 | 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
43 | 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
44 | 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
45 | 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
46 | 'vi watch wc whereis which who whoami Wget xargs yes'
47 | ;
48 |
49 | this.findMatches = function(regexList, code)
50 | {
51 | code = code.replace(/>/g, '>').replace(/</g, '<');
52 | this.code = code;
53 | return SyntaxHighlighter.Highlighter.prototype.findMatches.apply(this, [regexList, code]);
54 | };
55 |
56 | this.regexList = [
57 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
58 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
59 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
60 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
61 | { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
62 | ];
63 | }
64 |
65 | SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter();
66 | SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell'];
67 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushCSharp.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.CSharp = function()
31 | {
32 | var keywords = 'abstract as base bool break byte case catch char checked class const ' +
33 | 'continue decimal default delegate do double else enum event explicit ' +
34 | 'extern false finally fixed float for foreach get goto if implicit in int ' +
35 | 'interface internal is lock long namespace new null object operator out ' +
36 | 'override params private protected public readonly ref return sbyte sealed set ' +
37 | 'short sizeof stackalloc static string struct switch this throw true try ' +
38 | 'typeof uint ulong unchecked unsafe ushort using virtual void while';
39 |
40 | function fixComments(match, regexInfo)
41 | {
42 | var css = (match[0].indexOf("///") == 0)
43 | ? 'color1'
44 | : 'comments'
45 | ;
46 |
47 | return [new SyntaxHighlighter.Match(match[0], match.index, css)];
48 | }
49 |
50 | this.regexList = [
51 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
52 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
53 | { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
54 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
55 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
56 | { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
57 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
58 | { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
59 | { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
60 | ];
61 |
62 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
63 | };
64 |
65 | SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter();
66 | SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp'];
67 |
68 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushDelphi.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Delphi = function()
31 | {
32 | var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
33 | 'case char class comp const constructor currency destructor div do double ' +
34 | 'downto else end except exports extended false file finalization finally ' +
35 | 'for function goto if implementation in inherited int64 initialization ' +
36 | 'integer interface is label library longint longword mod nil not object ' +
37 | 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
38 | 'pint64 pointer private procedure program property pshortstring pstring ' +
39 | 'pvariant pwidechar pwidestring protected public published raise real real48 ' +
40 | 'record repeat set shl shortint shortstring shr single smallint string then ' +
41 | 'threadvar to true try type unit until uses val var varirnt while widechar ' +
42 | 'widestring with word write writeln xor';
43 |
44 | this.regexList = [
45 | { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *)
46 | { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { }
47 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line
48 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
49 | { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags
50 | { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345
51 | { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3
52 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
53 | ];
54 | };
55 |
56 | SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter();
57 | SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal', 'pas'];
58 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushDiff.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Diff = function()
31 | {
32 | this.regexList = [
33 | { regex: /^\+\+\+.*$/gm, css: 'color2' },
34 | { regex: /^\-\-\-.*$/gm, css: 'color2' },
35 | { regex: /^\s.*$/gm, css: 'color1' },
36 | { regex: /^@@.*@@$/gm, css: 'variable' },
37 | { regex: /^\+[^\+]{1}.*$/gm, css: 'string' },
38 | { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' }
39 | ];
40 | };
41 |
42 | SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter();
43 | SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch'];
44 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushErlang.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Erlang = function()
31 | {
32 | // Contributed by Jean-Lou Dupont
33 | // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
34 |
35 | // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
36 | var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
37 | 'case catch cond div end fun if let not of or orelse '+
38 | 'query receive rem try when xor'+
39 | // additional
40 | ' module export import define';
41 |
42 | this.regexList = [
43 | { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
44 | { regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
45 | { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
46 | { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
47 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
48 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
49 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
50 | ];
51 | };
52 |
53 | SyntaxHighlighter.brushes.Erlang.prototype = new SyntaxHighlighter.Highlighter();
54 | SyntaxHighlighter.brushes.Erlang.aliases = ['erl', 'erlang'];
55 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushGroovy.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Groovy = function()
31 | {
32 | // Contributed by Andres Almiray
33 | // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
34 |
35 | var keywords = 'as assert break case catch class continue def default do else extends finally ' +
36 | 'if in implements import instanceof interface new package property return switch ' +
37 | 'throw throws try while public protected private static';
38 | var types = 'void boolean byte char short int long float double';
39 | var constants = 'null';
40 | var methods = 'allProperties count get size '+
41 | 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
42 | 'findIndexOf grep inject max min reverseEach sort ' +
43 | 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
44 | 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
45 | 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
46 | 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
47 | 'transformChar transformLine withOutputStream withPrintWriter withStream ' +
48 | 'withStreams withWriter withWriterAppend write writeLine '+
49 | 'dump inspect invokeMethod print println step times upto use waitForOrKill '+
50 | 'getText';
51 |
52 | this.regexList = [
53 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
54 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
55 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
56 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
57 | { regex: /""".*"""/g, css: 'string' }, // GStrings
58 | { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers
59 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword
60 | { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type
61 | { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants
62 | { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods
63 | ];
64 |
65 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
66 | }
67 |
68 | SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter();
69 | SyntaxHighlighter.brushes.Groovy.aliases = ['groovy'];
70 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushJScript.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.JScript = function()
31 | {
32 | var keywords = 'break case catch continue ' +
33 | 'default delete do else false ' +
34 | 'for function if in instanceof ' +
35 | 'new null return super switch ' +
36 | 'this throw true try typeof var while with'
37 | ;
38 |
39 | this.regexList = [
40 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
41 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
42 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
43 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
44 | { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
45 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
46 | ];
47 |
48 | this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
49 | };
50 |
51 | SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter();
52 | SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript'];
53 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Java = function()
31 | {
32 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
33 | 'continue default do double else enum extends ' +
34 | 'false final finally float for goto if implements import ' +
35 | 'instanceof int interface long native new null ' +
36 | 'package private protected public return ' +
37 | 'short static strictfp super switch synchronized this throw throws true ' +
38 | 'transient try void volatile while';
39 |
40 | this.regexList = [
41 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
42 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
43 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
44 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
45 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
46 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
47 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
48 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
49 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
50 | ];
51 |
52 | this.forHtmlScript({
53 | left : /(<|<)%[@!=]?/g,
54 | right : /%(>|>)/g
55 | });
56 | };
57 |
58 | SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter();
59 | SyntaxHighlighter.brushes.Java.aliases = ['java'];
60 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushJavaFX.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.JavaFX = function()
31 | {
32 | // Contributed by Patrick Webster
33 | // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
34 | var datatypes = 'Boolean Byte Character Double Duration '
35 | + 'Float Integer Long Number Short String Void'
36 | ;
37 |
38 | var keywords = 'abstract after and as assert at before bind bound break catch class '
39 | + 'continue def delete else exclusive extends false finally first for from '
40 | + 'function if import in indexof init insert instanceof into inverse last '
41 | + 'lazy mixin mod nativearray new not null on or override package postinit '
42 | + 'protected public public-init public-read replace return reverse sizeof '
43 | + 'step super then this throw true try tween typeof var where while with '
44 | + 'attribute let private readonly static trigger'
45 | ;
46 |
47 | this.regexList = [
48 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
49 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
50 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
51 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
52 | { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
53 | { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
54 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
55 | ];
56 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
57 | };
58 |
59 | SyntaxHighlighter.brushes.JavaFX.prototype = new SyntaxHighlighter.Highlighter();
60 | SyntaxHighlighter.brushes.JavaFX.aliases = ['jfx', 'javafx'];
61 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushPerl.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Perl = function()
31 | {
32 | // Contributed by David Simmons-Duffin and Marty Kube
33 |
34 | var funcs =
35 | 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' +
36 | 'chroot close closedir connect cos crypt defined delete each endgrent ' +
37 | 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' +
38 | 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' +
39 | 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' +
40 | 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' +
41 | 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' +
42 | 'getservbyname getservbyport getservent getsockname getsockopt glob ' +
43 | 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' +
44 | 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' +
45 | 'oct open opendir ord pack pipe pop pos print printf prototype push ' +
46 | 'quotemeta rand read readdir readline readlink readpipe recv rename ' +
47 | 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' +
48 | 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' +
49 | 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' +
50 | 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' +
51 | 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' +
52 | 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' +
53 | 'undef unlink unpack unshift utime values vec wait waitpid warn write';
54 |
55 | var keywords =
56 | 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
57 | 'for foreach goto if import last local my next no our package redo ref ' +
58 | 'require return sub tie tied unless untie until use wantarray while';
59 |
60 | this.regexList = [
61 | { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' },
62 | { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang
63 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
64 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
65 | { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' },
66 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
67 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
68 | ];
69 |
70 | this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
71 | }
72 |
73 | SyntaxHighlighter.brushes.Perl.prototype = new SyntaxHighlighter.Highlighter();
74 | SyntaxHighlighter.brushes.Perl.aliases = ['perl', 'Perl', 'pl'];
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushPlain.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Plain = function()
31 | {
32 | };
33 |
34 | SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter();
35 | SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain'];
36 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushPowerShell.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.PowerShell = function()
31 | {
32 | // Contributes by B.v.Zanten, Getronics
33 | // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
34 |
35 | var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
36 | 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
37 | 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
38 | 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
39 | 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
40 | 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
41 | 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
42 | 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
43 | 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
44 | 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
45 | 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
46 | 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
47 | 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
48 | 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
49 | 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
50 | 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
51 | 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
52 | 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
53 | 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
54 | 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
55 | 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
56 | var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
57 | 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
58 | 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
59 | 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
60 | 'spps spsv sv tee cat cd cp h history kill lp ls ' +
61 | 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
62 | 'erase rd ren type % \\?';
63 |
64 | this.regexList = [
65 | { regex: /#.*$/gm, css: 'comments' }, // one line comments
66 | { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1
67 | { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq
68 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
69 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
70 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' },
71 | { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' }
72 | ];
73 | };
74 |
75 | SyntaxHighlighter.brushes.PowerShell.prototype = new SyntaxHighlighter.Highlighter();
76 | SyntaxHighlighter.brushes.PowerShell.aliases = ['powershell', 'ps'];
77 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushPython.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Python = function()
31 | {
32 | // Contributed by Gheorghe Milas and Ahmad Sherif
33 |
34 | var keywords = 'and assert break class continue def del elif else ' +
35 | 'except exec finally for from global if import in is ' +
36 | 'lambda not or pass print raise return try yield while';
37 |
38 | var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' +
39 | 'chr classmethod cmp coerce compile complex delattr dict dir ' +
40 | 'divmod enumerate eval execfile file filter float format frozenset ' +
41 | 'getattr globals hasattr hash help hex id input int intern ' +
42 | 'isinstance issubclass iter len list locals long map max min next ' +
43 | 'object oct open ord pow print property range raw_input reduce ' +
44 | 'reload repr reversed round set setattr slice sorted staticmethod ' +
45 | 'str sum super tuple type type unichr unicode vars xrange zip';
46 |
47 | var special = 'None True False self cls class_';
48 |
49 | this.regexList = [
50 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
51 | { regex: /^\s*@\w+/gm, css: 'decorator' },
52 | { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' },
53 | { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' },
54 | { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' },
55 | { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' },
56 | { regex: /\b\d+\.?\w*/g, css: 'value' },
57 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
58 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
59 | { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' }
60 | ];
61 |
62 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
63 | };
64 |
65 | SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter();
66 | SyntaxHighlighter.brushes.Python.aliases = ['py', 'python'];
67 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushRuby.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Ruby = function()
31 | {
32 | // Contributed by Erik Peterson.
33 |
34 | var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
35 | 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
36 | 'self super then throw true undef unless until when while yield';
37 |
38 | var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
39 | 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
40 | 'ThreadGroup Thread Time TrueClass';
41 |
42 | this.regexList = [
43 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
44 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
45 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
46 | { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants
47 | { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols
48 | { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables
49 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
50 | { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins
51 | ];
52 |
53 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
54 | };
55 |
56 | SyntaxHighlighter.brushes.Ruby.prototype = new SyntaxHighlighter.Highlighter();
57 | SyntaxHighlighter.brushes.Ruby.aliases = ['ruby', 'rails', 'ror', 'rb'];
58 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushScala.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Scala = function()
31 | {
32 | // Contributed by Yegor Jbanov and David Bernard.
33 |
34 | var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' +
35 | 'override try lazy for var catch throw type extends class while with new final yield abstract ' +
36 | 'else do if return protected private this package false';
37 |
38 | var keyops = '[_:=><%#@]+';
39 |
40 | this.regexList = [
41 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
42 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
43 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings
44 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string
45 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
46 | { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers
47 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
48 | { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword
49 | ];
50 | }
51 |
52 | SyntaxHighlighter.brushes.Scala.prototype = new SyntaxHighlighter.Highlighter();
53 | SyntaxHighlighter.brushes.Scala.aliases = ['scala'];
54 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushSql.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Sql = function()
31 | {
32 | var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
33 | 'current_user day isnull left lower month nullif replace right ' +
34 | 'session_user space substring sum system_user upper user year';
35 |
36 | var keywords = 'absolute action add after alter as asc at authorization begin bigint ' +
37 | 'binary bit by cascade char character check checkpoint close collate ' +
38 | 'column commit committed connect connection constraint contains continue ' +
39 | 'create cube current current_date current_time cursor database date ' +
40 | 'deallocate dec decimal declare default delete desc distinct double drop ' +
41 | 'dynamic else end end-exec escape except exec execute false fetch first ' +
42 | 'float for force foreign forward free from full function global goto grant ' +
43 | 'group grouping having hour ignore index inner insensitive insert instead ' +
44 | 'int integer intersect into is isolation key last level load local max min ' +
45 | 'minute modify move name national nchar next no numeric of off on only ' +
46 | 'open option order out output partial password precision prepare primary ' +
47 | 'prior privileges procedure public read real references relative repeatable ' +
48 | 'restrict return returns revoke rollback rollup rows rule schema scroll ' +
49 | 'second section select sequence serializable set size smallint static ' +
50 | 'statistics table temp temporary then time timestamp to top transaction ' +
51 | 'translation trigger true truncate uncommitted union unique update values ' +
52 | 'varchar varying view when where with work';
53 |
54 | var operators = 'all and any between cross in join like not null or outer some';
55 |
56 | this.regexList = [
57 | { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments
58 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
59 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
60 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
61 | { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
62 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
63 | ];
64 | };
65 |
66 | SyntaxHighlighter.brushes.Sql.prototype = new SyntaxHighlighter.Highlighter();
67 | SyntaxHighlighter.brushes.Sql.aliases = ['sql'];
68 |
69 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushVb.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Vb = function()
31 | {
32 | var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' +
33 | 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' +
34 | 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' +
35 | 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' +
36 | 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' +
37 | 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' +
38 | 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' +
39 | 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' +
40 | 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' +
41 | 'Overloads Overridable Overrides ParamArray Preserve Private Property ' +
42 | 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' +
43 | 'Return Select Set Shadows Shared Short Single Static Step Stop String ' +
44 | 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' +
45 | 'Variant When While With WithEvents WriteOnly Xor';
46 |
47 | this.regexList = [
48 | { regex: /'.*$/gm, css: 'comments' }, // one line comments
49 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
50 | { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
51 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword
52 | ];
53 |
54 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
55 | };
56 |
57 | SyntaxHighlighter.brushes.Vb.prototype = new SyntaxHighlighter.Highlighter();
58 | SyntaxHighlighter.brushes.Vb.aliases = ['vb', 'vbnet'];
59 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shBrushXml.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | SyntaxHighlighter.brushes.Xml = function()
31 | {
32 | function process(match, regexInfo)
33 | {
34 | var constructor = SyntaxHighlighter.Match,
35 | code = match[0],
36 | tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code),
37 | result = []
38 | ;
39 |
40 | if (match.attributes != null)
41 | {
42 | var attributes,
43 | regex = new XRegExp('(? [\\w:\\-\\.]+)' +
44 | '\\s*=\\s*' +
45 | '(? ".*?"|\'.*?\'|\\w+)',
46 | 'xg');
47 |
48 | while ((attributes = regex.exec(code)) != null)
49 | {
50 | result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
51 | result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
52 | }
53 | }
54 |
55 | if (tag != null)
56 | result.push(
57 | new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
58 | );
59 |
60 | return result;
61 | }
62 |
63 | this.regexList = [
64 | { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, //
65 | { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, //
66 | { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process }
67 | ];
68 | };
69 |
70 | SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter();
71 | SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html'];
72 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/scripts/shLegacy.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1 y={d:{}};y.d={F:6(S,l,q,k,m,n){6 J(z,Y){1 V=16 15("^"+Y+"\\\\[(?\\\\w+)\\\\]$","14"),x=2;h(1 i=0;i.
29 | */
30 | var dp = {
31 | SyntaxHighlighter : {}
32 | };
33 |
34 | dp.SyntaxHighlighter = {
35 | parseParams: function(
36 | input,
37 | showGutter,
38 | showControls,
39 | collapseAll,
40 | firstLine,
41 | showColumns
42 | )
43 | {
44 | function getValue(list, name)
45 | {
46 | var regex = new XRegExp('^' + name + '\\[(?\\w+)\\]$', 'gi'),
47 | match = null
48 | ;
49 |
50 | for (var i = 0; i < list.length; i++)
51 | if ((match = regex.exec(list[i])) != null)
52 | return match.value;
53 |
54 | return null;
55 | };
56 |
57 | function defaultValue(value, def)
58 | {
59 | return value != null ? value : def;
60 | };
61 |
62 | function asString(value)
63 | {
64 | return value != null ? value.toString() : null;
65 | };
66 |
67 | var parts = input.split(':'),
68 | brushName = parts[0],
69 | options = {},
70 | straight = { 'true' : 'true' }
71 | reverse = { 'true' : 'false' },
72 | result = null,
73 | defaults = SyntaxHighlighter.defaults
74 | ;
75 |
76 | for (var i in parts)
77 | options[parts[i]] = 'true';
78 |
79 | showGutter = asString(defaultValue(showGutter, defaults.gutter));
80 | showControls = asString(defaultValue(showControls, defaults.toolbar));
81 | collapseAll = asString(defaultValue(collapseAll, defaults.collapse));
82 | showColumns = asString(defaultValue(showColumns, defaults.ruler));
83 | firstLine = asString(defaultValue(firstLine, defaults['first-line']));
84 |
85 | result = {
86 | brush : brushName,
87 | gutter : defaultValue(reverse[options.nogutter], showGutter),
88 | toolbar : defaultValue(reverse[options.nocontrols], showControls),
89 | collapse : defaultValue(straight[options.collapse], collapseAll),
90 | ruler : defaultValue(straight[options.showcolumns], showColumns),
91 | 'first-line' : defaultValue(getValue(parts, 'firstline'), firstLine)
92 | };
93 |
94 | return result;
95 | },
96 |
97 | HighlightAll: function(
98 | name,
99 | showGutter /* optional */,
100 | showControls /* optional */,
101 | collapseAll /* optional */,
102 | firstLine /* optional */,
103 | showColumns /* optional */
104 | )
105 | {
106 | function findValue()
107 | {
108 | var a = arguments;
109 |
110 | for (var i = 0; i < a.length; i++)
111 | {
112 | if (a[i] === null)
113 | continue;
114 |
115 | if (typeof(a[i]) == 'string' && a[i] != '')
116 | return a[i] + '';
117 |
118 | if (typeof(a[i]) == 'object' && a[i].value != '')
119 | return a[i].value + '';
120 | }
121 |
122 | return null;
123 | };
124 |
125 | function findTagsByName(list, name, tagName)
126 | {
127 | var tags = document.getElementsByTagName(tagName);
128 |
129 | for (var i = 0; i < tags.length; i++)
130 | if (tags[i].getAttribute('name') == name)
131 | list.push(tags[i]);
132 | }
133 |
134 | var elements = [],
135 | highlighter = null,
136 | registered = {},
137 | propertyName = 'innerHTML'
138 | ;
139 |
140 | // for some reason IE doesn't find by name, however it does see them just fine by tag name...
141 | findTagsByName(elements, name, 'pre');
142 | findTagsByName(elements, name, 'textarea');
143 |
144 | if (elements.length === 0)
145 | return;
146 |
147 | for (var i = 0; i < elements.length; i++)
148 | {
149 | var element = elements[i],
150 | params = findValue(
151 | element.attributes['class'], element.className,
152 | element.attributes['language'], element.language
153 | ),
154 | language = ''
155 | ;
156 |
157 | if (params === null)
158 | continue;
159 |
160 | params = dp.SyntaxHighlighter.parseParams(
161 | params,
162 | showGutter,
163 | showControls,
164 | collapseAll,
165 | firstLine,
166 | showColumns
167 | );
168 |
169 | SyntaxHighlighter.highlight(params, element);
170 | }
171 | }
172 | };
173 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/wxParse/styles/help.png
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/magnifier.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/wxParse/styles/magnifier.png
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/page_white_code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/wxParse/styles/page_white_code.png
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/page_white_copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/wxParse/styles/page_white_copy.png
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/printer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/wxParse/styles/printer.png
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/shThemeDefault.css:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | /************************************
31 | * Default Syntax Highlighter theme.
32 | *
33 | * Interface elements.
34 | ************************************/
35 |
36 | .syntaxhighlighter
37 | {
38 | background-color: #fff !important;
39 | }
40 |
41 | /* Highlighed line number */
42 | .syntaxhighlighter .line.highlighted .number
43 | {
44 | color: black !important;
45 | }
46 |
47 | /* Highlighed line */
48 | .syntaxhighlighter .line.highlighted.alt1,
49 | .syntaxhighlighter .line.highlighted.alt2
50 | {
51 | background-color: #e0e0e0 !important;
52 | }
53 |
54 | /* Gutter line numbers */
55 | .syntaxhighlighter .line .number
56 | {
57 | color: #afafaf !important;
58 | }
59 |
60 | /* Add border to the lines */
61 | .syntaxhighlighter .line .content
62 | {
63 | border-left: 3px solid #6CE26C !important;
64 | color: #000 !important;
65 | }
66 |
67 | .syntaxhighlighter.printing .line .content
68 | {
69 | border: 0 !important;
70 | }
71 |
72 | /* First line */
73 | .syntaxhighlighter .line.alt1
74 | {
75 | background-color: #fff !important;
76 | }
77 |
78 | /* Second line */
79 | .syntaxhighlighter .line.alt2
80 | {
81 | background-color: #F8F8F8 !important;
82 | }
83 |
84 | .syntaxhighlighter .toolbar
85 | {
86 | background-color: #F8F8F8 !important;
87 | border: #E7E5DC solid 1px !important;
88 | }
89 |
90 | .syntaxhighlighter .toolbar a
91 | {
92 | color: #a0a0a0 !important;
93 | }
94 |
95 | .syntaxhighlighter .toolbar a:hover
96 | {
97 | color: red !important;
98 | }
99 |
100 | /************************************
101 | * Actual syntax highlighter colors.
102 | ************************************/
103 | .syntaxhighlighter .plain,
104 | .syntaxhighlighter .plain a
105 | {
106 | color: #000 !important;
107 | }
108 |
109 | .syntaxhighlighter .comments,
110 | .syntaxhighlighter .comments a
111 | {
112 | color: #008200 !important;
113 | }
114 |
115 | .syntaxhighlighter .string,
116 | .syntaxhighlighter .string a
117 | {
118 | color: blue !important;
119 | }
120 |
121 | .syntaxhighlighter .keyword
122 | {
123 | color: #069 !important;
124 | font-weight: bold !important;
125 | }
126 |
127 | .syntaxhighlighter .preprocessor
128 | {
129 | color: gray !important;
130 | }
131 |
132 | .syntaxhighlighter .variable
133 | {
134 | color: #a70 !important;
135 | }
136 |
137 | .syntaxhighlighter .value
138 | {
139 | color: #090 !important;
140 | }
141 |
142 | .syntaxhighlighter .functions
143 | {
144 | color: #ff1493 !important;
145 | }
146 |
147 | .syntaxhighlighter .constants
148 | {
149 | color: #0066CC !important;
150 | }
151 |
152 | .syntaxhighlighter .script
153 | {
154 | background-color: yellow !important;
155 | }
156 |
157 | .syntaxhighlighter .color1,
158 | .syntaxhighlighter .color1 a
159 | {
160 | color: #808080 !important;
161 | }
162 |
163 | .syntaxhighlighter .color2,
164 | .syntaxhighlighter .color2 a
165 | {
166 | color: #ff1493 !important;
167 | }
168 |
169 | .syntaxhighlighter .color3,
170 | .syntaxhighlighter .color3 a
171 | {
172 | color: red !important;
173 | }
174 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/shThemeDjango.css:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | /**
31 | * Django SyntaxHighlighter theme
32 | */
33 |
34 | /************************************
35 | * Interface elements.
36 | ************************************/
37 |
38 | .syntaxhighlighter
39 | {
40 | background-color: #0B2F20 !important;
41 | }
42 |
43 | /* Gutter line numbers */
44 | .syntaxhighlighter .line .number
45 | {
46 | color: #497958 !important;
47 | }
48 |
49 | /* Add border to the lines */
50 | .syntaxhighlighter .line .content
51 | {
52 | border-left: 3px solid #41A83E !important;
53 | color: #B9BDB6 !important;
54 | }
55 |
56 | .syntaxhighlighter.printing .line .content
57 | {
58 | border: 0 !important;
59 | }
60 |
61 | /* First line */
62 | .syntaxhighlighter .line.alt1
63 | {
64 | }
65 |
66 | /* Second line */
67 | .syntaxhighlighter .line.alt2
68 | {
69 | background-color: #0a2b1d !important;
70 | }
71 |
72 | /* Highlighed line number */
73 | .syntaxhighlighter .line.highlighted .number
74 | {
75 | background-color: #336442 !important;
76 | color: #fff !important;
77 | }
78 |
79 | /* Highlighed line */
80 | .syntaxhighlighter .line.highlighted.alt1,
81 | .syntaxhighlighter .line.highlighted.alt2
82 | {
83 | background-color: #336442 !important;
84 | }
85 |
86 | .syntaxhighlighter .toolbar
87 | {
88 | background-color: #245032 !important;
89 | border: #0B2F20 solid 1px !important;
90 | }
91 |
92 | .syntaxhighlighter .toolbar a
93 | {
94 | color: #C4B14A !important;
95 | }
96 |
97 | .syntaxhighlighter .toolbar a:hover
98 | {
99 | color: #FFE862 !important;
100 | }
101 |
102 | /************************************
103 | * Actual syntax highlighter colors.
104 | ************************************/
105 | .syntaxhighlighter .plain,
106 | .syntaxhighlighter .plain a
107 | {
108 | color: #F8F8F8 !important;
109 | }
110 |
111 | .syntaxhighlighter .comments,
112 | .syntaxhighlighter .comments a
113 | {
114 | color: #336442 !important;
115 | font-style: italic !important;
116 | }
117 |
118 | .syntaxhighlighter .string,
119 | .syntaxhighlighter .string a
120 | {
121 | color: #9DF39F !important;
122 | }
123 |
124 | .syntaxhighlighter .keyword
125 | {
126 | color: #96DD3B !important;
127 | font-weight: bold !important;
128 | }
129 |
130 | .syntaxhighlighter .preprocessor
131 | {
132 | color: #91BB9E !important;
133 | }
134 |
135 | .syntaxhighlighter .variable
136 | {
137 | color: #FFAA3E !important;
138 | }
139 |
140 | .syntaxhighlighter .value
141 | {
142 | color: #F7E741 !important;
143 | }
144 |
145 | .syntaxhighlighter .functions
146 | {
147 | color: #FFAA3E !important;
148 | }
149 |
150 | .syntaxhighlighter .constants
151 | {
152 | color: #E0E8FF !important;
153 | }
154 |
155 | .syntaxhighlighter .script
156 | {
157 | background-color: #497958 !important;
158 | }
159 |
160 | .syntaxhighlighter .color1,
161 | .syntaxhighlighter .color1 a
162 | {
163 | color: #EB939A !important;
164 | }
165 |
166 | .syntaxhighlighter .color2,
167 | .syntaxhighlighter .color2 a
168 | {
169 | color: #91BB9E !important;
170 | }
171 |
172 | .syntaxhighlighter .color3,
173 | .syntaxhighlighter .color3 a
174 | {
175 | color: #EDEF7D !important;
176 | }
177 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/shThemeEclipse.css:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | /**
31 | * Eclipse IDE SyntaxHighlighter color theme
32 | * (C) Code-House
33 | * http://blog.code-house.org/2009/10/xml-i-adnotacje-kod-ogolnego-przeznaczenia-i-jpa/
34 | */
35 |
36 | .syntaxhighlighter
37 | {
38 | background-color: #fff !important;
39 | }
40 |
41 | /* Highlighed line number */
42 | .syntaxhighlighter .line.highlighted .number
43 | {
44 | background-color: #c3defe !important;
45 | }
46 |
47 | /* Highlighed line */
48 | .syntaxhighlighter .line.highlighted.alt1,
49 | .syntaxhighlighter .line.highlighted.alt2
50 | {
51 | background-color: #c3defe !important;
52 | }
53 |
54 | /* Gutter line numbers */
55 | .syntaxhighlighter .line .number
56 | {
57 | color: #787878 !important;
58 | background-color: #fff !important;
59 | }
60 |
61 | /* Add border to the lines */
62 | .syntaxhighlighter .line .content
63 | {
64 | border-left: 1px solid #d4d0c8 !important;
65 | color: #000 !important;
66 | }
67 |
68 | .syntaxhighlighter.printing .line .content
69 | {
70 | border: 0 !important;
71 | }
72 |
73 | /* First line */
74 | .syntaxhighlighter .line.alt1
75 | {
76 | background-color: #fff !important;
77 | }
78 |
79 | /* Second line */
80 | .syntaxhighlighter .line.alt2
81 | {
82 | background-color: #fff !important;
83 | }
84 |
85 | .syntaxhighlighter .toolbar
86 | {
87 | background-color: #F8F8F8 !important;
88 | border: #E7E5DC solid 1px !important;
89 | }
90 |
91 | .syntaxhighlighter .toolbar a
92 | {
93 | color: #a0a0a0 !important;
94 | }
95 |
96 | .syntaxhighlighter .toolbar a:hover
97 | {
98 | color: red !important;
99 | }
100 |
101 | /************************************
102 | * Actual syntax highlighter colors.
103 | ************************************/
104 | .syntaxhighlighter .plain,
105 | .syntaxhighlighter .plain a
106 | {
107 | color: #000 !important;
108 | }
109 |
110 | .syntaxhighlighter .comments,
111 | .syntaxhighlighter .comments a
112 | {
113 | color: #3f5fbf !important;
114 | }
115 |
116 | .syntaxhighlighter .string,
117 | .syntaxhighlighter .string a
118 | {
119 | color: #2a00ff !important;
120 | }
121 |
122 | .syntaxhighlighter .keyword
123 | {
124 | color: #7f0055 !important;
125 | font-weight: bold !important;
126 | }
127 |
128 | .syntaxhighlighter .preprocessor
129 | {
130 | color: #646464 !important;
131 | }
132 |
133 | .syntaxhighlighter .variable
134 | {
135 | color: #a70 !important;
136 | }
137 |
138 | .syntaxhighlighter .value
139 | {
140 | color: #090 !important;
141 | }
142 |
143 | .syntaxhighlighter .functions
144 | {
145 | color: #ff1493 !important;
146 | }
147 |
148 | .syntaxhighlighter .constants
149 | {
150 | color: #0066CC !important;
151 | }
152 |
153 | .syntaxhighlighter .script
154 | {
155 | background-color: yellow !important;
156 | }
157 |
158 | .syntaxhighlighter .color1,
159 | .syntaxhighlighter .color1 a
160 | {
161 | color: #808080 !important;
162 | }
163 |
164 | .syntaxhighlighter .color2,
165 | .syntaxhighlighter .color2 a
166 | {
167 | color: #ff1493 !important;
168 | }
169 |
170 | .syntaxhighlighter .color3,
171 | .syntaxhighlighter .color3 a
172 | {
173 | color: red !important;
174 | }
175 |
176 |
177 | .xml .keyword {
178 | color: #3f7f7f !important;
179 | font-weight: normal !important;
180 | }
181 |
182 | .xml .color1,
183 | .xml .color1 a{
184 | color: #7f007f !important;
185 | }
186 |
187 | .xml .string {
188 | font-style: italic !important;
189 | color: #2a00ff !important;
190 | }
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/shThemeEmacs.css:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | /**
31 | * Emacs SyntaxHighlighter theme based on theme by Joshua Emmons
32 | * http://www.skia.net/
33 | */
34 |
35 | /************************************
36 | * Interface elements.
37 | ************************************/
38 |
39 | .syntaxhighlighter
40 | {
41 | background-color: #000000 !important;
42 | }
43 |
44 | /* Gutter line numbers */
45 | .syntaxhighlighter .line .number
46 | {
47 | color: #D3D3D3 !important;
48 | }
49 |
50 | /* Add border to the lines */
51 | .syntaxhighlighter .line .content
52 | {
53 | border-left: 3px solid #990000 !important;
54 | color: #B9BDB6 !important;
55 | }
56 |
57 | .syntaxhighlighter.printing .line .content
58 | {
59 | border: 0 !important;
60 | }
61 |
62 | /* First line */
63 | .syntaxhighlighter .line.alt1
64 | {
65 | }
66 |
67 | /* Second line */
68 | .syntaxhighlighter .line.alt2
69 | {
70 | background-color: #0f0f0f !important;
71 | }
72 |
73 | /* Highlighed line number */
74 | .syntaxhighlighter .line.highlighted .number
75 | {
76 | background-color: #435A5F !important;
77 | color: #fff !important;
78 | }
79 |
80 | /* Highlighed line */
81 | .syntaxhighlighter .line.highlighted.alt1,
82 | .syntaxhighlighter .line.highlighted.alt2
83 | {
84 | background-color: #435A5F !important;
85 | }
86 |
87 | .syntaxhighlighter .toolbar
88 | {
89 | background-color: #000000 !important;
90 | border: #000000 solid 1px !important;
91 | }
92 |
93 | .syntaxhighlighter .toolbar a
94 | {
95 | color: #646763 !important;
96 | }
97 |
98 | .syntaxhighlighter .toolbar a:hover
99 | {
100 | color: #9CCFF4 !important;
101 | }
102 |
103 | /************************************
104 | * Actual syntax highlighter colors.
105 | ************************************/
106 | .syntaxhighlighter .plain,
107 | .syntaxhighlighter .plain a
108 | {
109 | color: #D3D3D3 !important;
110 | }
111 |
112 | .syntaxhighlighter .comments,
113 | .syntaxhighlighter .comments a
114 | {
115 | color: #FF7D27 !important;
116 | }
117 |
118 | .syntaxhighlighter .string,
119 | .syntaxhighlighter .string a
120 | {
121 | color: #FF9E7B !important;
122 | }
123 |
124 | .syntaxhighlighter .keyword
125 | {
126 | color: #00FFFF !important;
127 | }
128 |
129 | .syntaxhighlighter .preprocessor
130 | {
131 | color: #AEC4DE !important;
132 | }
133 |
134 | .syntaxhighlighter .variable
135 | {
136 | color: #FFAA3E !important;
137 | }
138 |
139 | .syntaxhighlighter .value
140 | {
141 | color: #090 !important;
142 | }
143 |
144 | .syntaxhighlighter .functions
145 | {
146 | color: #81CEF9 !important;
147 | }
148 |
149 | .syntaxhighlighter .constants
150 | {
151 | color: #FF9E7B !important;
152 | }
153 |
154 | .syntaxhighlighter .script
155 | {
156 | background-color: #990000 !important;
157 | }
158 |
159 | .syntaxhighlighter .color1,
160 | .syntaxhighlighter .color1 a
161 | {
162 | color: #EBDB8D !important;
163 | }
164 |
165 | .syntaxhighlighter .color2,
166 | .syntaxhighlighter .color2 a
167 | {
168 | color: #FF7D27 !important;
169 | }
170 |
171 | .syntaxhighlighter .color3,
172 | .syntaxhighlighter .color3 a
173 | {
174 | color: #AEC4DE !important;
175 | }
176 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/shThemeFadeToGrey.css:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | /**
31 | * Fade to Grey SyntaxHighlighter theme based on theme by Brasten Sager
32 | * http://www.ibrasten.com/
33 | */
34 |
35 | /************************************
36 | * Interface elements.
37 | ************************************/
38 |
39 | .syntaxhighlighter
40 | {
41 | background-color: #121212 !important;
42 | }
43 |
44 | /* Gutter line numbers */
45 | .syntaxhighlighter .line .number
46 | {
47 | color: #C3C3C3 !important;
48 | }
49 |
50 | /* Add border to the lines */
51 | .syntaxhighlighter .line .content
52 | {
53 | border-left: 3px solid #3185B9 !important;
54 | color: #B9BDB6 !important;
55 | }
56 |
57 | .syntaxhighlighter.printing .line .content
58 | {
59 | border: 0 !important;
60 | }
61 |
62 | /* First line */
63 | .syntaxhighlighter .line.alt1
64 | {
65 | }
66 |
67 | /* Second line */
68 | .syntaxhighlighter .line.alt2
69 | {
70 | background-color: #000000 !important;
71 | }
72 |
73 | /* Highlighed line number */
74 | .syntaxhighlighter .line.highlighted .number
75 | {
76 | background-color: #3A3A00 !important;
77 | color: #fff !important;
78 | }
79 |
80 | /* Highlighed line */
81 | .syntaxhighlighter .line.highlighted.alt1,
82 | .syntaxhighlighter .line.highlighted.alt2
83 | {
84 | background-color: #3A3A00 !important;
85 | }
86 |
87 | .syntaxhighlighter .toolbar
88 | {
89 | background-color: #000000 !important;
90 | border: #000000 solid 1px !important;
91 | }
92 |
93 | .syntaxhighlighter .toolbar a
94 | {
95 | color: #808080 !important;
96 | }
97 |
98 | .syntaxhighlighter .toolbar a:hover
99 | {
100 | color: #96DAFF !important;
101 | }
102 |
103 | /************************************
104 | * Actual syntax highlighter colors.
105 | ************************************/
106 | .syntaxhighlighter .plain,
107 | .syntaxhighlighter .plain a
108 | {
109 | color: #FFFFFF !important;
110 | }
111 |
112 | .syntaxhighlighter .comments,
113 | .syntaxhighlighter .comments a
114 | {
115 | color: #696854 !important;
116 | }
117 |
118 | .syntaxhighlighter .string,
119 | .syntaxhighlighter .string a
120 | {
121 | color: #E3E658 !important;
122 | }
123 |
124 | .syntaxhighlighter .keyword
125 | {
126 | color: #D01D33 !important;
127 | }
128 |
129 | .syntaxhighlighter .preprocessor
130 | {
131 | color: #435A5F !important;
132 | }
133 |
134 | .syntaxhighlighter .variable
135 | {
136 | color: #898989 !important;
137 | }
138 |
139 | .syntaxhighlighter .value
140 | {
141 | color: #090 !important;
142 | }
143 |
144 | .syntaxhighlighter .functions
145 | {
146 | color: #AAAAAA !important;
147 | font-weight: bold !important;
148 | }
149 |
150 | .syntaxhighlighter .constants
151 | {
152 | color: #96DAFF !important;
153 | }
154 |
155 | .syntaxhighlighter .script
156 | {
157 | background-color: #C3C3C3 !important;
158 | color: #000 !important;
159 | }
160 |
161 | .syntaxhighlighter .color1,
162 | .syntaxhighlighter .color1 a
163 | {
164 | color: #FFC074 !important;
165 | }
166 |
167 | .syntaxhighlighter .color2,
168 | .syntaxhighlighter .color2 a
169 | {
170 | color: #4A8CDB !important;
171 | }
172 |
173 | .syntaxhighlighter .color3,
174 | .syntaxhighlighter .color3 a
175 | {
176 | color: #96DAFF !important;
177 | }
178 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/shThemeMidnight.css:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | /**
31 | * Midnight SyntaxHighlighter theme based on theme by J.D. Myers
32 | * http://webdesign.lsnjd.com/
33 | */
34 |
35 | /************************************
36 | * Interface elements.
37 | ************************************/
38 |
39 | .syntaxhighlighter
40 | {
41 | background-color: #0F192A !important;
42 | }
43 |
44 | /* Gutter line numbers */
45 | .syntaxhighlighter .line .number
46 | {
47 | color: #38566F !important;
48 | }
49 |
50 | /* Add border to the lines */
51 | .syntaxhighlighter .line .content
52 | {
53 | border-left: 3px solid #435A5F !important;
54 | color: #B9BDB6 !important;
55 | }
56 |
57 | .syntaxhighlighter.printing .line .content
58 | {
59 | border: 0 !important;
60 | }
61 |
62 | /* First line */
63 | .syntaxhighlighter .line.alt1
64 | {
65 | background-color: #0F192A !important;
66 | }
67 |
68 | /* Second line */
69 | .syntaxhighlighter .line.alt2
70 | {
71 | background-color: #0F192A !important;
72 | }
73 |
74 | /* Highlighed line number */
75 | .syntaxhighlighter .line.highlighted .number
76 | {
77 | background-color: #253E5A !important;
78 | color: #fff !important;
79 | }
80 |
81 | /* Highlighed line */
82 | .syntaxhighlighter .line.highlighted.alt1,
83 | .syntaxhighlighter .line.highlighted.alt2
84 | {
85 | background-color: #253E5A !important;
86 | }
87 |
88 | .syntaxhighlighter .toolbar
89 | {
90 | background-color: #0F192A !important;
91 | }
92 |
93 | .syntaxhighlighter .toolbar a
94 | {
95 | color: #38566F !important;
96 | }
97 |
98 | .syntaxhighlighter .toolbar a:hover
99 | {
100 | color: #8AA6C1 !important;
101 | }
102 |
103 | /************************************
104 | * Actual syntax highlighter colors.
105 | ************************************/
106 | .syntaxhighlighter .plain,
107 | .syntaxhighlighter .plain a
108 | {
109 | color: #D1EDFF !important;
110 | }
111 |
112 | .syntaxhighlighter .comments,
113 | .syntaxhighlighter .comments a
114 | {
115 | color: #428BDD !important;
116 | }
117 |
118 | .syntaxhighlighter .string,
119 | .syntaxhighlighter .string a
120 | {
121 | color: #1DC116 !important;
122 | }
123 |
124 | .syntaxhighlighter .keyword
125 | {
126 | color: #B43D3D !important;
127 | }
128 |
129 | .syntaxhighlighter .preprocessor
130 | {
131 | color: #8AA6C1 !important;
132 | }
133 |
134 | .syntaxhighlighter .variable
135 | {
136 | color: #FFAA3E !important;
137 | }
138 |
139 | .syntaxhighlighter .value
140 | {
141 | color: #F7E741 !important;
142 | }
143 |
144 | .syntaxhighlighter .functions
145 | {
146 | color: #FFAA3E !important;
147 | }
148 |
149 | .syntaxhighlighter .constants
150 | {
151 | color: #E0E8FF !important;
152 | }
153 |
154 | .syntaxhighlighter .script
155 | {
156 | background-color: #404040 !important;
157 | }
158 |
159 | .syntaxhighlighter .color1,
160 | .syntaxhighlighter .color1 a
161 | {
162 | color: #F8BB00 !important;
163 | }
164 |
165 | .syntaxhighlighter .color2,
166 | .syntaxhighlighter .color2 a
167 | {
168 | color: #FFFFFF !important;
169 | }
170 |
171 | .syntaxhighlighter .color3,
172 | .syntaxhighlighter .color3 a
173 | {
174 | color: #FFAA3E !important;
175 | }
176 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/styles/shThemeRDark.css:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 | *
8 | * @version
9 | * 2.1.364 (October 15 2009)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * @license
15 | * This file is part of SyntaxHighlighter.
16 | *
17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 | * it under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation, either version 3 of the License, or
20 | * (at your option) any later version.
21 | *
22 | * SyntaxHighlighter is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | * GNU General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with SyntaxHighlighter. If not, see .
29 | */
30 | /**
31 | * RDark SyntaxHighlighter theme based on theme by Radu Dineiu
32 | * http://www.vim.org/scripts/script.php?script_id=1732
33 | */
34 |
35 | /************************************
36 | * Interface elements.
37 | ************************************/
38 |
39 | .syntaxhighlighter
40 | {
41 | background-color: #1B2426 !important;
42 | }
43 |
44 | /* Gutter line numbers */
45 | .syntaxhighlighter .line .number
46 | {
47 | color: #B9BDB6 !important;
48 | }
49 |
50 | /* Add border to the lines */
51 | .syntaxhighlighter .line .content
52 | {
53 | border-left: 3px solid #435A5F !important;
54 | color: #B9BDB6 !important;
55 | }
56 |
57 | .syntaxhighlighter.printing .line .content
58 | {
59 | border: 0 !important;
60 | }
61 |
62 | /* First line */
63 | .syntaxhighlighter .line.alt1
64 | {
65 | background-color: #1B2426 !important;
66 | }
67 |
68 | /* Second line */
69 | .syntaxhighlighter .line.alt2
70 | {
71 | background-color: #1B2426 !important;
72 | }
73 |
74 | /* Highlighed line number */
75 | .syntaxhighlighter .line.highlighted .number
76 | {
77 | background-color: #435A5F !important;
78 | color: #fff !important;
79 | }
80 |
81 | /* Highlighed line */
82 | .syntaxhighlighter .line.highlighted.alt1,
83 | .syntaxhighlighter .line.highlighted.alt2
84 | {
85 | background-color: #435A5F !important;
86 | }
87 |
88 | .syntaxhighlighter .toolbar
89 | {
90 | background-color: #1B2426 !important;
91 | }
92 |
93 | .syntaxhighlighter .toolbar a
94 | {
95 | color: #646763 !important;
96 | }
97 |
98 | .syntaxhighlighter .toolbar a:hover
99 | {
100 | color: #E0E8FF !important;
101 | }
102 |
103 | /************************************
104 | * Actual syntax highlighter colors.
105 | ************************************/
106 | .syntaxhighlighter .plain,
107 | .syntaxhighlighter .plain a
108 | {
109 | color: #B9BDB6 !important;
110 | }
111 |
112 | .syntaxhighlighter .comments,
113 | .syntaxhighlighter .comments a
114 | {
115 | color: #878A85 !important;
116 | }
117 |
118 | .syntaxhighlighter .string,
119 | .syntaxhighlighter .string a
120 | {
121 | color: #5CE638 !important;
122 | }
123 |
124 | .syntaxhighlighter .keyword
125 | {
126 | color: #5BA1CF !important;
127 | }
128 |
129 | .syntaxhighlighter .preprocessor
130 | {
131 | color: #435A5F !important;
132 | }
133 |
134 | .syntaxhighlighter .variable
135 | {
136 | color: #FFAA3E !important;
137 | }
138 |
139 | .syntaxhighlighter .value
140 | {
141 | color: #090 !important;
142 | }
143 |
144 | .syntaxhighlighter .functions
145 | {
146 | color: #FFAA3E !important;
147 | }
148 |
149 | .syntaxhighlighter .constants
150 | {
151 | color: #E0E8FF !important;
152 | }
153 |
154 | .syntaxhighlighter .script
155 | {
156 | background-color: #435A5F !important;
157 | }
158 |
159 | .syntaxhighlighter .color1,
160 | .syntaxhighlighter .color1 a
161 | {
162 | color: #E0E8FF !important;
163 | }
164 |
165 | .syntaxhighlighter .color2,
166 | .syntaxhighlighter .color2 a
167 | {
168 | color: #FFFFFF !important;
169 | }
170 |
171 | .syntaxhighlighter .color3,
172 | .syntaxhighlighter .color3 a
173 | {
174 | color: #FFAA3E !important;
175 | }
176 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/wxParse.js:
--------------------------------------------------------------------------------
1 | /**
2 | * author: Di (微信小程序开发工程师)
3 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
4 | * 垂直微信小程序开发交流社区
5 | *
6 | * github地址: https://github.com/icindy/wxParse
7 | *
8 | * for: 微信小程序富文本解析
9 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
10 | */
11 |
12 | /**
13 | * utils函数引入
14 | **/
15 | var showdown = require('./showdown.js');
16 | // import showdown from './showdown.js';
17 | // import HtmlToJson from './html2json.js';
18 | var HtmlToJson = require('./html2json.js')
19 | /**
20 | * 配置及公有属性
21 | **/
22 | /**
23 | * 主函数入口区
24 | **/
25 | function wxParse(bindName = 'wxParseData', type='html', data='数据不能为空
', target,imagePadding) {
26 | var that = target;
27 | var transData = {};//存放转化后的数据
28 | if (type == 'html') {
29 | transData = HtmlToJson.html2json(data, bindName);
30 | console.log(JSON.stringify(transData, ' ', ' '));
31 | } else if (type == 'md' || type == 'markdown') {
32 | var converter = new showdown.Converter();
33 | var html = converter.makeHtml(data);
34 | transData = HtmlToJson.html2json(html, bindName);
35 | console.log(JSON.stringify(transData, ' ', ' '));
36 | }
37 | transData.view = {};
38 | transData.view.imagePadding = 0;
39 | if(typeof(imagePadding) != 'undefined'){
40 | transData.view.imagePadding = imagePadding
41 | }
42 | var bindData = {};
43 | bindData[bindName] = transData;
44 | that.setData(bindData)
45 | that.wxParseImgLoad = wxParseImgLoad;
46 | that.wxParseImgTap = wxParseImgTap;
47 | }
48 | // 图片点击事件
49 | function wxParseImgTap(e) {
50 | var that = this;
51 | var nowImgUrl = e.target.dataset.src;
52 | var tagFrom = e.target.dataset.from;
53 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
54 | wx.previewImage({
55 | current: nowImgUrl, // 当前显示图片的http链接
56 | urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表
57 | })
58 | }
59 | }
60 |
61 | /**
62 | * 图片视觉宽高计算函数区
63 | **/
64 | function wxParseImgLoad(e) {
65 | var that = this;
66 | var tagFrom = e.target.dataset.from;
67 | var idx = e.target.dataset.idx;
68 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
69 | calMoreImageInfo(e, idx, that, tagFrom)
70 | }
71 | }
72 | // 假循环获取计算图片视觉最佳宽高
73 | function calMoreImageInfo(e, idx, that, bindName) {
74 | var temData = that.data[bindName];
75 | if (temData.images.length == 0) {
76 | return;
77 | }
78 | var temImages = temData.images;
79 | //因为无法获取view宽度 需要自定义padding进行计算,稍后处理
80 | var recal = wxAutoImageCal(e.detail.width, e.detail.height,that,bindName);
81 | temImages[idx].width = recal.imageWidth;
82 | temImages[idx].height = recal.imageheight;
83 | temData.images = temImages;
84 | var bindData = {};
85 | bindData[bindName] = temData;
86 | that.setData(bindData);
87 | }
88 |
89 | // 计算视觉优先的图片宽高
90 | function wxAutoImageCal(originalWidth, originalHeight,that,bindName) {
91 | //获取图片的原始长宽
92 | var windowWidth = 0, windowHeight = 0;
93 | var autoWidth = 0, autoHeight = 0;
94 | var results = {};
95 | wx.getSystemInfo({
96 | success: function (res) {
97 | var padding = that.data[bindName].view.imagePadding;
98 | windowWidth = res.windowWidth-2*padding;
99 | windowHeight = res.windowHeight;
100 | //判断按照那种方式进行缩放
101 | console.log("windowWidth" + windowWidth);
102 | if (originalWidth > windowWidth) {//在图片width大于手机屏幕width时候
103 | autoWidth = windowWidth;
104 | console.log("autoWidth" + autoWidth);
105 | autoHeight = (autoWidth * originalHeight) / originalWidth;
106 | console.log("autoHeight" + autoHeight);
107 | results.imageWidth = autoWidth;
108 | results.imageheight = autoHeight;
109 | } else {//否则展示原来的数据
110 | results.imageWidth = originalWidth;
111 | results.imageheight = originalHeight;
112 | }
113 | }
114 | })
115 | return results;
116 | }
117 |
118 | function wxParseTemArray(temArrayName,bindNameReg,total,that){
119 | var array = [];
120 | var temData = that.data;
121 | var obj = null;
122 | for(var i = 0; i < total; i++){
123 | var simArr = temData[bindNameReg+i].nodes;
124 | array.push(simArr);
125 | }
126 |
127 | temArrayName = temArrayName || 'wxParseTemArray';
128 | obj = JSON.parse('{"'+ temArrayName +'":""}');
129 | obj[temArrayName] = array;
130 | that.setData(obj);
131 | }
132 |
133 | /**
134 | * 配置emojis
135 | *
136 | */
137 |
138 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
139 | HtmlToJson.emojisInit(reg,baseSrc,emojis);
140 | }
141 |
142 | module.exports = {
143 | wxParse: wxParse,
144 | wxParseTemArray:wxParseTemArray,
145 | emojisInit:emojisInit
146 | }
147 |
148 |
149 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxParse/wxParse.wxss:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * author: Di (微信小程序开发工程师)
4 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
5 | * 垂直微信小程序开发交流社区
6 | *
7 | * github地址: https://github.com/icindy/wxParse
8 | *
9 | * for: 微信小程序富文本解析
10 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
11 | */
12 |
13 | .wxParse{
14 | margin: 0 5px;
15 | font-family: Helvetica,sans-serif;
16 | font-size: 28rpx;
17 | color: #666;
18 | line-height: 1.8;
19 | }
20 | view{
21 | word-break:break-all; overflow:auto;
22 | }
23 | .wxParse-inline{
24 | display: inline;
25 | margin: 0;
26 | padding: 0;
27 | }
28 | /*//标题 */
29 | .wxParse-div{margin: 0;padding: 0;}
30 | .wxParse-h1{ font-size:2em; margin: .67em 0 }
31 | .wxParse-h2{ font-size:1.5em; margin: .75em 0 }
32 | .wxParse-h3{ font-size:1.17em; margin: .83em 0 }
33 | .wxParse-h4{ margin: 1.12em 0}
34 | .wxParse-h5 { font-size:.83em; margin: 1.5em 0 }
35 | .wxParse-h6{ font-size:.75em; margin: 1.67em 0 }
36 |
37 | .wxParse-h1 {
38 | font-size: 18px;
39 | font-weight: 400;
40 | margin-bottom: .9em;
41 | }
42 | .wxParse-h2 {
43 | font-size: 16px;
44 | font-weight: 400;
45 | margin-bottom: .34em;
46 | }
47 | .wxParse-h3 {
48 | font-weight: 400;
49 | font-size: 15px;
50 | margin-bottom: .34em;
51 | }
52 | .wxParse-h4 {
53 | font-weight: 400;
54 | font-size: 14px;
55 | margin-bottom: .24em;
56 | }
57 | .wxParse-h5 {
58 | font-weight: 400;
59 | font-size: 13px;
60 | margin-bottom: .14em;
61 | }
62 | .wxParse-h6 {
63 | font-weight: 400;
64 | font-size: 12px;
65 | margin-bottom: .04em;
66 | }
67 |
68 | .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder }
69 |
70 | .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
71 | .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
72 | .wxParse-pre{white-space:pre}
73 | .wxParse-big{font-size:1.17em}
74 | .wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}
75 | .wxParse-sub{vertical-align:sub}
76 | .wxParse-sup{vertical-align:super}
77 | .wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}
78 | /*wxparse-自定义个性化的css样式*/
79 | /*增加video的css样式*/
80 | .wxParse-strong,.wxParse-s{display: inline}
81 | .wxParse-a{
82 | color: deepskyblue;
83 | word-break:break-all;
84 | overflow:auto;
85 | }
86 |
87 | .wxParse-video{
88 | text-align: center;
89 | margin: 10px 0;
90 | }
91 |
92 | .wxParse-video-video{
93 | width:100%;
94 | }
95 |
96 | .wxParse-img{
97 | background-color: #efefef;
98 | overflow: hidden;
99 | }
100 |
101 | .wxParse-blockquote {
102 | margin: 0;
103 | padding:10px 0 10px 5px;
104 | font-family:Courier, Calibri,"宋体";
105 | background:#f5f5f5;
106 | border-left: 3px solid #dbdbdb;
107 | }
108 |
109 | .wxParse-code,.wxParse-wxxxcode-style{
110 | display: inline;
111 | background:#f5f5f5;
112 | }
113 | .wxParse-ul{
114 | margin: 20rpx 10rpx;
115 | }
116 |
117 | .wxParse-li,.wxParse-li-inner{
118 | display: flex;
119 | align-items: baseline;
120 | margin: 10rpx 0;
121 | }
122 | .wxParse-li-text{
123 |
124 | align-items: center;
125 | line-height: 20px;
126 | }
127 |
128 | .wxParse-li-circle{
129 | display: inline-flex;
130 | width: 5px;
131 | height: 5px;
132 | background-color: #333;
133 | margin-right: 5px;
134 | }
135 |
136 | .wxParse-li-square{
137 | display: inline-flex;
138 | width: 10rpx;
139 | height: 10rpx;
140 | background-color: #333;
141 | margin-right: 5px;
142 | }
143 | .wxParse-li-ring{
144 | display: inline-flex;
145 | width: 10rpx;
146 | height: 10rpx;
147 | border: 2rpx solid #333;
148 | border-radius: 50%;
149 | background-color: #fff;
150 | margin-right: 5px;
151 | }
152 |
153 | /*.wxParse-table{
154 | width: 100%;
155 | height: 400px;
156 | }
157 | .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
158 | display: flex;
159 | flex-direction: row;
160 | }
161 | .wxParse-th,.wxParse-td{
162 | display: flex;
163 | width: 580px;
164 | overflow: auto;
165 | }*/
166 |
167 | .wxParse-u {
168 | text-decoration: underline;
169 | }
170 | .wxParse-hide{
171 | display: none;
172 | }
173 | .WxEmojiView{
174 | align-items: center;
175 | }
176 | .wxEmoji{
177 | width: 16px;
178 | height:16px;
179 | }
180 | .wxParse-tr{
181 | display: flex;
182 | border-right:1px solid #e0e0e0;
183 | border-bottom:1px solid #e0e0e0;
184 | border-top:1px solid #e0e0e0;
185 | }
186 | .wxParse-th,
187 | .wxParse-td{
188 | flex:1;
189 | padding:5px;
190 | font-size:28rpx;
191 | border-left:1px solid #e0e0e0;
192 | word-break: break-all;
193 | }
194 | .wxParse-td:last{
195 | border-top:1px solid #e0e0e0;
196 | }
197 | .wxParse-th{
198 | background:#f0f0f0;
199 | border-top:1px solid #e0e0e0;
200 | }
201 |
202 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxSearch/images/wxSearch-icon-delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/WeChatMiniApp/wxSearch/images/wxSearch-icon-delete.png
--------------------------------------------------------------------------------
/WeChatMiniApp/wxSearch/wxSearch.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item}}
9 |
10 |
11 |
12 |
13 |
14 | 热门搜索
15 |
16 |
17 | {{item}}
18 |
19 |
20 |
21 |
22 | 搜索历史
23 |
24 |
25 |
26 | {{item}}
27 | 删除
28 |
29 |
30 | 清除历史
31 |
32 |
33 | 搜索历史为空
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/WeChatMiniApp/wxSearch/wxSearch.wxss:
--------------------------------------------------------------------------------
1 | .wxSearch{
2 | position: absolute;
3 | top: 43px;
4 | left: 0;
5 | width: 100%;
6 | height: 100%;
7 | border-top: 1px #eee solid;
8 | background-color: rgba(0, 0, 0, 0.2);
9 | }
10 | .wxSearchInner{
11 | background-color: #fff;
12 | }
13 | .wxSearch-section{
14 | background-color: #fff;
15 | padding: 5px 10px;
16 | border: 1px #eee solid;
17 | }
18 | .wxSearch-pancel{
19 | display: flex;
20 | flex-direction: row;
21 | }
22 | .wxSearch-input{
23 | flex: 8;
24 | background-color: #eee;
25 | padding: 5px 10px;
26 | }
27 | .wxSearch-button{
28 | flex: 1;
29 | border: none !important;
30 | color: cornflowerblue !important;
31 | }
32 |
33 | .wxSearchTitle{
34 | display: block;
35 | padding: 10px 5px 5px 10px;
36 | font-size: 12px;
37 | text-align: center;
38 | }
39 |
40 |
41 | .wxSearchMindKeyItem{
42 | padding: 10px 5px;
43 | border-bottom: 1px solid #eee;
44 | display: flex;
45 | font-size: 14px;
46 | color: cornflowerblue;
47 | }
48 |
49 | .wxSearchKeyList{
50 | display: flex;
51 | flex-direction: row;
52 | flex-wrap: wrap;
53 | }
54 |
55 | .wxSearchKeyItem{
56 | flex: 0 0 20%;
57 | font-size: 14px;
58 | text-align: center;
59 | border: 1px solid #eee;
60 | margin: 5px;
61 | padding: 5px 10px;
62 | border-radius: 5px;
63 | }
64 | .wxSearchHistoryItem{
65 | padding: 10px 5px;
66 | border-bottom: 1px solid #eee;
67 | display: flex;
68 | }
69 | .wxSearchHistoryItemText{
70 | flex: 8;
71 | font-size: 14px;
72 | }
73 | .wxSearchHistoryItemDel{
74 | flex: 1;
75 | font-size: 12px;
76 | text-align: center;
77 | padding: 3px 5px;
78 | border: 1px solid #eee;
79 | border-radius: 5px;
80 | }
81 | .wxSearchHistoryEmpty{
82 | text-align: center;
83 | height: 50px;
84 | line-height: 50px;
85 | font-size: 12px;
86 | }
87 | .wxSearchDeleteAllBtn{
88 | height: 50px;
89 | line-height: 50px;
90 | text-align: center;
91 | font-size: 12px;
92 | }
--------------------------------------------------------------------------------
/img/GT1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/img/GT1.jpeg
--------------------------------------------------------------------------------
/img/GT2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/img/GT2.jpeg
--------------------------------------------------------------------------------
/img/GT3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/img/GT3.jpeg
--------------------------------------------------------------------------------
/img/WebHubGif.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/img/WebHubGif.gif
--------------------------------------------------------------------------------
/img/start.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/img/start.gif
--------------------------------------------------------------------------------
/img/xiaochengxv.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiyouMc/GithubTrending-Mini-Program/ffdeff24deb43873f89873ea790b32a454a1bab7/img/xiaochengxv.jpg
--------------------------------------------------------------------------------