diff --git a/conf/config.json b/conf/config.json index 48d4d359..b4660d2f 100644 --- a/conf/config.json +++ b/conf/config.json @@ -4,7 +4,7 @@ /* 上传图片配置项 */ "imageActionName": "uploadimage", /* 执行上传图片的action名称 */ "imageFieldName": "upfile", /* upfile提交的图片表单名称 */ - "imageMaxSize": 2048000, /* 上传大小限制,单位B */ + "imageMaxSize": 20480000, /* 上传大小限制,单位B */ "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */ "imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressBorder": 800, /* 图片压缩最长边限制 */ @@ -68,7 +68,8 @@ ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", - ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" + ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml", + ".dwg",".dgn" ], /* 上传文件格式显示 */ /* 列出指定目录下的图片 */ diff --git a/controllers/article.go b/controllers/article.go index 6f096338..91f9ef72 100644 --- a/controllers/article.go +++ b/controllers/article.go @@ -7,6 +7,7 @@ import ( "github.com/astaxie/beego/httplib" "time" // "os" + "regexp" "strconv" "strings" // "path" @@ -201,6 +202,72 @@ func (c *ArticleController) GetArticle() { projurls = "/" + strings.Replace(proj.ParentIdPath, "-", "/", -1) + "/" + strconv.FormatInt(proj.Id, 10) } + //上一篇和下一篇 + //根据项目id取得所有成果 + products, err := models.GetProducts(proj.Id) + if err != nil { + beego.Error(err) + } + + // Attachslice := make([]AttachmentLink, 0) + Articles := make([]*models.Article, 0) + for _, w := range products { + //取到每个成果的附件(模态框打开);pdf、文章——新窗口打开 + //循环成果 + //每个成果取到所有附件 + //一个附件则直接打开/下载;2个以上则打开模态框 + //取得文章 + Articles1, err := models.GetArticles(w.Id) + if err != nil { + beego.Error(err) + } + Articles = append(Articles, Articles1...) + } + + // count := len(Articles) + // count1 := strconv.Itoa(count) + // count2, err := strconv.ParseInt(count1, 10, 64) + // if err != nil { + // beego.Error(err) + // } + + // if p == "" {//这里是用于在页面打开pdf附件的时候,显示地址是/pdf?id=628,id是附件id + // var p1 string + for i, v := range Articles { + if v.Id == idNum { //idnumb是附件的id + // p1 = strconv.Itoa(i + 1) + // PdfLink = Url + "/" + v.FileName + //上一篇 + if i > 0 { + c.Data["NextArticleId"] = strconv.FormatInt(Articles[i-1].Id, 10) + //由文章id取得prodtitle + //查出成果编号,名称和作者 + articleprod, err := models.GetProd(Articles[i-1].ProductId) + if err != nil { + beego.Error(err) + } + c.Data["NextArticleTitle"] = articleprod.Title + c.Data["Next"] = true + } else { + c.Data["Next"] = false + } + if i < len(Articles)-1 { + c.Data["PreArticleId"] = strconv.FormatInt(Articles[i+1].Id, 10) + //由文章id取得prodtitle + //查出成果编号,名称和作者 + articleprod, err := models.GetProd(Articles[i+1].ProductId) + if err != nil { + beego.Error(err) + } + c.Data["PreArticleTitle"] = articleprod.Title + c.Data["Pre"] = true + } else { + c.Data["Pre"] = false + } + break + } + } + // if e.Enforce(useridstring, projurls+"/", "POST", ".1") { // c.Data["RoleAdd"] = "true" // } else { @@ -217,9 +284,21 @@ func (c *ArticleController) GetArticle() { c.Data["RoleDelete"] = "false" } // c.Data["productid"] = prod.Uid//文章作者id + u := c.Ctx.Input.UserAgent() + matched, err := regexp.MatchString("AppleWebKit.*Mobile.*", u) + if err != nil { + beego.Error(err) + } + if matched == true { + // beego.Info("移动端~") + c.TplName = "marticle.tpl" + } else { + // beego.Info("电脑端!") + c.TplName = "article.tpl" + } c.Data["article"] = Article c.Data["product"] = prod - c.TplName = "article.tpl" + } //向某个侧栏id下添加文章 @@ -244,153 +323,163 @@ func (c *ArticleController) AddArticle() { var news string var cid int64 - _, role := checkprodRole(c.Ctx) - if role == 1 { - // id := c.Ctx.Input.Param(":id") - pid := c.Input().Get("pid") - code := c.Input().Get("code") - title := c.Input().Get("title") - subtext := c.Input().Get("subtext") - label := c.Input().Get("label") - principal := c.Input().Get("principal") - content := c.Input().Get("content") - // c.Data["Id"] = id - // beego.Info(subtext) - //id转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - //根据项目id添加成果code, title, label, principal, content string, projectid int64 - Id, err := models.AddProduct(code, title, label, principal, "", user.Id, pidNum) - if err != nil { - beego.Error(err) - } + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + // id := c.Ctx.Input.Param(":id") + pid := c.Input().Get("pid") + code := c.Input().Get("code") + title := c.Input().Get("title") + subtext := c.Input().Get("subtext") + label := c.Input().Get("label") + principal := c.Input().Get("principal") + relevancy := c.Input().Get("relevancy") + content := c.Input().Get("content") + // c.Data["Id"] = id + // beego.Info(subtext) + //id转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + //根据项目id添加成果code, title, label, principal, content string, projectid int64 + Id, err := models.AddProduct(code, title, label, principal, "", user.Id, pidNum) + if err != nil { + beego.Error(err) + } - //成果写入postmerit表,准备提交merit********* - Number, Name, DesignStage, Section, err := GetProjTitleNumber(pidNum) + //*****添加成果关联信息 + if relevancy != "" { + _, err = models.AddRelevancy(Id, relevancy) if err != nil { beego.Error(err) } - catalog.ProjectNumber = Number - catalog.ProjectName = Name - catalog.DesignStage = DesignStage - catalog.Section = Section - - catalog.Tnumber = code - catalog.Name = title - catalog.Count = 1 - catalog.Drawn = meritbasic.Nickname - catalog.Designd = meritbasic.Nickname - catalog.Author = meritbasic.Username - catalog.Drawnratio = 0.4 - catalog.Designdratio = 0.4 - - const lll = "2006-01-02" - convdate := time.Now().Format(lll) - t1, err := time.Parse(lll, convdate) //这里t1要是用t1:=就不是前面那个t1了 - if err != nil { - beego.Error(err) - } - catalog.Datestring = convdate - catalog.Date = t1 + } + //*****添加成果关联信息结束 - catalog.Created = time.Now() //.Add(+time.Duration(hours) * time.Hour) - catalog.Updated = time.Now() //.Add(+time.Duration(hours) * time.Hour) + //成果写入postmerit表,准备提交merit********* + Number, Name, DesignStage, Section, err := GetProjTitleNumber(pidNum) + if err != nil { + beego.Error(err) + } + catalog.ProjectNumber = Number + catalog.ProjectName = Name + catalog.DesignStage = DesignStage + catalog.Section = Section - catalog.Complex = 1 - catalog.State = 0 - //生成提交merit的清单结束******************* + catalog.Tnumber = code + catalog.Name = title + catalog.Count = 1 + catalog.Drawn = meritbasic.Nickname + catalog.Designd = meritbasic.Nickname + catalog.Author = meritbasic.Username + catalog.Drawnratio = 0.4 + catalog.Designdratio = 0.4 + + const lll = "2006-01-02" + convdate := time.Now().Format(lll) + t1, err := time.Parse(lll, convdate) //这里t1要是用t1:=就不是前面那个t1了 + if err != nil { + beego.Error(err) + } + catalog.Datestring = convdate + catalog.Date = t1 + + catalog.Created = time.Now() //.Add(+time.Duration(hours) * time.Hour) + catalog.Updated = time.Now() //.Add(+time.Duration(hours) * time.Hour) - //将文章添加到成果id下 - aid, err := models.AddArticle(subtext, content, Id) + catalog.Complex = 1 + catalog.State = 0 + //生成提交merit的清单结束******************* + + //将文章添加到成果id下 + aid, err := models.AddArticle(subtext, content, Id) + if err != nil { + beego.Error(err) + } else { + //生成提交merit的清单******************* + cid, err, news = models.AddPostMerit(catalog) if err != nil { beego.Error(err) } else { - //生成提交merit的清单******************* - cid, err, news = models.AddPostMerit(catalog) + link1 := "/project/product/article/" + strconv.FormatInt(aid, 10) //附件链接地址 + _, err = models.AddCatalogLink(cid, link1) if err != nil { beego.Error(err) - } else { - link1 := "/project/product/article/" + strconv.FormatInt(aid, 10) //附件链接地址 - _, err = models.AddCatalogLink(cid, link1) - if err != nil { - beego.Error(err) - } - data := news - c.Ctx.WriteString(data) } - //生成提交merit的清单结束******************* - c.Data["json"] = "ok" - c.ServeJSON() + data := news + c.Ctx.WriteString(data) } - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return + //生成提交merit的清单结束******************* + c.Data["json"] = "ok" + c.ServeJSON() } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // c.Redirect("/roleerr", 302) + // return + // } } //向成果id下添加文章——这个没用,上面那个已经包含了 func (c *ArticleController) AddProdArticle() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - // id := c.Ctx.Input.Param(":id") - pid := c.Input().Get("pid") - subtext := c.Input().Get("subtext") - content := c.Input().Get("content") - //id转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - //将文章添加到成果id下 - _, err = models.AddArticle(subtext, content, pidNum) - if err != nil { - beego.Error(err) - } else { - c.Data["json"] = "ok" - c.ServeJSON() - } + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + // id := c.Ctx.Input.Param(":id") + pid := c.Input().Get("pid") + subtext := c.Input().Get("subtext") + content := c.Input().Get("content") + //id转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + //将文章添加到成果id下 + _, err = models.AddArticle(subtext, content, pidNum) + if err != nil { + beego.Error(err) } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return + c.Data["json"] = "ok" + c.ServeJSON() } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } //编辑 成果id func (c *ArticleController) UpdateArticle() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - // id := c.Ctx.Input.Param(":id") - pid := c.Input().Get("pid") - subtext := c.Input().Get("subtext") - content := c.Input().Get("content") - //id转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - //将文章添加到成果id下 - err = models.UpdateArticle(pidNum, subtext, content) - if err != nil { - beego.Error(err) - } else { - c.Data["json"] = "ok" - c.ServeJSON() - } + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + // id := c.Ctx.Input.Param(":id") + pid := c.Input().Get("pid") + subtext := c.Input().Get("subtext") + content := c.Input().Get("content") + //id转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + //将文章添加到成果id下 + err = models.UpdateArticle(pidNum, subtext, content) + if err != nil { + beego.Error(err) } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return + c.Data["json"] = "ok" + c.ServeJSON() } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } //根据文章id删除文章_没删除文章中的图片 diff --git a/controllers/attachment.go b/controllers/attachment.go index c76838fd..b5082c15 100644 --- a/controllers/attachment.go +++ b/controllers/attachment.go @@ -51,9 +51,9 @@ func (c *AttachController) GetAttachments() { beego.Error(err) } // beego.Info(Url) - } else { + } //else { - } + //} //根据成果id取得所有附件 Attachments, err := models.GetAttachments(idNum) if err != nil { @@ -261,7 +261,7 @@ func (c *AttachController) GetPdfs() { if err != nil { beego.Error(err) } - beego.Info(Url) + // beego.Info(Url) } else { } @@ -612,237 +612,237 @@ func (c *AttachController) AddAttachment2() { var news string var cid int64 - _, role := checkprodRole(c.Ctx) - if role == 1 { - //解析表单 - pid := c.Input().Get("pid") - // beego.Info(pid) - //pid转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - prodcode := c.Input().Get("prodcode") //和上面那个区别仅仅在此处而已 - prodname := c.Input().Get("prodname") - prodlabel := c.Input().Get("prodlabel") - prodprincipal := c.Input().Get("prodprincipal") - size := c.Input().Get("size") - filesize, err := strconv.ParseInt(size, 10, 64) - if err != nil { - beego.Error(err) - } - filesize = filesize / 1000.0 - // proj, err := models.GetProj(pidNum) - // if err != nil { - // beego.Error(err) - // } - //根据proj的Id - Url, DiskDirectory, err := GetUrlPath(pidNum) + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + //解析表单 + pid := c.Input().Get("pid") + // beego.Info(pid) + //pid转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + prodcode := c.Input().Get("prodcode") //和上面那个区别仅仅在此处而已 + prodname := c.Input().Get("prodname") + prodlabel := c.Input().Get("prodlabel") + prodprincipal := c.Input().Get("prodprincipal") + size := c.Input().Get("size") + filesize, err := strconv.ParseInt(size, 10, 64) + if err != nil { + beego.Error(err) + } + filesize = filesize / 1000.0 + // proj, err := models.GetProj(pidNum) + // if err != nil { + // beego.Error(err) + // } + //根据proj的Id + Url, DiskDirectory, err := GetUrlPath(pidNum) + if err != nil { + beego.Error(err) + } + Number, Name, DesignStage, Section, err := GetProjTitleNumber(pidNum) + if err != nil { + beego.Error(err) + } + catalog.ProjectNumber = Number + catalog.ProjectName = Name + catalog.DesignStage = DesignStage + catalog.Section = Section + + //获取上传的文件 + _, h, err := c.GetFile("file") + if err != nil { + beego.Error(err) + } + var path, attachment string + // var filesize int64 + if h != nil { + //保存附件 + attachment = h.Filename + path = DiskDirectory + "\\" + h.Filename + // f.Close()// 关闭上传的文件,不然的话会出现临时文件不能清除的情况 + //存入成果数据库 + //如果编号重复,则不写入,值返回Id值。 + //根据id添加成果code, title, label, principal, content string, projectid int64 + prodId, err := models.AddProduct(prodcode, prodname, prodlabel, prodprincipal, "", user.Id, pidNum) if err != nil { beego.Error(err) } - Number, Name, DesignStage, Section, err := GetProjTitleNumber(pidNum) + + //成果写入postmerit表,准备提交merit********* + catalog.Tnumber = prodcode + catalog.Name = prodname + catalog.Count = 1 + catalog.Drawn = meritbasic.Nickname + catalog.Designd = meritbasic.Nickname + catalog.Author = meritbasic.Username + catalog.Drawnratio = 0.4 + catalog.Designdratio = 0.4 + + const lll = "2006-01-02" + convdate := time.Now().Format(lll) + t1, err := time.Parse(lll, convdate) //这里t1要是用t1:=就不是前面那个t1了 if err != nil { beego.Error(err) } - catalog.ProjectNumber = Number - catalog.ProjectName = Name - catalog.DesignStage = DesignStage - catalog.Section = Section + catalog.Datestring = convdate + catalog.Date = t1 + + catalog.Created = time.Now() //.Add(+time.Duration(hours) * time.Hour) + catalog.Updated = time.Now() //.Add(+time.Duration(hours) * time.Hour) - //获取上传的文件 - _, h, err := c.GetFile("file") + catalog.Complex = 1 + catalog.State = 0 + cid, err, news = models.AddPostMerit(catalog) if err != nil { beego.Error(err) - } - var path, attachment string - // var filesize int64 - if h != nil { - //保存附件 - attachment = h.Filename - path = DiskDirectory + "\\" + h.Filename - // f.Close()// 关闭上传的文件,不然的话会出现临时文件不能清除的情况 - //存入成果数据库 - //如果编号重复,则不写入,值返回Id值。 - //根据id添加成果code, title, label, principal, content string, projectid int64 - prodId, err := models.AddProduct(prodcode, prodname, prodlabel, prodprincipal, "", user.Id, pidNum) - if err != nil { - beego.Error(err) - } - - //成果写入postmerit表,准备提交merit********* - catalog.Tnumber = prodcode - catalog.Name = prodname - catalog.Count = 1 - catalog.Drawn = meritbasic.Nickname - catalog.Designd = meritbasic.Nickname - catalog.Author = meritbasic.Username - catalog.Drawnratio = 0.4 - catalog.Designdratio = 0.4 - - const lll = "2006-01-02" - convdate := time.Now().Format(lll) - t1, err := time.Parse(lll, convdate) //这里t1要是用t1:=就不是前面那个t1了 + } else { + link1 := Url + "/" + attachment //附件链接地址 + _, err = models.AddCatalogLink(cid, link1) if err != nil { beego.Error(err) } - catalog.Datestring = convdate - catalog.Date = t1 - - catalog.Created = time.Now() //.Add(+time.Duration(hours) * time.Hour) - catalog.Updated = time.Now() //.Add(+time.Duration(hours) * time.Hour) + data := news + c.Ctx.WriteString(data) + } + //生成提交merit的清单结束******************* - catalog.Complex = 1 - catalog.State = 0 - cid, err, news = models.AddPostMerit(catalog) + //把成果id作为附件的parentid,把附件的名称等信息存入附件数据库 + //如果附件名称相同,则覆盖上传,但数据库不追加 + _, err = models.AddAttachment(attachment, filesize, 0, prodId) + if err != nil { + beego.Error(err) + } else { + err = c.SaveToFile("file", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 if err != nil { beego.Error(err) - } else { - link1 := Url + "/" + attachment //附件链接地址 - _, err = models.AddCatalogLink(cid, link1) - if err != nil { - beego.Error(err) - } - data := news - c.Ctx.WriteString(data) - } - //生成提交merit的清单结束******************* - - //把成果id作为附件的parentid,把附件的名称等信息存入附件数据库 - //如果附件名称相同,则覆盖上传,但数据库不追加 - _, err = models.AddAttachment(attachment, filesize, 0, prodId) - if err != nil { - beego.Error(err) - } else { - err = c.SaveToFile("file", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 - if err != nil { - beego.Error(err) - } - c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "title": attachment, "original": attachment, "url": Url + "/" + attachment} - c.ServeJSON() } + c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "title": attachment, "original": attachment, "url": Url + "/" + attachment} + c.ServeJSON() } - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } //向一个成果id下追加附件 func (c *AttachController) UpdateAttachment() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - //解析表单 - pid := c.Input().Get("pid") - size := c.Input().Get("size") - filesize, err := strconv.ParseInt(size, 10, 64) + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + //解析表单 + pid := c.Input().Get("pid") + size := c.Input().Get("size") + filesize, err := strconv.ParseInt(size, 10, 64) + if err != nil { + beego.Error(err) + } + filesize = filesize / 1000.0 + // beego.Info(pid) + //pid转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + + prod, err := models.GetProd(pidNum) + if err != nil { + beego.Error(err) + } + //根据proj的Id + Url, DiskDirectory, err := GetUrlPath(prod.ProjectId) + if err != nil { + beego.Error(err) + } + //获取上传的文件 + _, h, err := c.GetFile("file") + if err != nil { + beego.Error(err) + } + var path, attachment string + // var filesize int64 + if h != nil { + //保存附件 + attachment = h.Filename + path = DiskDirectory + "\\" + h.Filename // 关闭上传的文件,不然的话会出现临时文件不能清除的情况 + // filesize, _ = FileSize(path) + // filesize = filesize / 1000.0 + //把成果id作为附件的parentid,把附件的名称等信息存入附件数据库 + //如果附件名称相同,则覆盖上传,但数据库不追加 + _, err = models.AddAttachment(attachment, filesize, 0, pidNum) if err != nil { beego.Error(err) + } else { + err = c.SaveToFile("file", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 + if err != nil { + beego.Error(err) + } + c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "title": attachment, "original": attachment, "url": Url + "/" + attachment} + c.ServeJSON() } - filesize = filesize / 1000.0 - // beego.Info(pid) - //pid转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) + } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } +} + +//删除附件——这个用于针对删除一个附件 +func (c *AttachController) DeleteAttachment() { + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + //解析表单 + ids := c.GetString("ids") + array := strings.Split(ids, ",") + for _, v := range array { + // pid = strconv.FormatInt(v1, 10) + //id转成64位 + idNum, err := strconv.ParseInt(v, 10, 64) if err != nil { beego.Error(err) } - - prod, err := models.GetProd(pidNum) + //取得附件的成果id——再取得成果的项目目录id——再取得路径 + attach, err := models.GetAttachbyId(idNum) if err != nil { beego.Error(err) } - //根据proj的Id - Url, DiskDirectory, err := GetUrlPath(prod.ProjectId) + prod, err := models.GetProd(attach.ProductId) if err != nil { beego.Error(err) } - //获取上传的文件 - _, h, err := c.GetFile("file") + //根据proj的id + _, DiskDirectory, err := GetUrlPath(prod.ProjectId) if err != nil { beego.Error(err) - } - var path, attachment string - // var filesize int64 - if h != nil { - //保存附件 - attachment = h.Filename - path = DiskDirectory + "\\" + h.Filename // 关闭上传的文件,不然的话会出现临时文件不能清除的情况 - // filesize, _ = FileSize(path) - // filesize = filesize / 1000.0 - //把成果id作为附件的parentid,把附件的名称等信息存入附件数据库 - //如果附件名称相同,则覆盖上传,但数据库不追加 - _, err = models.AddAttachment(attachment, filesize, 0, pidNum) - if err != nil { - beego.Error(err) - } else { - err = c.SaveToFile("file", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 - if err != nil { - beego.Error(err) - } - c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "title": attachment, "original": attachment, "url": Url + "/" + attachment} - c.ServeJSON() - } - } - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return - } -} - -//删除附件——这个用于针对删除一个附件 -func (c *AttachController) DeleteAttachment() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - //解析表单 - ids := c.GetString("ids") - array := strings.Split(ids, ",") - for _, v := range array { - // pid = strconv.FormatInt(v1, 10) - //id转成64位 - idNum, err := strconv.ParseInt(v, 10, 64) - if err != nil { - beego.Error(err) - } - //取得附件的成果id——再取得成果的项目目录id——再取得路径 - attach, err := models.GetAttachbyId(idNum) + } else { + path := DiskDirectory + "\\" + attach.FileName + err = os.Remove(path) if err != nil { beego.Error(err) } - prod, err := models.GetProd(attach.ProductId) + err = models.DeleteAttachment(idNum) if err != nil { beego.Error(err) } - //根据proj的id - _, DiskDirectory, err := GetUrlPath(prod.ProjectId) - if err != nil { - beego.Error(err) - } else { - path := DiskDirectory + "\\" + attach.FileName - err = os.Remove(path) - if err != nil { - beego.Error(err) - } - err = models.DeleteAttachment(idNum) - if err != nil { - beego.Error(err) - } - } } - c.Data["json"] = "ok" - c.ServeJSON() - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return } + c.Data["json"] = "ok" + c.ServeJSON() + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } // 下载附件——这个仅是测试 diff --git a/controllers/product.go b/controllers/product.go index 568c60dd..dad9e524 100644 --- a/controllers/product.go +++ b/controllers/product.go @@ -25,6 +25,7 @@ type ProductLink struct { Code string Title string Label string + Relevancy []models.Relevancy Uid int64 Principal string ProjectId int64 @@ -102,13 +103,13 @@ func (c *ProdController) GetProjProd() { c.Data["Uid"] = user.Id // userrole = user.Role useridstring = strconv.FormatInt(user.Id, 10) - } else { - // userrole = 5 - // route := c.Ctx.Request.URL.String() - // c.Data["Url"] = route - // c.Redirect("/roleerr?url="+route, 302) - // return - } + } //else { + // userrole = 5 + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // return + //} //2.取得侧栏目录路径——路由id //2.1 根据id取得路由 var projurls string @@ -278,6 +279,51 @@ func (c *ProdController) GetProducts() { } linkarr[0].Articlecontent = Articleslice Articleslice = make([]ArticleContent, 0) + + //取得关联 + relevancies, err := models.GetRelevancy(w.Id) + if err != nil { + beego.Error(err) + } + relevancies1 := make([]models.Relevancy, 0) + if len(relevancies) > 0 { + for _, tt := range relevancies { + relevancies2 := make([]models.Relevancy, 1) + relevancies2[0].Relevancy = tt.Relevancy + relevancies1 = append(relevancies1, relevancies2...) + } + linkarr[0].Relevancy = relevancies1 + relevancies1 = make([]models.Relevancy, 0) + } else if len(relevancies) == 0 { + //循环所有relevancies,以,号分割,如果相等prodcode,则返回 + relevancies3, err := models.GetAllRelevancies() + if err != nil { + beego.Error(err) + } + // if len(relevancies)>0{} + for _, vv := range relevancies3 { + array := strings.Split(vv.Relevancy, ",") + // beego.Info(array) + for _, ww := range array { + if ww == w.Code { + relevancies2 := make([]models.Relevancy, 1) + // v.ProductId查出prodcode + prod, err := models.GetProd(vv.ProductId) + if err != nil { + beego.Error(err) + } else { + // beego.Info(ww) //20171228 + // beego.Info(prod.Code) //20171231 + relevancies2[0].Relevancy = prod.Code + relevancies1 = append(relevancies1, relevancies2...) + } + break + } + } + } + linkarr[0].Relevancy = relevancies1 + // relevancies1 = make([]models.Relevancy, 0) + } link = append(link, linkarr...) } @@ -612,111 +658,111 @@ func (c *ProdController) AddProduct() { //编辑成果信息 func (c *ProdController) UpdateProduct() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - id := c.Input().Get("pid") - code := c.Input().Get("code") - title := c.Input().Get("title") - label := c.Input().Get("label") - principal := c.Input().Get("principal") + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + id := c.Input().Get("pid") + code := c.Input().Get("code") + title := c.Input().Get("title") + label := c.Input().Get("label") + principal := c.Input().Get("principal") - //id转成64为 - idNum, err := strconv.ParseInt(id, 10, 64) + //id转成64为 + idNum, err := strconv.ParseInt(id, 10, 64) + if err != nil { + beego.Error(err) + } + //根据id添加成果code, title, label, principal, content string, projectid int64 + err = models.UpdateProduct(idNum, code, title, label, principal) + if err != nil { + beego.Error(err) + } + c.Data["json"] = "ok" + c.ServeJSON() + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } +} + +//删除成果,包含成果里的附件。删除附件用attachment中的 +func (c *ProdController) DeleteProduct() { + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + ids := c.GetString("ids") + array := strings.Split(ids, ",") + for _, v := range array { + // pid = strconv.FormatInt(v1, 10) + //id转成64位 + idNum, err := strconv.ParseInt(v, 10, 64) if err != nil { beego.Error(err) } - //根据id添加成果code, title, label, principal, content string, projectid int64 - err = models.UpdateProduct(idNum, code, title, label, principal) + //循环删除成果 + //根据成果id取得所有附件 + attachments, err := models.GetAttachments(idNum) if err != nil { beego.Error(err) } - c.Data["json"] = "ok" - c.ServeJSON() - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return - } -} - -//删除成果,包含成果里的附件。删除附件用attachment中的 -func (c *ProdController) DeleteProduct() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - ids := c.GetString("ids") - array := strings.Split(ids, ",") - for _, v := range array { - // pid = strconv.FormatInt(v1, 10) - //id转成64位 - idNum, err := strconv.ParseInt(v, 10, 64) + for _, w := range attachments { + //取得附件的成果id——再取得成果的项目目录id——再取得路径 + attach, err := models.GetAttachbyId(w.Id) if err != nil { beego.Error(err) } - //循环删除成果 - //根据成果id取得所有附件 - attachments, err := models.GetAttachments(idNum) + prod, err := models.GetProd(attach.ProductId) if err != nil { beego.Error(err) } - for _, w := range attachments { - //取得附件的成果id——再取得成果的项目目录id——再取得路径 - attach, err := models.GetAttachbyId(w.Id) - if err != nil { - beego.Error(err) - } - prod, err := models.GetProd(attach.ProductId) - if err != nil { - beego.Error(err) - } - //根据proj的id - _, DiskDirectory, err := GetUrlPath(prod.ProjectId) + //根据proj的id + _, DiskDirectory, err := GetUrlPath(prod.ProjectId) + if err != nil { + beego.Error(err) + } else { + path := DiskDirectory + "\\" + attach.FileName + //删除附件 + err = os.Remove(path) if err != nil { beego.Error(err) - } else { - path := DiskDirectory + "\\" + attach.FileName - //删除附件 - err = os.Remove(path) - if err != nil { - beego.Error(err) - } - //删除附件数据表 - err = models.DeleteAttachment(w.Id) - if err != nil { - beego.Error(err) - } } - } - //删除文章,文章中的图片无法删除 - //取得成果id下所有文章 - articles, err := models.GetArticles(idNum) - if err != nil { - beego.Error(err) - } - //删除文章表 - for _, z := range articles { - //删除文章数据表 - err = models.DeleteArticle(z.Id) + //删除附件数据表 + err = models.DeleteAttachment(w.Id) if err != nil { beego.Error(err) } } - err = models.DeleteProduct(idNum) //删除成果数据表 + } + //删除文章,文章中的图片无法删除 + //取得成果id下所有文章 + articles, err := models.GetArticles(idNum) + if err != nil { + beego.Error(err) + } + //删除文章表 + for _, z := range articles { + //删除文章数据表 + err = models.DeleteArticle(z.Id) if err != nil { beego.Error(err) - } else { - c.Data["json"] = "ok" - c.ServeJSON() } } - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return + err = models.DeleteProduct(idNum) //删除成果数据表 + if err != nil { + beego.Error(err) + } else { + c.Data["json"] = "ok" + c.ServeJSON() + } } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } func checkprodRole(ctx *context.Context) (uname string, role int) { @@ -731,7 +777,11 @@ func checkprodRole(ctx *context.Context) (uname string, role int) { if err != nil { beego.Error(err) } - userrole = user.Role + if user.Role == 0 { + userrole = 4 + } else { + userrole = user.Role + } } else { userrole = 5 uname = ctx.Input.IP() diff --git a/controllers/project.go b/controllers/project.go index e3c2fdbe..0bc1996b 100644 --- a/controllers/project.go +++ b/controllers/project.go @@ -859,7 +859,7 @@ func (c *ProjController) AddCalendar() { start := c.Input().Get("start") end := c.Input().Get("end") color := c.Input().Get("color") - url := "/" + c.Input().Get("url") + url := c.Input().Get("url") //"/" + allday1 := c.Input().Get("allday") var allday bool if allday1 == "true" { @@ -967,7 +967,7 @@ func (c *ProjController) UpdateCalendar() { start := c.Input().Get("start") end := c.Input().Get("end") color := c.Input().Get("color") - url := "/" + c.Input().Get("url") + url := c.Input().Get("url") //"/" + memorabilia1 := c.Input().Get("memorabilia") var memorabilia bool if memorabilia1 == "true" { diff --git a/controllers/roleControllers.go b/controllers/roleControllers.go index d2e3b7c2..b22aaf6b 100644 --- a/controllers/roleControllers.go +++ b/controllers/roleControllers.go @@ -4,9 +4,11 @@ import ( // "encoding/json" m "engineercms/models" "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" "github.com/casbin/beego-orm-adapter" "github.com/casbin/casbin" _ "github.com/mattn/go-sqlite3" + "path" "regexp" "strconv" "strings" @@ -40,6 +42,17 @@ type Tree struct { Nodes []Tree `json:"nodes"` } +// type CasbinRule struct { +// Id int +// PType string +// V0 string +// V1 string +// V2 string +// V3 string +// V4 string +// V5 string +// } + // type RoleController struct { // models models.RoleModel // } @@ -206,7 +219,7 @@ func (c *RoleController) Get() { // if err != nil { // beego.Error(err) // } - //查出用户的角色,处于勾选状态 + //查出用户的角色,处于勾选状态,来自casbin\rbac_api.go userroles := e.GetRolesForUser(id) userrole := make([]Userrole, 0) var level string @@ -382,6 +395,7 @@ func (c *RoleController) UserRole() { // beego.Info(rule) // e.AddPolicy(uid, v1) e.AddGroupingPolicy(uid, v1) + //应该用AddRoleForUser() // rule = make([]string, 0) } // a.SavePolicy(e.GetModel())//autosave默认是true @@ -488,6 +502,7 @@ func (c *RoleController) RolePermission() { // beego.Info(action) // beego.Info(suf) success = e.AddPolicy(v1, projurl, action, suf) + //这里应该用AddPermissionForUser(),来自casbin\rbac_api.go } } } @@ -529,6 +544,43 @@ func highest(nodeid, nodesid []string, i int) (nodesid1 []string, err error) { return nodesid, err } +//查询角色所具有的权限对应的项目目录 +func (c *RoleController) GetRolePermission() { + roleid := c.GetString("roleid") //角色id + action := c.GetString("action") + projectid := c.GetString("projectid") + beego.Info(roleid) + beego.Info(action) + beego.Info(projectid) + myRes := e.GetPermissionsForUser(roleid) + beego.Info(myRes) + // 2018/01/03 21:42:15 [I] [roleControllers.go:543] [[1 /25001/* POST .*] [1 /25001 + // /* PUT .*] [1 /25001/* DELETE .*] [1 /25001/* GET .*] [1 /25001/25003/* GET (?i: + // PDF)] [1 /25001/25002/25013/* GET (?i:PDF)] [1 /25001/25002/25012/* GET (?i:PDF) + // ] [1 /25001/25002/25011/* GET (?i:PDF)] [1 /25001/* GET (?i:PDF)] [1 /25001/2500 + // 4/* POST .*]] + // Permissions, err := models.GetPermissions(roleid,projectid,action) + // if err != nil { + // beego.Error(err) + // } + var paths []beegoormadapter.CasbinRule + o := orm.NewOrm() + qs := o.QueryTable("casbin_rule") + _, err := qs.Filter("PType", "p").Filter("v0", roleid).Filter("v1__contains", "/"+projectid+"/").Filter("v2", action).All(&paths) + if err != nil { + beego.Error(err) + } + // beego.Info(paths) + var projids []string + for _, v1 := range paths { + projid := strings.Replace(v1.V1, "/*", "", -1) + projids = append(projids, path.Base(projid)) + } + beego.Info(projids) + c.Data["json"] = projids + c.ServeJSON() +} + // swagger:operation POST /v1/auth/role/delete RoleController RoleController // // 删除角色信息 diff --git a/controllers/ueditor.go b/controllers/ueditor.go index 1cd215b5..817bf0bd 100644 --- a/controllers/ueditor.go +++ b/controllers/ueditor.go @@ -54,7 +54,7 @@ type UploadimageUE struct { func (c *UeditorController) ControllerUE() { op := c.Input().Get("action") - // key := c.Input().Get("key") //这里进行判断各个页面,如果是addtopic,如果是addcategory + key := c.Input().Get("key") //这里进行判断各个页面,如果是addtopic,如果是addcategory switch op { case "config": //这里还是要优化成conf/config.json // $CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents("config.json")), true); @@ -109,54 +109,81 @@ func (c *UeditorController) ControllerUE() { // c.Data["json"] = r // c.ServeJSON() case "uploadimage", "uploadfile", "uploadvideo": - //解析表单 - pid := c.Input().Get("pid") - beego.Info(pid) - //pid转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - //根据proj的parentIdpath - Url, DiskDirectory, err := GetUrlPath(pidNum) - if err != nil { - beego.Error(err) - } - beego.Info(DiskDirectory) - //获取上传的文件 - _, h, err := c.GetFile("upfile") - if err != nil { - beego.Error(err) - } - fileSuffix := path.Ext(h.Filename) - // random_name - newname := strconv.FormatInt(time.Now().UnixNano(), 10) + fileSuffix // + "_" + filename - // err = ioutil.WriteFile(path1+newname+".jpg", ddd, 0666) //buffer输出到jpg文件中(不做处理,直接写到文件) - // if err != nil { - // beego.Error(err) - // } - year, month, _ := time.Now().Date() - err = os.MkdirAll(DiskDirectory+"\\"+strconv.Itoa(year)+month.String()+"\\", 0777) //..代表本当前exe文件目录的上级,.表示当前目录,没有.表示盘的根目录 - if err != nil { - beego.Error(err) - } - var path string - var filesize int64 - if h != nil { - //保存附件 - path = DiskDirectory + "\\" + strconv.Itoa(year) + month.String() + "\\" + newname - Url = "/" + Url + "/" + strconv.Itoa(year) + month.String() + "/" - err = c.SaveToFile("upfile", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 + switch key { + case "wiki": //添加wiki + //保存上传的图片 + _, h, err := c.GetFile("upfile") + if err != nil { + beego.Error(err) + } + var filesize int64 + fileSuffix := path.Ext(h.Filename) + newname := strconv.FormatInt(time.Now().UnixNano(), 10) + fileSuffix // + "_" + filename + year, month, _ := time.Now().Date() + err = os.MkdirAll(".\\attachment\\wiki\\"+strconv.Itoa(year)+month.String()+"\\", 0777) //..代表本当前exe文件目录的上级,.表示当前目录,没有.表示盘的根目录 if err != nil { beego.Error(err) } - filesize, _ = FileSize(path) + path1 := ".\\attachment\\wiki\\" + strconv.Itoa(year) + month.String() + "\\" + newname //h.Filename + Url := "/attachment/wiki/" + strconv.Itoa(year) + month.String() + "/" + err = c.SaveToFile("upfile", path1) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 + if err != nil { + beego.Error(err) + } + filesize, _ = FileSize(path1) filesize = filesize / 1000.0 c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "url": Url + newname, "title": h.Filename, "original": h.Filename} c.ServeJSON() - } else { - c.Data["json"] = map[string]interface{}{"state": "ERROR", "url": "", "title": "", "original": ""} - c.ServeJSON() + default: + //解析表单 + pid := c.Input().Get("pid") + beego.Info(pid) + //pid转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + //根据proj的parentIdpath + Url, DiskDirectory, err := GetUrlPath(pidNum) + if err != nil { + beego.Error(err) + } + beego.Info(DiskDirectory) + //获取上传的文件 + _, h, err := c.GetFile("upfile") + if err != nil { + beego.Error(err) + } + fileSuffix := path.Ext(h.Filename) + // random_name + newname := strconv.FormatInt(time.Now().UnixNano(), 10) + fileSuffix // + "_" + filename + // err = ioutil.WriteFile(path1+newname+".jpg", ddd, 0666) //buffer输出到jpg文件中(不做处理,直接写到文件) + // if err != nil { + // beego.Error(err) + // } + year, month, _ := time.Now().Date() + err = os.MkdirAll(DiskDirectory+"\\"+strconv.Itoa(year)+month.String()+"\\", 0777) //..代表本当前exe文件目录的上级,.表示当前目录,没有.表示盘的根目录 + if err != nil { + beego.Error(err) + } + var path string + var filesize int64 + if h != nil { + //保存附件 + path = DiskDirectory + "\\" + strconv.Itoa(year) + month.String() + "\\" + newname + Url = "/" + Url + "/" + strconv.Itoa(year) + month.String() + "/" + err = c.SaveToFile("upfile", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 + if err != nil { + beego.Error(err) + } + filesize, _ = FileSize(path) + filesize = filesize / 1000.0 + c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "url": Url + newname, "title": h.Filename, "original": h.Filename} + c.ServeJSON() + } else { + c.Data["json"] = map[string]interface{}{"state": "ERROR", "url": "", "title": "", "original": ""} + c.ServeJSON() + } } case "uploadscrawl": number := c.Input().Get("number") diff --git a/controllers/user.go b/controllers/user.go index baca2760..ba48039b 100644 --- a/controllers/user.go +++ b/controllers/user.go @@ -195,6 +195,7 @@ func (c *UserController) View() { c.TplName = "admin_user_view.tpl" } +//添加用户 func (c *UserController) AddUser() { // u := m.User{} // if err := c.ParseForm(&u); err != nil { @@ -205,11 +206,18 @@ func (c *UserController) AddUser() { user.Username = c.Input().Get("username") user.Nickname = c.Input().Get("nickname") + Pwd1 := c.Input().Get("password") md5Ctx := md5.New() - md5Ctx.Write([]byte(c.Input().Get("password"))) + md5Ctx.Write([]byte(Pwd1)) cipherStr := md5Ctx.Sum(nil) user.Password = hex.EncodeToString(cipherStr) - user.Repassword = c.Input().Get("repassword") + // user.Repassword = c.Input().Get("repassword") + // Pwd1=c.Input().Get("password") + // md5Ctx := md5.New() + // md5Ctx.Write([]byte(Pwd1)) + // cipherStr := md5Ctx.Sum(nil) + // user.Password = hex.EncodeToString(cipherStr) + user.Email = c.Input().Get("email") user.Department = c.Input().Get("department") user.Secoffice = c.Input().Get("secoffice") diff --git a/controllers/wiki.go b/controllers/wiki.go index 68d9a37d..7a94bb50 100644 --- a/controllers/wiki.go +++ b/controllers/wiki.go @@ -188,6 +188,14 @@ func (c *WikiController) AddWiki() { // uname, _ := checkprodRole(c.Ctx) //login里的 // rolename, _ = strconv.Atoi(role) // c.Data["Uname"] = uname + if role > 4 { //&& uname != category.Author + // port := strconv.Itoa(c.Ctx.Input.Port())//c.Ctx.Input.Site() + ":" + port + + route := c.Ctx.Request.URL.String() + c.Data["Url"] = route + c.Redirect("/roleerr?url="+route, 302) + // c.Redirect("/roleerr", 302) + return + } _, err := models.AddWikiOne(title, content, username) if err != nil { beego.Error(err) diff --git a/document/casbin.docx b/document/casbin.docx new file mode 100644 index 00000000..08814547 Binary files /dev/null and b/document/casbin.docx differ diff --git "a/document/\345\210\251\347\224\250EngineerCMS\346\211\223\351\200\240\350\256\276\344\273\243\350\265\204\346\226\231\347\256\241\347\220\206\345\271\263\345\217\260.docx" "b/document/\345\210\251\347\224\250EngineerCMS\346\211\223\351\200\240\350\256\276\344\273\243\350\265\204\346\226\231\347\256\241\347\220\206\345\271\263\345\217\260.docx" new file mode 100644 index 00000000..73bc64cd Binary files /dev/null and "b/document/\345\210\251\347\224\250EngineerCMS\346\211\223\351\200\240\350\256\276\344\273\243\350\265\204\346\226\231\347\256\241\347\220\206\345\271\263\345\217\260.docx" differ diff --git a/models/ArticModel.go b/models/ArticModel.go index 49dd6ecf..756685ac 100644 --- a/models/ArticModel.go +++ b/models/ArticModel.go @@ -14,6 +14,7 @@ type Article struct { Subtext string `orm:"sie(20)"` Content string `orm:"sie(5000)"` ProductId int64 `orm:"null"` + Views int64 `orm:"default(0)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now_add;type(datetime)"` } @@ -92,12 +93,20 @@ func GetArticles(pid int64) (Articles []*Article, err error) { } //根据文章id取得文章 -func GetArticle(id int64) (Artic Article, err error) { +func GetArticle(id int64) (Artic *Article, err error) { o := orm.NewOrm() + article := new(Article) qs := o.QueryTable("Article") //这个表名AchievementTopic需要用驼峰式, - err = qs.Filter("id", id).One(&Artic) + err = qs.Filter("id", id).One(article) if err != nil { return Artic, err } - return Artic, err + + article.Views++ + _, err = o.Update(article) + if err != nil { + return article, err + } + + return article, err } diff --git a/models/ProdModel.go b/models/ProdModel.go index fa8cb5c2..f5f9b8d9 100644 --- a/models/ProdModel.go +++ b/models/ProdModel.go @@ -127,7 +127,7 @@ func GetProjProducts(id int64) (products []*Product, err error) { projects := make([]*Project, 0) cond := orm.NewCondition() - cond1 := cond.Or("Id", id).Or("ParentIdPath__contains", idstring) + cond1 := cond.Or("Id", id).Or("ParentIdPath__contains", idstring+"-").Or("ParentId", id) o := orm.NewOrm() //先查出所有项目parent id path中包含id的数据 qs := o.QueryTable("Project") diff --git a/models/ProjModel.go b/models/ProjModel.go index 4a524b05..253d66ad 100644 --- a/models/ProjModel.go +++ b/models/ProjModel.go @@ -175,15 +175,37 @@ func GetProj(id int64) (proj Project, err error) { // } // return proj, err // } + //根据id查出所有子孙,用ParentIdPath //逻辑错误:110-210-310包含了10???? +//20180107完美解决这个问题。同ProdModel.go中GetProjProducts一致 +//通过Id为projid,查出本级 +//parentid是projid,查出二级 +//parentidpath包含projid-,查出三级,以及往下 +//差点按照无闻的视频,将parentidpath存成$id1#$id2#$id3# +//存:parentidpath="$"+id1+"#" +//查:__contains,"$"+id1+"#" +//取:stings.replace(stings.replace(parentidpath,"#",","-1),"$",""-1) +//输出:strings.split(上面的,",") func GetProjectsbyPid(id int64) (projects []*Project, err error) { + idstring := strconv.FormatInt(id, 10) + cond := orm.NewCondition() + cond1 := cond.Or("Id", id).Or("ParentIdPath__contains", idstring+"-").Or("ParentId", id) o := orm.NewOrm() + //先查出所有项目parent id path中包含id的数据 qs := o.QueryTable("Project") - _, err = qs.Filter("ParentIdPath__contains", id).All(&projects) + qs = qs.SetCond(cond1) + + _, err = qs.All(&projects) if err != nil { return nil, err } + + // qs := o.QueryTable("Project") + // _, err = qs.Filter("ParentIdPath__contains", id).All(&projects) + // if err != nil { + // return nil, err + // } return projects, err } diff --git a/models/RelevancyModel.go b/models/RelevancyModel.go new file mode 100644 index 00000000..da8eaee3 --- /dev/null +++ b/models/RelevancyModel.go @@ -0,0 +1,68 @@ +package models + +import ( + "github.com/astaxie/beego/orm" + _ "github.com/mattn/go-sqlite3" + // "strconv" + // "fmt" + // "strings" + "time" +) + +type Relevancy struct { + Id int64 `form:"-"` + ProductId int64 `orm:"null"` //编号 + Relevancy string `orm:"null"` //标签 + Created time.Time `orm:"null","auto_now_add;type(datetime)"` + Updated time.Time `orm:"null","auto_now_add;type(datetime)"` +} + +func init() { + orm.RegisterModel(new(Relevancy)) //, new(Article) + // orm.RegisterDriver("sqlite", orm.DRSqlite) + // orm.RegisterDataBase("default", "sqlite3", "database/engineer.db", 10) +} + +//添加项目 +func AddRelevancy(prodid int64, relevancy string) (id int64, err error) { + o := orm.NewOrm() + //关闭写同步 + o.Raw("PRAGMA synchronous = OFF; ", 0, 0, 0).Exec() + // var project Project + // if pid == "" { + relev := &Relevancy{ + ProductId: prodid, + Relevancy: relevancy, + Created: time.Now(), + Updated: time.Now(), + } + id, err = o.Insert(relev) + if err != nil { + return 0, err + } + return id, nil +} + +//根据成果id取得关联文件 +//根据成果编号,取得关联文件编号 +func GetRelevancy(prodid int64) (relevancies []*Relevancy, err error) { + o := orm.NewOrm() + qs := o.QueryTable("Relevancy") + // relevancies1 := make([]*Relevancy, 0) + _, err = qs.Filter("ProductId", prodid).All(&relevancies) + if err != nil { + return nil, err + } + return relevancies, err +} + +func GetAllRelevancies() (relevancies []*Relevancy, err error) { + o := orm.NewOrm() + qs := o.QueryTable("Relevancy") + // relevancies1 := make([]*Relevancy, 0) + _, err = qs.All(&relevancies) + if err != nil { + return nil, err + } + return relevancies, err +} diff --git a/models/RoleModel.go b/models/RoleModel.go index ba44a30f..85ede692 100644 --- a/models/RoleModel.go +++ b/models/RoleModel.go @@ -12,6 +12,8 @@ import ( "github.com/astaxie/beego/orm" // "github.com/astaxie/beego/validation" // . "github.com/beego/admin/src/lib" + // "github.com/casbin/beego-orm-adapter" + // "github.com/casbin/casbin" ) //用户表 @@ -162,3 +164,14 @@ func DeleteUserRole(uid, rid int64) error { // } return err } + +//由角色id、action和项目id,取得所有的路径 +// func GetPermissions(roleid, projectid, action) (paths []*CasbinRule, err error) { +// o := orm.NewOrm() +// qs := o.QueryTable("casbin_rule") +// _, err = qs.Filter("PType", "p").Filter("v0", roleid).Filter("v1__contains", projectid).Filter("v2", action).All(&paths) +// if err != nil { +// return nil, err +// } +// return roles, err +// } diff --git a/routers/router.go b/routers/router.go index f9037778..55a1ec19 100644 --- a/routers/router.go +++ b/routers/router.go @@ -147,6 +147,8 @@ func init() { beego.Router("/admin/role/userrole", &controllers.RoleController{}, "post:UserRole") //添加角色权限 beego.Router("/admin/role/permission", &controllers.RoleController{}, "post:RolePermission") + //查询角色权限 + beego.Router("/admin/role/getpermission", &controllers.RoleController{}, "get:GetRolePermission") //meritbasic表格数据填充 beego.Router("/admin/merit/meritbasic", &controllers.AdminController{}, "*:MeritBasic") diff --git a/static/css/common.css b/static/css/common.css index 7f49320b..92c4860c 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -92,7 +92,7 @@ label { } @font-face { font-family: "iconfont"; - src: url('/static/fonts/iconfont.eot?1573b42e3f0'), url('/static/fonts/iconfont.eot?&1573b42e3f0#iefix') format('embedded-opentype'), url('/static/fonts/iconfont.woff?1573b42e3f0') format('woff'), url('/static/fonts/iconfont.ttf?1573b42e3f0') format('truetype'), url('/static/fonts/iconfont.svg?1573b42e3f0#iconfont') format('svg') ; + src: url('/static/fonts/iconfont.eot?1512613120761'), url('/static/fonts/iconfont.eot?&1512613120761#iefix') format('embedded-opentype'), url('/static/fonts/iconfont.woff?1512613120761') format('woff'), url('/static/fonts/iconfont.ttf?1512613120761') format('truetype'), url('/static/fonts/iconfont.svg?1512613120761#iconfont') format('svg') ; } .iconfont { font-family: "iconfont" !important; @@ -114,5 +114,3 @@ label { :-ms-input-placeholder { color: #dfdfdf; } - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1vbi5zdHlsIiwiY29tbW9uLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0VBQ0UsVUFBQTtFQUNBLFdBQUE7RUFDQSx3Q0FBQTtDQ3dCRDtBRHZCRDtFQUNFLGtCQUFBO0NDeUJEO0FEeEJEO0VBQ0UsbUJBQUE7Q0MwQkQ7QUR6QkQ7RUFDRSxrQkFBQTtDQzJCRDtBRDFCRDs7Ozs7OztFQUNFLGlCQUFBO0VBQ0EsVUFBQTtFQUNBLFdBQUE7Q0NrQ0Q7QURqQ0Q7UUNtQ1E7QURqQ1I7RUFDRSxvQkFBQTtFQUNBLHdDQUFBO0VBQ0EsY0FBQTtDQ21DRDtBRGpDRDtFQUNFLGFBQUE7RUFDQSxjQUFBO0NDbUNEO0FEbENEOztFQUNFLG1CQUFBO0NDcUNEO0FEcENEO0VBQ0UsY0FBQTtDQ3NDRDtBRHJDRDtFQUNFLGNBQUE7RUFDQSxzQkFBQTtFQUNBLFlBQUE7Q0N1Q0Q7QUR0Q0M7OztFQUNFLHNCQUFBO0NDMENIO0FEeENDO0VBQ0UsYUFBQTtFQUNBLFVBQUE7RUFDQSxtQkFBQTtFQUNBLGVBQUE7RUFDQSxZQUFBO0NDMENIO0FEekNEOzs7RUFDRSxpQkFBQTtFQUNBLG9CQUFBO0NDNkNEO0FENUNEO0VBQ0Usb0JBQUE7Q0M4Q0Q7QUQ3Q0Q7RUFDRSx3QkFBQTtFQUNBLDZVQUFBO0NDK0NEO0FENUNEO0VBQ0UsbUNBQUE7RUFDQSxnQkFBQTtFQUNBLG1CQUFBO0VBQ0Esb0NBQUE7RUFDQSxpQ0FBQTtFQUNBLG1DQUFBO0NDOENEO0FENUNEO0VBQ0UsZUFBQTtDQzhDRDtBRDdDRDtFQUNFLGVBQUE7Q0MrQ0Q7QUQ5Q0Q7RUFDRSxlQUFBO0NDZ0REO0FEL0NEO0VBQ0UsZUFBQTtDQ2lERCIsImZpbGUiOiJjb21tb24uY3NzIiwic291cmNlc0NvbnRlbnQiOlsiYm9keSxoMSxoMixoMyxoNCxoNSxoNix1bCxsaSxvbCxkbCxkdCxkZCxwLHNwYW4sb2JqZWN0LGlmcmFtZSxwcmUsYSxhYmJyLGNpdGUsaW5wdXQsc2VsZWN0LGlucHV0LG9wdGlvblxyXG4gIG1hcmdpbiAwXHJcbiAgcGFkZGluZyAwXHJcbiAgZm9udC1mYW1pbHkgJ0FyaWFsJywnTWljcm9zb2Z0IFlhSGVpJ1xyXG5oMVxyXG4gIGZvbnQtc2l6ZSAwLjlyZW1cclxuaDJcclxuICBmb250LXNpemUgMC43NXJlbVxyXG5oM1xyXG4gIGZvbnQtc2l6ZSAwLjZyZW1cclxudWwsbGksb2wsZGwsZGQsZHQsZm9ybVxyXG4gIGxpc3Qtc3R5bGUgbm9uZVxyXG4gIG1hcmdpbiAwXHJcbiAgcGFkZGluZyAwXHJcbi8qaHRtbFxyXG4gIDEwMCUqL1xyXG5ib2R5XHJcbiAgYmFja2dyb3VuZCAjZjBmMGYwXHJcbiAgZm9udC1mYW1pbHkgJ0FyaWFsJywnTWljcm9zb2Z0IFlhSGVpJ1xyXG4gIGZvbnQgaW5oZXJpdFxyXG4gIC8vaGVpZ2h0IDEwMCVcclxuaW1nXHJcbiAgYm9yZGVyIG5vbmVcclxuICBvdXRsaW5lIG5vbmVcclxuZW0saVxyXG4gIGZvbnQtc3R5bGUgbm9ybWFsXHJcbmlucHV0XHJcbiAgb3V0bGluZSBub25lXHJcbmFcclxuICBvdXRsaW5lIG5vbmVcclxuICB0ZXh0LWRlY29yYXRpb24gbm9uZVxyXG4gIGNvbG9yICMzMzNcclxuICAmOmhvdmVyLCY6YWN0aXZlLCZ2aXNpdGVkXHJcbiAgICB0ZXh0LWRlY29yYXRpb24gbm9uZVxyXG4uY2xlYXJmaXhcclxuICAmOmFmdGVyXHJcbiAgICBjb250ZW50ICcuJ1xyXG4gICAgaGVpZ2h0IDBcclxuICAgIHZpc2liaWxpdHkgaGlkZGVuXHJcbiAgICBkaXNwbGF5IGJsb2NrXHJcbiAgICBjbGVhciBib3RoXHJcbmRkLGR0LGRsXHJcbiAgbGluZS1oZWlnaHQgMS4yXHJcbiAgZm9udC13ZWlnaHQgbm9ybWFsXHJcbmxhYmVsXHJcbiAgZm9udC13ZWlnaHQgbm9ybWFsXHJcbkBmb250LWZhY2VcclxuICBmb250LWZhbWlseTogXCJpY29uZm9udFwiXHJcbiAgc3JjOiB1cmwoJy4uL2ZvbnRzL2ljb25mb250LmVvdCcpLHVybCgnLi4vZm9udHMvaWNvbmZvbnQuZW90PyNpZWZpeCcpIGZvcm1hdCgnZW1iZWRkZWQtb3BlbnR5cGUnKSx1cmwoJy4uL2ZvbnRzL2ljb25mb250LndvZmYnKSBmb3JtYXQoJ3dvZmYnKSx1cmwoJy4uL2ZvbnRzL2ljb25mb250LnR0ZicpIGZvcm1hdCgndHJ1ZXR5cGUnKSx1cmwoJy4uL2ZvbnRzL2ljb25mb250LnN2ZyNpY29uZm9udCcpIGZvcm1hdCgnc3ZnJykgLyogaU9TIDQuMS0gKi9cclxuXHJcblxyXG4uaWNvbmZvbnRcclxuICBmb250LWZhbWlseTpcImljb25mb250XCIgIWltcG9ydGFudFxyXG4gIGZvbnQtc2l6ZToxNnB4XHJcbiAgZm9udC1zdHlsZTpub3JtYWxcclxuICAtd2Via2l0LWZvbnQtc21vb3RoaW5nOiBhbnRpYWxpYXNlZFxyXG4gIC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDAuMnB4XHJcbiAgLW1vei1vc3gtZm9udC1zbW9vdGhpbmc6IGdyYXlzY2FsZVxyXG5cclxuOjotd2Via2l0LWlucHV0LXBsYWNlaG9sZGVyXHJcbiAgY29sb3IgI2RmZGZkZlxyXG46LW1vei1wbGFjZWhvbGRlclxyXG4gIGNvbG9yICNkZmRmZGZcclxuOjotbW96LWlucHV0LXBsYWNlaG9sZGVyXHJcbiAgY29sb3IgI2RmZGZkZlxyXG46LW1zLWlucHV0LXBsYWNlaG9sZGVyXHJcbiAgY29sb3IgI2RmZGZkZiIsImJvZHksXG5oMSxcbmgyLFxuaDMsXG5oNCxcbmg1LFxuaDYsXG51bCxcbmxpLFxub2wsXG5kbCxcbmR0LFxuZGQsXG5wLFxuc3Bhbixcbm9iamVjdCxcbmlmcmFtZSxcbnByZSxcbmEsXG5hYmJyLFxuY2l0ZSxcbmlucHV0LFxuc2VsZWN0LFxub3B0aW9uIHtcbiAgbWFyZ2luOiAwO1xuICBwYWRkaW5nOiAwO1xuICBmb250LWZhbWlseTogJ0FyaWFsJywgJ01pY3Jvc29mdCBZYUhlaSc7XG59XG5oMSB7XG4gIGZvbnQtc2l6ZTogMC45cmVtO1xufVxuaDIge1xuICBmb250LXNpemU6IDAuNzVyZW07XG59XG5oMyB7XG4gIGZvbnQtc2l6ZTogMC42cmVtO1xufVxudWwsXG5saSxcbm9sLFxuZGwsXG5kZCxcbmR0LFxuZm9ybSB7XG4gIGxpc3Qtc3R5bGU6IG5vbmU7XG4gIG1hcmdpbjogMDtcbiAgcGFkZGluZzogMDtcbn1cbi8qaHRtbFxuICAxMDAlKi9cbmJvZHkge1xuICBiYWNrZ3JvdW5kOiAjZjBmMGYwO1xuICBmb250LWZhbWlseTogJ0FyaWFsJywgJ01pY3Jvc29mdCBZYUhlaSc7XG4gIGZvbnQ6IGluaGVyaXQ7XG59XG5pbWcge1xuICBib3JkZXI6IG5vbmU7XG4gIG91dGxpbmU6IG5vbmU7XG59XG5lbSxcbmkge1xuICBmb250LXN0eWxlOiBub3JtYWw7XG59XG5pbnB1dCB7XG4gIG91dGxpbmU6IG5vbmU7XG59XG5hIHtcbiAgb3V0bGluZTogbm9uZTtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xuICBjb2xvcjogIzMzMztcbn1cbmE6aG92ZXIsXG5hOmFjdGl2ZSxcbmF2aXNpdGVkIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuLmNsZWFyZml4OmFmdGVyIHtcbiAgY29udGVudDogJy4nO1xuICBoZWlnaHQ6IDA7XG4gIHZpc2liaWxpdHk6IGhpZGRlbjtcbiAgZGlzcGxheTogYmxvY2s7XG4gIGNsZWFyOiBib3RoO1xufVxuZGQsXG5kdCxcbmRsIHtcbiAgbGluZS1oZWlnaHQ6IDEuMjtcbiAgZm9udC13ZWlnaHQ6IG5vcm1hbDtcbn1cbmxhYmVsIHtcbiAgZm9udC13ZWlnaHQ6IG5vcm1hbDtcbn1cbkBmb250LWZhY2Uge1xuICBmb250LWZhbWlseTogXCJpY29uZm9udFwiO1xuICBzcmM6IHVybChcIi4uL2ZvbnRzL2ljb25mb250LmVvdFwiKSwgdXJsKFwiLi4vZm9udHMvaWNvbmZvbnQuZW90PyNpZWZpeFwiKSBmb3JtYXQoJ2VtYmVkZGVkLW9wZW50eXBlJyksIHVybChcIi4uL2ZvbnRzL2ljb25mb250LndvZmZcIikgZm9ybWF0KCd3b2ZmJyksIHVybChcIi4uL2ZvbnRzL2ljb25mb250LnR0ZlwiKSBmb3JtYXQoJ3RydWV0eXBlJyksIHVybChcIi4uL2ZvbnRzL2ljb25mb250LnN2ZyNpY29uZm9udFwiKSBmb3JtYXQoJ3N2ZycpIC8qIGlPUyA0LjEtICovO1xufVxuLmljb25mb250IHtcbiAgZm9udC1mYW1pbHk6IFwiaWNvbmZvbnRcIiAhaW1wb3J0YW50O1xuICBmb250LXNpemU6IDE2cHg7XG4gIGZvbnQtc3R5bGU6IG5vcm1hbDtcbiAgLXdlYmtpdC1mb250LXNtb290aGluZzogYW50aWFsaWFzZWQ7XG4gIC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDAuMnB4O1xuICAtbW96LW9zeC1mb250LXNtb290aGluZzogZ3JheXNjYWxlO1xufVxuOjotd2Via2l0LWlucHV0LXBsYWNlaG9sZGVyIHtcbiAgY29sb3I6ICNkZmRmZGY7XG59XG46LW1vei1wbGFjZWhvbGRlciB7XG4gIGNvbG9yOiAjZGZkZmRmO1xufVxuOjotbW96LWlucHV0LXBsYWNlaG9sZGVyIHtcbiAgY29sb3I6ICNkZmRmZGY7XG59XG46LW1zLWlucHV0LXBsYWNlaG9sZGVyIHtcbiAgY29sb3I6ICNkZmRmZGY7XG59XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= */ \ No newline at end of file diff --git a/static/css/csdn_blog_detail.min.css b/static/css/csdn_blog_detail.min.css new file mode 100644 index 00000000..1dd80aa5 --- /dev/null +++ b/static/css/csdn_blog_detail.min.css @@ -0,0 +1 @@ +@charset "utf-8";.commentform li,li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}.commentform ul{clear:both;font:400 12px/24px Arial,Helvetica,sans-serif}.commentform .left{float:left;display:block;width:80px}.commentform .right{display:block;margin-left:90px}.commentform textarea{padding:5px;border:1px solid #ddd;color:#555;font:400 14px/24px Arial,Helvetica,sans-serif}#lang_list{width:388px;background-color:#FFF;border:1px solid #ccc;font-size:12px}#lang_list a{display:inline-block;cursor:pointer;border-right:1px solid #ccc;border-bottom:1px solid #ccc;padding:0 5px;text-align:center;float:left}#lang_list a:hover{background-color:#666;color:#fff}.long_name{width:70px}.duan_name{width:25px}.zhong_name{width:48px}.commentform li,.commentform ul{margin:0}.hljs{display:block;padding:.5em;background:#fff;color:#000}.hljs-comment,.hljs-comment *,.hljs-javadoc,.hljs-template_comment{color:#800}.clojure .hljs-built_in,.hljs-keyword,.hljs-list .hljs-title,.hljs-request,.hljs-status,.hljs-tag .hljs-title,.hljs-winutils,.http .hljs-title,.method,.nginx .hljs-title,.setting .hljs-value,.tex .hljs-command{color:#008}.hljs-envvar,.tex .hljs-special{color:#660}.apache .hljs-cbracket,.coffeescript .hljs-attribute,.hljs-attr_selector,.hljs-cdata,.hljs-date,.hljs-filter .hljs-argument,.hljs-regexp,.hljs-string,.hljs-tag .hljs-value{color:#080}.clojure .hljs-attribute,.css .hljs-function,.css .hljs-value .hljs-number,.hljs-decorator,.hljs-hexcolor,.hljs-literal,.hljs-number,.hljs-pi,.hljs-prompt,.hljs-rules .hljs-value,.hljs-shebang,.hljs-sub .hljs-identifier,.hljs-symbol,.hljs-tag,.hljs-tag .hljs-keyword,.ini .hljs-title,.ruby .hljs-symbol .hljs-string{color:#066}.clojure .hljs-title,.haskell .hljs-type,.hljs-built_in,.hljs-class .hljs-id,.hljs-class .hljs-title,.hljs-doctype,.hljs-javadoctag,.hljs-params,.hljs-phpdoc,.hljs-tag .hljs-attribute,.hljs-typename,.hljs-variable,.hljs-yardoctag,.setting,.smalltalk .hljs-class{color:#606}.css .hljs-tag,.hljs-pseudo,.hljs-rules .hljs-property,.hljs-subst{color:#000}.css .hljs-class,.css .hljs-id{color:#9b703f}.hljs-value .hljs-important{color:#f70;font-weight:700}.hljs-rules .hljs-keyword{color:#c5af75}.apache .hljs-sqbracket,.hljs-annotation,.nginx .hljs-built_in{color:#9b859d}.hljs-pragma,.hljs-preprocessor,.hljs-preprocessor *{color:#444}.tex .hljs-formula{background-color:#eee;font-style:italic}.diff .hljs-header,.hljs-chunk{color:grey;font-weight:700}.diff .hljs-change{background-color:#bccff9}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-comment .hljs-yardoctag{font-weight:700}.markdown_views{font-family:'microsoft yahei';font-size:16px;color:#3f3f3f}.markdown_views *{box-sizing:border-box}.markdown_views h1,.markdown_views h2,.markdown_views h3,.markdown_views h4,.markdown_views h5,.markdown_views h6{font-family:inherit;font-weight:300;line-height:1.1;color:inherit;margin:.8em 0;text-align:start}.markdown_views h1{font-size:2.6em}.markdown_views h2{font-size:2.15em}.markdown_views h3{font-size:1.7em}.markdown_views h4{font-size:1.25em}.markdown_views h5{font-size:1em}.markdown_views h6{font-size:.8em}.markdown_views a{color:#4fa1db}.markdown_views blockquote,.markdown_views p,.markdown_views pre,.markdown_views pre.prettyprint{margin:0 0 1.7em;line-height:170%}.markdown_views dl,.markdown_views ol,.markdown_views p,.markdown_views ul{line-height:170%;margin-bottom:1.7em}.markdown_views img{margin-top:15px;margin-bottom:15px}.markdown_views hr{margin:2em 0;border:0;border-top:1px solid rgba(128,128,128,.1)}.markdown_views dt{font-weight:700}.markdown_views abbr[data-original-title],.markdown_views abbr[title]{cursor:help;border-bottom:1px dotted #999}.markdown_views .initialism{font-size:90%;text-transform:uppercase}.markdown_views blockquote{padding:15px 20px;border-left:10px solid rgba(128,128,128,.075);background-color:rgba(128,128,128,.05);border-radius:0 5px 5px 0}.markdown_views blockquote p{line-height:1.5;font-size:1em;color:#6f6f6f}.markdown_views blockquote p:last-child{margin-bottom:0}.markdown_views blockquote .small,.markdown_views blockquote small{display:block;line-height:1.45;color:#999}.markdown_views blockquote .small:before,.markdown_views blockquote small:before{content:"— "}.markdown_views blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid rgba(128,128,128,.075);border-left:0}.markdown_views blockquote.pull-right .small,.markdown_views blockquote.pull-right p,.markdown_views blockquote.pull-right small{text-align:right}.markdown_views blockquote.pull-right .small:before,.markdown_views blockquote.pull-right small:before{content:""}.markdown_views blockquote.pull-right .small:after,.markdown_views blockquote.pull-right small:after{content:" —"}.markdown_views blockquote:after,.markdown_views blockquote:before{content:""}.markdown_views address{margin-bottom:21px;font-style:normal;line-height:1.45}.markdown_views code,.markdown_views kbd,.markdown_views pre,.markdown_views samp{font-family:"Source Code Pro",monospace}.markdown_views code{padding:2px 4px;font-size:90%;color:#3f3f3f;background-color:rgba(128,128,128,.075);white-space:nowrap;border-radius:0}.markdown_views pre{display:block;padding:10px;margin:0 0 10.5px;font-size:14px;line-height:1.45;word-break:break-all;word-wrap:break-word;color:#333;background-color:rgba(128,128,128,.05);border:1px solid rgba(128,128,128,.075);border-radius:0}.markdown_views pre code{overflow-x:auto;padding:0;font-size:90%;color:inherit;white-space:pre;word-wrap:normal;background-color:transparent;border-radius:0}.markdown_views .pre-scrollable{max-height:340px;overflow-y:scroll}.markdown_views .flow-chart,.markdown_views .sequence-diagram{text-align:center;margin-bottom:1.1em}.markdown_views table{width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;border:1px solid #eee}.markdown_views table td,.markdown_views table th{padding:8px;line-height:20px;vertical-align:top;border:1px solid #eee}.category_l img,.category_l span,.similar_list li a,.similar_list li em,.subItem_l li a,.subItem_l li em{vertical-align:middle}.article_manage,.category{border-bottom:solid 1px #ededed}.markdown_views .prettyprint{padding:5px 5px 5px 60px;position:relative;overflow-y:hidden;overflow-x:auto;white-space:nowrap}.markdown_views .prettyprint .pre-numbering{position:absolute;width:50px;background-color:#eee;top:0;left:0;margin:0;padding:6px 0 40px;border-right:1px solid #ddd;list-style:none;text-align:right}.markdown_views .prettyprint .pre-numbering li{padding:0 5px;list-style:none;margin-left:0}.markdown_views em{font-style:italic}.article_manage{color:#999;font:400 12px/22px Arial;text-align:right;margin:0 -20px;padding:0 20px 5px;overflow:hidden}.article_manage span{margin:0 5px}.article_manage .link_postdate{margin:0 5px 0 0}.article_manage .link_view{padding:0 0 0 14px;background:url(../../../images/ico_view.png) left center no-repeat}.article_manage .link_comments{padding:0 0 0 14px;background:url(../../../images/ico_comm.png) left center no-repeat}.article_manage .link_categories{float:left}.list_view{margin:0 20px;padding:5px 0}.list_view .article_title{display:inline;float:left;height:30px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0!important;font:400 14px/30px Arial!important}.list_view .article_title:after{content:"..."}.list_view .article_title h1,.list_view .article_title h3{font:400 12px/30px Arial!important}.category_l,.category_r{font-size:14px;float:left}.category_r .subItem_t .J_close,.category_r em,.similar_c_t label em,.similar_list li em{font-style:normal}.list_view .article_manage{display:inline;float:right;padding:0!important;line-height:30px!important;text-align:right!important;white-space:nowrap}.list_view .article_description{display:none!important}.article_l span a,.category_l,.category_l span,.category_r,.category_r label{display:inline-block}.list_view .article_manage span{margin:0!important}.article_l{width:100%;float:left}.article_l span a{margin-right:10px}.article_r .fa{font-weight:400}.category{margin:0 -20px;padding:5px 20px}.category_l{color:#333;width:70px;line-height:28px}.category_r{color:#df3434;width:90%}.category_r .subItem_t .J_close{float:right;line-height:42px;font-weight:400;font-size:16px;color:#ccc}.category_r label{margin-left:15px;cursor:pointer;line-height:28px;position:relative}.category_r label .fa{color:#999}.subItem,.subItem .subItem_l li a{color:#333}.category_r label .fa-caret-up{display:none;transform:all 2.2s}.subItem{display:none;position:absolute;top:46px;left:-10px;width:400px;max-height:400px;border:1px solid #dcdcdc;background:#fff;box-shadow:5px 0 10px #dcdcdc;z-index:9999}.subItem:after{position:absolute;width:10px;height:10px;display:block;content:'';top:-10px;left:20px;background:url(../images/triangle.png) no-repeat}.subItem_t{height:42px;line-height:42px;border-bottom:solid 1px #dcdcdc;padding:0 20px 0 15px;color:#999}.category_r .subItem_t .fa-close{float:right;line-height:42px;font-weight:400;font-size:16px;color:#ccc}.subItem_l{max-height:358px;overflow-y:auto;list-style:none;padding:0;margin:0}.similar_article,.subItem_l li a{overflow:hidden}.subItem .subItem_l li{height:52px;line-height:52px;border-bottom:solid 1px #eee;padding:0 20px}.subItem_l li em{display:inline-block;margin-right:10px}.subItem_l li a{display:inline-block;width:95%;text-overflow:ellipsis;white-space:nowrap;font-size:14px;color:#333}.similar_article h4{font-size:16px;color:#333}.similar_c{border:1px solid #bbb}.similar_c_t{line-height:45px;border-bottom:solid 1px #dcdcdc}.similar_c_t label{display:inline-block;margin-left:25px;font-size:16px;color:#666}.similar_c_t .similar_cur{font-weight:700}.fl{float:left}.fr{float:right}.similar_wrap{background:#fcfcfc;max-height:180px;overflow-y:auto;padding:10px 20px}.similar_list{width:48%;list-style:none;margin:0;padding:0}.similar_list li{list-style:none;line-height:30px;height:30px;overflow:hidden;text-overflow:ellipsis}.similar_list li em{display:inline-block;margin-right:10px}.similar_list li a{display:inline-block;max-width:276px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#333}.similar_list li a:hover{color:#fe0000}.similar_list li label,.similar_list li span{font-size:12px;color:#bbb;display:inline-block;margin-left:9px}.similar_list li label b,.similar_list li label i{font-weight:400;font-style:normal}.similar_list li label b{margin-left:5px}.MoreArticle{clear:both;display:block;height:35px;line-height:35px;background:#fcfcfc;font-size:12px;color:#666;text-align:center}.MoreArticle:hover{background:#f2f2f2}.bog_copyright{padding:20px 0}.copyright_p{height:14px;line-height:14px;border-left:solid 3px #e41c1e;padding-left:10px;color:#666;font-size:14px}.mod_zhuanjia_dianping{background-color:#fffdf5;font-size:12px;color:#656565;margin-top:80px;border-top:1px solid #fbf5dd;border-bottom:1px solid #fbf5dd}.mod_zhuanjia_dianping li,.mod_zhuanjia_dianping ul{padding:0;margin:0;list-style:none}.mod_zhuanjia_dianping img{border:none}.mod_zhuanjia_dianping .dianping_title{height:40px;line-height:40px;border-bottom:2px solid #ccc}.mod_zhuanjia_dianping .dianping_title .dianping_title_left{float:left;border-bottom:2px solid #cb0000;font-size:16px}.mod_zhuanjia_dianping .dianping_title .dianping_title_right{float:right;font-size:14px;color:#656565;font-weight:400}.mod_zhuanjia_dianping .dianping_title .dianping_title_right .red{color:#cb0000;padding:0 5px}.mod_zhuanjia_dianping .dianping_title .dianping_title_right img{padding-right:5px;vertical-align:-2px}.mod_zhuanjia_dianping .dianping_content{overflow:hidden;max-height:800px;height:240px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list{padding:20px 0;width:100%;float:left;border-top:1px dashed #dedcdd}.mod_zhuanjia_dianping .dianping_content .dianping_content_list_left{width:40px;float:left;margin-left:-100%;margin-top:20px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list_left .name{color:#000;text-align:center;margin-top:10px;width:40px;display:inline-block}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right{margin-left:40px;padding-left:20px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right .time{color:#7795a5}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right .time .time_desc{padding:0 5px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right .dianping_content_list_right_content{margin-top:10px;line-height:18px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right .time img{vertical-align:-2px}.mod_zhuanjia_dianping .more{text-align:center;position:relative;width:100%}.mod_zhuanjia_dianping .more img{position:relative;bottom:-20px;cursor:pointer}.mod_more_detail{font-size:12px;color:#333;margin-top:50px;border:1px solid #e8e8e8}.mod_more_detail li,.mod_more_detail ul{padding:0;margin:0;list-style:none;height:24px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mod_more_detail li a{color:#333}.mod_more_detail .mod_more_detail_title{height:40px;line-height:40px;background-color:#f1f1f1;text-indent:10px}.mod_more_detail .mod_more_detail_title .mod_more_detail_left{float:left;font-size:16px;color:#000}.mod_more_detail .mod_more_detail_content{overflow:hidden;padding:20px 0}.mod_more_detail .mod_more_detail_content .mod_more_detail_content_left{float:left;padding:0 20px;border-right:1px solid #e8e8e8;width:50%;box-sizing:border-box}.mod_more_detail .mod_more_detail_content .mod_more_detail_content_right{float:left;padding:0 20px;width:50%;box-sizing:border-box}.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.clo,.opn,.pun{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.kwd,.tag,.typ{font-weight:700}.str{color:#060}.kwd{color:#006}.com{color:#600;font-style:italic}.typ{color:#404}.lit{color:#044}.clo,.opn,.pun{color:#440}.tag{color:#006}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:0 solid #888}ol.linenums{margin-top:0;margin-bottom:0}.dp-highlighter,.prettyprint{position:relative;overflow-y:hidden;overflow-x:auto}.pad_bot{padding-bottom:45px!important}.save_code{display:none;position:absolute;height:60px;right:30px;top:5px;font-size:14px;color:#fff;cursor:pointer;z-index:2}#mask_code{display:none;position:fixed;width:100%;height:100%;left:0;top:0;background:rgba(0,0,0,.3);z-index:990}.gist_edit{display:none;position:absolute;left:50%;top:50%;width:505px;height:330px;margin:-165px 0 0 -252px;z-index:9999}.save_snippets .tit,.save_snippets .tit h3,.save_snippets .tit span{height:45px;line-height:45px;box-sizing:border-box}.save_snippets{clear:both;overflow:hidden;background:#fff;border:1px solid #dddcdd;font-size:14px;font-family:"Microsoft YaHei";box-sizing:border-box}.save_snippets .tit{clear:both;overflow:hidden;border-bottom:1px solid #dddcdd;padding:0 20px}.save_snippets .tit h3{float:left;font-weight:400;font-size:16px;padding:0;margin:0}.gist_edit_list{padding:0;box-sizing:border-box;width:100%}.save_snippets .tit span{display:block;float:right;color:#999}.save_snippets .tit span a,.save_snippets .tit span a:active,.save_snippets .tit span a:hover,.save_snippets .tit span a:link,.save_snippets .tit span a:visited{color:#00f;text-decoration:underline}.save_snippets .con_form{clear:both;overflow:hidden;padding-top:20px;box-sizing:border-box}.save_snippets .con_form .gist_edit_list li{clear:both;overflow:hidden;min-height:32px;margin-bottom:20px;list-style:none;box-sizing:border-box}.save_snippets .con_form .gist_edit_list li span.red{display:block;float:left;line-height:36px;height:32px;color:red;padding-right:10px;margin-left:20px;box-sizing:border-box}.save_snippets .con_form .gist_edit_list li span.txt{display:block;float:left;height:32px;line-height:32px;padding-right:20px}.insertTag,.save_snippets .con_form .gist_edit_list li .form-input{height:30px}#divSearchTags,.save_snippets .con_form .gist_edit_list li .form-input{width:398px;border:1px solid #dddcdd;background:#fafafa;padding:0 10px;float:left;color:#666;box-sizing:border-box;font-family:"Microsoft YaHei"}#divSearchTags{margin-left:2px;text-align:left}#divSearchTags .label span{color:#666}.insertTag{width:208px;color:#666;background:0 0;border:none;box-sizing:border-box}#divSearchTags .blog_tag{display:block;float:left;margin:7px 10px 7px 0;padding:0 5px;background:#f3f3f3;color:#666;border-radius:10px;box-sizing:border-box}#divSearchTags .blog_tag span{display:block;float:left}#divSearchTags .label a{color:#666;margin-left:8px;box-sizing:border-box}.save_snippets .con_form .gist_edit_list li .form-textarea{float:left;width:398px;height:60px;font-size:12px;border:1px solid #dddcdd;background:#fafafa;padding:3px 10px;color:#666;font-family:"Microsoft YaHei";box-sizing:border-box}.save_snippets .bottom-bar{clear:both;overflow:hidden;border-top:1px solid #dddcdd;padding:17px 20px}.save_snippets .bottom-bar .btn-submit{border:1px solid #888;background:#f0f0f0;border-radius:2px;border-left:0;border-top:0;width:45px;height:20px;text-align:center;line-height:20px;float:right;margin-left:7px;font-size:12px;font-family:"Microsoft YaHei";color:#333}.file_holder .file_content.code table.lines pre.line_numbers{width:40px!important}.pop_CA_cover{position:fixed;left:0;top:0;width:100%;height:100%;z-index:10000000}.pop.pop_CA{position:fixed;left:50%;top:50%;margin-left:-325px;margin-top:-179px;width:650px;background:#fff;border:1px solid #cecece;box-shadow:0 0 10px 0 #cecece;z-index:10000001}.pop .CA_header{height:50px;line-height:50px;padding:0 20px;border-bottom:1px solid #cecece;position:relative;text-align:left;font-size:16px;color:#333}.pop .CA_header .cancel_icon{display:block;width:15px;height:15px;position:absolute;right:16px;top:18px;background:url(../images/cancel_icon.png) center no-repeat;cursor:pointer}.pop .CA_header .cancel_icon:hover{opacity:.8} \ No newline at end of file diff --git a/static/css/csdn_style.css b/static/css/csdn_style.css new file mode 100644 index 00000000..36c6add7 --- /dev/null +++ b/static/css/csdn_style.css @@ -0,0 +1,1128 @@ +@import url("/static/css/csdnarticlecommon.css"); +.interact .attented{background:url(/static/img/btn_attented2.gif) no-repeat 0 0;} +html, +h1, +h2, +h3, +h4, +h5, +h6, +p { + margin: 0; + padding: 0; +} +body { + margin: 0; + font-family: 'microsoft yahei'; +} +body .pub_footerall { + border-top-color: #a7b9c4; +} +body .csdn-toolbar .container { + width:96%!important; + min-width: 980px; + max-width: 1256px; +} +body a { + text-decoration: none; +} +body > a > img { + position: absolute; + left: 50%; +} +#header:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#header .header { + width:96%; + min-width: 980px; + max-width: 1256px; + margin: 0 auto; +} +.side ul, +.article_next_prev ul, +#navigator ul { + padding: 0; +} +.side ul li, +.article_next_prev ul li, +#navigator ul li { + list-style: none; +} +#navigator { + margin-top: -45px; +} +#navigator .navigator { + width: 1265px; + margin: 0 auto; + padding: 0 0 15px 0; +} +#navigator .navigator:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#navigator ul { + float: right; + margin: 0; + padding: 0; +} +#navigator ul:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#navigator ul li { + float: left; + border: 1px solid #ccc; + width: 88px; + height: 26px; + margin-left: 10px; + line-height: 26px; + font-size: 12px; + text-align: center; + background: #fff; +} +#navigator ul li a { + color: #666; + text-decoration: none; +} +#navigator ul li a img { + vertical-align: text-bottom; + margin-right: 6px; +} +#body { + width:96%; + min-width: 980px; + max-width: 1256px; + margin: 0 auto; + font-size: 12px; + margin-bottom: 40px; +} +#body:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +.panel_head, +.blog-ass-articl dt { + font-weight: bold; +} +#side { + float: left; + margin-right: 12px; + width: 270px; + margin: 0 auto; + margin-right: -280px; +} +#side .panel { + border: 1px solid #fff; + margin-bottom: 9px; + background: #fff; +} +#side .panel_head { + background: #f5f5f5; + height: 29px; + line-height: 29px; + padding-left: 11px; + color: #333; +} +#side .panel_body { + padding: 15px 16px 17px; + word-break: break-all; +} +#side .panel_body iframe { + max-width: 240px; +} +#side .panel_body hr { + height: 0px; + border: 0; + border-bottom: 1px dotted #eee; +} +#side .panel_body .list_closed, +#side .panel_body .list_opended { + display: inline-block; + color: #666; + padding-right: 20px; + background: url("/static/img/icon-arrow.png") no-repeat right bottom; + cursor: pointer; +} +#side .panel_body .list_opended { + background-position: right top; +} +#side div[id^=custom_column] ul.panel_body ul { + line-height: 2em; +} +#side div[id^=custom_column] ul.panel_body ul * { + text-decoration: none; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(1) { + color: #35904a; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(1) * { + color: #35904a; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(2) { + color: #2880d2; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(2) * { + color: #2880d2; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(3) { + color: #b020ab; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(3) * { + color: #b020ab; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(4) { + color: #22a57d; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(4) * { + color: #22a57d; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(5) { + color: #c81622; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(5) * { + color: #c81622; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(6) { + color: #fc9b18; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(6) * { + color: #fc9b18; +} +#side .profile { + padding-top: 29px; + padding-bottom: 5px; +} +#side .profile #blog_userface { + text-align: center; +} +#side .profile #blog_userface a { + display: inline-block; +} +#side .profile #blog_userface .user_name { + color: #666; + font: 16px/20px 'microsoft yahei'; + text-decoration: none; +} +#side .profile #blog_userface span { + display: block; + margin: 15px 0; +} +#side .profile .interact { + text-align: center; + padding-bottom: 15px; + margin-bottom: 7px; +} +#side .profile .interact a { + background-color: #999; + background-repeat: no-repeat; + display: inline-block; + margin-left: 6px; + width: 50px; + height: 25px; + line-height: 25px; + color: #fff !important; + text-align: center; + padding-left: 18px; + text-decoration: none; +} +#side .profile .interact .attent { + background-image: url("/static/img/skin-attent.png"); + background-position: 15px center; +} +#side .profile .interact .attent:after { + content: "关注"; +} +#side .profile .interact .letter { + background-image: url("/static/img/skin-email.png"); + background-position: 8px center; +} +#side .profile .interact .letter:after { + content: "发私信"; +} +#side .profile #blog_medal { + margin-bottom: 10px; +} +#side .profile #blog_medal .ico_expert { + margin: 0 auto 10px auto; +} +#side .profile #blog_medal a { + width: 21px; + margin-right: 10px; +} +#side .profile #blog_medal a img{ + width: 21px; +} +#side .profile #blog_rank { + padding: 4px; + border-bottom: 1px dashed #ccc; + margin-bottom: 13px; +} +#side .profile #blog_rank li { + margin-bottom: 11px; +} +#side .profile #blog_statistics:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#side .profile #blog_statistics li { + float: left; + width: 114px; + color: #333; + margin-bottom: 12px; +} +#side .profile #blog_statistics li span { + color: #666; +} +#side #panel_Search { + position: relative; +} +#side #panel_Search .blogsearch { + width: 192px; + border: 1px solid #ccc; + padding: 7px 30px 7px 7px; +} +#side #panel_Search #btnSubmit { + border: 0; + background: url("/static/img/skin-search.png") no-repeat center; + position: absolute; + width: 20px; + height: 20px; + top: 50px; + right: 30px; + text-indent: -100px; + cursor: pointer; +} +#side #panel_Search #btnSubmit:hover { + opacity: 0.7; +} +#side #panel_Category { + color: #000; +} +#side #panel_Category ul { + margin-bottom: -9px; +} +#side #panel_Category #sp_column { + margin-bottom: -11px; +} +#side #panel_Category img { + border: 1px solid #ccc; +} +#side #panel_Category table { + margin-bottom: 11px; +} +#side #panel_Category p { + padding-top: 16px; + padding-bottom: 8px; +} +#side #panel_Category li { + margin-bottom: 9px; +} +#side #panel_Category li span { + margin-left: 8px; +} +#side #archive_list { + color: #000; +} +#side #archive_list ul { + margin-bottom: -8px; +} +#side #archive_list li { + margin-bottom: 8px; +} +#side #archive_list a { + margin-right: 8px; +} +#side #archive_list .list_closed { + color: #666; + margin-top: 17px; +} +#side #hotarticls, +#side #hotarticls2, +#side #newcomments { + color: #666; +} +#side #hotarticls ul, +#side #hotarticls2 ul, +#side #newcomments ul { + margin-bottom: -8px; +} +#side #hotarticls li, +#side #hotarticls2 li, +#side #newcomments li { + margin-bottom: 8px; +} +#side #hotarticls li span, +#side #hotarticls2 li span, +#side #newcomments li span { + margin-left: 10px; +} +#side #newcomments a { + margin-right: 9px; +} +.itemlist li a { + width: 170px; + text-overflow: ellipsis; +} +#main { + float: right; + width: 100%; + padding-left: 280px; + box-sizing:border-box; +} +#main .main{ + width: 100%; + overflow: hidden; + background-color: #fff; +} +#main .ad_class { + border: 0 !important; + padding: 10px; + clear: both; + overflow: hidden; + background: #fff; +} +#main .ad_class .notice { + background: #fffce7 url("/static/img/skin-light.png") no-repeat 8px center; + border: 1px dashed #f8cc7e; + padding: 5px 0 5px 23px; + width: 100%; + max-width: 931px; + box-sizing: border-box; +} +#main .details, +#main .list_item_new { + padding: 20px 20px 35px; + background: #fff; +} +#main .article_title { + margin-bottom: 21px; +} +#main .article_title .ico { + display: inline-block; + vertical-align: middle; + width: 19px; + height: 19px; + margin-right: 10px; +} +#main .article_title .ico_type_Repost { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: -50px 0px; +} +#main .article_title .ico_type_Translated { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: -25px 0; +} +#main .article_title .ico_type_Original { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0px 0; +} +#main .article_title h1 { + display: inline-block; + vertical-align: middle; + font-size: 18px; +} +#main .article_title h1 a { + color: #000; +} +#main .contents .article_title h1 { + font-size: 12px; +} +#main .article_manage { + margin-bottom: 10px; + text-align: right; + color: #999; +} +#main .article_manage a { + color: #33a5ba; +} +#main .article_manage span { + margin-right: 16px; +} +#main .article_manage .link_categories { + float: left; + margin-right: 0; +} +#main .article_manage .link_view, +#main .article_manage .link_comments, +#main .article_manage .link_collect, +#main .article_manage .link_report { + display: inline-block; +} +#main .article_manage .link_view { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0 -25px; + padding-left: 24px; +} +#main .article_manage .link_comments { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0 -43px; + padding-left: 17px; +} +#main .article_manage .link_collect { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0 -62px; + padding-left: 17px; +} +#main .article_manage .link_report { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0 -81px; + padding-left: 17px; +} +#main .tag2box { + padding-bottom: 20px; +} +#main .tag2box a { + background: #eee; + display: inline-block; + padding: 4px 10px; + margin-right: 10px; + border: 1px solid #eee; + border-radius: 10px; + color: #369; +} +#main .article_content { + margin: 35px 0; + font-size: 15px; + color: #555; + line-height: 35px; +} +#main .article_content p > img { + max-width: 602px; + height: auto; +} +#main .article_content a { + color: #0c89cf; +} +#main .article_content .dp-highlighter { + border-color: #ccc; + overflow: hidden; +} +#main .article_next_prev span { + width: 51px; + height: 26px; + line-height: 26px; + display: inline-block; + color: #fff; + padding-left: 27px; + margin-right: 7px; + background: #999; +} +#main .article_next_prev a { + text-decoration: none; + color: #333; +} +#main .article_next_prev .prev_article { + margin-bottom: 3px; +} +#main .article_next_prev .prev_article span { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 8px -111px; + margin-right: 7px; +} +#main .article_next_prev .next_article span { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 8px -140px; + margin-right: 7px; +} +#main .article_next_prev li:hover span { + background-color: #3d84b0; +} +#main .article_next_prev li:hover a { + color: #3d84b0; +} +#main #digg { + text-align: center; + margin-top: 44px; +} +#main #digg .digg { + display: inline-block; + width: 72px; + font-size: 27px; + color: #fff; + cursor: pointer; + margin: 0; + vertical-align: middle; + padding: 7px 0; +} +#main #digg .digg dt { + margin-bottom: 4px; +} +#main #digg .digg dd { + font-size: 15px; + overflow: hidden; + margin: 0; +} +#main #digg #btnDigg { + background: #f90; +} +#main #digg #btnBury { + background: #ff7900; +} +#main #digg .digg_disable { + background: #999 !important; +} +#main .blog-associat-tag { + background: #f5f5f5; + padding: 25px 20px 10px; + clear: both; + color: #333; + margin: 0; +} +#main .blog-associat-tag:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#main .blog-associat-tag dt, +#main .blog-associat-tag dd { + float: left; + margin: 0; +} +#main .blog-associat-tag dt { + font-size: 14px; + margin-right: 19px; +} +#main .blog-associat-tag .blog-tage-red { + background: #e7e7e7; + display: inline-block; + height: 20px; + line-height: 20px; + padding: 0 14px; + border-radius: 10px; + color: #333; + text-decoration: none; +} +#main .blog-ass-articl { + background: #f5f5f5; + margin: 0; + padding: 0 20px 20px; +} +#main .blog-ass-articl:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#main .blog-ass-articl dt { + font-size: 14px; + height: 35px; + line-height: 35px; + margin: 0 0 15px; + border-bottom: 2px solid #ccc; +} +#main .blog-ass-articl dt span { + border-bottom: 2px #c00 solid; + height: 35px; + display: inline-block; +} +#main .blog-ass-articl dd { + margin-left: 0; + float: left; + width: 47%; + height: 23px; + line-height: 23px; + padding-left: 10px; + margin-right: 9px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + background: none !important; + position: relative; +} +#main .blog-ass-articl dd:before { + content: ''; + position: absolute; + left: 0; + top: 10px; + width: 3px; + height: 3px; + background: #3d84b0; +} +#main .blog-ass-articl dd a { + text-decoration: none; + color: #000; +} +#main #ad_cen { + padding-top: 15px; + padding-bottom: 13px; + padding-left: 29px; + padding-right: 38px; + margin-bottom: 11px; + background: #fff; +} +#main .comment_class { + background: #fff; + padding: 20px 30px; +} +#main .comment_class .panel_head { + border-bottom: 2px solid #ccc; + font-size: 14px; +} +#main .comment_class .panel_head > span { + display: inline-block; + border-bottom: 2px solid #c00; + padding-bottom: 7px; + margin-bottom: -2px; +} +#main .comment_class #comment_list { + margin: 20px 0px; +} +#main .comment_class #comment_list dl { + position: relative; + border-top: 1px solid #ccc; + margin: 0; + padding-top: 16px; +} +#main .comment_class #comment_list dl:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#main .comment_class #comment_list dl:first-child { + margin-top: -24px; + border-top: 0; +} +#main .comment_class #comment_list dl > dt { + float: right; + color: #999; +} +#main .comment_class #comment_list dl > dd { + float: left; +} +#main .comment_class #comment_list .username { + position: absolute; + left: 47px; + color: #3d84b0; + text-decoration: none; + font-size: 14px; +} +#main .comment_class #comment_list .comment_userface { + margin-right: 7px; + margin-left: 0; + margin-bottom: 16px; +} +#main .comment_class #comment_list .comment_head .reply, +#main .comment_class #comment_list .comment_head .quote, +#main .comment_class #comment_list .comment_head .report, +#main .comment_class #comment_list .comment_head .delete { + display: inline-block; + padding-left: 17px; + color: #999; + text-decoration: none; + margin-left: 10px; +} +#main .comment_class #comment_list .comment_head .reply { + background-image: url("/static/img/skin-comment-icon.png"); + background-repeat: no-repeat; + background-position: 0 3px; +} +#main .comment_class #comment_list .comment_head .quote { + background-image: url("/static/img/skin-comment-icon.png"); + background-repeat: no-repeat; + background-position: 0 -13px; +} +#main .comment_class #comment_list .comment_head .report { + background-image: url("/static/img/skin-comment-icon.png"); + background-repeat: no-repeat; + background-position: 0 -31px; +} +#main .comment_class #comment_list .comment_head .delete { + background-image: url("/static/img/skin-comment-icon.png"); + background-repeat: no-repeat; + background-position: 0 -50px; +} +#main .comment_class #comment_list .comment_body { + margin: 25px 0 0; + width: 57%; + word-break: break-all; + word-wrap: break-all; + font-size: #333; + padding-bottom: 16px; +} +#main .comment_class #comment_list .comment_reply { + clear: both; + float: right; + border-top: 1px solid #ccc; + padding-top: 16px; + width: 95%; +} +#main .comment_class #comment_list .comment_reply .username { + left: 48px; +} +#main .comment_class #comment_list .comment_reply .comment_body { + width: 50%; +} +#main #comment_form .commentform > ul { + margin: 0 0 0 29px; +} +#main #comment_form .panel_head { + border-bottom: 2px solid #ccc; + line-height: 30px; + margin-bottom: 15px; + position: relative; +} +#main #comment_form .panel_head:after { + content: ""; + height: 2px; + width: 60px; + position: absolute; + background: #c00; + left: 0; + bottom: -2px; +} +#main #comment_form .comment_btn { + margin: 5px 10px 10px 90px; + font-size: 14px; + padding: 5px 40px; +} +#main #comment_form .guest_link { + background: #f5f5f5; + height: 41px; + line-height: 41px; + color: #333; + margin: 15px -30px; + padding-left: 29px; +} +#main #comment_form .guest_link a { + color: #3d84b0; + text-decoration: none; +} +#main #comment_form .comment_content { + min-width: 90%; + max-height: 120px; +} +#main .announce { + color: #999; +} +#main .tag_list { + margin: 11px 0 0; + padding: 20px 30px; +} +#main .tag_list h5 { + background: #fff; + border-bottom: 2px solid #ccc; + line-height: normal; + height: auto; + padding: 0; + color: #333; +} +#main .tag_list h5 > a { + display: inline-block; + border-bottom: 2px solid #c00; + padding-bottom: 9px; + margin-bottom: -2px; + text-decoration: none; + font-size: 14px; +} +#main .tag_list .classify { + margin: 0; + padding: 2px 0 0; +} +#main .tag_list .classify a { + display: inline-block; + text-decoration: none; + color: #3d84b0; + margin-top: 12px; + margin-right: 25px; +} +#main .list_item_new .list_item { + border-bottom: 1px dashed #ddd; + margin: 0 10px; + padding: 20px 0 15px 0; + font-family: 'microsoft yahei'; +} +#main .list_item_new .list_item .article_title { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +#main .list_item_new .list_item h1 { + font-weight: normal; +} +#main .list_item_new .list_item .article_description { + font: 14px/24px 'microsoft yahei'; + margin: -10px 0 10px 0; + color: #666; +} +#main .list_item_new .list_item.list_view { + padding: 10px 0; + position: relative; + height: 25px; +} +#main .list_item_new .list_item.list_view .article_title { + width: 760px; +} +#main .list_item_new .list_item.list_view .article_title, +#main .list_item_new .list_item.list_view .article_manage { + white-space: nowrap; + overflow: hidden; +} +#main .list_item_new .list_item.list_view .article_manage { + top: 15px; + right: -20px; + width: 120px; + position: absolute; +} +#main .pagelist { + margin: 20px auto; + text-align: center; + font: 12px/20px 'microsoft yahei'; +} +#main .pagelist > * { + margin: 0 2px; +} +#main .pagelist span { + color: #666; + margin-right: 10px; +} +#main .pagelist a { + border: solid 1px #dbe5ee; + color: #333; + text-decoration: none; + padding: 2px 8px; +} +#main .pagelist strong, +#main .pagelist a:hover { + background: #07519a; + color: #fff; + padding: 2px 8px; + border: 1px solid #07519a; +} +#main #d-top { + position: fixed; + left: 50%; + margin-left: 640px; +} +#main #d-top a { + display: block; + margin: 1px 0; +} +#main .tag_list h5 > a, +#main .blog-ass-articl dt span, +#main .comment_class .panel_head > span { + border-bottom-color: #3d84b0; +} +#main #comment_form .panel_head:after { + background: #3d84b0; +} +body { + background: url("/static/img/bg-yellow.png") repeat; +} +#header { + background: url("/static/img/title-yellow.png") no-repeat center -201px; + height: 145px; + color: #fff; +} +#header h2 { + padding: 32px 0 0 0; + margin: 0; +} +#header h2 a { + color: #454545; + font: bold 24px/40px 'microsoft yahei'; +} +#header h3 { + padding: 0 0 0 0; + font: 14px/20px 'microsoft yahei'; + max-height: 21px; + overflow: hidden; + margin: 0; + color: #666; +} +#navigator { + margin-top: -45px; +} +#navigator .navigator { + width:96%; + min-width: 980px; + max-width: 1256px; + margin: 0 auto; + background: #454545; + padding: 10px; + box-sizing:border-box; +} +#navigator .navigator:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#navigator ul { + float: right; + margin: 0; + padding: 0; +} +#navigator ul:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#navigator ul li { + float: left; + border: 1px solid #ccc; + width: 88px; + height: 26px; + margin-left: 10px; + line-height: 26px; + font-size: 12px; + text-align: center; + background: #fff; +} +#navigator ul li a { + color: #666; + text-decoration: none; +} +#navigator ul li a img { + vertical-align: text-bottom; + margin-right: 6px; +} +#side .panel { + border: 1px solid #ccc; +} +#side .panel a:link, +#side .panel a:visited { + color: #c88326; +} +#side .panel a:hover { + color: #e63; +} +#main .article_manage a { + color: #c88326; +} +#main .article_next_prev li:hover span { + background-color: #c88326; +} +#main .article_next_prev li:hover a { + color: #c88326; +} +#main .article_next_prev #btnDigg { + background: #f90; +} +#main .article_next_prev #btnBury { + background: #ff7900; +} +#main .details { + border: 1px solid #ccc; + border-bottom: 0; +} +#main .blog-associat-tag, +#main .blog-ass-articl, +#main #ad_cen { + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} +#main #ad_cen { + border-bottom: 1px solid #ccc; +} +#main .comment_class, +#main .tag_list { + border: 1px solid #ccc; +} +#main .comment_head .username { + color: #c88326 !important; +} +#main .comment_head a:hover { + color: #c88326 !important; +} +#main .comment_head a:hover.reply, +#main .comment_head a:hover.quote, +#main .comment_head a:hover.report, +#main .comment_head a:hover.delete { + background-image: url("/static/img/skin-comment-icon-yellow.png") !important; +} +#main .article_manage a { + color: #c88326; +} +#main .article_manage .link_comments, +#main .article_manage .link_collect, +#main .article_manage .link_report { + background-image: url("/static/img/skin-type-icon-yellow.png") !important; +} +#main .tag_list .classify a, +#main .guest_link a { + color: #c88326 !important; +} +#main .blog-ass-articl dd:before { + background: #c88326; +} +#main .tag_list h5 > a, +#main .blog-ass-articl dt span, +#main .comment_class .panel_head > span { + border-bottom-color: #c88326; +} +#main #comment_form .panel_head:after { + background: #c88326; +} + +/*2016.11.02 modifed by liwz*/ +#article_content img{ + max-width:100%; + max-height:100%; +} +#article_content p img{ + max-width:100%; + max-height:100%; +} + +#article_content p span img{ + max-width:100%; + max-height:100%; +} +/* 新加搜索样式 */ +.search_con{ + display: none; + border-bottom: 1px solid #DDDDDD; + margin-left: 30px; + margin-right: 30px; + font-size: 16px; + color: #666666; + padding: 16px 0; +} +.search_con #return_icon{ + width: 8px; + height: 8px; + color: #DDDDDD; + cursor: pointer; + fill:#DDDDDD; +} +.search_con #return_icon:hover{ + fill: #C92027; +} +.search_text{ + color: #333333; + +} \ No newline at end of file diff --git a/static/css/csdnarticlecommon.css b/static/css/csdnarticlecommon.css new file mode 100644 index 00000000..2e4e3637 --- /dev/null +++ b/static/css/csdnarticlecommon.css @@ -0,0 +1,116 @@ +body,form,h1,h2,h3,h4{margin:0px;padding:0px;} +.side li{list-style:none;} +.side ul{margin:0px;padding:0px;} +img{border:none;} +pre{white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; word-wrap:break-word; } + +.share_buttons{float:right; width:170px; margin:5px 0; font:normal 12px/24px Arial, Helvetica, sans-serif; text-align:right;} +.share_buttons span{display:inline-block; line-height:30px; font-weight:bold; color:green; vertical-align:middle;} +.share_buttons a{display:inline-block; width:25px; height:30px; background-position: 0px 5px; cursor:pointer; vertical-align:middle;} +.share_douban{background-image:url(/static/img/ico_douban.gif)} +.share_renren{background-image:url(/static/img/ico_renren.gif)} +.share_sina{background:url(/static/img/ico_sina.gif) no-repeat center center;} +.share_qq{background:url(/static/img/ico_qq.gif) no-repeat center center;} + +.article_description { text-indent:2em;} +.list_opended { background-image: url(/static/img/dir_arr.gif); background-repeat: no-repeat; background-position: 0px 7px; } +.list_opended:hover { background-repeat: no-repeat; background-position: 0px -15px; } +.list_closed { background-image: url(/static/img/dir_arr.gif); background-repeat: no-repeat; background-position: 0px -45px; } +.list_closed:hover { background-repeat: no-repeat; background-position: 0px -69px; } + +/* comment style */ +.comment_item{margin:2px 10px; font:normal 12px/26px Arial, Helvetica, sans-serif;} +.comment_item fieldset{border:solid 1px; font:normal 12px/26px Arial, Helvetica, sans-serif;} +.comment_reply{margin-left:50px;} + +.comment_list{clear: both; } +.comment_list dl{clear: both; display: block; overflow: hidden; } +.comment_item .user{} +.comment_item_reply{ margin-left: 50px; } +.comment_userface{ float: left; margin: 4px; } +.comment_userface img { width:40px; height:40px; } +.comment_body{margin-left: 50px; line-height: 20px; padding: 5px; min-height:35px;} + +.commentform{/*padding:0 0 20px 0;*/} +.commentform ul{clear: both; margin:0 20px 5px 20px; /*overflow: hidden;*/ font:normal 12px/24px Arial, Helvetica, sans-serif;} +.commentform .left{float: left; display: block; width:80px;} +.commentform .right{display: block; margin-left:90px;} +.commentform textarea{padding:5px; border:solid 1px #ddd; color:#555; font:normal 14px/24px Arial, Helvetica, sans-serif;} + +.guest_link{ background-color:#f5f5f5; border:solid 1px #ccc; margin:10px; padding:10px;font-size:12px;} +#lang_list{ background-color: #FFFFFF; border:solid 1px #ccc;font-size:12px;} +#lang_list a { display: inline-block; cursor: pointer; border-right: 1px solid #ccc; padding: 0px 5px; text-align: center; float: left;} +#lang_list a:hover { background-color:#666; color:#fff;} + +a.cmt_btn { background-position:left top; background-repeat:no-repeat; overflow:hidden; display:inline-block; width:16px; height:16px; padding:1px; margin-bottom:-5px; _margin-bottom:4px; text-indent:-2000px; } +a.cmt_btn:hover { border:solid 1px #ccc; padding:0px; } +a.reply{ background-image:url(/static/img/ico_reply.png);} +a.quote{ background-image:url(/static/img/ico_quote.png);} +a.report{ background-image:url(/static/img/ico_report.png);} +a.delete{ background-image:url(/static/img/ico_del.png);} + + +#report_dialog{ position:absolute; left:30%; right:33%; top:33%; z-index:99;} +#panel_report{ background:#fff; border: solid 1px #DDD; width:440px; padding:8px 8px 20px 8px; + border-radius: 5px; -moz-border-radius: 5px;-webkit-border-radius:5px;} +#panel_report .pop_table {line-height:20px; margin:10px 0 0 12px;} +#panel_report th,#panel_report td{padding:4px 0; vertical-align:top;} +#panel_report th{text-align:right; font-weight:normal;} +#panel_report h3{ line-height:60px; } +#report_other_content { height:16px; padding:0px; border:solid 1px #999; } +#btnSubmitReport{border:0px;} + +/*锟斤拷锟斤拷勋锟斤拷*/ +#bms_box { display:block; margin-top:4px; padding: 14px 4px 4px 0; border-top: dashed 1px #ccc; text-align:left; } +#bms_box img { margin-left:6px; cursor:pointer; } +.medal_intro { display:block; *display:inline-block; position:absolute; z-index:10; width:274px; padding:16px; _padding-top:26px; ;background-color: #fff;font-family:'微软雅黑'; + position: absolute; + text-align: center; + width: 252px; + min-height: 100px; + background-color: #fff; + border: 2px #DDDDDD solid; + box-shadow: 0px 2px 2px rgba(0,0,0,0.1); + left: -55px; + top: 33px; + z-index: 100; + vertical-align: top; + padding: 20px; +} + +.medal_intro:after{content:"."; display:block; height:0; clear:both; visibility:hidden;} +.medal_intro dl{margin: 0} +.medal_intro dt{float:left;margin-right: 18px;} +.medal_intro dd{float:left; margin:0; text-align:left;width:180px; + color: #666666; + line-height: 18px;} +.medal_intro dd strong{display:block; padding-bottom:10px; color:#004279;font-size: 18px;} + +#sp_column img { border:solid 1px #ccc; } +#sp_column p { margin:0px; padding:6px 0px; } + +/*锟斤拷注锟斤拷私锟斤拷*/ +.interact{padding:0 0 15px 0; text-align:center;} +.interact .attent, +.interact .attented, +.interact .letter{display:inline-block; width:59px; height:20px; overflow:hidden; cursor:pointer;} +.interact .attent{background:url(/static/img/btn_attent.gif) no-repeat 0 0;} +.interact .attented{background:url(/static/img/btn_attented.gif) no-repeat 0 0;} +.interact .letter{margin:0 10px 0 0; background:url(/static/img/btn_sendletter.gif) no-repeat 0 0;} + +.panel_body li span { padding-left:6px;position: relative} +.itemlist li a { display:inline-block; white-space:nowrap; width:130px; height:15px; overflow:hidden; } +.itemlist li span { display:inline-block; height:14px; float:right; _margin-top:-18px; } +#newcomments .itemlist li a { width:98%; } +#newcomments .itemlist li a.user_name { display:inline; width:auto; } + +#side #blog_userface a { color:#333; } + +#d-top {position:fixed; float:right; z-index:10; right:10px; bottom:10px;} +#d-top img { width:42px; filter:alpha(opcity=30); -moz-opacity:0.3; -khtml-opacity:0.3; opacity:0.3; } +#d-top a:hover img { filter:alpha(opcity=100); -moz-opacity:1; -khtml-opacity:1; opacity:1; } + +.article_next_prev { margin-top:30px; } +.tag2box { margin:10px 0;} +.tag2box a { display:inline-block; padding:4px 10px; line-height:100%; margin-right:10px; border:solid 1px #eee; background-color:#eee; border-radius:10px;} + diff --git a/static/css/main.css b/static/css/main.css index 4777d8d5..ad6f75b5 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,12 +1,12 @@ .blog_top { - height: 3rem; + height: 2rem; background: #fff; position: relative; box-shadow: 2px 4px 7px #dcdcdc; } .blog_top .blog_top_t { text-align: center; - line-height: 3rem; + line-height: 2rem; font-size: 0.85rem; color: #333; } @@ -15,7 +15,7 @@ position: absolute; top: 0.6rem; font-size: 0.8rem; - color: #be0000; + color: #000; cursor: pointer; font-family: '微软雅黑'; } @@ -35,14 +35,14 @@ display: none; width: 100%; position: absolute; - bottom: -3.3rem; + bottom: -2.3rem; padding: 0.5rem; background: #f0f0f0; } .search input { width: 100%; display: block; - height: 2.3rem; + height: 1.3rem; border-style: solid; border-width: 0.025rem; border-color: #cdcdcd; @@ -339,8 +339,7 @@ } .personal dt a img, .personal dt img img { - width: 2.5rem; - height: 2.5rem; + width: 1rem; } .personal dt .per_user { margin-left: 0.5rem; @@ -352,6 +351,9 @@ width: 0.35rem; height: 0.5rem; } +.personal dt .zhuanjia{ + width: 1rem; +} .personal dt .exit, .personal dt .attention { position: absolute; @@ -520,11 +522,11 @@ padding: 0 0.5rem; } .blog_article .blog_article_c .article_t { - font-size: 0.7rem; - color: #333; - padding: 0.5rem 0 0.3rem; - line-height: 1.2; - word-break: break-all; + font-size: 0.8rem; + color: #333; + padding: 0.5rem 0 0.3rem; + line-height: 1.2rem; + word-break: break-all; } .blog_article .blog_article_c .date, .blog_article .blog_article_c .category_p { @@ -716,35 +718,88 @@ pre { border-bottom: solid 0.05rem #ddd; padding-left: 0.5rem; } +.isArticle{ + border-bottom-style: none; + background-color: #f0f0f0; + text-align: center; + font-size: 18px; + color: #333333; + padding-top: .5rem; + height: 2rem; +} .my_hot_article { background: #fff; margin-bottom: 0.5rem; - border-top: solid 0.05rem #dcdcdc; + /* border-top: solid 0.05rem #dcdcdc; */ border-bottom: solid 0.05rem #dcdcdc; } .my_hot_article:last-child { margin-bottom: 2rem; } .my_hot_article .hot_article { - padding: 0 0.5rem; + /* padding: 0 0.5rem; */ } .my_hot_article .hot_article li { - height: 1.6rem; - line-height: 1.6rem; + padding: 0 0.5rem; + /* height: 1.6rem; */ + /* line-height: 1.6rem; */ font-size: 0.6rem; color: #666; border-bottom: solid 0.05rem #ddd; } .my_hot_article .hot_article li:last-child { - border-bottom: none; + /* border-bottom: none; */ } .my_hot_article .hot_article li a { display: inline-block; width: 100%; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; + /* white-space: nowrap; */ + /* text-overflow: ellipsis; */ + /* overflow: hidden; */ color: #666; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + line-height: 1.6rem; + font-size: 0.6rem; + color: #333333; + margin-bottom: 0.3rem; +} +.my_hot_article .hot_article li .userinfo{ + margin-bottom: 0.6rem; +} +.my_hot_article .hot_article li .userinfo span i{ + vertical-align: middle; + margin-right: 8px; +} +.my_hot_article .hot_article li .userinfo .username img{ + width: 1rem; + height: 1rem; + border-radius: 0.5rem; +} +.my_hot_article .hot_article li .userinfo .username .name{ + font-size: 12px; + color: #333333; +} +.my_hot_article .hot_article li .userinfo .time, +.my_hot_article .hot_article li .userinfo .read{ + font-size: 12px; + color: #999999; +} +.my_hot_article .showMore{ + height: 1.7rem; + width: 7.7rem; + margin-left: auto; + margin-right: auto; + margin: 0.68rem auto; + text-align: center; + border: solid 0.05rem #C92027; + +} +.my_hot_article .showMore a{ + color: #C92027; + font-size: 16px; } .blog_handle { width: 100%; @@ -1026,7 +1081,7 @@ pre { } .main_list { width: 100%; - margin: 3.5rem 0 0; + margin: 2.5rem 0 0; } .search_no { padding: 4rem 0; @@ -1052,6 +1107,32 @@ pre { .file_holder .file_content .code .lines .line_numbers { width: 40px !important; } +/* */ +.readall_box{ + position: relative; +} +.readall_box .read_more_btn{ + text-align: center; + font-size: 0.7rem; + height: 1.7rem; + line-height: 1.7rem; + width: 7.7rem; + margin-left: auto; + margin-right: auto; + margin: 0.68rem auto; + text-align: center; + border: solid 0.05rem #C92027; + color: #C92027; +} +.readall_box .read_more_mask{ + position: absolute; + width: 100%; + height: 3rem; + top: -3rem; + background: -moz-linear-gradient(bottom,rgba(255,255,255,0.7),rgba(255,255,255,0)); + background: -webkit-gradient(linear,0 top,0 bottom,from(rgba(255,255,255,0.7)),to(#fff)); + background: -o-linear-gradient(bottom,rgba(255,255,255,0.7),rgba(255,255,255,0)); +} .MathJax .math>span:last-child{ color: #fff;} /*.blog_article .blog_article_c .article_c{ width: 100%; background-color: #fff; overflow: auto;}*/ .MathJax_Display{ overflow-x: auto; overflow-y: hidden;} diff --git a/static/img/bg-yellow.png b/static/img/bg-yellow.png new file mode 100644 index 00000000..85946a57 Binary files /dev/null and b/static/img/bg-yellow.png differ diff --git a/static/img/fancy.png b/static/img/fancy.png new file mode 100644 index 00000000..29f2390e Binary files /dev/null and b/static/img/fancy.png differ diff --git a/static/img/go.jpg b/static/img/go.jpg new file mode 100644 index 00000000..5a94000d Binary files /dev/null and b/static/img/go.jpg differ diff --git a/static/img/icon-arrow.png b/static/img/icon-arrow.png new file mode 100644 index 00000000..3846d682 Binary files /dev/null and b/static/img/icon-arrow.png differ diff --git a/static/img/iconfont-fudongxiangshang.png b/static/img/iconfont-fudongxiangshang.png new file mode 100644 index 00000000..bdc2839a Binary files /dev/null and b/static/img/iconfont-fudongxiangshang.png differ diff --git a/static/img/iconfont-youjiantou.png b/static/img/iconfont-youjiantou.png new file mode 100644 index 00000000..06d21d61 Binary files /dev/null and b/static/img/iconfont-youjiantou.png differ diff --git a/static/img/icons_0_16.png b/static/img/icons_0_16.png new file mode 100644 index 00000000..960adc73 Binary files /dev/null and b/static/img/icons_0_16.png differ diff --git a/static/img/skin-attent.png b/static/img/skin-attent.png new file mode 100644 index 00000000..afd60ef1 Binary files /dev/null and b/static/img/skin-attent.png differ diff --git a/static/img/skin-email.png b/static/img/skin-email.png new file mode 100644 index 00000000..c4e16b70 Binary files /dev/null and b/static/img/skin-email.png differ diff --git a/static/img/skin-light.png b/static/img/skin-light.png new file mode 100644 index 00000000..c93ad338 Binary files /dev/null and b/static/img/skin-light.png differ diff --git a/static/img/skin-search.png b/static/img/skin-search.png new file mode 100644 index 00000000..5c0473d9 Binary files /dev/null and b/static/img/skin-search.png differ diff --git a/static/img/skin-type-icon-yellow.png b/static/img/skin-type-icon-yellow.png new file mode 100644 index 00000000..2bb2170e Binary files /dev/null and b/static/img/skin-type-icon-yellow.png differ diff --git a/static/img/skin-type-icon.png b/static/img/skin-type-icon.png new file mode 100644 index 00000000..ec349ff2 Binary files /dev/null and b/static/img/skin-type-icon.png differ diff --git a/static/img/title-yellow.png b/static/img/title-yellow.png new file mode 100644 index 00000000..e6d02197 Binary files /dev/null and b/static/img/title-yellow.png differ diff --git a/static/js/details_mobile.js b/static/js/details_mobile.js new file mode 100644 index 00000000..d5858d16 --- /dev/null +++ b/static/js/details_mobile.js @@ -0,0 +1,190 @@ +/* +*created by liwz 2015/11/5 +* +*/ + +$(function(){ + //搜索展开隐藏功能 + // var searchFn = (function() + // { + // var oSearch = $("#search_J"), + // oSearchC = $("#search_c_J"), + // oClose = $(".icon_close"); + + // oSearch.on("click",function() + // { + // oSearchC.slideToggle(); + // }); + // oClose.on("click",function() + // { + // oSearchC.slideUp(); + // }); + // })(); +// var readMore = (function(){ +// var widHeight = $(window).height(); +// var artHeight = $('.article_c').height(); +// if(artHeight>(widHeight*2)){ +// $('.article_c').height(widHeight*2-285).css({'overflow':'hidden'}); +// var article_show = true; +// $('.read_more_btn').on('click',bindRead_more); +// }else{ +// article_show = true; +// $('.article_c').removeClass('article_Hide'); +// $('.readall_box').hide().addClass('readall_box_nobg'); +// } +// function bindRead_more(){ +// if(!article_show){ +// $('.article_c').height(widHeight*2).css({'overflow':'hidden'}); +// $('.readall_box').show().removeClass('readall_box_nobg'); +// article_show = true; +// }else{ +// $('.article_c').height("").css({'overflow':'hidden'}); +// $('.readall_box').show().addClass('readall_box_nobg'); +// $('.readall_box').hide().addClass('readall_box_nobg'); +// article_show = false; +// } +// } +// })() + //点击按钮左侧菜单弹出及隐藏 + // var leftNavFn = (function() + // { + // var oMenuBtn = $("#menu_J"), + // oLeftNav = $(".leftNav"), + // oMask = $("#mask"), + // winH = $(window).height(); + // oMenuBtn.on('click',function() + // { + // if(!oLeftNav.is(":animated")) + // { + // oLeftNav.animate({'left':0},500); + // //var oMask = $('
'); + // oMask.show(); + // $('body').css({ + // 'height':winH, + // 'overflow-y':'hidden' + // }); //屏蔽滚动条 + // } + // return false; //阻止默认事件及冒泡 + // }); + // oMask.click(function(ev) + // { + // /*if($(ev.target).attr('id') == 'mask') + // {*/ + // if(!oLeftNav.is(":animated")) + // { + // oLeftNav.animate({'left':-40 + "rem"},500); + // oMask.hide(); + // $('body').css({ + // 'height':'auto', + // 'overflow-y':'auto' + // }); //打开滚动条 + // } + // //} + // return false; + // }) + // })(); + + //点击关闭底部广告 + // var home_AD = (function() + // { + // var oClose = $(".ad_close"); + // oClose.on('click',function() + // { + // $(this).parents(".ad_box").hide(); + // }) + // })(); + + //点击全部博文展示筛选内容 + // var blogList = (function() + // { + // var oTotalBlog = $(".total_blog"); + // oTotalBlog.on('click',function() + // { + // $(this).next(".filter_category").toggle(); + // }) + // })(); + + //返回顶部 + var backTop = (function() + { + var $backToTopFile = $('.backToTop ') + .click(function() + { + $("body,html").animate({scrollTop:0},500); + }); + + var backToFun = function () + { + var scrollTop = $(document).scrollTop(); + var winh = $(window).height(); + (scrollTop > 0) ? $backToTopFile.show() : $backToTopFile.hide(); + //IE6下的定位 + if (!window.XMLHttpRequest) { + $backToTopFile.css("top", scrollTop + winh - 86); + } + }; + $(window).bind('scroll',backToFun); + backToFun(); + })(); + + //左侧菜单导航增加点击时的样式 + // var leftStyle = (function() + // { + // var aLeftA = $(".nav_list a"); + // aLeftA.on('click',function() + // { + // $(this).addClass("left_cur"); + // }) + // })(); + + // var preCode = (function() + // { + //$("pre").css({'width':'100%!important','overflow':'hidden'}); + // var aPre = document.getElementsByTagName('pre'); + // for(var i=0; i=0)&&i(e,!n)}}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(i,s){function n(e,i,s,n){return t.each(o,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),n&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var o="Width"===s?["Left","Right"]:["Top","Bottom"],a=s.toLowerCase(),r={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+s]=function(i){return i===e?r["inner"+s].call(this):this.each(function(){t(this).css(a,n(this,i)+"px")})},t.fn["outer"+s]=function(e,i){return"number"!=typeof e?r["outer"+s].call(this,e):this.each(function(){t(this).css(a,n(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i){var s,n=t.plugins[e];if(n&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(s=0;n.length>s;s++)t.options[n[s][0]]&&n[s][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)}})})(jQuery),function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})}(jQuery),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,o="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("
").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,o,a=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=e.pageX,l=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.lefti[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,o=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var o=!1,a=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(a.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY=0;u--)r=p.snapElements[u].left,h=r+p.snapElements[u].width,l=p.snapElements[u].top,c=l+p.snapElements[u].height,r-g>v||m>h+g||l-g>b||_>c+g||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==f.snapMode&&(s=g>=Math.abs(l-b),n=g>=Math.abs(c-_),o=g>=Math.abs(r-v),a=g>=Math.abs(h-m),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||o||a,"outer"!==f.snapMode&&(s=g>=Math.abs(l-_),n=g>=Math.abs(c-b),o=g>=Math.abs(r-m),a=g>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||o||a||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||o||a||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept; -this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,o,a=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,h=a+t.helperProportions.width,l=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return a>=c&&d>=h&&r>=u&&p>=l;case"intersect":return a+t.helperProportions.width/2>c&&d>h-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>l-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,o=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(o,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||l>=u&&p>=l||u>r&&l>p)&&(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=t.ui.intersect(e,this,this.options.tolerance),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),o.length&&(s=t.data(o[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}}(jQuery),function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,o,a=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),o="ui-resizable-"+s,n=t("
"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(t(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,o,a=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),a.containment&&(s+=t(a.containment).scrollLeft()||0,n+=t(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===o?this.axis+"-resize":o),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},o=this.originalMousePosition,a=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-o.left||0,d=e.pageY-o.top||0,p=this._change[a];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,o,a,r=this.options;a={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=a.minHeight*this.aspectRatio,n=a.minWidth/this.aspectRatio,s=a.maxHeight*this.aspectRatio,o=a.maxWidth/this.aspectRatio,e>a.minWidth&&(a.minWidth=e),n>a.minHeight&&(a.minHeight=n),a.maxWidth>s&&(a.maxWidth=s),a.maxHeight>o&&(a.maxHeight=o)),this._vBoundaries=a},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidtht.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return a&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),a&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),o&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,o=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:o.height()-this.borderDif[0]-this.borderDif[2]||0,width:o.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,o,a,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,o=l.containerSize.height,a=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:a,h=t.ui.hasScroll(p)?p.scrollHeight:o,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,o,a=t(this).data("ui-resizable"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio),a.position.top=a._helper?h.top:0),a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top,i=Math.abs((a._helper?a.offset.left-u.left:a.offset.left-u.left)+a.sizeDiff.width),s=Math.abs((a._helper?a.offset.top-u.top:a.offset.top-h.top)+a.sizeDiff.height),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o&&(i-=Math.abs(a.parentData.left)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),o={},a=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(a,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(o[e]=i||null)}),e.css(o)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):(p-l>0?(e.size.height=p,e.position.top=o.top-u):(e.size.height=l,e.position.top=o.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=o.left-c):(e.size.width=h,e.position.left=o.left+n.width-h))}})}(jQuery),function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("
")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||o>i.right||i.top>h||a>i.bottom):"fit"===n.tolerance&&(l=i.left>o&&r>i.right&&i.top>a&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break; -this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t(" ",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}(jQuery),function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("

")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function s(e,i){var s,n,a={};for(s in i)n=i[s],e[s]!==n&&(o[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(a[s]=n));return a}var n=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),o=function(){t.each(n,function(t,i){e[i]&&a[i+"Class"](e[i])})},o(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,o,a,r){return"boolean"==typeof n||n===e?o?t.effects.animateClass.call(this,n?{add:s}:{remove:s},o,a,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,o,a)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,o;for(o=0;s.length>o;o++)null!==s[o]&&(n=t.data(i+s[o]),n===e&&(n=""),t.css(s[o],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):a.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,o=i.queue,a=t.effects.effect[i.effect];return t.fx.off||!a?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):o===!1?this.each(e):this.queue(o||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()}(jQuery),function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons")) -},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,o=this.element.parent(),a=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),o=n.attr("id");s||(s=a+"-header-"+e,i.attr("id",s)),o||(o=a+"-panel-"+e,n.attr("id",o)),i.attr("aria-controls",o),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=o.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:a?t():n,newPanel:r};e.preventDefault(),o&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=a?!1:this.headers.index(n),this.active=o?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(t,e,n){var o,a,r,h=this,l=0,c=t.length&&(!e.length||t.index()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o?!0:a?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("