-
{{add .question.Viewnum 1}} 阅读
-
+
{{add .question.Viewnum 1}} 阅读
+
赞 {{if .question.Likenum}}{{.question.Likenum}}{{end}}
diff --git a/template/user/comments.html b/template/user/comments.html
index 5e369325..f06dcefe 100644
--- a/template/user/comments.html
+++ b/template/user/comments.html
@@ -27,7 +27,7 @@
{{end}}
评论了
{{.Objinfo.type_name}}
-
{{substring .Objinfo.title 60 "..."}}
+
{{substring .Objinfo.title 60 "..."}}
{{substring .Content 100 "..."}}
@@ -113,4 +113,4 @@
{{.usernam
});
-{{end}}
\ No newline at end of file
+{{end}}
From a23aa7735addbd4b8ea31e99d58038343637f037 Mon Sep 17 00:00:00 2001
From: xuxinhua
Date: Sun, 6 Mar 2022 22:49:52 +0800
Subject: [PATCH 16/25] =?UTF-8?q?Go=E6=AF=8F=E6=97=A5=E4=B8=80=E9=A2=98?=
=?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/db.sql | 2 +-
template/interview/question.html | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/config/db.sql b/config/db.sql
index e7b1a2a6..5d34735c 100644
--- a/config/db.sql
+++ b/config/db.sql
@@ -845,7 +845,7 @@ CREATE TABLE `interview_question` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`sn` bigint unsigned NOT NULL DEFAULT 0 COMMENT '题目序号,程序生成',
`question` varchar(1022) NOT NULL DEFAULT '' COMMENT '问题',
- `answer` varchar(4094) NOT NULL DEFAULT '' COMMENT '答案',
+ `answer` text NOT NULL COMMENT '答案',
`level` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '问题难易级别:0-低;1-中;2-高',
`viewnum` int unsigned NOT NULL DEFAULT 0 COMMENT '浏览数',
`cmtnum` int unsigned NOT NULL DEFAULT 0 COMMENT '评论数',
diff --git a/template/interview/question.html b/template/interview/question.html
index 2ddd2ed3..45b81295 100644
--- a/template/interview/question.html
+++ b/template/interview/question.html
@@ -102,6 +102,9 @@ 答案解析:
"/rank/view"
];
+var keyprefix = 'interview';
+var objid = {{.question.Id}};
+
$(function(){
loadComments();
From 7a0b063bb67326ebc07645c019786d4e5ba0e203 Mon Sep 17 00:00:00 2001
From: polarisxu
Date: Sun, 13 Mar 2022 10:03:03 +0800
Subject: [PATCH 17/25] bugfix
---
logic/interview_question.go | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/logic/interview_question.go b/logic/interview_question.go
index 5ed603d8..38f8b74e 100644
--- a/logic/interview_question.go
+++ b/logic/interview_question.go
@@ -122,10 +122,9 @@ func (InterviewLogic) UpdateTodayQuestionID() {
defer redis.Close()
id := goutils.MustInt(redis.GET(questionIDKey), 0)
+ id = (id + 1) % (question.Id + 1)
if id == 0 {
id = 1
- } else {
- id = (id + 1) % question.Id
}
redis.SET(questionIDKey, id, 0)
}
From a93e4ae96ddb5de934f67648d09dc32ebe0f65bb Mon Sep 17 00:00:00 2001
From: polarisxu
Date: Sat, 19 Mar 2022 20:24:30 +0800
Subject: [PATCH 18/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20indexing=20=E6=97=B6?=
=?UTF-8?q?=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
model/document.go | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/model/document.go b/model/document.go
index 2b68a02b..0f9cd19c 100644
--- a/model/document.go
+++ b/model/document.go
@@ -11,6 +11,7 @@ import (
"html/template"
"regexp"
"strings"
+ "time"
"github.com/studygolang/studygolang/db"
)
@@ -53,7 +54,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
case *Topic:
viewnum, cmtnum, likenum := 0, 0, 0
if objectExt != nil {
- // 传递过来的是一个 *TopicEx 对象,类型是有的,即时值是 nil,这里也和 nil 是不等
+ // 传递过来的是一个 *TopicEx 对象,类型是有的,即使值是 nil,这里也和 nil 是不等
topicEx := objectExt.(*TopicUpEx)
if topicEx != nil {
viewnum = topicEx.View
@@ -62,11 +63,9 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
}
}
- var sortTime = NewOftenTime()
- if objdoc.Lastreplyuid != 0 {
+ var sortTime = objdoc.Ctime
+ if objdoc.Lastreplyuid != 0 && time.Since(time.Time(sortTime)) < 120*24*time.Hour {
sortTime = objdoc.Lastreplytime
- } else {
- sortTime = objdoc.Ctime
}
userLogin := &UserLogin{}
@@ -102,11 +101,9 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
uid = userLogin.Uid
}
- var sortTime = NewOftenTime()
- if objdoc.Lastreplyuid != 0 {
+ var sortTime = objdoc.Ctime
+ if objdoc.Lastreplyuid != 0 && time.Since(time.Time(sortTime)) < 120*24*time.Hour {
sortTime = objdoc.Lastreplytime
- } else {
- sortTime = objdoc.Ctime
}
document = &Document{
@@ -140,11 +137,9 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
}
}
- var sortTime = NewOftenTime()
- if objdoc.Lastreplyuid != 0 {
+ var sortTime = objdoc.Ctime
+ if objdoc.Lastreplyuid != 0 && time.Since(time.Time(sortTime)) < 120*24*time.Hour {
sortTime = objdoc.Lastreplytime
- } else {
- sortTime = objdoc.Ctime
}
userLogin := &UserLogin{}
@@ -174,11 +169,9 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
userLogin := &UserLogin{}
db.MasterDB.Where("username=?", objdoc.Username).Get(userLogin)
- var sortTime = NewOftenTime()
- if objdoc.Lastreplyuid != 0 {
+ var sortTime = objdoc.Ctime
+ if objdoc.Lastreplyuid != 0 && time.Since(time.Time(sortTime)) < 120*24*time.Hour {
sortTime = objdoc.Lastreplytime
- } else {
- sortTime = objdoc.Ctime
}
document = &Document{
From fe3270c99a03f759a18b4b36227189fee5e0ecea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BE=90=E6=96=B0=E5=8D=8E?=
Date: Sat, 4 Mar 2023 10:29:46 +0800
Subject: [PATCH 19/25] modify cdn
---
.air.conf | 2 +-
cmd/server.go | 1 +
docker-compose.yml | 8 +-
global/app.go | 4 +-
sg.service | 13 +
static/dist/js/sg_libs.js | 814 +++++++++---------
static/dist/js/sg_libs.min.js | 2 +-
static/js/libs/jquery.githubRepoWidget.min.js | 2 +-
template/articles/detail.html | 2 +-
template/atom.html | 2 +-
template/books/detail.html | 4 +-
template/books/list.html | 2 +-
template/rich/add.html | 4 +-
13 files changed, 435 insertions(+), 425 deletions(-)
create mode 100644 sg.service
diff --git a/.air.conf b/.air.conf
index ba3cff6e..c29c615d 100644
--- a/.air.conf
+++ b/.air.conf
@@ -19,7 +19,7 @@ log = "air_errors.log"
# Watch these filename extensions.
include_ext = ["go", "tpl", "tmpl", "html"]
# Ignore these filename extensions or directories.
-exclude_dir = ["log", "tmp", "vendor", "node_modules", "template", "static", "docs", "bin", "sitemap", "data", "config", "pid"]
+exclude_dir = ["log", "tmp", "vendor", "node_modules", "template", "static", "docs", "bin", "sitemap", "data", "config", "pid", "docker"]
# There's no necessary to trigger build each time file changes if it's too frequency.
delay = 1000 # ms
diff --git a/cmd/server.go b/cmd/server.go
index af65870c..b2b050cc 100644
--- a/cmd/server.go
+++ b/cmd/server.go
@@ -31,6 +31,7 @@ func IndexingServer() {
}
if *manualIndex {
+ logger.Infoln("manual indexing")
indexing(true)
}
diff --git a/docker-compose.yml b/docker-compose.yml
index 8807d74d..c8cbb7f3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -24,11 +24,7 @@ services:
restart: always
nginx:
container_name: nginx
- build: ./nginx
- depends_on:
- - play
- links:
- - play:play
+ build: ./docker/nginx
volumes:
- /data/www:/data/www:rw
- ./nginx/conf.d:/etc/nginx/conf.d:ro
@@ -69,4 +65,4 @@ services:
networks:
app_net:
- external: true
\ No newline at end of file
+ external: true
diff --git a/global/app.go b/global/app.go
index 86bdfa2c..c2893f0f 100644
--- a/global/app.go
+++ b/global/app.go
@@ -37,8 +37,8 @@ import (
)
const (
- DefaultCDNHttp = "http://test.static.studygolang.com/"
- DefaultCDNHttps = "https://static.studygolang.com/"
+ DefaultCDNHttp = "http://test.static.golangjob.cn/"
+ DefaultCDNHttps = "https://static.golangjob.cn/"
)
var Build string
diff --git a/sg.service b/sg.service
new file mode 100644
index 00000000..fcb57bcd
--- /dev/null
+++ b/sg.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=studygolang
+
+[Service]
+ExecStart=/data/www/studygolang/bin/studygolang
+ExecReload=/bin/kill -USR2 $MAINPID
+PIDFile=/data/www/studygolang/pid/studygolang.pid
+Restart=always
+User=xuxinhua
+Group=xuxinhua
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/static/dist/js/sg_libs.js b/static/dist/js/sg_libs.js
index 7a8bfcdf..59146ed0 100644
--- a/static/dist/js/sg_libs.js
+++ b/static/dist/js/sg_libs.js
@@ -88,290 +88,290 @@ var emojis = [
];
emojis = $.map(emojis, function(value, i) {return {key:':'+value+':', name:value}});
-(function($){
-$.fn.Huploadify = function(opts){
- var itemTemp = '';
- var defaults = {
- fileTypeExts:'*.*',//允许上传的文件类型,格式'*.jpg;*.doc'
- uploader:'',//文件提交的地址
- auto:false,//是否开启自动上传
- method:'post',//发送请求的方式,get或post
- multi:true,//是否允许选择多个文件
- formData:null,//发送给服务端的参数,格式:{key1:value1,key2:value2}
- fileObjName:'file',//在后端接受文件的参数名称,如PHP中的$_FILES['file']
- fileSizeLimit:2048,//允许上传的文件大小,单位KB
- showUploadedPercent:true,//是否实时显示上传的百分比,如20%
- showUploadedSize:false,//是否实时显示已上传的文件大小,如1M/2M
- buttonText:'选择文件',//上传按钮上的文字
- removeTimeout: 1000,//上传完成后进度条的消失时间
- itemTemplate:itemTemp,//上传队列显示的模板
- onUploadStart:null,//上传开始时的动作
- onUploadSuccess:null,//上传成功的动作
- onUploadComplete:null,//上传完成的动作
- onUploadAllComplete: null, // 批量上传时,所有的都上传完后回调
- onUploadError:null, //上传失败的动作
- onInit:null,//初始化时的动作
- onCancel:null//删除掉某个文件后的回调函数,可传入参数file
- }
-
- var option = $.extend(defaults,opts);
-
- //将文件的单位由bytes转换为KB或MB,若第二个参数指定为true,则永远转换为KB
- var formatFileSize = function(size,byKB){
- if (size> 1024 * 1024&&!byKB){
- size = (Math.round(size * 100 / (1024 * 1024)) / 100).toString() + 'MB';
- }
- else{
- size = (Math.round(size * 100 / 1024) / 100).toString() + 'KB';
- }
- return size;
- }
- //根据文件序号获取文件
- var getFile = function(index,files){
- for(var i=0;i ';
- inputStr += '';
- inputStr += option.buttonText;
- inputStr += ' ';
- var uploadFileListStr = '
';
- _this.append(inputStr+uploadFileListStr);
-
-
- //创建文件对象
- var fileObj = {
- fileInput: _this.find('.selectbtn'), //html file控件
- uploadFileList : _this.find('.uploadify-queue'),
- url: option.uploader, //ajax地址
- fileFilter: [], //过滤后的文件数组
- filter: function(files) { //选择文件组的过滤方法
- var arr = [];
- var typeArray = getFileTypes(option.fileTypeExts);
- if(typeArray.length>0){
- for(var i=0,len=files.length;ioption.fileSizeLimit){
- alert('文件'+thisFile.name+'大小超出限制!');
- continue;
- }
- if($.inArray(thisFile.name.split('.').pop(),typeArray)>=0 || $.inArray('*',typeArray)>=0){
- arr.push(thisFile);
- }
- else{
- alert('文件'+thisFile.name+'类型不允许!');
- }
- }
- }
- return arr;
- },
- //文件选择后
- onSelect: function(files){
- for(var i=0,len=files.length;i0) {
- this.fileInput.change(function(e) {
- fileObj.funGetFiles(e);
- });
- }
-
- //点击上传按钮时触发file的click事件
- _this.find('.uploadify-button').on('click',function(){
- _this.find('.selectbtn').trigger('click');
- });
-
- option.onInit&&option.onInit();
- }
- };
-
- //初始化文件对象
- fileObj.init();
- });
-}
-
-})(jQuery);
+(function($){
+$.fn.Huploadify = function(opts){
+ var itemTemp = '';
+ var defaults = {
+ fileTypeExts:'*.*',//允许上传的文件类型,格式'*.jpg;*.doc'
+ uploader:'',//文件提交的地址
+ auto:false,//是否开启自动上传
+ method:'post',//发送请求的方式,get或post
+ multi:true,//是否允许选择多个文件
+ formData:null,//发送给服务端的参数,格式:{key1:value1,key2:value2}
+ fileObjName:'file',//在后端接受文件的参数名称,如PHP中的$_FILES['file']
+ fileSizeLimit:2048,//允许上传的文件大小,单位KB
+ showUploadedPercent:true,//是否实时显示上传的百分比,如20%
+ showUploadedSize:false,//是否实时显示已上传的文件大小,如1M/2M
+ buttonText:'选择文件',//上传按钮上的文字
+ removeTimeout: 1000,//上传完成后进度条的消失时间
+ itemTemplate:itemTemp,//上传队列显示的模板
+ onUploadStart:null,//上传开始时的动作
+ onUploadSuccess:null,//上传成功的动作
+ onUploadComplete:null,//上传完成的动作
+ onUploadAllComplete: null, // 批量上传时,所有的都上传完后回调
+ onUploadError:null, //上传失败的动作
+ onInit:null,//初始化时的动作
+ onCancel:null//删除掉某个文件后的回调函数,可传入参数file
+ }
+
+ var option = $.extend(defaults,opts);
+
+ //将文件的单位由bytes转换为KB或MB,若第二个参数指定为true,则永远转换为KB
+ var formatFileSize = function(size,byKB){
+ if (size> 1024 * 1024&&!byKB){
+ size = (Math.round(size * 100 / (1024 * 1024)) / 100).toString() + 'MB';
+ }
+ else{
+ size = (Math.round(size * 100 / 1024) / 100).toString() + 'KB';
+ }
+ return size;
+ }
+ //根据文件序号获取文件
+ var getFile = function(index,files){
+ for(var i=0;i ';
+ inputStr += '';
+ inputStr += option.buttonText;
+ inputStr += ' ';
+ var uploadFileListStr = '
';
+ _this.append(inputStr+uploadFileListStr);
+
+
+ //创建文件对象
+ var fileObj = {
+ fileInput: _this.find('.selectbtn'), //html file控件
+ uploadFileList : _this.find('.uploadify-queue'),
+ url: option.uploader, //ajax地址
+ fileFilter: [], //过滤后的文件数组
+ filter: function(files) { //选择文件组的过滤方法
+ var arr = [];
+ var typeArray = getFileTypes(option.fileTypeExts);
+ if(typeArray.length>0){
+ for(var i=0,len=files.length;ioption.fileSizeLimit){
+ alert('文件'+thisFile.name+'大小超出限制!');
+ continue;
+ }
+ if($.inArray(thisFile.name.split('.').pop(),typeArray)>=0 || $.inArray('*',typeArray)>=0){
+ arr.push(thisFile);
+ }
+ else{
+ alert('文件'+thisFile.name+'类型不允许!');
+ }
+ }
+ }
+ return arr;
+ },
+ //文件选择后
+ onSelect: function(files){
+ for(var i=0,len=files.length;i0) {
+ this.fileInput.change(function(e) {
+ fileObj.funGetFiles(e);
+ });
+ }
+
+ //点击上传按钮时触发file的click事件
+ _this.find('.uploadify-button').on('click',function(){
+ _this.find('.selectbtn').trigger('click');
+ });
+
+ option.onInit&&option.onInit();
+ }
+ };
+
+ //初始化文件对象
+ fileObj.init();
+ });
+}
+
+})(jQuery);
(function(){!function(a){return"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){var b,c,d,e,f,g,h,i=[].slice;c=function(){function b(b){this.current_flag=null,this.controllers={},this.alias_maps={},this.$inputor=a(b),this.setIframe(),this.listen()}return b.prototype.createContainer=function(b){return 0===(this.$el=a("#atwho-container",b)).length?a(b.body).append(this.$el=a("
")):void 0},b.prototype.setIframe=function(a,b){var c;return null==b&&(b=!1),a?(this.window=a.contentWindow,this.document=a.contentDocument||this.window.document,this.iframe=a):(this.document=document,this.window=window,this.iframe=null),(this.iframeStandalone=b)?(null!=(c=this.$el)&&c.remove(),this.createContainer(this.document)):this.createContainer(document)},b.prototype.controller=function(a){var b,c,d,e;if(this.alias_maps[a])c=this.controllers[this.alias_maps[a]];else{e=this.controllers;for(d in e)if(b=e[d],d===a){c=b;break}}return c?c:this.controllers[this.current_flag]},b.prototype.set_context_for=function(a){return this.current_flag=a,this},b.prototype.reg=function(a,b){var c,e;return c=(e=this.controllers)[a]||(e[a]=new d(this,a)),b.alias&&(this.alias_maps[b.alias]=a),c.init(b),this},b.prototype.listen=function(){return this.$inputor.on("keyup.atwhoInner",function(a){return function(b){return a.on_keyup(b)}}(this)).on("keydown.atwhoInner",function(a){return function(b){return a.on_keydown(b)}}(this)).on("scroll.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this)).on("blur.atwhoInner",function(a){return function(b){var c;return(c=a.controller())?c.view.hide(b,c.get_opt("display_timeout")):void 0}}(this)).on("click.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this))},b.prototype.shutdown=function(){var a,b,c;c=this.controllers;for(b in c)a=c[b],a.destroy(),delete this.controllers[b];return this.$inputor.off(".atwhoInner"),this.$el.remove()},b.prototype.dispatch=function(){return a.map(this.controllers,function(a){return function(b){var c;return(c=b.get_opt("delay"))?(clearTimeout(a.delayedCallback),a.delayedCallback=setTimeout(function(){return b.look_up()?a.set_context_for(b.at):void 0},c)):b.look_up()?a.set_context_for(b.at):void 0}}(this))},b.prototype.on_keyup=function(b){var c;switch(b.keyCode){case f.ESC:b.preventDefault(),null!=(c=this.controller())&&c.view.hide();break;case f.DOWN:case f.UP:case f.CTRL:a.noop();break;case f.P:case f.N:b.ctrlKey||this.dispatch();break;default:this.dispatch()}},b.prototype.on_keydown=function(b){var c,d;if(c=null!=(d=this.controller())?d.view:void 0,c&&c.visible())switch(b.keyCode){case f.ESC:b.preventDefault(),c.hide(b);break;case f.UP:b.preventDefault(),c.prev();break;case f.DOWN:b.preventDefault(),c.next();break;case f.P:if(!b.ctrlKey)return;b.preventDefault(),c.prev();break;case f.N:if(!b.ctrlKey)return;b.preventDefault(),c.next();break;case f.TAB:case f.ENTER:if(!c.visible())return;b.preventDefault(),c.choose(b);break;default:a.noop()}},b}(),d=function(){function b(b,c){this.app=b,this.at=c,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.setting=null,this.query=null,this.pos=0,this.cur_rect=null,this.range=null,0===(this.$el=a("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=a("
")),this.model=new g(this),this.view=new h(this)}return b.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},b.prototype.init=function(b){return this.setting=a.extend({},this.setting||a.fn.atwho["default"],b),this.view.init(),this.model.reload(this.setting.data)},b.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},b.prototype.call_default=function(){var b,c,d;d=arguments[0],b=2<=arguments.length?i.call(arguments,1):[];try{return e[d].apply(this,b)}catch(f){return c=f,a.error(""+c+" Or maybe At.js doesn't have function "+d)}},b.prototype.trigger=function(a,b){var c,d;return null==b&&(b=[]),b.push(this),c=this.get_opt("alias"),d=c?""+a+"-"+c+".atwho":""+a+".atwho",this.$inputor.trigger(d,b)},b.prototype.callbacks=function(a){return this.get_opt("callbacks")[a]||e[a]},b.prototype.get_opt=function(a){var b;try{return this.setting[a]}catch(c){return b=c,null}},b.prototype.content=function(){return this.$inputor.is("textarea, input")?this.$inputor.val():this.$inputor.text()},b.prototype.catch_query=function(){var a,b,c,d,e,f;return b=this.content(),a=this.$inputor.caret("pos",{iframe:this.app.iframe}),f=b.slice(0,a),d=this.callbacks("matcher").call(this,this.at,f,this.get_opt("start_with_space")),"string"==typeof d&&d.length<=this.get_opt("max_len",20)?(e=a-d.length,c=e+d.length,this.pos=e,d={text:d,head_pos:e,end_pos:c},this.trigger("matched",[this.at,d.text])):(d=null,this.view.hide()),this.query=d},b.prototype.rect=function(){var b,c,d;if(b=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeStandalone&&(c=a(this.app.iframe).offset(),b.left+=c.left,b.top+=c.top),this.$inputor.is("[contentEditable]")&&(b=this.cur_rect||(this.cur_rect=b)),d=this.app.document.selection?0:2,{left:b.left,top:b.top,bottom:b.top+b.height+d}},b.prototype.reset_rect=function(){return this.$inputor.is("[contentEditable]")?this.cur_rect=null:void 0},b.prototype.mark_range=function(){var a;if(this.$inputor.is("[contentEditable]"))return this.app.window.getSelection&&(a=this.app.window.getSelection()).rangeCount>0?this.range=a.getRangeAt(0):this.app.document.selection?this.ie8_range=this.app.document.selection.createRange():void 0},b.prototype.insert_content_for=function(b){var c,d,e;return d=b.data("value"),e=this.get_opt("insert_tpl"),this.$inputor.is("textarea, input")||!e?d:(c=a.extend({},b.data("item-data"),{"atwho-data-value":d,"atwho-at":this.at}),this.callbacks("tpl_eval").call(this,e,c))},b.prototype.insert=function(b){var c,d,e,f,g,h,i,j,k;return c=this.$inputor,k=this.callbacks("inserting_wrapper").call(this,c,b,this.get_opt("suffix")),c.is("textarea, input")?(h=c.val(),i=h.slice(0,Math.max(this.query.head_pos-this.at.length,0)),j=""+i+k+h.slice(this.query.end_pos||0),c.val(j),c.caret("pos",i.length+k.length,{iframe:this.app.iframe})):(f=this.range)?(e=f.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,f.setStart(f.endContainer,Math.max(e,0)),f.setEnd(f.endContainer,f.endOffset),f.deleteContents(),d=a(k,this.app.document)[0],f.insertNode(d),f.setEndAfter(d),f.collapse(!1),g=this.app.window.getSelection(),g.removeAllRanges(),g.addRange(f)):(f=this.ie8_range)&&(f.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),f.pasteHTML(k),f.collapse(!1),f.select()),c.is(":focus")||c.focus(),c.change()},b.prototype.render_view=function(a){var b;return b=this.get_opt("search_key"),a=this.callbacks("sorter").call(this,this.query.text,a.slice(0,1001),b),this.view.render(a.slice(0,this.get_opt("limit")))},b.prototype.look_up=function(){var b,c;if(b=this.catch_query())return c=function(a){return a&&a.length>0?this.render_view(a):this.view.hide()},this.model.query(b.text,a.proxy(c,this)),b},b}(),g=function(){function b(a){this.context=a,this.at=this.context.at,this.storage=this.context.$inputor}return b.prototype.destroy=function(){return this.storage.data(this.at,null)},b.prototype.saved=function(){return this.fetch()>0},b.prototype.query=function(a,b){var c,d,e;return c=this.fetch(),d=this.context.get_opt("search_key"),c=this.context.callbacks("filter").call(this.context,a,c,d)||[],e=this.context.callbacks("remote_filter"),c.length>0||!e&&0===c.length?b(c):e.call(this.context,a,b)},b.prototype.fetch=function(){return this.storage.data(this.at)||[]},b.prototype.save=function(a){return this.storage.data(this.at,this.context.callbacks("before_save").call(this.context,a||[]))},b.prototype.load=function(a){return!this.saved()&&a?this._load(a):void 0},b.prototype.reload=function(a){return this._load(a)},b.prototype._load=function(b){return"string"==typeof b?a.ajax(b,{dataType:"json"}).done(function(a){return function(b){return a.save(b)}}(this)):this.save(b)},b}(),h=function(){function b(b){this.context=b,this.$el=a(""),this.timeout_id=null,this.context.$el.append(this.$el),this.bind_event()}return b.prototype.init=function(){var a;return a=this.context.get_opt("alias")||this.context.at.charCodeAt(0),this.$el.attr({id:"at-view-"+a})},b.prototype.destroy=function(){return this.$el.remove()},b.prototype.bind_event=function(){var b;return b=this.$el.find("ul"),b.on("mouseenter.atwho-view","li",function(c){return b.find(".cur").removeClass("cur"),a(c.currentTarget).addClass("cur")}).on("click",function(a){return function(b){return a.choose(b),b.preventDefault()}}(this))},b.prototype.visible=function(){return this.$el.is(":visible")},b.prototype.choose=function(a){var b,c;return(b=this.$el.find(".cur")).length&&(c=this.context.insert_content_for(b),this.context.insert(this.context.callbacks("before_insert").call(this.context,c,b),b),this.context.trigger("inserted",[b,a]),this.hide(a)),this.context.get_opt("hide_without_suffix")?this.stop_showing=!0:void 0},b.prototype.reposition=function(b){var c,d,e,f;return f=this.context.app.iframeStandalone?this.context.app.window:window,b.bottom+this.$el.height()-a(f).scrollTop()>a(f).height()&&(b.bottom=b.top-this.$el.height()),b.left>(d=a(f).width()-this.$el.width()-5)&&(b.left=d),c={left:b.left,top:b.bottom},null!=(e=this.context.callbacks("before_reposition"))&&e.call(this.context,c),this.$el.offset(c),this.context.trigger("reposition",[c])},b.prototype.next=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.next(),b.length||(b=this.$el.find("li:first")),b.addClass("cur")},b.prototype.prev=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.prev(),b.length||(b=this.$el.find("li:last")),b.addClass("cur")},b.prototype.show=function(){var a;return this.stop_showing?void(this.stop_showing=!1):(this.context.mark_range(),this.visible()||(this.$el.show(),this.context.trigger("shown")),(a=this.context.rect())?this.reposition(a):void 0)},b.prototype.hide=function(a,b){var c;if(this.visible())return isNaN(b)?(this.context.reset_rect(),this.$el.hide(),this.context.trigger("hidden",[a])):(c=function(a){return function(){return a.hide()}}(this),clearTimeout(this.timeout_id),this.timeout_id=setTimeout(c,b))},b.prototype.render=function(b){var c,d,e,f,g,h,i;if(!(a.isArray(b)&&b.length>0))return void this.hide();for(this.$el.find("ul").empty(),d=this.$el.find("ul"),g=this.context.get_opt("tpl"),h=0,i=b.length;i>h;h++)e=b[h],e=a.extend({},e,{"atwho-at":this.context.at}),f=this.context.callbacks("tpl_eval").call(this.context,g,e),c=a(this.context.callbacks("highlighter").call(this.context,f,this.context.query.text)),c.data("item-data",e),d.append(c);return this.show(),this.context.get_opt("highlight_first")?d.find("li:first").addClass("cur"):void 0},b}(),f={DOWN:40,UP:38,ESC:27,TAB:9,ENTER:13,CTRL:17,P:80,N:78},e={before_save:function(b){var c,d,e,f;if(!a.isArray(b))return b;for(f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(a.isPlainObject(c)?c:{name:c});return f},matcher:function(a,b,c){var d,e,f,g;return a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),c&&(a="(?:^|\\s)"+a),f=decodeURI("%C3%80"),g=decodeURI("%C3%BF"),e=new RegExp(""+a+"([A-Za-z"+f+"-"+g+"0-9_+-]*)$|"+a+"([^\\x00-\\xff]*)$","gi"),d=e.exec(b),d?d[2]||d[1]:null},filter:function(a,b,c){var d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],~new String(d[c]).toLowerCase().indexOf(a.toLowerCase())&&g.push(d);return g},remote_filter:null,sorter:function(a,b,c){var d,e,f,g;if(!a)return b;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],d.atwho_order=new String(d[c]).toLowerCase().indexOf(a.toLowerCase()),d.atwho_order>-1&&g.push(d);return g.sort(function(a,b){return a.atwho_order-b.atwho_order})},tpl_eval:function(a,b){var c;try{return a.replace(/\$\{([^\}]*)\}/g,function(a,c){return b[c]})}catch(d){return c=d,""}},highlighter:function(a,b){var c;return b?(c=new RegExp(">\\s*(\\w*?)("+b.replace("+","\\+")+")(\\w*)\\s*<","ig"),a.replace(c,function(a,b,c,d){return"> "+b+""+c+" "+d+" <"})):a},before_insert:function(a){return a},inserting_wrapper:function(a,b,c){var d,e;return d=""===c?c:c||" ",a.is("textarea, input")?""+b+d:"true"===a.attr("contentEditable")?(d=""===c?c:c||" ",/firefox/i.test(navigator.userAgent)?e=""+b+d+" ":(c=""+d+"",e=""+b+c+" "),this.app.document.selection&&(e=""+b+" "),e):void 0}},b={load:function(a,b){var c;return(c=this.controller(a))?c.model.load(b):void 0},setIframe:function(a,b){return this.setIframe(a,b),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},a.fn.atwho=function(d){var e,f;return f=arguments,e=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var g,h;return(h=(g=a(this)).data("atwho"))||g.data("atwho",h=new c(this)),"object"!=typeof d&&d?b[d]&&h?e=b[d].apply(h,Array.prototype.slice.call(f,1)):a.error("Method "+d+" does not exist on jQuery.caret"):h.reg(d.at,d)}),e||this},a.fn.atwho["default"]={at:void 0,alias:void 0,data:null,tpl:"${name} ",insert_tpl:"${atwho-data-value} ",callbacks:e,search_key:"name",suffix:void 0,hide_without_suffix:!1,start_with_space:!0,highlight_first:!0,limit:5,max_len:20,display_timeout:300,delay:null}})}).call(this);
/*
@@ -395,129 +395,129 @@ jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=funct
var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeyup=growTextarea;sendContentToMirror(this)})};
(function(a){a.fn.cftoaster=function(b){var d=a.extend({},a.fn.cftoaster.options,b);return this.each(function(){d.element=a(this);if(!c(d)){a.cftoaster._addToQueue(d)}else{a.cftoaster._destroy(d)}});function c(e){var g="";for(var f=0;f<=a.cftoaster.DESTROY_COMMAND.length;f++){if(!e.hasOwnProperty(f)){break}g+=e[f]}return g==a.cftoaster.DESTROY_COMMAND}};a.fn.cftoaster.options={content:"This is a toast message eh",element:"body",animationTime:150,showTime:3000,maxWidth:250,backgroundColor:"#1a1a1a",fontColor:"#eaeaea",bottomMargin:75}})(jQuery);jQuery.extend({cftoaster:{NAMESPACE:"cf_toaster",DESTROY_COMMAND:"destroy",MAIN_CSS_CLASS:"cf_toaster",_queue:[],_addToQueue:function(a){this._queue.push(a);if(a.element&&!this._isShowingToastMessage(a.element)){this._showNextInQueue(a.element)}},_removeFromQueue:function(c){if(c){for(var b in this._queue){var a=this._queue[b];if($(a.element).is(c)){this._queue.splice(b,1)}}}else{this._queue=[]}},_destroy:function(a){var b=a&&a.element?a.element:undefined;if(b){$(b).find("."+this.MAIN_CSS_CLASS).remove()}else{$("."+this.MAIN_CSS_CLASS).remove()}this._removeFromQueue(b)},_isShowingToastMessage:function(b){var a=false;if(b){a=$(b).find("."+this.MAIN_CSS_CLASS).size()>0}return a},_showNextInQueue:function(e){var a;for(var d=0;d").addClass("background").css("background",a.backgroundColor);var f=$("
").addClass("content").html(a.content).css("width",a.maxWidth+"px").css("color",a.fontColor);var b=$("
").addClass(this.MAIN_CSS_CLASS).hide().append(c).append(f);$(e).append(b);var h=-$(b).outerWidth()/2+"px";$(b).css("bottom",a.bottomMargin+"px").css("margin-left",h);$(b).stop().fadeIn(a.animationTime).delay(a.showTime).fadeOut(a.animationTime,function(){$(this).remove();$.cftoaster._showNextInQueue(e)})}},setDefaults:function(a){var b=$.extend({},$.fn.cftoaster.options,a);$.fn.cftoaster.options=b}}});
-jQuery(document).ready(function(e){var t=0;var n="https://static.studygolang.com/github_logo.gif";var r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAqCAMAAACEJ4viAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpEQjIyNkJEQkM0NjYxMUUxOEFDQzk3ODcxRDkzRjhCRSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpEQjIyNkJEQ0M0NjYxMUUxOEFDQzk3ODcxRDkzRjhCRSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkRCMjI2QkQ5QzQ2NjExRTE4QUNDOTc4NzFEOTNGOEJFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkRCMjI2QkRBQzQ2NjExRTE4QUNDOTc4NzFEOTNGOEJFIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+h1kA9gAAAK5QTFRF+fn5sbGx8fHx09PTmpqa2dnZ/f3919fX9PT00NDQ1dXVpKSk+vr6+/v7vb298vLyycnJ8/PztLS0zc3N6enp/v7+q6ur2NjY9/f3srKy/Pz8p6en7u7uoaGhnJyc4eHhtbW1pqam6Ojo9fX17e3toqKirKys1NTUzs7Ox8fHwcHBwMDA5eXlnZ2dpaWl0dHR9vb25ubm4uLi3d3dqqqqwsLCv7+/oKCgmZmZ////8yEsbwAAAMBJREFUeNrE0tcOgjAUBuDSliUoMhTEvfdef9//xUQjgaLX0Ium/ZLT/+SkRPxZpGykvuf5VMJogy5jY9yjDHcWFhqlcRuHc4o6B1QK0BDg+hcZgNDh3NWTwzItH/bRrhvT+g3zSxZkNGCZpoWGIbU0a3Y6zV5VA6keyeDxiw62P0gUqEW0FbDim4nVikFJbU2zZXybUEaxhCqOQqyh5/G0wpWICUwthyqwD4InOMuXJ7/gs7WkoPdVg1vykF8CDACEFanKO3aSYwAAAABJRU5ErkJggg==";e(".github-widget").each(function(){if(t==0)e("head").append('");t++;var s=e(this),o,u=s.data("repo"),a=u.split("/")[0],f=u.split("/")[1],l="http://github.com/"+a,c="http://github.com/"+a+"/"+f;o=e('");o.appendTo(s);e.ajax({url:"https://api.github.com/repos/"+u,dataType:"jsonp",success:function(t){var n=t.data,r,i="unknown";if(n.pushed_at){r=new Date(n.pushed_at);i=r.getMonth()+1+"-"+r.getDate()+"-"+r.getFullYear()}o.find(".watchers").text(n.watchers);o.find(".forks").text(n.forks);o.find(".description span").text(n.description);o.find(".updated").html("Latest commit to the "+n.default_branch+" branch on "+i);if(n.homepage!=null)o.find(".link").append(e(" ").attr("href",n.homepage).text(n.homepage))}})})});
-
-/*
- * Metadata - jQuery plugin for parsing metadata from elements
- *
- * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $
- *
- */
-
-/**
- * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
- * in the JSON will become a property of the element itself.
- *
- * There are three supported types of metadata storage:
- *
- * attr: Inside an attribute. The name parameter indicates *which* attribute.
- *
- * class: Inside the class attribute, wrapped in curly braces: { }
- *
- * elem: Inside a child element (e.g. a script tag). The
- * name parameter indicates *which* element.
- *
- * The metadata for an element is loaded the first time the element is accessed via jQuery.
- *
- * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
- * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
- *
- * @name $.metadata.setType
- *
- * @example This is a p
- * @before $.metadata.setType("class")
- * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
- * @desc Reads metadata from the class attribute
- *
- * @example This is a p
- * @before $.metadata.setType("attr", "data")
- * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
- * @desc Reads metadata from a "data" attribute
- *
- * @example This is a p
- * @before $.metadata.setType("elem", "script")
- * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
- * @desc Reads metadata from a nested script element
- *
- * @param String type The encoding type
- * @param String name The name of the attribute to be used to get metadata (optional)
- * @cat Plugins/Metadata
- * @descr Sets the type of encoding to be used when loading metadata for the first time
- * @type undefined
- * @see metadata()
- */
-
-(function($) {
-
-$.extend({
- metadata : {
- defaults : {
- type: 'class',
- name: 'metadata',
- cre: /({.*})/,
- single: 'metadata'
- },
- setType: function( type, name ){
- this.defaults.type = type;
- this.defaults.name = name;
- },
- get: function( elem, opts ){
- var settings = $.extend({},this.defaults,opts);
- // check for empty string in single property
- if ( !settings.single.length ) settings.single = 'metadata';
-
- var data = $.data(elem, settings.single);
- // returned cached data if it already exists
- if ( data ) return data;
-
- data = "{}";
-
- if ( settings.type == "class" ) {
- var m = settings.cre.exec( elem.className );
- if ( m )
- data = m[1];
- } else if ( settings.type == "elem" ) {
- if( !elem.getElementsByTagName )
- return undefined;
- var e = elem.getElementsByTagName(settings.name);
- if ( e.length )
- data = $.trim(e[0].innerHTML);
- } else if ( elem.getAttribute != undefined ) {
- var attr = elem.getAttribute( settings.name );
- if ( attr )
- data = attr;
- }
-
- if ( data.indexOf( '{' ) <0 )
- data = "{" + data + "}";
-
- data = eval("(" + data + ")");
-
- $.data( elem, settings.single, data );
- return data;
- }
- }
-});
-
-/**
- * Returns the metadata object for the first member of the jQuery object.
- *
- * @name metadata
- * @descr Returns element's metadata object
- * @param Object opts An object contianing settings to override the defaults
- * @type jQuery
- * @cat Plugins/Metadata
- */
-$.fn.metadata = function( opts ){
- return $.metadata.get( this[0], opts );
-};
-
+jQuery(document).ready(function(e){var t=0;var n="https://static.golangjob.cn/github_logo.gif";var r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAqCAMAAACEJ4viAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpEQjIyNkJEQkM0NjYxMUUxOEFDQzk3ODcxRDkzRjhCRSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpEQjIyNkJEQ0M0NjYxMUUxOEFDQzk3ODcxRDkzRjhCRSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkRCMjI2QkQ5QzQ2NjExRTE4QUNDOTc4NzFEOTNGOEJFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkRCMjI2QkRBQzQ2NjExRTE4QUNDOTc4NzFEOTNGOEJFIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+h1kA9gAAAK5QTFRF+fn5sbGx8fHx09PTmpqa2dnZ/f3919fX9PT00NDQ1dXVpKSk+vr6+/v7vb298vLyycnJ8/PztLS0zc3N6enp/v7+q6ur2NjY9/f3srKy/Pz8p6en7u7uoaGhnJyc4eHhtbW1pqam6Ojo9fX17e3toqKirKys1NTUzs7Ox8fHwcHBwMDA5eXlnZ2dpaWl0dHR9vb25ubm4uLi3d3dqqqqwsLCv7+/oKCgmZmZ////8yEsbwAAAMBJREFUeNrE0tcOgjAUBuDSliUoMhTEvfdef9//xUQjgaLX0Ium/ZLT/+SkRPxZpGykvuf5VMJogy5jY9yjDHcWFhqlcRuHc4o6B1QK0BDg+hcZgNDh3NWTwzItH/bRrhvT+g3zSxZkNGCZpoWGIbU0a3Y6zV5VA6keyeDxiw62P0gUqEW0FbDim4nVikFJbU2zZXybUEaxhCqOQqyh5/G0wpWICUwthyqwD4InOMuXJ7/gs7WkoPdVg1vykF8CDACEFanKO3aSYwAAAABJRU5ErkJggg==";e(".github-widget").each(function(){if(t==0)e("head").append('");t++;var s=e(this),o,u=s.data("repo"),a=u.split("/")[0],f=u.split("/")[1],l="http://github.com/"+a,c="http://github.com/"+a+"/"+f;o=e('");o.appendTo(s);e.ajax({url:"https://api.github.com/repos/"+u,dataType:"jsonp",success:function(t){var n=t.data,r,i="unknown";if(n.pushed_at){r=new Date(n.pushed_at);i=r.getMonth()+1+"-"+r.getDate()+"-"+r.getFullYear()}o.find(".watchers").text(n.watchers);o.find(".forks").text(n.forks);o.find(".description span").text(n.description);o.find(".updated").html("Latest commit to the "+n.default_branch+" branch on "+i);if(n.homepage!=null)o.find(".link").append(e(" ").attr("href",n.homepage).text(n.homepage))}})})});
+
+/*
+ * Metadata - jQuery plugin for parsing metadata from elements
+ *
+ * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $
+ *
+ */
+
+/**
+ * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
+ * in the JSON will become a property of the element itself.
+ *
+ * There are three supported types of metadata storage:
+ *
+ * attr: Inside an attribute. The name parameter indicates *which* attribute.
+ *
+ * class: Inside the class attribute, wrapped in curly braces: { }
+ *
+ * elem: Inside a child element (e.g. a script tag). The
+ * name parameter indicates *which* element.
+ *
+ * The metadata for an element is loaded the first time the element is accessed via jQuery.
+ *
+ * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
+ * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
+ *
+ * @name $.metadata.setType
+ *
+ * @example This is a p
+ * @before $.metadata.setType("class")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from the class attribute
+ *
+ * @example This is a p
+ * @before $.metadata.setType("attr", "data")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from a "data" attribute
+ *
+ * @example This is a p
+ * @before $.metadata.setType("elem", "script")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from a nested script element
+ *
+ * @param String type The encoding type
+ * @param String name The name of the attribute to be used to get metadata (optional)
+ * @cat Plugins/Metadata
+ * @descr Sets the type of encoding to be used when loading metadata for the first time
+ * @type undefined
+ * @see metadata()
+ */
+
+(function($) {
+
+$.extend({
+ metadata : {
+ defaults : {
+ type: 'class',
+ name: 'metadata',
+ cre: /({.*})/,
+ single: 'metadata'
+ },
+ setType: function( type, name ){
+ this.defaults.type = type;
+ this.defaults.name = name;
+ },
+ get: function( elem, opts ){
+ var settings = $.extend({},this.defaults,opts);
+ // check for empty string in single property
+ if ( !settings.single.length ) settings.single = 'metadata';
+
+ var data = $.data(elem, settings.single);
+ // returned cached data if it already exists
+ if ( data ) return data;
+
+ data = "{}";
+
+ if ( settings.type == "class" ) {
+ var m = settings.cre.exec( elem.className );
+ if ( m )
+ data = m[1];
+ } else if ( settings.type == "elem" ) {
+ if( !elem.getElementsByTagName )
+ return undefined;
+ var e = elem.getElementsByTagName(settings.name);
+ if ( e.length )
+ data = $.trim(e[0].innerHTML);
+ } else if ( elem.getAttribute != undefined ) {
+ var attr = elem.getAttribute( settings.name );
+ if ( attr )
+ data = attr;
+ }
+
+ if ( data.indexOf( '{' ) <0 )
+ data = "{" + data + "}";
+
+ data = eval("(" + data + ")");
+
+ $.data( elem, settings.single, data );
+ return data;
+ }
+ }
+});
+
+/**
+ * Returns the metadata object for the first member of the jQuery object.
+ *
+ * @name metadata
+ * @descr Returns element's metadata object
+ * @param Object opts An object contianing settings to override the defaults
+ * @type jQuery
+ * @cat Plugins/Metadata
+ */
+$.fn.metadata = function( opts ){
+ return $.metadata.get( this[0], opts );
+};
+
})(jQuery);
// Simplified Chinese
jQuery.timeago.settings.strings = {
diff --git a/static/dist/js/sg_libs.min.js b/static/dist/js/sg_libs.min.js
index ffeaab9a..1201f5bc 100644
--- a/static/dist/js/sg_libs.min.js
+++ b/static/dist/js/sg_libs.min.js
@@ -1 +1 @@
-var emojis=["bowtie","smile","laughing","blush","smiley","relaxed","smirk","heart_eyes","kissing_heart","kissing_closed_eyes","flushed","relieved","satisfied","grin","wink","stuck_out_tongue_winking_eye","stuck_out_tongue_closed_eyes","grinning","kissing","kissing_smiling_eyes","stuck_out_tongue","sleeping","worried","frowning","anguished","open_mouth","grimacing","confused","hushed","expressionless","unamused","sweat_smile","sweat","disappointed_relieved","weary","pensive","disappointed","confounded","fearful","cold_sweat","persevere","cry","sob","joy","astonished","scream","neckbeard","tired_face","angry","rage","triumph","sleepy","yum","mask","sunglasses","dizzy_face","imp","smiling_imp","neutral_face","no_mouth","innocent","alien","yellow_heart","blue_heart","purple_heart","heart","green_heart","broken_heart","heartbeat","heartpulse","two_hearts","revolving_hearts","cupid","sparkling_heart","sparkles","star","star2","dizzy","boom","collision","anger","exclamation","question","grey_exclamation","grey_question","zzz","dash","sweat_drops","notes","musical_note","fire","hankey","poop","shit","+1","thumbsup","-1","thumbsdown","ok_hand","punch","facepunch","fist","v","wave","hand","raised_hand","open_hands","point_up","point_down","point_left","point_right","raised_hands","pray","point_up_2","clap","muscle","metal","fu","walking","runner","running","couple","family","two_men_holding_hands","two_women_holding_hands","dancer","dancers","ok_woman","no_good","information_desk_person","raising_hand","bride_with_veil","person_with_pouting_face","person_frowning","bow","couplekiss","couple_with_heart","massage","haircut","nail_care","boy","girl","woman","man","baby","older_woman","older_man","person_with_blond_hair","man_with_gua_pi_mao","man_with_turban","construction_worker","cop","angel","princess","smiley_cat","smile_cat","heart_eyes_cat","kissing_cat","smirk_cat","scream_cat","crying_cat_face","joy_cat","pouting_cat","japanese_ogre","japanese_goblin","see_no_evil","hear_no_evil","speak_no_evil","guardsman","skull","feet","lips","kiss","droplet","ear","eyes","nose","tongue","love_letter","bust_in_silhouette","busts_in_silhouette","speech_balloon","thought_balloon","feelsgood","finnadie","goberserk","godmode","hurtrealbad","rage1","rage2","rage3","rage4","suspect","trollface","sunny","umbrella","cloud","snowflake","snowman","zap","cyclone","foggy","ocean","cat","dog","mouse","hamster","rabbit","wolf","frog","tiger","koala","bear","pig","pig_nose","cow","boar","monkey_face","monkey","horse","racehorse","camel","sheep","elephant","panda_face","snake","bird","baby_chick","hatched_chick","hatching_chick","chicken","penguin","turtle","bug","honeybee","ant","beetle","snail","octopus","tropical_fish","fish","whale","whale2","dolphin","cow2","ram","rat","water_buffalo","tiger2","rabbit2","dragon","goat","rooster","dog2","pig2","mouse2","ox","dragon_face","blowfish","crocodile","dromedary_camel","leopard","cat2","poodle","paw_prints","bouquet","cherry_blossom","tulip","four_leaf_clover","rose","sunflower","hibiscus","maple_leaf","leaves","fallen_leaf","herb","mushroom","cactus","palm_tree","evergreen_tree","deciduous_tree","chestnut","seedling","blossom","ear_of_rice","shell","globe_with_meridians","sun_with_face","full_moon_with_face","new_moon_with_face","new_moon","waxing_crescent_moon","first_quarter_moon","waxing_gibbous_moon","full_moon","waning_gibbous_moon","last_quarter_moon","waning_crescent_moon","last_quarter_moon_with_face","first_quarter_moon_with_face","moon","earth_africa","earth_americas","earth_asia","volcano","milky_way","partly_sunny","octocat","squirrel","bamboo","gift_heart","dolls","school_satchel","mortar_board","flags","fireworks","sparkler","wind_chime","rice_scene","jack_o_lantern","ghost","santa","christmas_tree","gift","bell","no_bell","tanabata_tree","tada","confetti_ball","balloon","crystal_ball","cd","dvd","floppy_disk","camera","video_camera","movie_camera","computer","tv","iphone","phone","telephone","telephone_receiver","pager","fax","minidisc","vhs","sound","speaker","mute","loudspeaker","mega","hourglass","hourglass_flowing_sand","alarm_clock","watch","radio","satellite","loop","mag","mag_right","unlock","lock","lock_with_ink_pen","closed_lock_with_key","key","bulb","flashlight","high_brightness","low_brightness","electric_plug","battery","calling","email","mailbox","postbox","bath","bathtub","shower","toilet","wrench","nut_and_bolt","hammer","seat","moneybag","yen","dollar","pound","euro","credit_card","money_with_wings","e-mail","inbox_tray","outbox_tray","envelope","incoming_envelope","postal_horn","mailbox_closed","mailbox_with_mail","mailbox_with_no_mail","package","door","smoking","bomb","gun","hocho","pill","syringe","page_facing_up","page_with_curl","bookmark_tabs","bar_chart","chart_with_upwards_trend","chart_with_downwards_trend","scroll","clipboard","calendar","date","card_index","file_folder","open_file_folder","scissors","pushpin","paperclip","black_nib","pencil2","straight_ruler","triangular_ruler","closed_book","green_book","blue_book","orange_book","notebook","notebook_with_decorative_cover","ledger","books","bookmark","name_badge","microscope","telescope","newspaper","football","basketball","soccer","baseball","tennis","8ball","rugby_football","bowling","golf","mountain_bicyclist","bicyclist","horse_racing","snowboarder","swimmer","surfer","ski","spades","hearts","clubs","diamonds","gem","ring","trophy","musical_score","musical_keyboard","violin","space_invader","video_game","black_joker","flower_playing_cards","game_die","dart","mahjong","clapper","memo","pencil","book","art","microphone","headphones","trumpet","saxophone","guitar","shoe","sandal","high_heel","lipstick","boot","shirt","tshirt","necktie","womans_clothes","dress","running_shirt_with_sash","jeans","kimono","bikini","ribbon","tophat","crown","womans_hat","mans_shoe","closed_umbrella","briefcase","handbag","pouch","purse","eyeglasses","fishing_pole_and_fish","coffee","tea","sake","baby_bottle","beer","beers","cocktail","tropical_drink","wine_glass","fork_and_knife","pizza","hamburger","fries","poultry_leg","meat_on_bone","spaghetti","curry","fried_shrimp","bento","sushi","fish_cake","rice_ball","rice_cracker","rice","ramen","stew","oden","dango","egg","bread","doughnut","custard","icecream","ice_cream","shaved_ice","birthday","cake","cookie","chocolate_bar","candy","lollipop","honey_pot","apple","green_apple","tangerine","lemon","cherries","grapes","watermelon","strawberry","peach","melon","banana","pear","pineapple","sweet_potato","eggplant","tomato","corn"];function md5cycle(t,e){var i=ff(i=t[0],r=t[1],n=t[2],o=t[3],e[0],7,-680876936),o=ff(o,i,r,n,e[1],12,-389564586),n=ff(n,o,i,r,e[2],17,606105819),r=ff(r,n,o,i,e[3],22,-1044525330);i=ff(i,r,n,o,e[4],7,-176418897),o=ff(o,i,r,n,e[5],12,1200080426),n=ff(n,o,i,r,e[6],17,-1473231341),r=ff(r,n,o,i,e[7],22,-45705983),i=ff(i,r,n,o,e[8],7,1770035416),o=ff(o,i,r,n,e[9],12,-1958414417),n=ff(n,o,i,r,e[10],17,-42063),r=ff(r,n,o,i,e[11],22,-1990404162),i=ff(i,r,n,o,e[12],7,1804603682),o=ff(o,i,r,n,e[13],12,-40341101),n=ff(n,o,i,r,e[14],17,-1502002290),i=gg(i,r=ff(r,n,o,i,e[15],22,1236535329),n,o,e[1],5,-165796510),o=gg(o,i,r,n,e[6],9,-1069501632),n=gg(n,o,i,r,e[11],14,643717713),r=gg(r,n,o,i,e[0],20,-373897302),i=gg(i,r,n,o,e[5],5,-701558691),o=gg(o,i,r,n,e[10],9,38016083),n=gg(n,o,i,r,e[15],14,-660478335),r=gg(r,n,o,i,e[4],20,-405537848),i=gg(i,r,n,o,e[9],5,568446438),o=gg(o,i,r,n,e[14],9,-1019803690),n=gg(n,o,i,r,e[3],14,-187363961),r=gg(r,n,o,i,e[8],20,1163531501),i=gg(i,r,n,o,e[13],5,-1444681467),o=gg(o,i,r,n,e[2],9,-51403784),n=gg(n,o,i,r,e[7],14,1735328473),i=hh(i,r=gg(r,n,o,i,e[12],20,-1926607734),n,o,e[5],4,-378558),o=hh(o,i,r,n,e[8],11,-2022574463),n=hh(n,o,i,r,e[11],16,1839030562),r=hh(r,n,o,i,e[14],23,-35309556),i=hh(i,r,n,o,e[1],4,-1530992060),o=hh(o,i,r,n,e[4],11,1272893353),n=hh(n,o,i,r,e[7],16,-155497632),r=hh(r,n,o,i,e[10],23,-1094730640),i=hh(i,r,n,o,e[13],4,681279174),o=hh(o,i,r,n,e[0],11,-358537222),n=hh(n,o,i,r,e[3],16,-722521979),r=hh(r,n,o,i,e[6],23,76029189),i=hh(i,r,n,o,e[9],4,-640364487),o=hh(o,i,r,n,e[12],11,-421815835),n=hh(n,o,i,r,e[15],16,530742520),i=ii(i,r=hh(r,n,o,i,e[2],23,-995338651),n,o,e[0],6,-198630844),o=ii(o,i,r,n,e[7],10,1126891415),n=ii(n,o,i,r,e[14],15,-1416354905),r=ii(r,n,o,i,e[5],21,-57434055),i=ii(i,r,n,o,e[12],6,1700485571),o=ii(o,i,r,n,e[3],10,-1894986606),n=ii(n,o,i,r,e[10],15,-1051523),r=ii(r,n,o,i,e[1],21,-2054922799),i=ii(i,r,n,o,e[8],6,1873313359),o=ii(o,i,r,n,e[15],10,-30611744),n=ii(n,o,i,r,e[6],15,-1560198380),r=ii(r,n,o,i,e[13],21,1309151649),i=ii(i,r,n,o,e[4],6,-145523070),o=ii(o,i,r,n,e[11],10,-1120210379),n=ii(n,o,i,r,e[2],15,718787259),r=ii(r,n,o,i,e[9],21,-343485551),t[0]=add32(i,t[0]),t[1]=add32(r,t[1]),t[2]=add32(n,t[2]),t[3]=add32(o,t[3])}function cmn(t,e,i,o,n,r){return e=add32(add32(e,t),add32(o,r)),add32(e<>>32-n,i)}function ff(t,e,i,o,n,r,a){return cmn(e&i|~e&o,t,e,n,r,a)}function gg(t,e,i,o,n,r,a){return cmn(e&o|i&~o,t,e,n,r,a)}function hh(t,e,i,o,n,r,a){return cmn(e^i^o,t,e,n,r,a)}function ii(t,e,i,o,n,r,a){return cmn(i^(e|~o),t,e,n,r,a)}function md51(t){txt="";for(var e=t.length,i=[1732584193,-271733879,-1732584194,271733878],o=64;o<=t.length;o+=64)md5cycle(i,md5blk(t.substring(o-64,o)));t=t.substring(o-64);var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(o=0;o>2]|=t.charCodeAt(o)<<(o%4<<3);if(n[o>>2]|=128<<(o%4<<3),55>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return e}emojis=$.map(emojis,function(t,e){return{key:":"+t+":",name:t}}),function(d){d.fn.Huploadify=function(t){function u(t,e){return t=1048576${fileName} 上传 删除 ',onUploadStart:null,onUploadSuccess:null,onUploadComplete:null,onUploadAllComplete:null,onUploadError:null,onInit:null,onCancel:null},c=d.extend(e,t);this.each(function(){var s=d(this),l=d(".uploadify").length+1,t='
',t+='
',t+=c.buttonText,t+=" ";var e='
';s.append(t+e);var h={fileInput:s.find(".selectbtn"),uploadFileList:s.find(".uploadify-queue"),url:c.uploader,fileFilter:[],filter:function(t){var e=[],i=a(c.fileTypeExts);if(0
c.fileSizeLimit?alert("文件"+r.name+"大小超出限制!"):0<=d.inArray(r.name.split(".").pop(),i)||0<=d.inArray("*",i)?e.push(r):alert("文件"+r.name+"类型不允许!")}return e},onSelect:function(t){for(var e=0,i=t.length;e0KB /${fileSize} '.replace(/\${fileSize}/g,u(n.size)),r.find(".uploadify-progress").after(o)),c.showUploadedPercent&&r.find(".uploadify-progress").after('0% ');var a=e==i-1?!0:!1;c.auto?this.funUploadFile(n,a):r.find(".uploadbtn").on("click",function(t){return function(){h.funUploadFile(t,a)}}(n)),r.find(".delfilebtn").on("click",function(t){return function(){h.funDeleteFile(t.index)}}(n))}},onProgress:function(t,e,i){var o=s.find("#fileupload_"+l+"_"+t.index+" .uploadify-progress"),t=(e/i*100).toFixed(2)+"%";c.showUploadedSize&&(o.nextAll(".progressnum .uploadedsize").text(u(e)),o.nextAll(".progressnum .totalsize").text(u(i))),c.showUploadedPercent&&o.nextAll(".up_percent").text(t),o.children(".uploadify-progress-bar").css("width",t)},funGetFiles:function(t){for(var e=t.target.files,i=0,o=(e=this.filter(e)).length;i "),this.timeout_id=null,this.context.$el.append(this.$el),this.bind_event()}function e(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}function c(t,e){this.app=t,this.at=e,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.setting=null,this.query=null,this.pos=0,this.cur_rect=null,this.range=null,0===(this.$el=s("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=s("
")),this.model=new l(this),this.view=new h(this)}function d(t){this.current_flag=null,this.controllers={},this.alias_maps={},this.$inputor=s(t),this.setIframe(),this.listen()}d.prototype.createContainer=function(t){return 0===(this.$el=s("#atwho-container",t)).length?s(t.body).append(this.$el=s("
")):void 0},d.prototype.setIframe=function(t,e){return null==e&&(e=!1),t?(this.window=t.contentWindow,this.document=t.contentDocument||this.window.document,this.iframe=t):(this.document=document,this.window=window,this.iframe=null),(this.iframeStandalone=e)?(null!=(e=this.$el)&&e.remove(),this.createContainer(this.document)):this.createContainer(document)},d.prototype.controller=function(t){var e,i,o,n;if(this.alias_maps[t])i=this.controllers[this.alias_maps[t]];else for(o in n=this.controllers)if(e=n[o],o===t){i=e;break}return i||this.controllers[this.current_flag]},d.prototype.set_context_for=function(t){return this.current_flag=t,this},d.prototype.reg=function(t,e){var i=(i=this.controllers)[t]||(i[t]=new o(this,t));return e.alias&&(this.alias_maps[e.alias]=t),i.init(e),this},d.prototype.listen=function(){return this.$inputor.on("keyup.atwhoInner",(r=this,function(t){return r.on_keyup(t)})).on("keydown.atwhoInner",(e=this,function(t){return e.on_keydown(t)})).on("scroll.atwhoInner",(n=this,function(t){var e;return null!=(e=n.controller())?e.view.hide(t):void 0})).on("blur.atwhoInner",(o=this,function(t){var e;return(e=o.controller())?e.view.hide(t,e.get_opt("display_timeout")):void 0})).on("click.atwhoInner",(i=this,function(t){var e;return null!=(e=i.controller())?e.view.hide(t):void 0}));var i,o,n,e,r},d.prototype.shutdown=function(){var t,e,i=this.controllers;for(e in i)t=i[e],t.destroy(),delete this.controllers[e];return this.$inputor.off(".atwhoInner"),this.$el.remove()},d.prototype.dispatch=function(){return s.map(this.controllers,(i=this,function(t){var e;return(e=t.get_opt("delay"))?(clearTimeout(i.delayedCallback),i.delayedCallback=setTimeout(function(){return t.look_up()?i.set_context_for(t.at):void 0},e)):t.look_up()?i.set_context_for(t.at):void 0}));var i},d.prototype.on_keyup=function(t){var e;switch(t.keyCode){case n.ESC:t.preventDefault(),null!=(e=this.controller())&&e.view.hide();break;case n.DOWN:case n.UP:case n.CTRL:s.noop();break;case n.P:case n.N:t.ctrlKey||this.dispatch();break;default:this.dispatch()}},d.prototype.on_keydown=function(t){var e,i=null!=(e=this.controller())?e.view:void 0;if(i&&i.visible())switch(t.keyCode){case n.ESC:t.preventDefault(),i.hide(t);break;case n.UP:t.preventDefault(),i.prev();break;case n.DOWN:t.preventDefault(),i.next();break;case n.P:if(!t.ctrlKey)return;t.preventDefault(),i.prev();break;case n.N:if(!t.ctrlKey)return;t.preventDefault(),i.next();break;case n.TAB:case n.ENTER:if(!i.visible())return;t.preventDefault(),i.choose(t);break;default:s.noop()}},a=d,c.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},c.prototype.init=function(t){return this.setting=s.extend({},this.setting||s.fn.atwho.default,t),this.view.init(),this.model.reload(this.setting.data)},c.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},c.prototype.call_default=function(){var e=arguments[0],t=2<=arguments.length?u.call(arguments,1):[];try{return i[e].apply(this,t)}catch(t){return s.error(t+" Or maybe At.js doesn't have function "+e)}},c.prototype.trigger=function(t,e){var i;return(e=null==e?[]:e).push(this),t=(i=this.get_opt("alias"))?t+"-"+i+".atwho":t+".atwho",this.$inputor.trigger(t,e)},c.prototype.callbacks=function(t){return this.get_opt("callbacks")[t]||i[t]},c.prototype.get_opt=function(t){try{return this.setting[t]}catch(t){return null}},c.prototype.content=function(){return this.$inputor.is("textarea, input")?this.$inputor.val():this.$inputor.text()},c.prototype.catch_query=function(){var t=this.content(),e=this.$inputor.caret("pos",{iframe:this.app.iframe}),i=t.slice(0,e),t=this.callbacks("matcher").call(this,this.at,i,this.get_opt("start_with_space"));return"string"==typeof t&&t.length<=this.get_opt("max_len",20)?(e=(i=e-t.length)+t.length,t={text:t,head_pos:this.pos=i,end_pos:e},this.trigger("matched",[this.at,t.text])):(t=null,this.view.hide()),this.query=t},c.prototype.rect=function(){var t,e;if(t=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeStandalone&&(e=s(this.app.iframe).offset(),t.left+=e.left,t.top+=e.top),this.$inputor.is("[contentEditable]")&&(t=this.cur_rect||(this.cur_rect=t)),e=this.app.document.selection?0:2,{left:t.left,top:t.top,bottom:t.top+t.height+e}},c.prototype.reset_rect=function(){return this.$inputor.is("[contentEditable]")?this.cur_rect=null:void 0},c.prototype.mark_range=function(){var t;if(this.$inputor.is("[contentEditable]"))return this.app.window.getSelection&&0<(t=this.app.window.getSelection()).rangeCount?this.range=t.getRangeAt(0):this.app.document.selection?this.ie8_range=this.app.document.selection.createRange():void 0},c.prototype.insert_content_for=function(t){var e=t.data("value"),i=this.get_opt("insert_tpl");return this.$inputor.is("textarea, input")||!i?e:(e=s.extend({},t.data("item-data"),{"atwho-data-value":e,"atwho-at":this.at}),this.callbacks("tpl_eval").call(this,i,e))},c.prototype.insert=function(t){var e,i,o=this.$inputor,t=this.callbacks("inserting_wrapper").call(this,o,t,this.get_opt("suffix"));return o.is("textarea, input")?(i=""+(e=(i=o.val()).slice(0,Math.max(this.query.head_pos-this.at.length,0)))+t+i.slice(this.query.end_pos||0),o.val(i),o.caret("pos",e.length+t.length,{iframe:this.app.iframe})):(i=this.range)?(e=i.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,i.setStart(i.endContainer,Math.max(e,0)),i.setEnd(i.endContainer,i.endOffset),i.deleteContents(),e=s(t,this.app.document)[0],i.insertNode(e),i.setEndAfter(e),i.collapse(!1),(e=this.app.window.getSelection()).removeAllRanges(),e.addRange(i)):(i=this.ie8_range)&&(i.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),i.pasteHTML(t),i.collapse(!1),i.select()),o.is(":focus")||o.focus(),o.change()},c.prototype.render_view=function(t){var e=this.get_opt("search_key");return t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.get_opt("limit")))},c.prototype.look_up=function(){var t,e;if(t=this.catch_query())return e=function(t){return t&&0
s(e).height()&&(t.bottom=t.top-this.$el.height()),t.left>(e=s(e).width()-this.$el.width()-5)&&(t.left=e),e={left:t.left,top:t.bottom},null!=(t=this.context.callbacks("before_reposition"))&&t.call(this.context,e),this.$el.offset(e),this.context.trigger("reposition",[e])},t.prototype.next=function(){var t=this.$el.find(".cur").removeClass("cur").next();return(t=!t.length?this.$el.find("li:first"):t).addClass("cur")},t.prototype.prev=function(){var t=this.$el.find(".cur").removeClass("cur").prev();return(t=!t.length?this.$el.find("li:last"):t).addClass("cur")},t.prototype.show=function(){var t;return this.stop_showing?void(this.stop_showing=!1):(this.context.mark_range(),this.visible()||(this.$el.show(),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0)},t.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.context.reset_rect(),this.$el.hide(),this.context.trigger("hidden",[t])):(i=this,t=function(){return i.hide()},clearTimeout(this.timeout_id),this.timeout_id=setTimeout(t,e))},t.prototype.render=function(t){var e,i,o,n,r,a;if(s.isArray(t)&&0\\s*(\\w*?)("+e.replace("+","\\+")+")(\\w*)\\s*<","ig"),t.replace(e,function(t,e,i,o){return"> "+e+""+i+" "+o+" <"})):t},before_insert:function(t){return t},inserting_wrapper:function(t,e,i){var o=""===i?i:i||" ";return t.is("textarea, input")?""+e+o:"true"===t.attr("contentEditable")?(o=""===i?i:i||" ",i=/firefox/i.test(navigator.userAgent)?""+e+o+" ":""+e+(i=""+o+"")+" ",i=this.app.document.selection?""+e+" ":i):void 0}},r={load:function(t,e){return(t=this.controller(t))?t.model.load(e):void 0},setIframe:function(t,e){return this.setIframe(t,e),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},s.fn.atwho=function(i){var o=arguments,n=null;return this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var t,e;return(e=(t=s(this)).data("atwho"))||t.data("atwho",e=new a(this)),"object"!=typeof i&&i?r[i]&&e?n=r[i].apply(e,Array.prototype.slice.call(o,1)):s.error("Method "+i+" does not exist on jQuery.caret"):e.reg(i.at,i)}),n||this},s.fn.atwho.default={at:void 0,alias:void 0,data:null,tpl:"${name} ",insert_tpl:"${atwho-data-value} ",callbacks:i,search_key:"name",suffix:void 0,hide_without_suffix:!1,start_with_space:!0,highlight_first:!0,limit:5,max_len:20,display_timeout:300,delay:null}},"function"==typeof define&&define.amd?define(["jquery"],t):t(window.jQuery)}.call(this),jQuery.fn.autoGrow=function(){return this.each(function(){function t(t){i.innerHTML=String(t.value).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\n/g," ")+". .",jQuery(t).height()!=jQuery(i).height()&&jQuery(t).height(jQuery(i).height())}var e,i=(e=this,jQuery(e).after('
'),jQuery(e).next(".autogrow-textarea-mirror")[0]);i.style.display="none",i.style.wordWrap="break-word",i.style.padding=jQuery(this).css("padding"),i.style.width=jQuery(this).css("width"),i.style.fontFamily=jQuery(this).css("font-family"),i.style.fontSize=jQuery(this).css("font-size"),i.style.lineHeight=jQuery(this).css("line-height"),this.style.overflow="hidden",this.style.minHeight=this.rows+"em",this.onkeyup=function(){t(this)},t(this)})},function(o){o.fn.cftoaster=function(t){var e=o.extend({},o.fn.cftoaster.options,t);return this.each(function(){e.element=o(this),!function(t){for(var e="",i=0;i<=o.cftoaster.DESTROY_COMMAND.length&&t.hasOwnProperty(i);i++)e+=t[i];return e==o.cftoaster.DESTROY_COMMAND}(e)?o.cftoaster._addToQueue(e):o.cftoaster._destroy(e)})},o.fn.cftoaster.options={content:"This is a toast message eh",element:"body",animationTime:150,showTime:3e3,maxWidth:250,backgroundColor:"#1a1a1a",fontColor:"#eaeaea",bottomMargin:75}}(jQuery),jQuery.extend({cftoaster:{NAMESPACE:"cf_toaster",DESTROY_COMMAND:"destroy",MAIN_CSS_CLASS:"cf_toaster",_queue:[],_addToQueue:function(t){this._queue.push(t),t.element&&!this._isShowingToastMessage(t.element)&&this._showNextInQueue(t.element)},_removeFromQueue:function(t){if(t)for(var e in this._queue){var i=this._queue[e];$(i.element).is(t)&&this._queue.splice(e,1)}else this._queue=[]},_destroy:function(t){t=t&&t.element?t.element:void 0;(t?$(t).find("."+this.MAIN_CSS_CLASS):$("."+this.MAIN_CSS_CLASS)).remove(),this._removeFromQueue(t)},_isShowingToastMessage:function(t){var e=!1;return e=t?0<$(t).find("."+this.MAIN_CSS_CLASS).size():e},_showNextInQueue:function(t){for(var e,i,o,n=0;n").addClass("background").css("background",e.backgroundColor),o=$("
").addClass("content").html(e.content).css("width",e.maxWidth+"px").css("color",e.fontColor),i=$("
").addClass(this.MAIN_CSS_CLASS).hide().append(i).append(o),$(t).append(i),o=-$(i).outerWidth()/2+"px",$(i).css("bottom",e.bottomMargin+"px").css("margin-left",o),$(i).stop().fadeIn(e.animationTime).delay(e.showTime).fadeOut(e.animationTime,function(){$(this).remove(),$.cftoaster._showNextInQueue(t)}))},setDefaults:function(t){t=$.extend({},$.fn.cftoaster.options,t);$.fn.cftoaster.options=t}}}),jQuery(document).ready(function(s){var l=0;s(".github-widget").each(function(){0==l&&s("head").append(''),l++;var t=s(this),e=t.data("repo"),i=e.split("/")[0],o=e.split("/")[1],n="http://github.com/"+i,r="http://github.com/"+i+"/"+o,a=s('');a.appendTo(t),s.ajax({url:"https://api.github.com/repos/"+e,dataType:"jsonp",success:function(t){var e=t.data,i="unknown";e.pushed_at&&(i=(t=new Date(e.pushed_at)).getMonth()+1+"-"+t.getDate()+"-"+t.getFullYear()),a.find(".watchers").text(e.watchers),a.find(".forks").text(e.forks),a.find(".description span").text(e.description),a.find(".updated").html("Latest commit to the "+e.default_branch+" branch on "+i),null!=e.homepage&&a.find(".link").append(s(" ").attr("href",e.homepage).text(e.homepage))}})})}),function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(t,e){this.defaults.type=t,this.defaults.name=e},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);settings.single.length||(settings.single="metadata");var data=$.data(elem,settings.single),attr;if(data)return data;if(data="{}","class"==settings.type){var m=settings.cre.exec(elem.className);m&&(data=m[1])}else if("elem"==settings.type){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);e.length&&(data=$.trim(e[0].innerHTML))}else{null!=elem.getAttribute&&(attr=elem.getAttribute(settings.name),attr&&(data=attr))}return data.indexOf("{")<0&&(data="{"+data+"}"),data=eval("("+data+")"),$.data(elem,settings.single,data),data}}}),$.fn.metadata=function(t){return $.metadata.get(this[0],t)}}(jQuery),jQuery.timeago.settings.strings={prefixAgo:null,prefixFromNow:"从现在开始",suffixAgo:"之前",suffixFromNow:null,seconds:"不到1分钟",minute:"大约1分钟",minutes:"%d分钟",hour:"大约1小时",hours:"大约%d小时",day:"1天",days:"%d天",month:"大约1个月",months:"%d月",year:"大约1年",years:"%d年",numbers:[],wordSeparator:""};var hex_chr="0123456789abcdef".split(""),QRCode;function rhex(t){for(var e="",i=0;i<4;i++)e+=hex_chr[t>>8*i+4&15]+hex_chr[t>>8*i&15];return e}function hex(t){for(var e=0;e>16)+(e>>16)+(i>>16)<<16|65535&i}md5("hello")}!function(o){var r,n="";o.fn.pasteUploadImage=function(t){return r=o(this),n=t,r.on("paste",function(t){var e,i=t.originalEvent;if(i.clipboardData&&i.clipboardData.items&&(e=isImage(i)))return t.preventDefault(),i=getFilename(i)||"image.png",pasteText("{{"+i+"(uploading...)}}"),uploadFile(e.getAsFile(),i)}),r.on("drop",function(t){var e,i=t.originalEvent;if(i.dataTransfer&&i.dataTransfer.files&&(e=isImageForDrop(i)))return t.preventDefault(),i=i.dataTransfer.files[0].name||"image.png",pasteText("{{"+i+"(uploading...)}}"),uploadFile(e,i)}),!0},pasteText=function(t){var e=r[0].selectionStart,i=r[0].selectionEnd,o=r.val().length,n=r.val().substring(0,e),o=r.val().substring(i,o);return r.val(n+t+o),r.get(0).setSelectionRange(e+t.length,i+t.length),r.trigger("input")},isImage=function(t){for(var e,i=0;i>>18,e[1]=128|(258048&n)>>>12,e[2]=128|(4032&n)>>>6,e[3]=128|63&n):2048>>12,e[1]=128|(4032&n)>>>6,e[2]=128|63&n):128>>6,e[1]=128|63&n):e[0]=n,this.parsedData=this.parsedData.concat(e)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function l(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function m(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var i=0;i>i);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=o}for(i=0;i<18;i++){o=!t&&1==(1&e>>i);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=o}},setupTypeInfo:function(t,e){for(var e=this.errorCorrectLevel<<3|e,i=b.getBCHTypeInfo(e),o=0;o<15;o++){var n=!t&&1==(1&i>>o);o<6?this.modules[o][8]=n:o<8?this.modules[o+1][8]=n:this.modules[this.moduleCount-15+o][8]=n}for(o=0;o<15;o++){n=!t&&1==(1&i>>o);o<8?this.modules[8][this.moduleCount-o-1]=n:o<9?this.modules[8][15-o-1+1]=n:this.modules[8][15-o-1]=n}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var i=-1,o=this.moduleCount-1,n=7,r=0,a=this.moduleCount-1;0>>n)),b.getMask(e,o,a-l)&&(s=!s),this.modules[o][a-l]=s,-1==--n&&(r++,n=7));if((o+=i)<0||this.moduleCount<=o){o-=i,i=-i;break}}}},l.PAD0=236,l.PAD1=17,l.createData=function(t,e,i){for(var o=u.getRSBlocks(t,e),n=new h,r=0;r8*s)throw new Error("code length overflow. ("+n.getLengthInBits()+">"+8*s+")");for(n.getLengthInBits()+4<=8*s&&n.put(0,4);0!=n.getLengthInBits()%8;)n.putBit(!1);for(;!(n.getLengthInBits()>=8*s)&&(n.put(l.PAD0,8),!(n.getLengthInBits()>=8*s));)n.put(l.PAD1,8);return l.createBytes(n,o)},l.createBytes=function(t,e){for(var i=0,o=0,n=0,r=new Array(e.length),a=new Array(e.length),s=0;s>>=1;return e},getPatternPosition:function(t){return b.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,i){switch(t){case n:return 0==(e+i)%2;case a:return 0==e%2;case s:return 0==i%3;case d:return 0==(e+i)%3;case p:return 0==(Math.floor(e/2)+Math.floor(i/3))%2;case f:return 0==e*i%2+e*i%3;case g:return 0==(e*i%2+e*i%3)%2;case _:return 0==(e*i%3+(e+i)%2)%2;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new m([1],0),i=0;i>>7-t%8)},put:function(t,e){for(var i=0;i>>e-i-1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var v=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],y=(C.prototype.draw=function(t){function e(t,e){var i,o=document.createElementNS("http://www.w3.org/2000/svg",t);for(i in e)e.hasOwnProperty(i)&&o.setAttribute(i,e[i]);return o}var i=this._htOption,o=this._el,n=t.getModuleCount();Math.floor(i.width/n),Math.floor(i.height/n),this.clear();var r=e("svg",{viewBox:"0 0 "+String(n)+" "+String(n),width:"100%",height:"100%",fill:i.colorLight});r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),o.appendChild(r),r.appendChild(e("rect",{fill:i.colorDark,width:"1",height:"1",id:"template"}));for(var a,s=0;s'],s=0;s");for(var l=0;l');a.push("")}a.push(""),i.innerHTML=a.join("");var h=i.childNodes[0],u=(e.width-h.offsetWidth)/2,i=(e.height-h.offsetHeight)/2;0>>32-n,i)}function ff(t,e,i,o,n,r,a){return cmn(e&i|~e&o,t,e,n,r,a)}function gg(t,e,i,o,n,r,a){return cmn(e&o|i&~o,t,e,n,r,a)}function hh(t,e,i,o,n,r,a){return cmn(e^i^o,t,e,n,r,a)}function ii(t,e,i,o,n,r,a){return cmn(i^(e|~o),t,e,n,r,a)}function md51(t){txt="";for(var e=t.length,i=[1732584193,-271733879,-1732584194,271733878],o=64;o<=t.length;o+=64)md5cycle(i,md5blk(t.substring(o-64,o)));t=t.substring(o-64);var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(o=0;o>2]|=t.charCodeAt(o)<<(o%4<<3);if(n[o>>2]|=128<<(o%4<<3),55>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return e}emojis=$.map(emojis,function(t,e){return{key:":"+t+":",name:t}}),function(d){d.fn.Huploadify=function(t){function u(t,e){return t=1048576${fileName} 上传 删除 ',onUploadStart:null,onUploadSuccess:null,onUploadComplete:null,onUploadAllComplete:null,onUploadError:null,onInit:null,onCancel:null},c=d.extend(e,t);this.each(function(){var s=d(this),l=d(".uploadify").length+1,t='