From 830efc90da2895d65c3a2df32e7ef79cf2a8d556 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 2 Sep 2014 07:11:39 -0400 Subject: update docs and mirror bug fix --- gogs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gogs.go') diff --git a/gogs.go b/gogs.go index 1e2150b3..a1160190 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.9.0831 Beta" +const APP_VER = "0.4.9.0902 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) -- cgit v1.2.3 From ab7206d6b787645956b0279f729bd7b22cbed690 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 5 Sep 2014 17:28:09 -0400 Subject: Fix #348 --- README.md | 3 +- README_ZH.md | 3 +- cmd/web.go | 1 + conf/locale/locale_en-US.ini | 3 ++ conf/locale/locale_zh-CN.ini | 3 ++ gogs.go | 2 +- models/repo.go | 4 +- routers/home.go | 26 +++++++++- templates/.VERSION | 2 +- templates/explore/nav.tmpl | 8 ++++ templates/explore/repos.tmpl | 25 ++++++++++ templates/org/settings/options.tmpl | 96 ++++++++++++++++++------------------- templates/status/404.tmpl | 4 +- 13 files changed, 121 insertions(+), 59 deletions(-) create mode 100644 templates/explore/nav.tmpl create mode 100644 templates/explore/repos.tmpl (limited to 'gogs.go') diff --git a/README.md b/README.md index ddb8367e..689b0df4 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ There are 5 ways to install Gogs: - [Install from binary](http://gogs.io/docs/installation/install_from_binary.md): **STRONGLY RECOMMENDED** - [Install from source](http://gogs.io/docs/installation/install_from_source.md) - [Install from packages](http://gogs.io/docs/installation/install_from_packages.md) -- [Ship with Docker](https://github.com/gogits/gogs/tree/master/dockerfiles) +- [Ship with Docker](https://github.com/gogits/gogs/tree/master/docker) - [Install with Vagrant](https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs) ## Acknowledgments @@ -70,7 +70,6 @@ There are 5 ways to install Gogs: - Usage and modification from [beego](http://beego.me) modules. - Thanks [lavachen](http://www.lavachen.cn/) and [Rocker](http://weibo.com/rocker1989) for designing Logo. - Thanks [gobuild.io](http://gobuild.io) for providing binary compile and download service. -- Thanks [Docker China](http://www.dockboard.org/) for providing [dockerfiles](https://github.com/gogits/gogs/tree/master/dockerfiles). ## Contributors diff --git a/README_ZH.md b/README_ZH.md index de982baf..401c8186 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -50,7 +50,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自 - [二进制安装](http://gogs.io/docs/installation/install_from_binary.md): **强烈推荐** - [源码安装](http://gogs.io/docs/installation/install_from_source.md) - [包管理安装](http://gogs.io/docs/installation/install_from_packages.md) -- [采用 Docker 部署](https://github.com/gogits/gogs/tree/master/dockerfiles) +- [采用 Docker 部署](https://github.com/gogits/gogs/tree/master/docker) - [通过 Vagrant 安装](https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs) ## 特别鸣谢 @@ -61,7 +61,6 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自 - [martini](http://martini.codegangsta.io/) 的路由与中间件机制。 - 感谢 [gobuild.io](http://gobuild.io) 提供二进制编译与下载服务。 - 感谢 [lavachen](http://www.lavachen.cn/) 和 [Rocker](http://weibo.com/rocker1989) 设计的 Logo。 -- 感谢 [Docker 中文社区](http://www.dockboard.org/) 提供的 [dockerfiles](https://github.com/gogits/gogs/tree/master/dockerfiles)。 ## 贡献成员 diff --git a/cmd/web.go b/cmd/web.go index 57164683..cad1db33 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -124,6 +124,7 @@ func runWeb(*cli.Context) { // Routers. m.Get("/", ignSignIn, routers.Home) + m.Get("/explore", routers.Explore) m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install) m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost) m.Group("", func(r *macaron.Router) { diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index 946d5604..e8329933 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -47,6 +47,9 @@ collaborative_repos = Collaborative Repositories my_orgs = My Organizations my_mirrors = My Mirrors +[explore] +repos = Repositories + [auth] create_new_account = Create New Account register_hepler_msg = Already have an account? Sign in now! diff --git a/conf/locale/locale_zh-CN.ini b/conf/locale/locale_zh-CN.ini index 55d22f23..a61a54ce 100644 --- a/conf/locale/locale_zh-CN.ini +++ b/conf/locale/locale_zh-CN.ini @@ -47,6 +47,9 @@ collaborative_repos = 参与协作的仓库 my_orgs = 我的组织 my_mirrors = 我的镜像 +[explore] +repos = 探索仓库 + [auth] create_new_account = 创建帐户 register_hepler_msg = 已经注册?立即登录! diff --git a/gogs.go b/gogs.go index a1160190..1c012d40 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.9.0902 Beta" +const APP_VER = "0.4.9.0905 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/repo.go b/models/repo.go index 23d44a6b..341e7e47 100644 --- a/models/repo.go +++ b/models/repo.go @@ -972,8 +972,8 @@ func GetRepositories(uid int64, private bool) ([]*Repository, error) { } // GetRecentUpdatedRepositories returns the list of repositories that are recently updated. -func GetRecentUpdatedRepositories() (repos []*Repository, err error) { - err = x.Where("is_private=?", false).Limit(5).Desc("updated").Find(&repos) +func GetRecentUpdatedRepositories(num int) (repos []*Repository, err error) { + err = x.Where("is_private=?", false).Limit(num).Desc("updated").Find(&repos) return repos, err } diff --git a/routers/home.go b/routers/home.go index 5ea3e2a0..36a4f50f 100644 --- a/routers/home.go +++ b/routers/home.go @@ -5,6 +5,9 @@ package routers import ( + "fmt" + + "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/setting" @@ -12,7 +15,8 @@ import ( ) const ( - HOME base.TplName = "home" + HOME base.TplName = "home" + EXPLORE_REPOS base.TplName = "explore/repos" ) func Home(ctx *middleware.Context) { @@ -42,6 +46,26 @@ func Home(ctx *middleware.Context) { ctx.HTML(200, HOME) } +func Explore(ctx *middleware.Context) { + ctx.Data["Title"] = ctx.Tr("explore") + ctx.Data["PageIsExploreRepositories"] = true + + repos, err := models.GetRecentUpdatedRepositories(20) + if err != nil { + ctx.Handle(500, "GetRecentUpdatedRepositories", err) + return + } + for _, repo := range repos { + if err = repo.GetOwner(); err != nil { + ctx.Handle(500, "GetOwner", fmt.Errorf("%d: %v", repo.Id, err)) + return + } + } + ctx.Data["Repos"] = repos + + ctx.HTML(200, EXPLORE_REPOS) +} + func NotFound(ctx *middleware.Context) { ctx.Data["Title"] = "Page Not Found" ctx.Handle(404, "home.NotFound", nil) diff --git a/templates/.VERSION b/templates/.VERSION index 5f3c5181..6e361299 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.4.9.0902 Beta \ No newline at end of file +0.4.9.0905 Beta \ No newline at end of file diff --git a/templates/explore/nav.tmpl b/templates/explore/nav.tmpl new file mode 100644 index 00000000..1310bccf --- /dev/null +++ b/templates/explore/nav.tmpl @@ -0,0 +1,8 @@ +
+

{{.i18n.Tr "explore"}}

+ +
\ No newline at end of file diff --git a/templates/explore/repos.tmpl b/templates/explore/repos.tmpl new file mode 100644 index 00000000..a1e3d408 --- /dev/null +++ b/templates/explore/repos.tmpl @@ -0,0 +1,25 @@ +{{template "ng/base/head" .}} +{{template "ng/base/header" .}} +
+
+ {{template "explore/nav" .}} +
+
+
+ {{range .Repos}} +
+
    +
  • {{.NumStars}}
  • +
  • {{.NumForks}}
  • +
+

{{.Name}}

+

{{.Description}}

+

{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}

+
+ {{end}} +
+
+
+
+
+{{template "ng/base/footer" .}} \ No newline at end of file diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl index ae225a9c..14ea1b34 100644 --- a/templates/org/settings/options.tmpl +++ b/templates/org/settings/options.tmpl @@ -3,54 +3,54 @@ {{template "org/base/header" .}}
- {{template "org/settings/nav" .}} -
-
- {{template "ng/base/alert" .}} -
-
-
- {{.i18n.Tr "org.settings.options"}} -
-
- {{.CsrfTokenHtml}} - -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-
+ {{template "org/settings/nav" .}} +
+
+ {{template "ng/base/alert" .}} +
+
+
+ {{.i18n.Tr "org.settings.options"}} +
+
+ {{.CsrfTokenHtml}} + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl index 2d04b559..e024715e 100644 --- a/templates/status/404.tmpl +++ b/templates/status/404.tmpl @@ -1,11 +1,11 @@ {{template "ng/base/head" .}} {{template "ng/base/header" .}} -
+

404



Application Version: {{AppVer}}

If you think this is an error, please open an issue on GitHub.

-

We're currently working on 0.5 beta version, many pages may be missing at this time. Sorry for confusion!

+
{{template "ng/base/footer" .}} -- cgit v1.2.3 From 0ddb1eb769610f1d74997ad12d848ae5a0bdb4ab Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 7 Sep 2014 19:02:58 -0400 Subject: Finish new install page, almost ready for 0.5 release --- conf/locale/locale_en-US.ini | 47 +++++- conf/locale/locale_zh-CN.ini | 45 ++++++ gogs.go | 2 +- modules/auth/user_form.go | 21 +-- public/ng/css/gogs.css | 13 ++ public/ng/js/gogs.js | 42 +++++- public/ng/js/min/gogs-min.js | 10 +- public/ng/less/gogs/external.less | 170 +++++++++++---------- routers/install.go | 49 +++--- templates/.VERSION | 2 +- templates/install.tmpl | 306 ++++++++++++++++---------------------- 11 files changed, 408 insertions(+), 299 deletions(-) (limited to 'gogs.go') diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index e8329933..50fbc3cd 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -38,6 +38,50 @@ issues = Issues cancel = Cancel +[install] +install = Installation +title = Install Steps For First-time Run +requite_db_desc = Gogs requires MySQL, PostgreSQL or SQLite3, but SQLite3 is usually available in the official binary version. +db_type = Database Type +host = Host +user = User +password = Password +db_name = Database Name +db_helper = Please use INNODB engine with utf8_general_ci charset for MySQL. +ssl_mode = SSL Mode +path = Path +sqlite_helper = The file path of SQLite3 database. +general_title = General Settings of Gogs +repo_path = Repository Root Path +repo_path_helper = All Git remote repositories will be saved to this directory. +run_user = Run User +run_user_helper = The user must have access to Repository Root Path and run Gogs. +domain = Domain +domain_helper = This affects SSH clone URLs. +app_url = Application URL +app_url_helper = This affects HTTP/HTTPS clone URL and somewhere in e-mail. +email_title = Email Service Settings(Optional) +smtp_host = SMTP Host +mailer_user = Sender E-mail +mailer_password = Sender Password +notify_title = Notification Settings(Optional) +register_confirm = Enable Register Confirmation +mail_notify = Enable Mail Notification +admin_title = Admin Account Settings +admin_name = Username +admin_password = Password +confirm_password = Confirm Password +admin_email = E-mail +install_gogs = Install Gogs +test_git_failed = Fail to test 'git' command: %v +sqlite3_not_available = Your release version does not support SQLite3, please download the official binary version from http://gogs.io/docs/installation/install_from_binary.html, NOT the gobuild version. +invalid_db_setting = Database setting is not correct: %v +invalid_repo_path = Repository root path is invalid: %v +run_user_not_match = Run user isn't the current user: %s -> %s +save_config_failed = Fail to save configuration: %v +invalid_admin_setting = Admin account setting is invalid: %v +install_success = Welcome! We're glad that you choose Gogs, have fun and take care. + [home] uname_holder = Username or E-mail password_holder = Password @@ -84,6 +128,7 @@ HttpsUrl = HTTPS URL PayloadUrl = Payload URL TeamName = Team name AuthName = Authorization name +AdminEmail = Admin E-mail require_error = ` cannot be empty.` alpha_dash_error = ` must be valid alpha or numeric or dash(-_) characters.` @@ -94,7 +139,7 @@ email_error = ` is not a valid e-mail address.` url_error = ` is not a valid URL.` unknown_error = Unknown error: captcha_incorrect = Captcha didn't match. -password_not_match = Password and re-type password are not same. +password_not_match = Password and confirm password are not same. username_been_taken = Username has been already taken. repo_name_been_taken = Repository name has been already taken. diff --git a/conf/locale/locale_zh-CN.ini b/conf/locale/locale_zh-CN.ini index a61a54ce..7d10142e 100644 --- a/conf/locale/locale_zh-CN.ini +++ b/conf/locale/locale_zh-CN.ini @@ -38,6 +38,50 @@ issues = 工单管理 cancel = 取消 +[install] +install = 安装页面 +title = 首次运行安装程序 +requite_db_desc = Gogs 允许后端数据库为 MySQL、PostgreSQL 或 SQLite3,但是 SQLite3 一般只有官方二进制发行版才支持。 +db_type = 数据库类型 +host = 数据库主机 +user = 数据库用户 +password = 数据库用户密码 +db_name = 数据库名称 +db_helper = 如果您使用 MySQL,请使用 INNODB 引擎以及 utf8_general_ci 字符集。 +ssl_mode = SSL 模式 +path = 数据库文件路径 +sqlite_helper = SQLite3 数据库的文件路径。 +general_title = 应用基本设置 +repo_path = 仓库根目录 +repo_path_helper = 所有 Git 远程仓库都将被存放于该目录。 +run_user = 运行系统用户 +run_user_helper = 该用户必须具有对仓库根目录和运行 Gogs 的操作权限。 +domain = 域名 +domain_helper = 该设置影响 SSH 克隆地址。 +app_url = 应用 URL +app_url_helper = 该设置影响 HTTP/HTTPS 克隆地址和一些邮箱中的链接。 +email_title = 邮件服务设置(可选) +smtp_host = SMTP 主机 +mailer_user = 发送邮箱 +mailer_password = 发送邮箱密码 +notify_title = 通知提醒设置(可选) +register_confirm = 启用注册邮箱确认 +mail_notify = 启用邮件通知提醒 +admin_title = 管理员帐号设置 +admin_name = 管理员用户名 +admin_password = 管理员密码 +confirm_password = 确认密码 +admin_email = 管理员邮箱 +install_gogs = 立即安装 +test_git_failed = 无法识别 'git' 命令:%v +sqlite3_not_available = 您所使用的发行版不支持 SQLite3,请从 http://gogs.io/docs/installation/install_from_binary.html 下载官方二进制发行版,而不是 gobuild 版本。 +invalid_db_setting = 数据库设置不正确:%v +invalid_repo_path = 仓库根目录设置不正确:%v +run_user_not_match = 运行系统用户非当前用户:%s -> %s +save_config_failed = 应用配置保存失败:%v +invalid_admin_setting = 管理员帐户设置不正确:%v +install_success = 您好!我们很高兴您选择使用 Gogs,祝您使用愉快,代码从此无 BUG! + [home] uname_holder = 用户名或邮箱 password_holder = 密码 @@ -84,6 +128,7 @@ HttpsUrl = HTTPS URL 地址 PayloadUrl = 推送地址 TeamName = 团队名称 AuthName = 认证名称 +AdminEmail = 管理员邮箱 require_error = 不能为空。 alpha_dash_error = 必须为英文字母、阿拉伯数字或横线(-_)。 diff --git a/gogs.go b/gogs.go index 1c012d40..2ca0f9ad 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.9.0905 Beta" +const APP_VER = "0.5.0.0907 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go index 51a07b91..93bd01a9 100644 --- a/modules/auth/user_form.go +++ b/modules/auth/user_form.go @@ -13,24 +13,25 @@ import ( type InstallForm struct { Database string `form:"database" binding:"Required"` - Host string `form:"host"` - User string `form:"user"` - Passwd string `form:"passwd"` + DbHost string `form:"host"` + DbUser string `form:"user"` + DbPasswd string `form:"passwd"` DatabaseName string `form:"database_name"` SslMode string `form:"ssl_mode"` DatabasePath string `form:"database_path"` - RepoRootPath string `form:"repo_path"` - RunUser string `form:"run_user"` - Domain string `form:"domain"` - AppUrl string `form:"app_url"` - AdminName string `form:"admin_name" binding:"Required;AlphaDashDot;MaxSize(30)"` - AdminPasswd string `form:"admin_pwd" binding:"Required;MinSize(6);MaxSize(255)"` - AdminEmail string `form:"admin_email" binding:"Required;Email;MaxSize(50)"` + RepoRootPath string `form:"repo_path" binding:"Required"` + RunUser string `form:"run_user" binding:"Required"` + Domain string `form:"domain" binding:"Required"` + AppUrl string `form:"app_url" binding:"Required"` SmtpHost string `form:"smtp_host"` SmtpEmail string `form:"mailer_user"` SmtpPasswd string `form:"mailer_pwd"` RegisterConfirm string `form:"register_confirm"` MailNotify string `form:"mail_notify"` + AdminName string `form:"admin_name" binding:"Required;AlphaDashDot;MaxSize(30)"` + AdminPasswd string `form:"admin_pwd" binding:"Required;MinSize(6);MaxSize(255)"` + ConfirmPasswd string `form:"confirm_passwd" binding:"Required;MinSize(6);MaxSize(255)"` + AdminEmail string `form:"admin_email" binding:"Required;Email;MaxSize(50)"` } func (f *InstallForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) { diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css index 636a8667..f4d33540 100644 --- a/public/ng/css/gogs.css +++ b/public/ng/css/gogs.css @@ -669,6 +669,19 @@ ol.linenums { #feature-wrapper .grid-1-2 { margin-bottom: 30px; } +#install-form { + padding: 15px; +} +#install-form label { + width: 35%; +} +#install-form input { + width: 30%; +} +#install-form input[type="checkbox"], +#install-form input[type="radio"] { + width: auto; +} /* The dashboard page style */ diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js index c08a887a..cb23c8f9 100644 --- a/public/ng/js/gogs.js +++ b/public/ng/js/gogs.js @@ -521,7 +521,7 @@ function initAdmin() { e.preventDefault(); return true; } - var $form = $('user-profile-form'); + var $form = $('#user-profile-form'); $form.attr('action', $form.data('delete-url')); }); // Create authorization. @@ -547,6 +547,43 @@ function initAdmin() { }); } +function initInstall() { + // Change database type. + (function () { + var mysql_default = '127.0.0.1:3306'; + var postgres_default = '127.0.0.1:5432'; + + $('#install-database').on("change", function () { + var val = $(this).val(); + if (val != "SQLite3") { + $('.server-sql').show(); + $('.sqlite-setting').addClass("hide"); + if (val == "PostgreSQL") { + $('.pgsql-setting').removeClass("hide"); + + // Change the host value to the Postgres default, but only + // if the user hasn't already changed it from the MySQL + // default. + if ($('#database-host').val() == mysql_default) { + $('#database-host').val(postgres_default); + } + } else if (val == 'MySQL') { + $('.pgsql-setting').addClass("hide"); + if ($('#database-host').val() == postgres_default) { + $('#database-host').val(mysql_default); + } + } else { + $('.pgsql-setting').addClass("hide"); + } + } else { + $('.server-sql').hide(); + $('.pgsql-setting').hide(); + $('.sqlite-setting').removeClass("hide"); + } + }); + }()); +} + $(document).ready(function () { initCore(); if ($('#user-profile-setting').length) { @@ -579,6 +616,9 @@ $(document).ready(function () { if ($('#admin-setting').length) { initAdmin(); } + if ($('#install-form').length) { + initInstall(); + } Tabs('#dashboard-sidebar-menu'); diff --git a/public/ng/js/min/gogs-min.js b/public/ng/js/min/gogs-min.js index 4e4d63fe..8151792f 100644 --- a/public/ng/js/min/gogs-min.js +++ b/public/ng/js/min/gogs-min.js @@ -1,5 +1,5 @@ -function Tabs(e){function t(e){console.log("hide",e),e.removeClass("js-tab-nav-show"),$(e.data("tab-target")).removeClass("js-tab-show").hide()}function n(e){console.log("show",e),e.addClass("js-tab-nav-show"),$(e.data("tab-target")).addClass("js-tab-show").show()}var r=$(e);if(r.length){var i=r.find(".js-tab-nav-show");i.length&&$(i.data("tab-target")).addClass("js-tab-show"),r.on("click",".js-tab-nav",function(){var e=$(this);e.hasClass("js-tab-nav-show")||(i=r.find(".js-tab-nav-show").eq(0),t(i),n(e))}),console.log("init tabs @",e)}}function initCore(){Gogs.renderMarkdown(),Gogs.renderCodeView()}function homepage(){$("#promo-form").submit(function(e){return""===$("#username").val()?(e.preventDefault(),window.location.href="/user/login",!0):void 0}),$("#register-button").click(function(e){return""===$("#username").val()?(e.preventDefault(),window.location.href="/user/sign_up",!0):void $("#promo-form").attr("action","/user/sign_up")})}function settingsProfile(){$("#user-profile-form").submit(function(e){return $("#username").data("uname")==$("#username").val()||confirm("Username has been changed, do you want to continue?")?void 0:(e.preventDefault(),!0)})}function settingsSSHKeys(){$("#ssh-add").click(function(){$("#user-ssh-add-form").removeClass("hide")})}function settingsDelete(){$("#delete-account-button").click(function(e){return confirm("This account is going to deleted, do you want to continue?")?void 0:(e.preventDefault(),!0)})}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=ot.type(e);return"function"===n||ot.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(ot.isFunction(t))return ot.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return ot.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(pt.test(t))return ot.filter(t,e,n);t=ot.filter(t,e)}return ot.grep(e,function(e){return ot.inArray(e,t)>=0!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t=wt[e]={};return ot.each(e.match(xt)||[],function(e,n){t[n]=!0}),t}function a(){mt.addEventListener?(mt.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1)):(mt.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(mt.addEventListener||"load"===event.type||"complete"===mt.readyState)&&(a(),ot.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(kt,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Et.test(n)?ot.parseJSON(n):n}catch(i){}ot.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!ot.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(ot.acceptData(e)){var i,o,a=ot.expando,s=e.nodeType,l=s?ot.cache:e,u=s?e[a]:e[a]&&a;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=s?e[a]=G.pop()||ot.guid++:a),l[u]||(l[u]=s?{}:{toJSON:ot.noop}),("object"==typeof t||"function"==typeof t)&&(r?l[u]=ot.extend(l[u],t):l[u].data=ot.extend(l[u].data,t)),o=l[u],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[ot.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[ot.camelCase(t)])):i=o,i}}function d(e,t,n){if(ot.acceptData(e)){var r,i,o=e.nodeType,a=o?ot.cache:e,s=o?e[ot.expando]:ot.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){ot.isArray(t)?t=t.concat(ot.map(t,ot.camelCase)):t in r?t=[t]:(t=ot.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!u(r):!ot.isEmptyObject(r))return}(n||(delete a[s].data,u(a[s])))&&(o?ot.cleanData([e],!0):rt.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}function f(){return!0}function p(){return!1}function h(){try{return mt.activeElement}catch(e){}}function m(e){var t=Ht.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function g(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==St?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==St?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||ot.nodeName(r,t)?o.push(r):ot.merge(o,g(r,t));return void 0===t||t&&ot.nodeName(e,t)?ot.merge([e],o):o}function v(e){jt.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return ot.nodeName(e,"table")&&ot.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==ot.find.attr(e,"type"))+"/"+e.type,e}function x(e){var t=Zt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,r=0;null!=(n=e[r]);r++)ot._data(n,"globalEval",!t||ot._data(t[r],"globalEval"))}function C(e,t){if(1===t.nodeType&&ot.hasData(e)){var n,r,i,o=ot._data(e),a=ot._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)ot.event.add(t,n,s[n][r])}a.data&&(a.data=ot.extend({},a.data))}}function S(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!rt.noCloneEvent&&t[ot.expando]){i=ot._data(t);for(r in i.events)ot.removeEvent(t,r,i.handle);t.removeAttribute(ot.expando)}"script"===n&&t.text!==e.text?(b(t).text=e.text,x(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),rt.html5Clone&&e.innerHTML&&!ot.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&jt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function T(t,n){var r,i=ot(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:ot.css(i[0],"display");return i.detach(),o}function E(e){var t=mt,n=Jt[e];return n||(n=T(e,t),"none"!==n&&n||(Kt=(Kt||ot("