From 5064894ab5ad5b84f22cdbaf84868871d8e7a549 Mon Sep 17 00:00:00 2001 From: deepzz0 Date: Sun, 18 Dec 2016 18:00:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=83=E7=89=9Bcdn?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.go | 39 ++++- qiniu.go | 66 +++++--- qiniu_test.go | 2 +- static/admin/background.css | 1 - static/admin/hyperdown.js | 1 + static/admin/moxie.js | 2 +- static/admin/pagedown-extra.js | 1 + static/admin/pagedown.js | 2 +- static/admin/plupload.js | 2 +- static/admin/stmd.js | 1 - static/admin/style.css | 2 + views/admin/backLayout.html | 1 - views/admin/login.html | 4 +- views/admin/post.html | 283 ++++++++++++++++----------------- 14 files changed, 223 insertions(+), 184 deletions(-) delete mode 100644 static/admin/background.css create mode 100644 static/admin/hyperdown.js create mode 100644 static/admin/pagedown-extra.js delete mode 100644 static/admin/stmd.js diff --git a/api.go b/api.go index 9c0fbc6..e754f24 100644 --- a/api.go +++ b/api.go @@ -48,6 +48,8 @@ func init() { APIs["trash-recover"] = apiTrashRecover // 上传文件 APIs["file-upload"] = apiFileUpload + // 删除文件 + APIs["file-delete"] = apiFileDelete } func apiAccount(c *gin.Context) { @@ -407,23 +409,48 @@ func apiFileUpload(c *gin.Context) { type Size interface { Size() int64 } - file, header, err := c.Request.FormFile("upload") + file, header, err := c.Request.FormFile("file") if err != nil { - responseNotice(c, NOTICE_NOTICE, "上传失败", "") + logd.Error(err) + c.String(http.StatusBadRequest, err.Error()) return } s, ok := file.(Size) if !ok { - responseNotice(c, NOTICE_NOTICE, "文件太大", "") + logd.Error("assert failed") + c.String(http.StatusBadRequest, "false") return } filename := strings.ToLower(header.Filename) - url, err := Upload(filename, s.Size(), file) + url, err := FileUpload(filename, s.Size(), file) if err != nil { - responseNotice(c, NOTICE_NOTICE, "上传失败", "") + logd.Error(err) + c.String(http.StatusBadRequest, err.Error()) return } - responseNotice(c, NOTICE_SUCCESS, url, "") + typ := c.Request.Header.Get("Content-Type") + c.JSON(http.StatusOK, gin.H{ + "name": filename, + "isImage": typ[:5] == "image", + "url": url, + "bytes": fmt.Sprintf("%dkb", s.Size()/1000), + }) +} + +func apiFileDelete(c *gin.Context) { + var err error + defer func() { + if err != nil { + logd.Error(err) + } + c.String(http.StatusOK, "删掉了吗?鬼知道。。。") + }() + name := c.PostForm("name") + if name == "" { + err = errors.New("参数错误") + return + } + err = FileDelete(name) } func responseNotice(c *gin.Context, typ, content, hl string) { diff --git a/qiniu.go b/qiniu.go index c9de41e..90a2f53 100644 --- a/qiniu.go +++ b/qiniu.go @@ -7,11 +7,16 @@ import ( "path/filepath" "github.com/eiblog/eiblog/setting" - "qiniupkg.com/api.v7/conf" "qiniupkg.com/api.v7/kodo" "qiniupkg.com/api.v7/kodocli" ) +var qiniu_cfg = &kodo.Config{ + AccessKey: setting.Conf.Kodo.AccessKey, + SecretKey: setting.Conf.Kodo.SecretKey, + Scheme: "https", +} + type bucket struct { name string domain string @@ -33,15 +38,13 @@ func onProgress(fsize, uploaded int64) { } } -func Upload(name string, size int64, data io.Reader) (string, error) { +func FileUpload(name string, size int64, data io.Reader) (string, error) { if setting.Conf.Kodo.AccessKey == "" || setting.Conf.Kodo.SecretKey == "" { return "", errors.New("qiniu config error") } - conf.ACCESS_KEY = setting.Conf.Kodo.AccessKey - conf.SECRET_KEY = setting.Conf.Kodo.SecretKey // 创建一个client - c := kodo.New(0, nil) + c := kodo.New(0, qiniu_cfg) // 设置上传的策略 policy := &kodo.PutPolicy{ @@ -56,20 +59,8 @@ func Upload(name string, size int64, data io.Reader) (string, error) { zone := 0 uploader := kodocli.NewUploader(zone, nil) - ext := filepath.Ext(name) - var key string - switch ext { - case ".bmp", ".png", ".jpg", ".gif", ".ico": - key = "blog/img/" + name - case ".mov", ".mp4": - key = "blog/video/" + name - case ".go", ".js", ".css", ".cpp", ".php", ".rb", ".java", ".py", ".sql", ".lua", ".html", ".sh", ".xml", ".cs": - key = "blog/code/" + name - case ".txt", ".md", ".ini", ".yaml", ".yml", ".doc", ".ppt", ".pdf": - key = "blog/document/" + name - case ".zip", ".rar", ".tar", ".gz": - key = "blog/archive/" + name - default: + key := getKey(name) + if key == "" { return "", errors.New("不支持的文件类型") } @@ -83,3 +74,40 @@ func Upload(name string, size int64, data io.Reader) (string, error) { url := kodo.MakeBaseUrl(setting.Conf.Kodo.Domain, ret.Key) return url, nil } + +func FileDelete(name string) error { + // new一个Bucket管理对象 + c := kodo.New(0, qiniu_cfg) + p := c.Bucket(setting.Conf.Kodo.Name) + + key := getKey(name) + if key == "" { + return errors.New("不支持的文件类型") + } + + // 调用Delete方法删除文件 + err := p.Delete(nil, key) + // 打印返回值以及出错信息 + if err != nil { + return err + } + return nil +} + +func getKey(name string) string { + ext := filepath.Ext(name) + var key string + switch ext { + case ".bmp", ".png", ".jpg", ".gif", ".ico": + key = "blog/img/" + name + case ".mov", ".mp4": + key = "blog/video/" + name + case ".go", ".js", ".css", ".cpp", ".php", ".rb", ".java", ".py", ".sql", ".lua", ".html", ".sh", ".xml", ".cs": + key = "blog/code/" + name + case ".txt", ".md", ".ini", ".yaml", ".yml", ".doc", ".ppt", ".pdf": + key = "blog/document/" + name + case ".zip", ".rar", ".tar", ".gz": + key = "blog/archive/" + name + } + return key +} diff --git a/qiniu_test.go b/qiniu_test.go index 1994def..cf5e54a 100644 --- a/qiniu_test.go +++ b/qiniu_test.go @@ -13,7 +13,7 @@ func TestUpload(t *testing.T) { t.Fatal(err) } info, _ := file.Stat() - url, err := Upload(info.Name(), info.Size(), file) + url, err := FileUpload(info.Name(), info.Size(), file) if err != nil { t.Fatal(err) } diff --git a/static/admin/background.css b/static/admin/background.css deleted file mode 100644 index 0236d0b..0000000 --- a/static/admin/background.css +++ /dev/null @@ -1 +0,0 @@ -article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){height:0}audio:not([controls]),[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:transparent}h1{font-size:2em;margin:0.67em 0}b,strong{font-weight:700}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}figure{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}a:focus{outline:thin dotted}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}svg:not(:root){overflow:hidden}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="search"]{box-sizing:content-box}.container,.row [class*="col-"]{box-sizing:border-box}.container{margin-left:auto;margin-right:auto;padding-left:10px;padding-right:10px}.row{margin-right:-10px;margin-left:-10px}.col-mb-1{width:8.33333%}.col-mb-2{width:16.66667%}.col-mb-3{width:25%}.col-mb-4{width:33.33333%}.col-mb-5{width:41.66667%}.col-mb-6{width:50%}.col-mb-7{width:58.33333%}.col-mb-8{width:66.66667%}.col-mb-9{width:75%}.col-mb-10{width:83.33333%}.col-mb-11{width:91.66667%}.col-mb-12{width:100%}.row [class*="col-"]{float:left;min-height:1px;padding-right:10px;padding-left:10px}.row [class*="-push-"],.row [class*="-pull-"]{position:relative}@media (min-width: 768px){.container{max-width:768px}.col-tb-1{width:8.33333%}.col-tb-2{width:16.66667%}.col-tb-3{width:25%}.col-tb-4{width:33.33333%}.col-tb-5{width:41.66667%}.col-tb-6{width:50%}.col-tb-7{width:58.33333%}.col-tb-8{width:66.66667%}.col-tb-9{width:75%}.col-tb-10{width:83.33333%}.col-tb-11{width:91.66667%}.col-tb-12{width:100%}.col-tb-offset-0{margin-left:0}.col-tb-offset-1{margin-left:8.33333%}.col-tb-offset-2{margin-left:16.66667%}.col-tb-offset-3{margin-left:25%}.col-tb-offset-4{margin-left:33.33333%}.col-tb-offset-5{margin-left:41.66667%}.col-tb-offset-6{margin-left:50%}.col-tb-offset-7{margin-left:58.33333%}.col-tb-offset-8{margin-left:66.66667%}.col-tb-offset-9{margin-left:75%}.col-tb-offset-10{margin-left:83.33333%}.col-tb-offset-11{margin-left:91.66667%}.col-tb-offset-12{margin-left:100%}.col-tb-pull-0{right:0}.col-tb-pull-1{right:8.33333%}.col-tb-pull-2{right:16.66667%}.col-tb-pull-3{right:25%}.col-tb-pull-4{right:33.33333%}.col-tb-pull-5{right:41.66667%}.col-tb-pull-6{right:50%}.col-tb-pull-7{right:58.33333%}.col-tb-pull-8{right:66.66667%}.col-tb-pull-9{right:75%}.col-tb-pull-10{right:83.33333%}.col-tb-pull-11{right:91.66667%}.col-tb-pull-12{right:100%}.col-tb-push-0{left:0}.col-tb-push-1{left:8.33333%}.col-tb-push-2{left:16.66667%}.col-tb-push-3{left:25%}.col-tb-push-4{left:33.33333%}.col-tb-push-5{left:41.66667%}.col-tb-push-6{left:50%}.col-tb-push-7{left:58.33333%}.col-tb-push-8{left:66.66667%}.col-tb-push-9{left:75%}.col-tb-push-10{left:83.33333%}.col-tb-push-11{left:91.66667%}.col-tb-push-12{left:100%}}@media (min-width: 992px){.container{max-width:952px}.col-1{width:8.33333%}.col-2{width:16.66667%}.col-3{width:25%}.col-4{width:33.33333%}.col-5{width:41.66667%}.col-6{width:50%}.col-7{width:58.33333%}.col-8{width:66.66667%}.col-9{width:75%}.col-10{width:83.33333%}.col-11{width:91.66667%}.col-12{width:100%}.col-offset-0{margin-left:0}.col-offset-1{margin-left:8.33333%}.col-offset-2{margin-left:16.66667%}.col-offset-3{margin-left:25%}.col-offset-4{margin-left:33.33333%}.col-offset-5{margin-left:41.66667%}.col-offset-6{margin-left:50%}.col-offset-7{margin-left:58.33333%}.col-offset-8{margin-left:66.66667%}.col-offset-9{margin-left:75%}.col-offset-10{margin-left:83.33333%}.col-offset-11{margin-left:91.66667%}.col-offset-12{margin-left:100%}.col-pull-0{right:0}.col-pull-1{right:8.33333%}.col-pull-2{right:16.66667%}.col-pull-3{right:25%}.col-pull-4{right:33.33333%}.col-pull-5{right:41.66667%}.col-pull-6{right:50%}.col-pull-7{right:58.33333%}.col-pull-8{right:66.66667%}.col-pull-9{right:75%}.col-pull-10{right:83.33333%}.col-pull-11{right:91.66667%}.col-pull-12{right:100%}.col-push-0{left:0}.col-push-1{left:8.33333%}.col-push-2{left:16.66667%}.col-push-3{left:25%}.col-push-4{left:33.33333%}.col-push-5{left:41.66667%}.col-push-6{left:50%}.col-push-7{left:58.33333%}.col-push-8{left:66.66667%}.col-push-9{left:75%}.col-push-10{left:83.33333%}.col-push-11{left:91.66667%}.col-push-12{left:100%}}@media (min-width: 1200px){.container{max-width:1160px}.col-wd-1{width:8.33333%}.col-wd-2{width:16.66667%}.col-wd-3{width:25%}.col-wd-4{width:33.33333%}.col-wd-5{width:41.66667%}.col-wd-6{width:50%}.col-wd-7{width:58.33333%}.col-wd-8{width:66.66667%}.col-wd-9{width:75%}.col-wd-10{width:83.33333%}.col-wd-11{width:91.66667%}.col-wd-12{width:100%}.col-wd-offset-0{margin-left:0}.col-wd-offset-1{margin-left:8.33333%}.col-wd-offset-2{margin-left:16.66667%}.col-wd-offset-3{margin-left:25%}.col-wd-offset-4{margin-left:33.33333%}.col-wd-offset-5{margin-left:41.66667%}.col-wd-offset-6{margin-left:50%}.col-wd-offset-7{margin-left:58.33333%}.col-wd-offset-8{margin-left:66.66667%}.col-wd-offset-9{margin-left:75%}.col-wd-offset-10{margin-left:83.33333%}.col-wd-offset-11{margin-left:91.66667%}.col-wd-offset-12{margin-left:100%}.col-wd-pull-0{right:0}.col-wd-pull-1{right:8.33333%}.col-wd-pull-2{right:16.66667%}.col-wd-pull-3{right:25%}.col-wd-pull-4{right:33.33333%}.col-wd-pull-5{right:41.66667%}.col-wd-pull-6{right:50%}.col-wd-pull-7{right:58.33333%}.col-wd-pull-8{right:66.66667%}.col-wd-pull-9{right:75%}.col-wd-pull-10{right:83.33333%}.col-wd-pull-11{right:91.66667%}.col-wd-pull-12{right:100%}.col-wd-push-0{left:0}.col-wd-push-1{left:8.33333%}.col-wd-push-2{left:16.66667%}.col-wd-push-3{left:25%}.col-wd-push-4{left:33.33333%}.col-wd-push-5{left:41.66667%}.col-wd-push-6{left:50%}.col-wd-push-7{left:58.33333%}.col-wd-push-8{left:66.66667%}.col-wd-push-9{left:75%}.col-wd-push-10{left:83.33333%}.col-wd-push-11{left:91.66667%}.col-wd-push-12{left:100%}}@media (max-width: 767px){.kit-hidden-mb{display:none}.typecho-list .typecho-table-wrap{padding:10px}.typecho-list .typecho-table-wrap th{padding:0 2px 5px}.typecho-list .typecho-table-wrap td{padding:10px 2px}}@media (max-width: 991px){.kit-hidden-tb{display:none}}@media (max-width: 1199px){.kit-hidden{display:none}}.clearfix,.row{zoom:1}.sr-only{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.typecho-head-nav{background:#292D33;padding:0 10px}.typecho-head-nav a{color:#bbb}.clearfix:before,.row:before,.clearfix:after,.row:after{content:" ";display:table}.clearfix:after,.row:after{clear:both}.typecho-head-nav .operate{float:right}.typecho-head-nav a:hover,.typecho-head-nav a:focus{color:#fff;text-decoration:none}.typecho-head-nav .operate span,.typecho-head-nav .operate a{border:1px solid #383D45;border-width:0 1px;color:#bbb;display:inline-block;line-height:36px;margin-left:-1px;padding:0 20px}.typecho-head-nav .operate span{color:#999}.typecho-head-nav .operate a:hover{background-color:#202328;color:#fff}#typecho-nav-list{float:left}#typecho-nav-list ul{list-style:none;margin:0;padding:0}#typecho-nav-list .root{float:left;position:relative}#typecho-nav-list ul:first-child{border-left:1px solid #383D45}#typecho-nav-list .parent a{border-right:1px solid #383D45;color:#bbb;display:block;float:left;height:36px;line-height:36px;padding:0 20px}#typecho-nav-list .parent a:hover,#typecho-nav-list .focus .parent a,#typecho-nav-list .root:hover .parent a{background:#202328;color:#fff;text-decoration:none}html{height:100%}body{background:#F6F6F3;color:#444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:87.5%;line-height:1.5}a{color:#467B96;text-decoration:none}.typecho-login-wrap{display:table;height:100%;margin:0 auto}.typecho-login{display:table-cell;padding:30px 0 100px;text-align:center;vertical-align:middle;width:280px}.welcome-board{color:#999;font-size:1.15em}.typecho-login h1{margin:0 0 1em}.typecho-dashboard ul{list-style:none;padding:0}.typecho-dashboard li{margin-bottom:5px}.welcome-board em{color:#444;font-size:2em;font-style:normal;font-family:Georgia,serif}.latest-link li{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.latest-link span{border-right:1px solid #ECECEC;color:#999;display:inline-block;margin-right:4px;padding-right:8px;text-align:right;width:37px}a:hover{color:#499BC3;text-decoration:underline}.typecho-login .more-link{color:#CCC;margin-top:2em}.typecho-login .more-link a{margin:0 3px}#typecho-welcome{background-color:#E9E9E6;margin:1em 0;padding:1em 2em}#start-link{border-bottom:1px solid #ECECEC;margin-bottom:25px;padding:0 0 35px}#start-link li{float:left;margin-right:1.5em}#typecho-nav-list .child{background:#202328;display:none;margin:0;max-width:240px;min-width:160px;position:absolute;top:36px;z-index:250}#start-link .balloon{margin-top:2px}#typecho-nav-list .child li a{color:#bbb;display:block;height:36px;line-height:36px;overflow:hidden;padding:0 20px;text-overflow:ellipsis;white-space:nowrap}#typecho-nav-list .focus .parent a{font-weight:700}#typecho-nav-list .child li a:hover,#typecho-nav-list .child li a:focus{background:#292D33;color:#fff}#typecho-nav-list .child li.focus a{color:#6DA1BB;font-weight:700}#typecho-nav-list .root:hover .child{display:block}code,pre,.mono{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}.p{margin:1em 0}.body-100{height:100%}a.balloon-button{background:#d8e7ee;border-radius:30px;display:inline-block;font-size:.78571em;height:16px;line-height:16px;min-width:12px;padding:0 6px;text-align:center;text-decoration:none}a.button:hover,a.balloon-button:hover{background-color:#a5cadc;color:#fff;text-decoration:none}input[type=text],input[type=password],input[type=email],textarea{-webkit-appearance:none;background:#fff;border:1px solid #D9D9D6;border-radius:2px;box-sizing:border-box;padding:7px}textarea{line-height:1.5;resize:vertical}select{border:1px solid #CCC;height:28px}.w-10{width:10%}.w-20{width:20%}.w-30{width:30%}.w-40{width:40%}.w-50{width:50%}.w-60{width:60%}.w-70{width:70%}.w-80{width:80%}.w-90{width:90%}.w-100{width:100%}.btn{background-color:#e9e9e6;border:none;border-radius:2px;color:#666;cursor:pointer;display:inline-block;height:32px;padding:0 12px;vertical-align:middle;zoom:1}.btn-xs{font-size:13px;height:25px;padding:0 10px}.btn-s{height:28px}.btn-l{font-size:1.14286em;font-weight:700;height:40px}.primary{background-color:#467b96;border:none;border-radius:2px;color:#fff;cursor:pointer}.btn-group{display:inline-block}.btn-drop{position:relative}.typecho-table-wrap{background:#fff;padding:30px}.typecho-list-table-title{color:#999;margin:1em 0;text-align:center}.typecho-list-table{width:100%}.typecho-list-operate{margin:.6em 0}.typecho-foot{color:#999;line-height:1.8;padding:1em 0 2em;text-align:center}.typecho-pager{list-style:none;margin:0;padding:0;float:right;line-height:1;text-align:center;zoom:1}input[type="radio"],input[type="checkbox"]{margin-right:3px}input.text-s,textarea.text-s{padding:5px}input.text-l,textarea.text-l{font-size:1.14286em;padding:10px}.typecho-page-title h2{font-size:1.28571em;margin:25px 0 10px}.typecho-list-table th{border-bottom:2px solid #F0F0EC;padding:0 10px 10px;text-align:left}.typecho-list-table td{border-top:1px solid #F0F0EC;padding:10px;word-break:break-word}.typecho-list-operate input,.typecho-list-operate button,.typecho-list-operate select{vertical-align:bottom}.allow-option ul{list-style:none;padding:0}.typecho-pager li{display:inline-block;height:28px;line-height:28px;margin:0 3px}.typecho-pager a{border-radius:2px;display:block;padding:0 10px}.typecho-page-title h2 a{background:#E9E9E6;border-radius:2px;font-size:.8em;margin-left:10px;padding:3px 8px}.btn:hover{background-color:#dbdbd6;transition-duration:0.4s}.btn:active{background-color:#d6d6d0}.btn:disabled{background-color:#f7f7f6;color:#999;cursor:default}.primary:hover{background-color:#3c6a81;transition-duration:0.4s}.primary:active,.primary.active{background-color:#39647a}.primary:disabled{background-color:#508cab;cursor:default}.typecho-list-table .center{text-align:center}.typecho-list-table .right{text-align:right}.typecho-list-operate .operate{float:left}.typecho-list-operate .search{float:right}.typecho-post-area .typecho-label{display:block;font-weight:700;margin:1em 0 -0.5em}.typecho-post-area .url-slug{color:#AAA;font-size:.92857em;margin-top:-0.5em}.typecho-list-operate a:hover{text-decoration:none}.typecho-list-operate input[type="checkbox"]{vertical-align:text-top}.typecho-post-area input.title{font-size:1.17em;font-weight:700}.typecho-pager a:hover{background:#E9E9E6}.typecho-pager a:hover,.typecho-page-title h2 a:hover{text-decoration:none}.typecho-pager li.current a{background:#E9E9E6;color:#444}.typecho-list-table tbody tr:hover td{background-color:#F6F6F3}.typecho-list-table tbody tr.checked td{background-color:#fff9E8}.typecho-list-table .sep:after{content:'/';margin:0 .1em}#link-delelte{color:red}#btn-submit{float:right}.typecho-post-area #slug{background:#fffBCC;border:none;color:#666;padding:2px 4px;width:200px}.typecho-post-area #text{resize:none} diff --git a/static/admin/hyperdown.js b/static/admin/hyperdown.js new file mode 100644 index 0000000..eef734e --- /dev/null +++ b/static/admin/hyperdown.js @@ -0,0 +1 @@ +(function(){var b,a=[].slice;b=(function(){var h,g,e,j,f,d,c;c=function(k){return(k.charAt(0)).toUpperCase()+k.substring(1)};j=function(k){return k.replace(/[-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};f=function(t,k,s){var q,o,n,r,p,m;if(t instanceof Array){if(k instanceof Array){for(q=o=0,r=t.length;o/g,">").replace(/"/g,""")};d=function(p,n){var q,m,k,o,l;if(n==null){n=null}if(n!=null){l="";for(m=k=0,o=n.length-1;0<=o?k<=o:k>=o;m=0<=o?++k:--k){q=n[m];q=j(q);l+=q}l="["+l+"]*";return p.replace(new RegExp("^"+l),"").replace(new RegExp(l+"$"),"")}else{return p.replace(/^\s*/,"").replace(/\s*$/,"")}};h=function(n){var q,p,o,m,l;l=[];if(n instanceof Array){for(o=p=0,m=n.length;p0){l+='

    ';k=1;while(m=this.footnotes.shift()){if(typeof m==="string"){m+=' '}else{m[m.length-1]+=' ';m=m.length>1?this.parse(m.join("\n")):this.parseInline(m[0])}l+='
  1. '+m+"
  2. ";k+=1}l+="
"}return l};i.prototype.parse=function(v){var n,l,o,q,r,p,s,x,k,w,m,t,u;x=[];l=this.parseBlock(v,x);r="";for(p=0,s=l.length;p=0&&l<10){m=f(h(this.holders),g(this.holders),m);l+=1}if(k){this.holders={}}return m};i.prototype.parseInline=function(m,l,k,n){if(l==null){l=""}if(k==null){k=true}if(n==null){n=true}m=this.call("beforeParseInline",m);m=m.replace(/(^|[^\\])(`+)(.+?)\2/mg,(function(o){return function(){var p;p=1<=arguments.length?a.call(arguments,0):[];return p[1]+o.makeHolder(""+(e(p[3]))+"")}})(this));m=m.replace(/\\(.)/g,(function(o){return function(){var q,p;p=1<=arguments.length?a.call(arguments,0):[];q=e(p[1]);q=q.replace(/\$/g,"$");return o.makeHolder(q)}})(this));m=m.replace(/<(https?:\/\/.+)>/ig,(function(o){return function(){var q,r,p;r=1<=arguments.length?a.call(arguments,0):[];p=o.cleanUrl(r[1]);q=o.call("parseLink",r[1]);return o.makeHolder(''+q+"")}})(this));m=m.replace(/<(\/?)([a-z0-9-]+)(\s+[^>]*)?>/ig,(function(o){return function(){var p;p=1<=arguments.length?a.call(arguments,0):[];if((("|"+o.commonWhiteList+"|"+l+"|").indexOf("|"+p[2].toLowerCase()+"|"))>=0){return o.makeHolder(p[0])}else{return e(p[0])}}})(this));m=f(["<",">"],["<",">"],m);m=m.replace(/\[\^((?:[^\]]|\\\]|\\\[)+?)\]/g,(function(o){return function(){var q,p;p=1<=arguments.length?a.call(arguments,0):[];q=o.footnotes.indexOf(p[1]);if(q<0){q=o.footnotes.length+1;o.footnotes.push(o.parseInline(p[1],"",false))}return o.makeHolder(''+q+"")}})(this));m=m.replace(/!\[((?:[^\]]|\\\]|\\\[)*?)\]\(((?:[^\)]|\\\)|\\\()+?)\)/g,(function(o){return function(){var r,q,p;q=1<=arguments.length?a.call(arguments,0):[];r=o.escapeBracket(q[1]);p=o.escapeBracket(q[2]);p=o.cleanUrl(p);return o.makeHolder(''+r+'')}})(this));m=m.replace(/!\[((?:[^\]]|\\\]|\\\[)*?)\]\[((?:[^\]]|\\\]|\\\[)+?)\]/g,(function(o){return function(){var r,q,p;q=1<=arguments.length?a.call(arguments,0):[];r=o.escapeBracket(q[1]);p=o.definitions[q[2]]!=null?''+r+'':r;return o.makeHolder(p)}})(this));m=m.replace(/\[((?:[^\]]|\\\]|\\\[)+?)\]\(((?:[^\)]|\\\)|\\\()+?)\)/g,(function(o){return function(){var r,q,p;q=1<=arguments.length?a.call(arguments,0):[];r=o.parseInline(o.escapeBracket(q[1]),"",false,false);p=o.escapeBracket(q[2]);p=o.cleanUrl(p);return o.makeHolder(''+r+"")}})(this));m=m.replace(/\[((?:[^\]]|\\\]|\\\[)+?)\]\[((?:[^\]]|\\\]|\\\[)+?)\]/g,(function(o){return function(){var r,q,p;q=1<=arguments.length?a.call(arguments,0):[];r=o.parseInline(o.escapeBracket(q[1]),"",false,false);p=o.definitions[q[2]]!=null?''+r+"":r;return o.makeHolder(p)}})(this));m=this.parseInlineCallback(m);m=m.replace(/<([_a-z0-9-\.\+]+@[^@]+\.[a-z]{2,})>/ig,'$1');if(n){m=m.replace(/(^|[^"])((https?):[x80-xff_a-z0-9-\.\/%#!@\?\+=~\|\,&\(\)]+)($|[^"])/ig,(function(o){return function(){var p,q;q=1<=arguments.length?a.call(arguments,0):[];p=o.call("parseLink",q[2]);return q[1]+''+p+""+q[4]}})(this))}m=this.call("afterParseInlineBeforeRelease",m);m=this.releaseHolder(m,k);m=this.call("afterParseInline",m);return m};i.prototype.parseInlineCallback=function(k){k=k.replace(/(\*{3})((?:.|\r)+?)\1/mg,(function(l){return function(){var m;m=1<=arguments.length?a.call(arguments,0):[];return""+(l.parseInlineCallback(m[2]))+""}})(this));k=k.replace(/(\*{2})((?:.|\r)+?)\1/mg,(function(l){return function(){var m;m=1<=arguments.length?a.call(arguments,0):[];return""+(l.parseInlineCallback(m[2]))+""}})(this));k=k.replace(/(\*)((?:.|\r)+?)\1/mg,(function(l){return function(){var m;m=1<=arguments.length?a.call(arguments,0):[];return""+(l.parseInlineCallback(m[2]))+""}})(this));k=k.replace(/(\s+|^)(_{3})((?:.|\r)+?)\2(\s+|$)/mg,(function(l){return function(){var m;m=1<=arguments.length?a.call(arguments,0):[];return m[1]+""+(l.parseInlineCallback(m[3]))+""+m[4]}})(this));k=k.replace(/(\s+|^)(_{2})((?:.|\r)+?)\2(\s+|$)/mg,(function(l){return function(){var m;m=1<=arguments.length?a.call(arguments,0):[];return m[1]+""+(l.parseInlineCallback(m[3]))+""+m[4]}})(this));k=k.replace(/(\s+|^)(_)((?:.|\r)+?)\2(\s+|$)/mg,(function(l){return function(){var m;m=1<=arguments.length?a.call(arguments,0):[];return m[1]+""+(l.parseInlineCallback(m[3]))+""+m[4]}})(this));k=k.replace(/(~{2})((?:.|\r)+?)\1/mg,(function(l){return function(){var m;m=1<=arguments.length?a.call(arguments,0):[];return""+(l.parseInlineCallback(m[2]))+""}})(this));return k};i.prototype.parseBlock=function(A,k){var E,o,x,p,r,C,F,J,D,G,w,u,z,B,n,v,s,t,y,H,q,I;s=A.split("\n");for(F=0,G=s.length;F0&&n[1].length>=H)||n[1].length>H}this.startBlock("code",J,[n[1],n[3],C])}continue}else{if(this.isBlock("code")){this.setBlock(J);continue}}if(!!(n=z.match(new RegExp("^\\s*<("+q+")(\\s+[^>]*)?>","i")))){I=n[1].toLowerCase();if(!(this.isBlock("html",I))&&!(this.isBlock("pre"))){this.startBlock("html",J,I)}continue}else{if(!!(n=z.match(new RegExp("\\s*$","i")))){I=n[1].toLowerCase();if(this.isBlock("html",I)){this.setBlock(J).endBlock()}continue}else{if(this.isBlock("html")){this.setBlock(J);continue}}}switch(true){case !!(z.match(/^ {4}/)):p=0;if((this.isBlock("pre"))||this.isBlock("list")){this.setBlock(J)}else{this.startBlock("pre",J)}break;case !!(n=z.match(/^(\s*)((?:[0-9a-z]+\.)|\-|\+|\*)\s+/)):H=n[1].length;p=0;if(this.isBlock("list")){this.setBlock(J,H)}else{this.startBlock("list",J,H)}break;case !!(n=z.match(/^\[\^((?:[^\]]|\]|\[)+?)\]:/)):H=n[0].length-1;this.startBlock("footnote",J,[H,n[1]]);break;case !!(n=z.match(/^\s*\[((?:[^\]]|\]|\[)+?)\]:\s*(.+)$/)):this.definitions[n[1]]=this.cleanUrl(n[2]);this.startBlock("definition",J).endBlock();break;case !!(z.match(/^\s*>/)):if(this.isBlock("quote")){this.setBlock(J)}else{this.startBlock("quote",J)}break;case !!(n=z.match(/^((?:(?:(?:[ :]*\-[ :]*)+(?:\||\+))|(?:(?:\||\+)(?:[ :]*\-[ :]*)+)|(?:(?:[ :]*\-[ :]*)+(?:\||\+)(?:[ :]*\-[ :]*)+))+)$/)):if(this.isBlock("table")){x[3][0].push(x[3][2]);x[3][2]+=1;this.setBlock(J,x[3])}else{r=0;if((x==null)||x[0]!=="normal"||k[x[2]].match(/^\s*$/)){this.startBlock("table",J)}else{r=1;this.backBlock(1,"table")}if(n[1][0]==="|"){n[1]=n[1].substring(1);if(n[1][n[1].length-1]==="|"){n[1]=n[1].substring(0,n[1].length-1)}}y=n[1].split(/\+|\|/);o=[];for(B=0,u=y.length;B0){this.startBlock("normal",J)}else{this.setBlock(J)}p+=1}else{if(p===0){this.setBlock(J)}else{this.startBlock("normal",J)}}}else{if(this.isBlock("footnote")){n=z.match(/^(\s*)/);if(n[1].length>=x[3][0]){this.setBlock(J)}else{this.startBlock("normal",J)}}else{if(this.isBlock("table")){if(0<=z.indexOf("|")){x[3][2]+=1;this.setBlock(J,x[3])}else{this.startBlock("normal",J)}}else{if(this.isBlock("pre")){if(z.match(/^\s*$/)){if(p>0){this.startBlock("normal",J)}else{this.setBlock(J)}p+=1}else{this.startBlock("normal",J)}}else{if(this.isBlock("quote")){if(z.match(/^(\s*)/)){if(p>0){this.startBlock("normal",J)}else{this.setBlock(J)}p+=1}else{if(p===0){this.setBlock(J)}else{this.startBlock("normal",J)}}}else{if((x==null)||x[0]!=="normal"){this.startBlock("normal",J)}else{this.setBlock(J)}}}}}}}}return this.optimizeBlocks(this.blocks,k)};i.prototype.optimizeBlocks=function(q,m){var o,k,v,p,w,x,t,n,l,u,s,r;k=q.slice(0);x=m.slice(0);k=this.call("beforeOptimizeBlocks",k,x);w=0;while(k[w]!=null){t=false;o=k[w];l=k[w-1]!=null?k[w-1]:null;n=k[w+1]!=null?k[w+1]:null;s=o[0],v=o[1],u=o[2];if("pre"===s){p=x.reduce(function(y,z){return(z.match(/^\s*$/))&&y},true);if(p){o[0]=s="normal"}}if("normal"===s){r=["list","quote"];if(v===u&&(x[v].match(/^\s*$/))&&(l!=null)&&(n!=null)){if(l[0]===n[0]&&(r.indexOf(l[0]))>=0){k[w-1]=[l[0],l[1],n[2],null];k.splice(w,2);t=true}}}if(!t){w+=1}}return this.call("afterOptimizeBlocks",k,x)};i.prototype.parseCode=function(l,n){var q,m,p,k,o;q=n[0],p=n[1];p=d(p);m=q.length;if(!p.match(/^[_a-z0-9-\+\#\:\.]+$/i)){p=null}else{n=p.split(":");if(n.length>1){p=n[0],k=n[1];p=d(p);k=d(k)}}l=l.slice(1,-1).map(function(r){return r.replace(new RegExp("/^[ ]{"+m+"}/"),"")});o=l.join("\n");if(o.match(/^\s*$/)){return""}else{return"
"+(e(o))+"
"}};i.prototype.parsePre=function(k){var l;k=k.map(function(m){return e(m.substring(4))});l=k.join("\n");if(l.match(/^\s*$/)){return""}else{return"
"+l+"
"}};i.prototype.parseSh=function(l,m){var k;k=this.parseInline(d(l[0],"# "));if(k.match(/^\s*$/)){return""}else{return""+k+""}};i.prototype.parseMh=function(k,l){return this.parseSh(k,l)};i.prototype.parseQuote=function(k){var l;k=k.map(function(m){return m.replace(/^\s*> ?/,"")});l=k.join("\n");if(l.match(/^\s*$/)){return""}else{return"
"+(this.parse(l))+"
"}};i.prototype.parseList=function(k){var w,v,B,G,z,D,s,C,r,q,u,y,n,A,p,t,E,F,x,o;v="";A=99999;t=[];for(G=B=0,C=k.length;B0){v+="
  • "+(this.parse(s.join("\n")))+"
  • "}if(D!==o){if(!!D){v+=""}v+="<"+o+">"}s=[x];D=o}}else{s.push(p.replace(new RegExp("^\\s{"+E+"}"),""))}}if(s.length>0){v+="
  • "+(this.parse(s.join("\n")))+("
  • ")}return v};i.prototype.parseTable=function(k,A){var n,x,o,m,p,y,C,D,G,B,u,E,s,w,r,t,q,v,F,z;C=A[0],n=A[1];p=C.length>0&&(C.reduce(function(l,H){return H+l}))>0;y="";x=p?null:true;t=false;for(G=D=0,E=k.length;D0){u+=1;m[u]=[(m[u]!=null?m[u][0]+1:1),q]}else{if(m[u]!=null){m[u][0]+=1}else{m[0]=[1,q]}}}if(p){y+=""}else{if(x){y+=""}}y+="";for(G in m){o=m[G];r=o[0],z=o[1];F=p?"th":"td";y+="<"+F;if(r>1){y+=' colspan="'+r+'"'}if((n[G]!=null)&&n[G]!=="none"){y+=' align="'+n[G]+'"'}y+=">"+(this.parseInline(z))+("")}y+="";if(p){y+=""}else{if(x){x=false}}}if(x!==null){y+=""}return y+="
    "};i.prototype.parseHr=function(){return"
    "};i.prototype.parseNormal=function(k){var l;k=k.map((function(m){return function(n){return m.parseInline(n)}})(this));l=d(k.join("\n"));l=l.replace(/(\n\s*){2,}/g,"

    ");l=l.replace(/\n/g,"
    ");if(l.match(/^\s*$/)){return""}else{return"

    "+l+"

    "}};i.prototype.parseFootnote=function(k,o){var l,m,n;n=o[0],m=o[1];l=this.footnotes.indexOf(m);if(l>=0){k=k.slice(0);k[0]=k[0].replace(/^\[\^((?:[^\]]|\]|\[)+?)\]:/,"");this.footnotes[l]=k}return""};i.prototype.parseDefinition=function(){return""};i.prototype.parseHtml=function(k,l){k=k.map((function(m){return function(n){return m.parseInline(n,m.specialWhiteList[l]!=null?m.specialWhiteList[l]:"")}})(this));return k.join("\n")};i.prototype.cleanUrl=function(k){var l;if(!!(l=k.match(/^\s*((http|https|ftp|mailto):[x80-xff_a-z0-9-\.\/%#@\?\+=~\|\,&\(\)]+)/i))){l[1]}if(!!(l=k.match(/^\s*([x80-xff_a-z0-9-\.\/%#@\?\+=~\|\,&]+)/i))){return l[1]}else{return"#"}};i.prototype.escapeBracket=function(k){return f(["\\[","\\]","\\(","\\)"],["[","]","(",")"],k)};i.prototype.startBlock=function(k,m,l){if(l==null){l=null}this.pos+=1;this.current=k;this.blocks.push([k,m,m,l]);return this};i.prototype.endBlock=function(){this.current="normal";return this};i.prototype.isBlock=function(k,l){if(l==null){l=null}return this.current===k&&(null===l?true:this.blocks[this.pos][3]===l)};i.prototype.getBlock=function(){if(this.blocks[this.pos]!=null){return this.blocks[this.pos]}else{return null}};i.prototype.setBlock=function(l,k){if(l==null){l=null}if(k==null){k=null}if(l!==null){this.blocks[this.pos][2]=l}if(k!==null){this.blocks[this.pos][3]=k}return this};i.prototype.backBlock=function(n,k,o){var m,l;if(o==null){o=null}if(this.pos<0){return this.startBlock(k,0,o)}l=this.blocks[this.pos][2];this.blocks[this.pos][2]=l-n;m=[k,l-n+1,l,o];if(this.blocks[this.pos][1]<=this.blocks[this.pos][2]){this.pos+=1;this.blocks.push(m)}else{this.blocks[this.pos]=m}this.current=k;return this};i.prototype.combineBlock=function(){var l,k;if(this.pos<1){return this}k=this.blocks[this.pos-1].slice(0);l=this.blocks[this.pos].slice(0);k[2]=l[2];this.blocks[this.pos-1]=k;this.current=k[0];this.blocks=this.blocks.slice(0,-1);this.pos-=1;return this};return i})();if(typeof module!=="undefined"&&module!==null){module.exports=b}else{if(typeof window!=="undefined"&&window!==null){window.HyperDown=b}}}).call(this); \ No newline at end of file diff --git a/static/admin/moxie.js b/static/admin/moxie.js index 55acfe0..28373f9 100644 --- a/static/admin/moxie.js +++ b/static/admin/moxie.js @@ -1 +1 @@ -(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k0){p(x,function(A,z){if(A!==v){if(r(w[z])===r(A)&&!!~u(r(A),["array","object"])){n(w[z],A)}else{w[z]=A}}})}});return w};var p=function(A,B){var z,x,w,y;if(A){try{z=A.length}catch(v){z=y}if(z===y){for(x in A){if(A.hasOwnProperty(x)){if(B(A[x],x)===false){return}}}}else{for(w=0;w0){if(I.length==2){if(typeof(I[1])==B){S[I[0]]=I[1].call(this,O)}else{S[I[0]]=I[1]}}else{if(I.length==3){if(typeof(I[1])===B&&!(I[1].exec&&I[1].test)){S[I[0]]=O?I[1].call(this,O,I[2]):r}else{S[I[0]]=O?O.replace(I[1],I[2]):r}}else{if(I.length==4){S[I[0]]=O?I[3].call(this,O.replace(I[1],I[2])):r}}}}else{S[I]=O?O:r}}break}}if(!!N){break}}return S},str:function(L,K){for(var J in K){if(typeof(K[J])===p&&K[J].length>0){for(var I=0;It[s]){n=1;break}}}if(!o){return n}switch(o){case">":case"gt":return(n>0);case">=":case"ge":return(n>=0);case"<=":case"le":return(n<=0);case"==":case"=":case"eq":return(n===0);case"<>":case"!=":case"ne":return(n!==0);case"":case"<":case"lt":return(n<0);default:return null}}var l=(function(){var n={define_property:(function(){return false}()),create_canvas:(function(){var o=document.createElement("canvas");return !!(o.getContext&&o.getContext("2d"))}()),return_response_type:function(o){try{if(m.inArray(o,["","text","document"])!==-1){return true}else{if(window.XMLHttpRequest){var q=new XMLHttpRequest();q.open("get","/");if("responseType" in q){q.responseType=o;if(q.responseType!==o){return false}return true}}}}catch(p){}return false},use_data_uri:(function(){var o=new Image();o.onload=function(){n.use_data_uri=(o.width===1&&o.height===1)};setTimeout(function(){o.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1);return false}()),use_data_uri_over32kb:function(){return n.use_data_uri&&(i.browser!=="IE"||i.version>=9)},use_data_uri_of:function(o){return(n.use_data_uri&&o<33000||n.use_data_uri_over32kb())},use_fileinput:function(){var o=document.createElement("input");o.setAttribute("type","file");return !o.disabled}};return function(p){var o=[].slice.call(arguments);o.shift();return m.typeOf(n[p])==="function"?n[p].apply(this,o):!!n[p]}}());var i={can:l,browser:k.browser.name,version:parseFloat(k.browser.major),os:k.os.name,osVersion:k.os.version,verComp:j,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};i.OS=i.os;return i});h("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(j){var k=function(q){if(typeof q!=="string"){return q}return document.getElementById(q)};var l=function(s,r){if(!s.className){return false}var q=new RegExp("(^|\\s+)"+r+"(\\s+|$)");return q.test(s.className)};var m=function(r,q){if(!l(r,q)){r.className=!r.className?q:r.className.replace(/\s+$/,"")+" "+q}};var p=function(s,r){if(s.className){var q=new RegExp("(^|\\s+)"+r+"(\\s+|$)");s.className=s.className.replace(q,function(u,t,v){return t===" "&&v===" "?" ":""})}};var i=function(r,q){if(r.currentStyle){return r.currentStyle[q]}else{if(window.getComputedStyle){return window.getComputedStyle(r,null)[q]}}};var o=function(r,v){var w=0,u=0,A,z=document,s,t;r=r;v=v||z.body;function q(E){var C,D,B=0,F=0;if(E){D=E.getBoundingClientRect();C=z.compatMode==="CSS1Compat"?z.documentElement:z.body;B=D.left+C.scrollLeft;F=D.top+C.scrollTop}return{x:B,y:F}}if(r&&r.getBoundingClientRect&&j.browser==="IE"&&(!z.documentMode||z.documentMode<8)){s=q(r);t=q(v);return{x:s.x-t.x,y:s.y-t.y}}A=r;while(A&&A!=v&&A.nodeType){w+=A.offsetLeft||0;u+=A.offsetTop||0;A=A.offsetParent}A=r.parentNode;while(A&&A!=v&&A.nodeType){w-=A.scrollLeft||0;u-=A.scrollTop||0;A=A.parentNode}return{x:w,y:u}};var n=function(q){return{w:q.offsetWidth||q.clientWidth,h:q.offsetHeight||q.clientHeight}};return{get:k,hasClass:l,addClass:m,removeClass:p,getStyle:i,getPos:o,getSize:n}});h("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(j){function i(m,l){var k;for(k in m){if(m[k]===l){return k}}return null}return{RuntimeError:(function(){var k={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};function l(m){this.code=m;this.name=i(k,m);this.message=this.name+": RuntimeError "+this.code}j.extend(l,k);l.prototype=Error.prototype;return l}()),OperationNotAllowedException:(function(){function k(l){this.code=l;this.name="OperationNotAllowedException"}j.extend(k,{NOT_ALLOWED_ERR:1});k.prototype=Error.prototype;return k}()),ImageError:(function(){var k={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2};function l(m){this.code=m;this.name=i(k,m);this.message=this.name+": ImageError "+this.code}j.extend(l,k);l.prototype=Error.prototype;return l}()),FileException:(function(){var k={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};function l(m){this.code=m;this.name=i(k,m);this.message=this.name+": FileException "+this.code}j.extend(l,k);l.prototype=Error.prototype;return l}()),DOMException:(function(){var k={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function l(m){this.code=m;this.name=i(k,m);this.message=this.name+": DOMException "+this.code}j.extend(l,k);l.prototype=Error.prototype;return l}()),EventException:(function(){function k(l){this.code=l;this.name="EventException"}j.extend(k,{UNSPECIFIED_EVENT_TYPE_ERR:0});k.prototype=Error.prototype;return k}())}});h("moxie/core/EventTarget",["moxie/core/Exceptions","moxie/core/utils/Basic"],function(i,j){function k(){var l={};j.extend(this,{uid:null,init:function(){if(!this.uid){this.uid=j.guid("uid_")}},addEventListener:function(q,p,n,o){var m=this,r;q=j.trim(q);if(/\s/.test(q)){j.each(q.split(/\s+/),function(s){m.addEventListener(s,p,n,o)});return}q=q.toLowerCase();n=parseInt(n,10)||0;r=l[this.uid]&&l[this.uid][q]||[];r.push({fn:p,priority:n,scope:o||this});if(!l[this.uid]){l[this.uid]={}}l[this.uid][q]=r},hasEventListener:function(m){return m?!!(l[this.uid]&&l[this.uid][m]):!!l[this.uid]},removeEventListener:function(o,n){o=o.toLowerCase();var p=l[this.uid]&&l[this.uid][o],m;if(p){if(n){for(m=p.length-1;m>=0;m--){if(p[m].fn===n){p.splice(m,1);break}}}else{p=[]}if(!p.length){delete l[this.uid][o];if(j.isEmptyObj(l[this.uid])){delete l[this.uid]}}}},removeAllEventListeners:function(){if(l[this.uid]){delete l[this.uid]}},dispatchEvent:function(r){var o,p,q,s,t={},u=true,m;if(j.typeOf(r)!=="string"){s=r;if(j.typeOf(s.type)==="string"){r=s.type;if(s.total!==m&&s.loaded!==m){t.total=s.total;t.loaded=s.loaded}t.async=s.async||false}else{throw new i.EventException(i.EventException.UNSPECIFIED_EVENT_TYPE_ERR)}}if(r.indexOf("::")!==-1){(function(v){o=v[0];r=v[1]}(r.split("::")))}else{o=this.uid}r=r.toLowerCase();p=l[o]&&l[o][r];if(p){p.sort(function(w,v){return v.priority-w.priority});q=[].slice.call(arguments);q.shift();t.type=r;q.unshift(t);var n=[];j.each(p,function(v){q[0].target=v.scope;if(t.async){n.push(function(w){setTimeout(function(){w(v.fn.apply(v.scope,q)===false)},1)})}else{n.push(function(w){w(v.fn.apply(v.scope,q)===false)})}});if(n.length){j.inSeries(n,function(v){u=!v})}}return u},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},convertEventPropsToHandlers:function(m){var o;if(j.typeOf(m)!=="array"){m=[m]}for(var n=0;n>16&255;n=z>>8&255;m=z&255;if(v==64){r[A++]=String.fromCharCode(o)}else{if(u==64){r[A++]=String.fromCharCode(o,n)}else{r[A++]=String.fromCharCode(o,n,m)}}}while(s>18&63;y=B>>12&63;x=B>>6&63;w=B&63;s[C++]=q.charAt(z)+q.charAt(y)+q.charAt(x)+q.charAt(w)}while(u0){if(x){ac.upload.dispatchEvent(ag)}ac.dispatchEvent(ag)}else{D=true;ac.dispatchEvent("error")}ad()});O.bind("Abort",function(ag){ac.dispatchEvent(ag);ad()});O.bind("Error",function(ag){D=true;Z("readyState",v.DONE);ac.dispatchEvent("readystatechange");L=true;ac.dispatchEvent(ag);ad()});af.exec.call(O,"XMLHttpRequest","send",{url:J,method:P,async:X,user:S,password:G,headers:Q,mimeType:K,encoding:I,responseType:ac.responseType,withCredentials:ac.withCredentials,options:T},ae)}if(typeof(T.required_caps)==="string"){T.required_caps=o.parseCaps(T.required_caps)}T.required_caps=q.extend({},T.required_caps,{return_response_type:ac.responseType});if(ae instanceof z){T.required_caps.send_multipart=true}if(!H){T.required_caps.do_cors=true}if(T.ruid){ab(O.connectRuntime(T))}else{O.bind("RuntimeInit",function(ag,af){ab(af)});O.bind("RuntimeError",function(ag,af){ac.dispatchEvent("RuntimeError",af)});O.connectRuntime(T)}}function M(){Z("responseText","");Z("responseXML",null);Z("response",null);Z("status",0);Z("statusText","");N=W=null}}v.UNSENT=0;v.OPENED=1;v.HEADERS_RECEIVED=2;v.LOADING=3;v.DONE=4;v.prototype=p.instance;return v});h("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(l,i,j,m){function k(){var r,p,n,s,v,u;j.call(this);l.extend(this,{uid:l.guid("uid_"),state:k.IDLE,result:null,transport:function(A,z,y){var x=this;y=l.extend({chunk_size:204798},y);if((r=y.chunk_size%3)){y.chunk_size+=3-r}u=y.chunk_size;t.call(this);n=A;s=A.length;if(l.typeOf(y)==="string"||y.ruid){q.call(x,z,this.connectRuntime(y))}else{var w=function(C,B){x.unbind("RuntimeInit",w);q.call(x,z,B)};this.bind("RuntimeInit",w);this.connectRuntime(y)}},abort:function(){var w=this;w.state=k.IDLE;if(p){p.exec.call(w,"Transporter","clear");w.trigger("TransportingAborted")}t.call(w)},destroy:function(){this.unbindAll();p=null;this.disconnectRuntime();t.call(this)}});function t(){s=v=0;n=this.result=null}function q(x,y){var w=this;p=y;w.bind("TransportingProgress",function(z){v=z.loaded;if(vy){u=y}x=i.btoa(n.substr(v,u));p.exec.call(w,"Transporter","receive",x,s)}}k.IDLE=0;k.BUSY=1;k.DONE=2;k.prototype=m.instance;return k});h("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(k,n,t,r,u,j,s,m,q,w,l,p,o){var v=["progress","load","error","resize","embedded"];function i(){s.call(this);k.extend(this,{uid:k.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){y.call(this)},999);this.convertEventPropsToHandlers(v);z.apply(this,arguments)},downsize:function(G,C,F,D){try{if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}if(this.width>i.MAX_RESIZE_WIDTH||this.height>i.MAX_RESIZE_HEIGHT){throw new t.ImageError(t.ImageError.MAX_RESOLUTION_ERR)}if(!G&&!C||k.typeOf(F)==="undefined"){F=false}G=G||this.width;C=C||this.height;D=(k.typeOf(D)==="undefined"?true:!!D);this.getRuntime().exec.call(this,"Image","downsize",G,C,F,D)}catch(E){this.trigger("error",E)}},crop:function(E,C,D){this.downsize(E,C,true,D)},getAsCanvas:function(){if(!q.can("create_canvas")){throw new t.RuntimeError(t.RuntimeError.NOT_SUPPORTED_ERR)}var C=this.connectRuntime(this.ruid);return C.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(C,D){if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}if(!C){C="image/jpeg"}if(C==="image/jpeg"&&!D){D=90}return this.getRuntime().exec.call(this,"Image","getAsBlob",C,D)},getAsDataURL:function(C,D){if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}return this.getRuntime().exec.call(this,"Image","getAsDataURL",C,D)},getAsBinaryString:function(C,E){var D=this.getAsDataURL(C,E);return o.atob(D.substring(D.indexOf("base64,")+7))},embed:function(F){var N=this,K,J,L,H,O=arguments[1]||{},E=this.width,M=this.height,G;function D(){if(q.can("create_canvas")){var P=K.getAsCanvas();if(P){F.appendChild(P);P=null;K.destroy();N.trigger("embedded");return}}var R=K.getAsDataURL(J,L);if(!R){throw new t.ImageError(t.ImageError.WRONG_FORMAT)}if(q.can("use_data_uri_of",R.length)){F.innerHTML='';K.destroy();N.trigger("embedded")}else{var Q=new m();Q.bind("TransportingComplete",function(){G=N.connectRuntime(this.result.ruid);N.bind("Embedded",function(){k.extend(G.getShimContainer().style,{top:"0px",left:"0px",width:K.width+"px",height:K.height+"px"});G=null},999);G.exec.call(N,"ImageView","display",this.result.uid,E,M);K.destroy()});Q.transport(o.atob(R.substring(R.indexOf("base64,")+7)),J,k.extend({},O,{required_caps:{display_media:true},runtime_order:"flash,silverlight",container:F}))}}try{if(!(F=n.get(F))){throw new t.DOMException(t.DOMException.INVALID_NODE_TYPE_ERR)}if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}if(this.width>i.MAX_RESIZE_WIDTH||this.height>i.MAX_RESIZE_HEIGHT){throw new t.ImageError(t.ImageError.MAX_RESOLUTION_ERR)}J=O.type||this.type||"image/jpeg";L=O.quality||90;H=k.typeOf(O.crop)!=="undefined"?O.crop:false;if(O.width){E=O.width;M=O.height||E}else{var C=n.getSize(F);if(C.w&&C.h){E=C.w;M=C.h}}K=new i();K.bind("Resize",function(){D.call(N)});K.bind("Load",function(){K.downsize(E,M,H,false)});K.clone(this,false);return K}catch(I){this.trigger("error",I)}},destroy:function(){if(this.ruid){this.getRuntime().exec.call(this,"Image","destroy");this.disconnectRuntime()}this.unbindAll()}});function y(C){if(!C){C=this.getRuntime().exec.call(this,"Image","getInfo")}this.size=C.size;this.width=C.width;this.height=C.height;this.type=C.type;this.meta=C.meta;if(this.name===""){this.name=C.name}}function z(E){var D=k.typeOf(E);try{if(E instanceof i){if(!E.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}x.apply(this,arguments)}else{if(E instanceof l){if(!~k.inArray(E.type,["image/jpeg","image/png"])){throw new t.ImageError(t.ImageError.WRONG_FORMAT)}A.apply(this,arguments)}else{if(k.inArray(D,["blob","file"])!==-1){z.call(this,new p(null,E),arguments[1])}else{if(D==="string"){if(/^data:[^;]*;base64,/.test(E)){z.call(this,new l(null,{data:E}),arguments[1])}else{B.apply(this,arguments)}}else{if(D==="node"&&E.nodeName.toLowerCase()==="img"){z.call(this,E.src,arguments[1])}else{throw new t.DOMException(t.DOMException.TYPE_MISMATCH_ERR)}}}}}}catch(C){this.trigger("error",C)}}function x(C,D){var E=this.connectRuntime(C.ruid);this.ruid=E.uid;E.exec.call(this,"Image","loadFromImage",C,(k.typeOf(D)==="undefined"?true:D))}function A(E,F){var D=this;D.name=E.name||"";function C(G){D.ruid=G.uid;G.exec.call(D,"Image","loadFromBlob",E)}if(E.isDetached()){this.bind("RuntimeInit",function(H,G){C(G)});if(F&&typeof(F.required_caps)==="string"){F.required_caps=j.parseCaps(F.required_caps)}this.connectRuntime(k.extend({required_caps:{access_image_binary:true,resize_image:true}},F))}else{C(this.connectRuntime(E.ruid))}}function B(E,D){var C=this,F;F=new u();F.open("get",E);F.responseType="blob";F.onprogress=function(G){C.trigger(G)};F.onload=function(){A.call(C,F.response,true)};F.onerror=function(G){C.trigger(G)};F.onloadend=function(){F.destroy()};F.bind("RuntimeError",function(H,G){C.trigger("RuntimeError",G)});F.send(null,D)}}i.MAX_RESIZE_WIDTH=6500;i.MAX_RESIZE_HEIGHT=6500;i.prototype=w.instance;return i});h("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(n,i,k,j){var m="html5",l={};function o(q){var p=this,t=k.capTest,s=k.capTrue;var r=n.extend({access_binary:t(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return p.can("access_binary")&&!!l.Image},display_media:t(j.can("create_canvas")||j.can("use_data_uri_over32kb")),do_cors:t(window.XMLHttpRequest&&"withCredentials" in new XMLHttpRequest()),drag_and_drop:t(function(){var u=document.createElement("div");return(("draggable" in u)||("ondragstart" in u&&"ondrop" in u))&&(j.browser!=="IE"||j.version>9)}()),filter_by_extension:t(function(){return(j.browser==="Chrome"&&j.version>=28)||(j.browser==="IE"&&j.version>=10)}()),return_response_headers:s,return_response_type:function(u){if(u==="json"&&!!window.JSON){return true}return j.can("return_response_type",u)},return_status_code:s,report_upload_progress:t(window.XMLHttpRequest&&new XMLHttpRequest().upload),resize_image:function(){return p.can("access_binary")&&j.can("create_canvas")},select_file:function(){return j.can("use_fileinput")&&window.File},select_folder:function(){return p.can("select_file")&&j.browser==="Chrome"&&j.version>=21},select_multiple:function(){return p.can("select_file")&&!(j.browser==="Safari"&&j.os==="Windows")&&!(j.os==="iOS"&&j.verComp(j.osVersion,"7.0.4","<"))},send_binary_string:t(window.XMLHttpRequest&&(new XMLHttpRequest().sendAsBinary||(window.Uint8Array&&window.ArrayBuffer))),send_custom_headers:t(window.XMLHttpRequest),send_multipart:function(){return !!(window.XMLHttpRequest&&new XMLHttpRequest().upload&&window.FormData)||p.can("send_binary_string")},slice_blob:t(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return p.can("slice_blob")&&p.can("send_multipart")},summon_file_dialog:t(function(){return(j.browser==="Firefox"&&j.version>=4)||(j.browser==="Opera"&&j.version>=12)||(j.browser==="IE"&&j.version>=10)||!!~n.inArray(j.browser,["Chrome","Safari"])}()),upload_filesize:s},arguments[2]);k.call(this,q,(arguments[1]||m),r);n.extend(this,{init:function(){this.trigger("Init")},destroy:(function(u){return function(){u.call(p);u=p=null}}(this.destroy))});n.extend(this.getShim(),l)}k.addConstructor(m,o);return l});h("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(j,k){function i(){function l(n,q,m){var o;if(window.File.prototype.slice){try{n.slice();return n.slice(q,m)}catch(p){return n.slice(q,m-q)}}else{if((o=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)){return o.call(n,q,m)}else{return null}}}this.slice=function(){return new k(this.getRuntime().uid,l.apply(this,arguments))}}return(j.Blob=i)});h("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(o){var p={},l="moxie_"+o.guid();function k(){this.returnValue=false}function j(){this.cancelBubble=true}var m=function(u,q,v,s){var t,r;q=q.toLowerCase();if(u.addEventListener){t=v;u.addEventListener(q,t,false)}else{if(u.attachEvent){t=function(){var w=window.event;if(!w.target){w.target=w.srcElement}w.preventDefault=k;w.stopPropagation=j;v(w)};u.attachEvent("on"+q,t)}}if(!u[l]){u[l]=o.guid()}if(!p.hasOwnProperty(u[l])){p[u[l]]={}}r=p[u[l]];if(!r.hasOwnProperty(q)){r[q]=[]}r[q].push({func:t,orig:v,key:s})};var n=function(v,q,w){var t,s;q=q.toLowerCase();if(v[l]&&p[v[l]]&&p[v[l]][q]){t=p[v[l]][q]}else{return}for(var r=t.length-1;r>=0;r--){if(t[r].orig===w||t[r].key===w){if(v.removeEventListener){v.removeEventListener(q,t[r].func,false)}else{if(v.detachEvent){v.detachEvent("on"+q,t[r].func)}}t[r].orig=null;t[r].func=null;t.splice(r,1);if(w!==s){break}}}if(!t.length){delete p[v[l]][q]}if(o.isEmptyObj(p[v[l]])){delete p[v[l]];try{delete v[l]}catch(u){v[l]=s}}};var i=function(r,q){if(!r||!r[l]){return}o.each(p[r[l]],function(t,s){n(r,s,q)})};return{addEvent:m,removeEvent:n,removeAllEvents:i}});h("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(m,o,l,j,k,i){function n(){var q=[],p;o.extend(this,{init:function(A){var r=this,y=r.getRuntime(),x,t,u,z,w,v;p=A;q=[];u=p.accept.mimes||k.extList2mimes(p.accept,y.can("filter_by_extension"));t=y.getShimContainer();t.innerHTML='";x=l.get(y.uid);o.extend(x.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});z=l.get(p.browse_button);if(y.can("summon_file_dialog")){if(l.getStyle(z,"position")==="static"){z.style.position="relative"}w=parseInt(l.getStyle(z,"z-index"),10)||1;z.style.zIndex=w;t.style.zIndex=w-1;j.addEvent(z,"click",function(C){var B=l.get(y.uid);if(B&&!B.disabled){B.click()}C.preventDefault()},r.uid)}v=y.can("summon_file_dialog")?z:t;j.addEvent(v,"mouseover",function(){r.trigger("mouseenter")},r.uid);j.addEvent(v,"mouseout",function(){r.trigger("mouseleave")},r.uid);j.addEvent(v,"mousedown",function(){r.trigger("mousedown")},r.uid);j.addEvent(l.get(p.container),"mouseup",function(){r.trigger("mouseup")},r.uid);x.onchange=function s(){q=[];if(p.directory){o.each(this.files,function(C){if(C.name!=="."){q.push(C)}})}else{q=[].slice.call(this.files)}if(i.browser!=="IE"){this.value=""}else{var B=this.cloneNode(true);this.parentNode.replaceChild(B,this);B.onchange=s}r.trigger("change")};r.trigger({type:"ready",async:true});t=null},getFiles:function(){return q},disable:function(t){var s=this.getRuntime(),r;if((r=l.get(s.uid))){r.disabled=!!t}},destroy:function(){var s=this.getRuntime(),t=s.getShim(),r=s.getShimContainer();j.removeAllEvents(r,this.uid);j.removeAllEvents(p&&l.get(p.container),this.uid);j.removeAllEvents(p&&l.get(p.browse_button),this.uid);if(r){r.innerHTML=""}t.removeInstance(this.uid);q=p=r=t=null}})}return(m.FileInput=n)});h("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(l,m,k,i,j){function n(){var p=[],r=[],v;m.extend(this,{init:function(y){var x=this,z;v=y;r=q(v.accept);z=v.container;i.addEvent(z,"dragover",function(A){A.preventDefault();A.stopPropagation();A.dataTransfer.dropEffect="copy"},x.uid);i.addEvent(z,"drop",function(A){A.preventDefault();A.stopPropagation();p=[];if(A.dataTransfer.items&&A.dataTransfer.items[0].webkitGetAsEntry){u(A.dataTransfer.items,function(){x.trigger("drop")})}else{m.each(A.dataTransfer.files,function(B){if(t(B)){p.push(B)}});x.trigger("drop")}},x.uid);i.addEvent(z,"dragenter",function(A){A.preventDefault();A.stopPropagation();x.trigger("dragenter")},x.uid);i.addEvent(z,"dragleave",function(A){A.preventDefault();A.stopPropagation();x.trigger("dragleave")},x.uid)},getFiles:function(){return p},destroy:function(){i.removeAllEvents(v&&k.get(v.container),this.uid);p=r=v=null}});function q(z){var y=[];for(var x=0;x=4&&m.version<7),z=m.browser==="Android Browser",E=false;w=G.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase();y=x();y.open(G.method,G.url,G.async,G.user,G.password);if(D instanceof k){if(D.isDetached()){E=true}D=D.getSource()}else{if(D instanceof r){if(D.hasBlob()){if(D.getBlob().isDetached()){D=v.call(F,D);E=true}else{if((C||z)&&j.typeOf(D.getBlob().getSource())==="blob"&&window.FileReader){s.call(F,G,D);return}}}if(D instanceof r){var B=new window.FormData();D.each(function(I,H){if(I instanceof k){B.append(H,I.getSource())}else{B.append(H,I)}});D=B}}}if(y.upload){if(G.withCredentials){y.withCredentials=true}y.addEventListener("load",function(H){F.trigger(H)});y.addEventListener("error",function(H){F.trigger(H)});y.addEventListener("progress",function(H){F.trigger(H)});y.upload.addEventListener("progress",function(H){F.trigger({type:"UploadProgress",loaded:H.loaded,total:H.total})})}else{y.onreadystatechange=function A(){switch(y.readyState){case 1:break;case 2:break;case 3:var J,H;try{if(i.hasSameOrigin(G.url)){J=y.getResponseHeader("Content-Length")||0}if(y.responseText){H=y.responseText.length}}catch(I){J=H=0}F.trigger({type:"progress",lengthComputable:!!J,total:parseInt(J,10),loaded:H});break;case 4:y.onreadystatechange=function(){};if(y.status===0){F.trigger("error")}else{F.trigger("load")}break}}}if(!j.isEmptyObj(G.headers)){j.each(G.headers,function(H,I){y.setRequestHeader(I,H)})}if(""!==G.responseType&&"responseType" in y){if("json"===G.responseType&&!m.can("return_response_type","json")){y.responseType="text"}else{y.responseType=G.responseType}}if(!E){y.send(D)}else{if(y.sendAsBinary){y.sendAsBinary(D)}else{(function(){var H=new Uint8Array(D.length);for(var I=0;I>Math.abs(n+q*8))&255)}i(s,o,r)}return{II:function(n){if(n===g){return l}else{l=n}},init:function(n){l=false;j=n},SEGMENT:function(n,p,o){switch(arguments.length){case 1:return j.substr(n,j.length-n-1);case 2:return j.substr(n,p);case 3:i(o,n,p);break;default:return j}},BYTE:function(n){return m(n,1)},SHORT:function(n){return m(n,2)},LONG:function(n,o){if(o===g){return m(n,4)}else{k(n,o,4)}},SLONG:function(n){var o=m(n,4);return(o>2147483647?o-4294967296:o)},STRING:function(n,o){var p="";for(o+=n;n=65488&&l<=65495){k+=2;continue}if(l===65498||l===65497){break}m=n.SHORT(k+2)+2;if(l>=65505&&l<=65519){p.push({hex:l,name:"APP"+(l&15),start:k,length:m,segment:n.SEGMENT(k,m)})}k+=m}n.init(null);return{headers:p,restore:function(s){var q,r;n.init(s);k=n.SHORT(2)==65504?4+n.SHORT(4):2;for(r=0,q=p.length;r=v.length){break}}},purge:function(){p=[];n.init(null);n=null}}}});h("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(k,j){return function i(){var p,m,l,n={},s;p=new j();m={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}};s={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};function o(t,B){var v=p.SHORT(t),y,E,F,A,z,u,w,C,D=[],x={};for(y=0;y4){w=p.LONG(w)+n.tiffHeader}for(E=0;E4){w=p.LONG(w)+n.tiffHeader}x[F]=p.STRING(w,z-1);continue;case 3:if(z>2){w=p.LONG(w)+n.tiffHeader}for(E=0;E1){w=p.LONG(w)+n.tiffHeader}for(E=0;E=65472&&y<=65475){x+=5;return{height:r.SHORT(x),width:r.SHORT(x+=2)}}z=r.SHORT(x+=2);x+=z-2}return null}p=w;r=new m();r.init(p);if(r.SHORT(0)!==65496){throw new i.ImageError(i.ImageError.WRONG_FORMAT)}t=new k(w);s=new j();o=!!s.init(t.get("app1")[0]);v=u.call(this);n.extend(this,{type:"image/jpeg",size:p.length,width:v&&v.width||0,height:v&&v.height||0,setExif:function(x,y){if(!o){return false}if(n.typeOf(x)==="object"){n.each(x,function(A,z){s.setExif(z,A)})}else{s.setExif(x,y)}t.set("app1",s.getBinary())},writeHeaders:function(){if(!arguments.length){return(p=t.restore(p))}return t.restore(arguments[0])},stripHeaders:function(x){return t.strip(x)},purge:function(){q.call(this)}});if(o){this.meta={tiff:s.TIFF(),exif:s.EXIF(),gps:s.GPS()}}function q(){if(!s||!t||!r){return}s.purge();t.purge();r.init(null);p=v=t=s=r=null}}return l});h("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(i,l,k){function j(u){var n,p,r,q,t;n=u;p=new k();p.init(n);(function(){var v=0,x=0,w=[35152,20039,3338,6666];for(x=0;xv?v-w:G;var A=0;while(Ap?p-A:G;o.clearRect(0,0,G,G);o.drawImage(I,-A,-w);var t=(A*C/p+r)<<0;var u=Math.ceil(B*C/p);var s=(w*z/v/E+q)<<0;var F=Math.ceil(H*z/v/E);D.drawImage(l,0,0,B,H,t,s,u,F);A+=G}w+=G}l=o=null}function j(n){var m=n.naturalWidth,p=n.naturalHeight;if(m*p>1024*1024){var o=document.createElement("canvas");o.width=o.height=1;var l=o.getContext("2d");l.drawImage(n,-m+1,0);return l.getImageData(0,0,1,1).data[3]===0}else{return false}}function k(p,m,u){var l=document.createElement("canvas");l.width=1;l.height=u;var v=l.getContext("2d");v.drawImage(p,0,0);var o=v.getImageData(0,0,1,u).data;var s=0;var q=u;var t=u;while(t>s){var n=o[(t-1)*4+3];if(n===0){q=t}else{s=t}t=(q+s)>>1}l=null;var r=(t/u);return(r===0)?1:r}return{isSubsampled:j,renderTo:i}});h("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/MegaPixel","moxie/core/utils/Mime","moxie/core/utils/Env"],function(o,i,p,k,m,r,q,j,l){function n(){var C=this,B,G,A,w,E,I=false,t=true;i.extend(this,{loadFromBlob:function(L){var K=this,M=K.getRuntime(),J=arguments.length>1?arguments[1]:true;if(!M.can("access_binary")){throw new p.RuntimeError(p.RuntimeError.NOT_SUPPORTED_ERR)}E=L;if(L.isDetached()){w=L.getSource();z.call(this,w);return}else{F.call(this,L.getSource(),function(N){if(J){w=H(N)}z.call(K,N)})}},loadFromImage:function(J,K){this.meta=J.meta;E=new m(null,{name:J.name,size:J.size,type:J.type});z.call(this,K?(w=J.getAsBinaryString()):J.getAsDataURL())},getInfo:function(){var J=this.getRuntime(),K;if(!G&&w&&J.can("access_image_binary")){G=new r(w)}K={width:x().width||0,height:x().height||0,type:E.type||j.getFileMime(E.name),size:w&&w.length||E.size||0,name:E.name||"",meta:G&&G.meta||this.meta||{}};return K},downsize:function(){s.apply(this,arguments)},getAsCanvas:function(){if(A){A.id=this.uid+"_canvas"}return A},getAsBlob:function(J,K){if(J!==this.type){s.call(this,this.width,this.height,false)}return new m(null,{name:E.name||"",type:J,data:C.getAsBinaryString.call(this,J,K)})},getAsDataURL:function(K){var L=arguments[1]||90;if(!I){return B.src}if("image/jpeg"!==K){return A.toDataURL("image/png")}else{try{return A.toDataURL("image/jpeg",L/100)}catch(J){return A.toDataURL("image/jpeg")}}},getAsBinaryString:function(K,M){if(!I){if(!w){w=H(C.getAsDataURL(K,M))}return w}if("image/jpeg"!==K){w=H(C.getAsDataURL(K,M))}else{var L;if(!M){M=90}try{L=A.toDataURL("image/jpeg",M/100)}catch(J){L=A.toDataURL("image/jpeg")}w=H(L);if(G){w=G.stripHeaders(w);if(t){if(G.meta&&G.meta.exif){G.setExif({PixelXDimension:this.width,PixelYDimension:this.height})}w=G.writeHeaders(w)}G.purge();G=null}}I=false;return w},destroy:function(){C=null;u.call(this);this.getRuntime().getShim().removeInstance(this.uid)}});function x(){if(!A&&!B){throw new p.ImageError(p.DOMException.INVALID_STATE_ERR)}return A||B}function H(J){return k.atob(J.substring(J.indexOf("base64,")+7))}function D(K,J){return"data:"+(J||"")+";base64,"+k.btoa(K)}function z(K){var J=this;B=new Image();B.onerror=function(){u.call(this);J.trigger("error",new p.ImageError(p.ImageError.WRONG_FORMAT))};B.onload=function(){J.trigger("load")};B.src=/^data:[^;]*;base64,/.test(K)?K:D(K,E.type)}function F(L,M){var K=this,J;if(window.FileReader){J=new FileReader();J.onload=function(){M(this.result)};J.onerror=function(){K.trigger("error",new p.FileException(p.FileException.NOT_READABLE_ERR))};J.readAsDataURL(L)}else{return M(L.getAsDataURL())}}function s(K,V,Q,S){var W=this,N,M,T=0,R=0,P,U,L,J;t=S;J=(this.meta&&this.meta.tiff&&this.meta.tiff.Orientation)||1;if(i.inArray(J,[5,6,7,8])!==-1){var O=K;K=V;V=O}P=x();M=!Q?Math.min:Math.max;N=M(K/P.width,V/P.height);if(N>1&&(!Q||S)){this.trigger("Resize");return}if(!A){A=document.createElement("canvas")}U=Math.round(P.width*N);L=Math.round(P.height*N);if(Q){A.width=K;A.height=V;if(U>K){T=Math.round((U-K)/2)}if(L>V){R=Math.round((L-V)/2)}}else{A.width=U;A.height=L}if(!t){y(A.width,A.height,J)}v.call(this,P,A,-T,-R,U,L);this.width=A.width;this.height=A.height;I=true;W.trigger("Resize")}function v(M,N,J,P,L,O){if(l.OS==="iOS"){q.renderTo(M,N,{width:L,height:O,x:J,y:P})}else{var K=N.getContext("2d");K.drawImage(M,J,P,L,O)}}function y(M,J,L){switch(L){case 5:case 6:case 7:case 8:A.width=J;A.height=M;break;default:A.width=M;A.height=J}var K=A.getContext("2d");switch(L){case 2:K.translate(M,0);K.scale(-1,1);break;case 3:K.translate(M,J);K.rotate(Math.PI);break;case 4:K.translate(0,J);K.scale(1,-1);break;case 5:K.rotate(0.5*Math.PI);K.scale(1,-1);break;case 6:K.rotate(0.5*Math.PI);K.translate(0,-J);break;case 7:K.rotate(0.5*Math.PI);K.translate(M,-J);K.scale(-1,1);break;case 8:K.rotate(-0.5*Math.PI);K.translate(-M,0);break}}function u(){if(G){G.purge();G=null}w=B=A=E=null;I=false}}return(o.Image=n)});h("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(j,m,k,p,i){var n="flash",o={};function l(){var r;try{r=navigator.plugins["Shockwave Flash"];r=r.description}catch(t){try{r=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(s){r="0.0"}}r=r.match(/\d+/g);return parseFloat(r[0]+"."+r[1])}function q(s){var r=this,t;s=j.extend({swf_url:m.swf_url},s);i.call(this,s,n,{access_binary:function(u){return u&&r.mode==="browser"},access_image_binary:function(u){return u&&r.mode==="browser"},display_media:i.capTrue,do_cors:i.capTrue,drag_and_drop:false,report_upload_progress:function(){return r.mode==="client"},resize_image:i.capTrue,return_response_headers:false,return_response_type:function(u){if(u==="json"&&!!window.JSON){return true}return !j.arrayDiff(u,["","text","document"])||r.mode==="browser"},return_status_code:function(u){return r.mode==="browser"||!j.arrayDiff(u,[200,404])},select_file:i.capTrue,select_multiple:i.capTrue,send_binary_string:function(u){return u&&r.mode==="browser"},send_browser_cookies:function(u){return u&&r.mode==="browser"},send_custom_headers:function(u){return u&&r.mode==="browser"},send_multipart:i.capTrue,slice_blob:i.capTrue,stream_upload:function(u){return u&&r.mode==="browser"},summon_file_dialog:false,upload_filesize:function(u){return j.parseSizeStr(u)<=2097152||r.mode==="client"},use_http_method:function(u){return !j.arrayDiff(u,["GET","POST"])}},{access_binary:function(u){return u?"browser":"client"},access_image_binary:function(u){return u?"browser":"client"},report_upload_progress:function(u){return u?"browser":"client"},return_response_type:function(u){return j.arrayDiff(u,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(u){return j.arrayDiff(u,[200,404])?"browser":["client","browser"]},send_binary_string:function(u){return u?"browser":"client"},send_browser_cookies:function(u){return u?"browser":"client"},send_custom_headers:function(u){return u?"browser":"client"},stream_upload:function(u){return u?"client":"browser"},upload_filesize:function(u){return j.parseSizeStr(u)>=2097152?"client":"browser"}},"client");if(l()<10){this.mode=false}j.extend(this,{getShim:function(){return k.get(this.uid)},shimExec:function(v,w){var u=[].slice.call(arguments,2);return r.getShim().exec(this.uid,v,w,u)},init:function(){var v,w,u;u=this.getShimContainer();j.extend(u.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"});v='';if(m.browser==="IE"){w=document.createElement("div");u.appendChild(w);w.outerHTML=v;w=u=null}else{u.innerHTML=v}t=setTimeout(function(){if(r&&!r.initialized){r.trigger("Error",new p.RuntimeError(p.RuntimeError.NOT_INIT_ERR))}},5000)},destroy:(function(u){return function(){u.call(r);clearTimeout(t);s=t=u=r=null}}(this.destroy))},o)}i.addConstructor(n,q);return o});h("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(j,k){var i={slice:function(n,p,l,o){var m=this.getRuntime();if(p<0){p=Math.max(n.size+p,0)}else{if(p>0){p=Math.min(p,n.size)}}if(l<0){l=Math.max(n.size+l,0)}else{if(l>0){l=Math.min(l,n.size)}}n=m.shimExec.call(this,"Blob","slice",p,l,o||"");if(n){n=new k(m.uid,n)}return n}};return(j.Blob=i)});h("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime"],function(i){var j={init:function(k){this.getRuntime().shimExec.call(this,"FileInput","init",{name:k.name,accept:k.accept,multiple:k.multiple});this.trigger("ready")}};return(i.FileInput=j)});h("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(l,i){var j="";function k(n,o){switch(o){case"readAsText":return i.atob(n,"utf8");case"readAsBinaryString":return i.atob(n);case"readAsDataURL":return n}return null}var m={read:function(q,o){var p=this,n=p.getRuntime();if(q==="readAsDataURL"){j="data:"+(o.type||"")+";base64,"}p.bind("Progress",function(s,r){if(r){j+=k(r,q)}});return n.shimExec.call(this,"FileReader","readAsBase64",o.uid)},getResult:function(){return j},destroy:function(){j=null}};return(l.FileReader=m)});h("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(k,i){function j(m,n){switch(n){case"readAsText":return i.atob(m,"utf8");case"readAsBinaryString":return i.atob(m);case"readAsDataURL":return m}return null}var l={read:function(p,o){var m,n=this.getRuntime();m=n.shimExec.call(this,"FileReaderSync","readAsBase64",o.uid);if(!m){return null}if(p==="readAsDataURL"){m="data:"+(o.type||"")+";base64,"+m}return j(m,p,o.type)}};return(k.FileReaderSync=l)});h("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter"],function(j,m,p,i,o,n,l){var k={send:function(x,s){var u=this,y=u.getRuntime();function r(){x.transport=y.mode;y.shimExec.call(u,"XMLHttpRequest","send",x,s)}function t(A,z){y.shimExec.call(u,"XMLHttpRequest","appendBlob",A,z.uid);s=null;r()}function v(A,z){var B=new l();B.bind("TransportingComplete",function(){z(this.result)});B.transport(A.getSource(),A.type,{ruid:y.uid})}if(!m.isEmptyObj(x.headers)){m.each(x.headers,function(z,A){y.shimExec.call(u,"XMLHttpRequest","setRequestHeader",A,z.toString())})}if(s instanceof n){var w;s.each(function(A,z){if(A instanceof p){w=z}else{y.shimExec.call(u,"XMLHttpRequest","append",z,A)}});if(!s.hasBlob()){s=null;r()}else{var q=s.getBlob();if(q.isDetached()){v(q,function(z){q.destroy();t(w,z)})}else{t(w,q)}}}else{if(s instanceof p){if(s.isDetached()){v(s,function(z){s.destroy();s=z.uid;r()})}else{s=s.uid;r()}}else{r()}}},getResponse:function(t){var q,s,r=this.getRuntime();s=r.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob");if(s){s=new i(r.uid,s);if("blob"===t){return s}try{q=new o();if(!!~m.inArray(t,["","text"])){return q.readAsText(s)}else{if("json"===t&&!!window.JSON){return JSON.parse(q.readAsText(s))}}}finally{s.destroy()}}return null},abort:function(r){var q=this.getRuntime();q.shimExec.call(this,"XMLHttpRequest","abort");this.dispatchEvent("readystatechange");this.dispatchEvent("abort")}};return(j.XMLHttpRequest=k)});h("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(i,k){var j={getAsBlob:function(n){var m=this.getRuntime(),l=m.shimExec.call(this,"Transporter","getAsBlob",n);if(l){return new k(m.uid,l)}return null}};return(i.Transporter=j)});h("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(j,l,k,n,m){var i={loadFromBlob:function(r){var q=this,p=q.getRuntime();function o(t){p.shimExec.call(q,"Image","loadFromBlob",t.uid);q=p=null}if(r.isDetached()){var s=new k();s.bind("TransportingComplete",function(){o(s.result.getSource())});s.transport(r.getSource(),r.type,{ruid:p.uid})}else{o(r.getSource())}},loadFromImage:function(p){var o=this.getRuntime();return o.shimExec.call(this,"Image","loadFromImage",p.uid)},getAsBlob:function(q,r){var p=this.getRuntime(),o=p.shimExec.call(this,"Image","getAsBlob",q,r);if(o){return new n(p.uid,o)}return null},getAsDataURL:function(){var q=this.getRuntime(),p=q.Image.getAsBlob.apply(this,arguments),o;if(!p){return null}o=new m();return o.readAsDataURL(p)}};return(j.Image=i)});h("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(j,m,l,p,i){var n="silverlight",o={};function q(z){var C=false,v=null,r,s,t,B,u,x=0;try{try{v=new ActiveXObject("AgControl.AgControl");if(v.IsVersionSupported(z)){C=true}v=null}catch(y){var w=navigator.plugins["Silverlight Plug-In"];if(w){r=w.description;if(r==="1.0.30226.2"){r="2.0.30226.2"}s=r.split(".");while(s.length>3){s.pop()}while(s.length<4){s.push(0)}t=z.split(".");while(t.length>4){t.pop()}do{B=parseInt(t[x],10);u=parseInt(s[x],10);x++}while(x';t=setTimeout(function(){if(r&&!r.initialized){r.trigger("Error",new p.RuntimeError(p.RuntimeError.NOT_INIT_ERR))}},m.OS!=="Windows"?10000:5000)},destroy:(function(u){return function(){u.call(r);clearTimeout(t);s=t=u=r=null}}(this.destroy))},o)}i.addConstructor(n,k);return o});h("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(i,j,k){return(i.Blob=j.extend({},k))});h("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime"],function(i){var j={init:function(l){function k(n){var o="";for(var m=0;m=28)||(k.browser==="IE"&&k.version>=10)}()),resize_image:function(){return m.Image&&p.can("access_binary")&&k.can("create_canvas")},report_upload_progress:false,return_response_headers:false,return_response_type:function(t){if(t==="json"&&!!window.JSON){return true}return !!~o.inArray(t,["text","document",""])},return_status_code:function(t){return !o.arrayDiff(t,[200,404])},select_file:function(){return k.can("use_fileinput")},select_multiple:false,send_binary_string:false,send_custom_headers:false,send_multipart:true,slice_blob:false,stream_upload:function(){return p.can("select_file")},summon_file_dialog:s(function(){return(k.browser==="Firefox"&&k.version>=4)||(k.browser==="Opera"&&k.version>=12)||!!~o.inArray(k.browser,["Chrome","Safari"])}()),upload_filesize:r,use_http_method:function(t){return !o.arrayDiff(t,["GET","POST"])}});o.extend(this,{init:function(){this.trigger("Init")},destroy:(function(t){return function(){t.call(p);t=p=null}}(this.destroy))});o.extend(this.getShim(),m)}l.addConstructor(n,j);return m});h("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(m,o,l,j,k,i){function n(){var s,q=[],t=[],p;function r(){var w=this,z=w.getRuntime(),y,x,u,B,v,A;A=o.guid("uid_");y=z.getShimContainer();if(s){u=l.get(s+"_form");if(u){o.extend(u.style,{top:"100%"})}}B=document.createElement("form");B.setAttribute("id",A+"_form");B.setAttribute("method","post");B.setAttribute("enctype","multipart/form-data");B.setAttribute("encoding","multipart/form-data");o.extend(B.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"});v=document.createElement("input");v.setAttribute("id",A);v.setAttribute("type","file");v.setAttribute("name",p.name||"Filedata");v.setAttribute("accept",t.join(","));o.extend(v.style,{fontSize:"999px",opacity:0});B.appendChild(v);y.appendChild(B);o.extend(v.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});if(i.browser==="IE"&&i.version<10){o.extend(v.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"})}v.onchange=function(){var D;if(!this.value){return}if(this.files){D=this.files[0]}else{D={name:this.value}}q=[D];this.onchange=function(){};r.call(w);w.bind("change",function C(){var E=l.get(A),G=l.get(A+"_form"),F;w.unbind("change",C);if(w.files.length&&E&&G){F=w.files[0];E.setAttribute("id",F.uid);G.setAttribute("id",F.uid+"_form");G.setAttribute("target",F.uid+"_iframe")}E=G=null},998);v=B=null;w.trigger("change")};if(z.can("summon_file_dialog")){x=l.get(p.browse_button);j.removeEvent(x,"click",w.uid);j.addEvent(x,"click",function(C){if(v&&!v.disabled){v.click()}C.preventDefault()},w.uid)}s=A;y=u=x=null}o.extend(this,{init:function(x){var u=this,w=u.getRuntime(),v;p=x;t=x.accept.mimes||k.extList2mimes(x.accept,w.can("filter_by_extension"));v=w.getShimContainer();(function(){var y,A,z;y=l.get(x.browse_button);if(w.can("summon_file_dialog")){if(l.getStyle(y,"position")==="static"){y.style.position="relative"}A=parseInt(l.getStyle(y,"z-index"),10)||1;y.style.zIndex=A;v.style.zIndex=A-1}z=w.can("summon_file_dialog")?y:v;j.addEvent(z,"mouseover",function(){u.trigger("mouseenter")},u.uid);j.addEvent(z,"mouseout",function(){u.trigger("mouseleave")},u.uid);j.addEvent(z,"mousedown",function(){u.trigger("mousedown")},u.uid);j.addEvent(l.get(x.container),"mouseup",function(){u.trigger("mouseup")},u.uid);y=null}());r.call(this);v=null;u.trigger({type:"ready",async:true})},getFiles:function(){return q},disable:function(v){var u;if((u=l.get(s))){u.disabled=!!v}},destroy:function(){var v=this.getRuntime(),w=v.getShim(),u=v.getShimContainer();j.removeAllEvents(u,this.uid);j.removeAllEvents(p&&l.get(p.container),this.uid);j.removeAllEvents(p&&l.get(p.browse_button),this.uid);if(u){u.innerHTML=""}w.removeInstance(this.uid);s=q=t=p=u=w=null}})}return(m.FileInput=n)});h("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(i,j){return(i.FileReader=j)});h("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(m,j,l,i,n,p,k,q){function o(){var t,r,u;function s(v){var A=this,y,z,w,x,B=false;if(!u){return}y=u.id.replace(/_iframe$/,"");z=l.get(y+"_form");if(z){w=z.getElementsByTagName("input");x=w.length;while(x--){switch(w[x].getAttribute("type")){case"hidden":w[x].parentNode.removeChild(w[x]);break;case"file":B=true;break}}w=[];if(!B){z.parentNode.removeChild(z)}z=null}setTimeout(function(){p.removeEvent(u,"load",A.uid);if(u.parentNode){u.parentNode.removeChild(u)}var C=A.getRuntime().getShimContainer();if(!C.children.length){C.parentNode.removeChild(C)}C=u=null;v()},1)}j.extend(this,{send:function(D,x){var z=this,C=z.getRuntime(),y,w,B,v;t=r=null;function A(){var E=C.getShimContainer()||document.body,F=document.createElement("div");F.innerHTML='';u=F.firstChild;E.appendChild(u);p.addEvent(u,"load",function(){var H;try{H=u.contentWindow.document||u.contentDocument||window.frames[u.id].document;if(/^4(0[0-9]|1[0-7]|2[2346])\s/.test(H.title)){t=H.title.replace(/^(\d+).*$/,"$1")}else{t=200;r=j.trim(H.body.innerHTML);z.trigger({type:"progress",loaded:r.length,total:r.length});if(v){z.trigger({type:"uploadprogress",loaded:v.size||1025,total:v.size||1025})}}}catch(G){if(i.hasSameOrigin(D.url)){t=404}else{s.call(z,function(){z.trigger("error")});return}}s.call(z,function(){z.trigger("load")})},z.uid)}if(x instanceof q&&x.hasBlob()){v=x.getBlob();y=v.uid;B=l.get(y);w=l.get(y+"_form");if(!w){throw new n.DOMException(n.DOMException.NOT_FOUND_ERR)}}else{y=j.guid("uid_");w=document.createElement("form");w.setAttribute("id",y+"_form");w.setAttribute("method",D.method);w.setAttribute("enctype","multipart/form-data");w.setAttribute("encoding","multipart/form-data");w.setAttribute("target",y+"_iframe");C.getShimContainer().appendChild(w)}if(x instanceof q){x.each(function(G,E){if(G instanceof k){if(B){B.setAttribute("name",E)}}else{var F=document.createElement("input");j.extend(F,{type:"hidden",name:E,value:G});if(B){w.insertBefore(F,B)}else{w.appendChild(F)}}})}w.setAttribute("action",D.url);A();w.submit();z.trigger("loadstart")},getStatus:function(){return t},getResponse:function(v){if("json"===v){if(j.typeOf(r)==="string"&&!!window.JSON){try{return JSON.parse(r.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(w){return null}}}else{if("document"===v){}}return r},abort:function(){var v=this;if(u&&u.contentWindow){if(u.contentWindow.stop){u.contentWindow.stop()}else{if(u.contentWindow.document.execCommand){u.contentWindow.document.execCommand("Stop")}else{u.src="about:blank"}}}s.call(this,function(){v.dispatchEvent("abort")})}})}return(m.XMLHttpRequest=o)});h("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(j,i){return(j.Image=i)});a(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"])})(this);(function(){var c={},b=moxie.core.utils.Basic.inArray;(function a(e){var d,f;for(d in e){f=typeof(e[d]);if(f==="object"&&!~b(d,["Exceptions","Env","Mime"])){a(e[d])}else{if(f==="function"){c[d]=e[d]}}}})(window.moxie);c.Env=window.moxie.core.utils.Env;c.Mime=window.moxie.core.utils.Mime;c.Exceptions=window.moxie.core.Exceptions;window.mOxie=c;if(!window.o){window.o=c}return c})(); \ No newline at end of file +var MXI_DEBUG=true;(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k0){q(y,function(B,A){if(B!==w){if(s(x[A])===s(B)&&!!~v(s(B),["array","object"])){n(x[A],B)}else{x[A]=B}}})}});return x};var q=function(A,B){var z,x,w,y;if(A){if(s(A.length)==="number"){for(w=0,z=A.length;w0){if(J.length==2){if(typeof(J[1])==C){T[J[0]]=J[1].call(this,P)}else{T[J[0]]=J[1]}}else{if(J.length==3){if(typeof(J[1])===C&&!(J[1].exec&&J[1].test)){T[J[0]]=P?J[1].call(this,P,J[2]):s}else{T[J[0]]=P?P.replace(J[1],J[2]):s}}else{if(J.length==4){T[J[0]]=P?J[3].call(this,P.replace(J[1],J[2])):s}}}}else{T[J]=P?P:s}}break}}if(!!O){break}}return T},str:function(M,L){for(var K in L){if(typeof(L[K])===q&&L[K].length>0){for(var J=0;Ju[t]){o=1;break}}}if(!p){return o}switch(p){case">":case"gt":return(o>0);case">=":case"ge":return(o>=0);case"<=":case"le":return(o<=0);case"==":case"=":case"eq":return(o===0);case"<>":case"!=":case"ne":return(o!==0);case"":case"<":case"lt":return(o<0);default:return null}}var l=(function(){var o={define_property:(function(){return false}()),create_canvas:(function(){var p=document.createElement("canvas");return !!(p.getContext&&p.getContext("2d"))}()),return_response_type:function(p){try{if(m.inArray(p,["","text","document"])!==-1){return true}else{if(window.XMLHttpRequest){var r=new XMLHttpRequest();r.open("get","/");if("responseType" in r){r.responseType=p;if(r.responseType!==p){return false}return true}}}}catch(q){}return false},use_data_uri:(function(){var p=new Image();p.onload=function(){o.use_data_uri=(p.width===1&&p.height===1)};setTimeout(function(){p.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1);return false}()),use_data_uri_over32kb:function(){return o.use_data_uri&&(i.browser!=="IE"||i.version>=9)},use_data_uri_of:function(p){return(o.use_data_uri&&p<33000||o.use_data_uri_over32kb())},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)){return false}var p=document.createElement("input");p.setAttribute("type","file");return !p.disabled}};return function(q){var p=[].slice.call(arguments);p.shift();return m.typeOf(o[q])==="function"?o[q].apply(this,p):!!o[q]}}());var n=new k().getResult();var i={can:l,uaParser:k,browser:n.browser.name,version:n.browser.version,os:n.os.name,osVersion:n.os.version,verComp:j,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};i.OS=i.os;if(MXI_DEBUG){i.debug={runtime:true,events:false};i.log=function(){function p(r){o.appendChild(document.createTextNode(r+"\n"))}var q=arguments[0];if(m.typeOf(q)==="string"){q=m.sprintf.apply(this,arguments)}if(window&&window.console&&window.console.log){window.console.log(q)}else{if(document){var o=document.getElementById("moxie-console");if(!o){o=document.createElement("pre");o.id="moxie-console";document.body.appendChild(o)}if(m.inArray(m.typeOf(q),["object","array"])!==-1){p(q)}else{o.appendChild(document.createTextNode(q+"\n"))}}}}}return i});h("moxie/core/I18n",["moxie/core/utils/Basic"],function(j){var i={};return{addI18n:function(k){return j.extend(i,k)},translate:function(k){return i[k]||k},_:function(k){return this.translate(k)},sprintf:function(l){var k=[].slice.call(arguments,1);return l.replace(/%[a-z]/g,function(){var m=k.shift();return j.typeOf(m)!=="undefined"?m:""})}}});h("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(l,k){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe";var j={mimes:{},extensions:{},addMimeType:function(m){var n=m.split(/,/),o,q,p;for(o=0;o=0;n--){if(q[n].fn===o){q.splice(n,1);break}}}else{q=[]}if(!q.length){delete m[this.uid][p];if(k.isEmptyObj(m[this.uid])){delete m[this.uid]}}}},removeAllEventListeners:function(){if(m[this.uid]){delete m[this.uid]}},dispatchEvent:function(s){var p,q,r,t,u={},v=true,n;if(k.typeOf(s)!=="string"){t=s;if(k.typeOf(t.type)==="string"){s=t.type;if(t.total!==n&&t.loaded!==n){u.total=t.total;u.loaded=t.loaded}u.async=t.async||false}else{throw new i.EventException(i.EventException.UNSPECIFIED_EVENT_TYPE_ERR)}}if(s.indexOf("::")!==-1){(function(w){p=w[0];s=w[1]}(s.split("::")))}else{p=this.uid}s=s.toLowerCase();q=m[p]&&m[p][s];if(q){q.sort(function(x,w){return w.priority-x.priority});r=[].slice.call(arguments);r.shift();u.type=s;r.unshift(u);if(MXI_DEBUG&&j.debug.events){j.log("Event '%s' fired on %u",u.type,p)}var o=[];k.each(q,function(w){r[0].target=w.scope;if(u.async){o.push(function(x){setTimeout(function(){x(w.fn.apply(w.scope,r)===false)},1)})}else{o.push(function(x){x(w.fn.apply(w.scope,r)===false)})}});if(o.length){k.inSeries(o,function(w){v=!w})}}return v},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(o){var n=this;this.bind(o.join(" "),function(p){var q="on"+p.type.toLowerCase();if(k.typeOf(this[q])==="function"){this[q].apply(this,arguments)}});k.each(o,function(p){p="on"+p.toLowerCase(p);if(k.typeOf(n[p])==="undefined"){n[p]=null}})}})}l.instance=new l();return l});h("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(j,n,m,o){var i={},k={};function l(x,u,s,r,q){var w=this,p,v=n.guid(u+"_"),t=q||"browser";x=x||{};k[v]=this;s=n.extend({access_binary:false,access_image_binary:false,display_media:false,do_cors:false,drag_and_drop:false,filter_by_extension:true,resize_image:false,report_upload_progress:false,return_response_headers:false,return_response_type:false,return_status_code:true,send_custom_headers:false,select_file:false,select_folder:false,select_multiple:true,send_binary_string:false,send_browser_cookies:true,send_multipart:true,slice_blob:false,stream_upload:false,summon_file_dialog:false,upload_filesize:true,use_http_method:true},s);if(x.preferred_caps){t=l.getMode(r,x.preferred_caps,t)}if(MXI_DEBUG&&j.debug.runtime){j.log("\tdefault mode: %s",t)}p=(function(){var y={};return{exec:function(B,z,C,A){if(p[z]){if(!y[B]){y[B]={context:this,instance:new p[z]()}}if(y[B].instance[C]){return y[B].instance[C].apply(this,A)}}},removeInstance:function(z){delete y[z]},removeAllInstances:function(){var z=this;n.each(y,function(B,A){if(n.typeOf(B.instance.destroy)==="function"){B.instance.destroy.call(B.context)}z.removeInstance(A)})}}}());n.extend(this,{initialized:false,uid:v,type:u,mode:l.getMode(r,(x.required_caps),t),shimid:v+"_container",clients:0,options:x,can:function(A,B){var y=arguments[2]||s;if(n.typeOf(A)==="string"&&n.typeOf(B)==="undefined"){A=l.parseCaps(A)}if(n.typeOf(A)==="object"){for(var z in A){if(!this.can(z,A[z],y)){return false}}return true}if(n.typeOf(y[A])==="function"){return y[A].call(this,B)}else{return(B===y[A])}},getShimContainer:function(){var y,z=m.get(this.shimid);if(!z){y=this.options.container?m.get(this.options.container):document.body;z=document.createElement("div");z.id=this.shimid;z.className="moxie-shim moxie-shim-"+this.type;n.extend(z.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"});y.appendChild(z);y=null}return z},getShim:function(){return p},shimExec:function(z,A){var y=[].slice.call(arguments,2);return w.getShim().exec.call(this,this.uid,z,A,y)},exec:function(z,A){var y=[].slice.call(arguments,2);if(w[z]&&w[z][A]){return w[z][A].apply(this,y)}return w.shimExec.apply(this,arguments)},destroy:function(){if(!w){return}var y=m.get(this.shimid);if(y){y.parentNode.removeChild(y)}if(p){p.removeAllInstances()}this.unbindAll();delete k[this.uid];this.uid=null;v=w=p=y=null}});if(this.mode&&x.required_caps&&!this.can(x.required_caps)){this.mode=false}}l.order="html5,flash,silverlight,html4";l.getRuntime=function(p){return k[p]?k[p]:false};l.addConstructor=function(q,p){p.prototype=o.instance;i[q]=p};l.getConstructor=function(p){return i[p]||null};l.getInfo=function(p){var q=l.getRuntime(p);if(q){return{uid:q.uid,type:q.type,mode:q.mode,can:function(){return q.can.apply(q,arguments)}}}return null};l.parseCaps=function(p){var q={};if(n.typeOf(p)!=="string"){return p||{}}n.each(p.split(","),function(r){q[r]=true});return q};l.can=function(q,s){var r,p=l.getConstructor(q),t;if(p){r=new p({required_caps:s});t=r.mode;r.destroy();return !!t}return false};l.thatCan=function(r,s){var q=(s||l.order).split(/\s*,\s*/);for(var p in q){if(l.can(q[p],r)){return q[p]}}return null};l.getMode=function(p,s,q){var r=null;if(n.typeOf(q)==="undefined"){q="browser"}if(s&&!n.isEmptyObj(p)){n.each(s,function(v,t){if(p.hasOwnProperty(t)){var u=p[t](v);if(typeof(u)==="string"){u=[u]}if(!r){r=u}else{if(!(r=n.arrayIntersect(r,u))){if(MXI_DEBUG&&j.debug.runtime){j.log("\t\t%c: %v (conflicting mode requested: %s)",t,v,u)}return(r=false)}}}if(MXI_DEBUG&&j.debug.runtime){j.log("\t\t%c: %v (compatible modes: %s)",t,v,r)}});if(r){return n.inArray(q,r)!==-1?q:r[0]}else{if(r===false){return false}}}return q};l.capTrue=function(){return true};l.capFalse=function(){return false};l.capTest=function(p){return function(){return !!p}};return l});h("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(j,i,m,l){return function k(){var n;m.extend(this,{connectRuntime:function(r){var p=this,q;function o(s){var u,t;if(!s.length){p.trigger("RuntimeError",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR));n=null;return}u=s.shift().toLowerCase();t=l.getConstructor(u);if(!t){o(s);return}if(MXI_DEBUG&&j.debug.runtime){j.log("Trying runtime: %s",u);j.log(r)}n=new t(r);n.bind("Init",function(){n.initialized=true;if(MXI_DEBUG&&j.debug.runtime){j.log("Runtime '%s' initialized",n.type)}setTimeout(function(){n.clients++;p.trigger("RuntimeInit",n)},1)});n.bind("Error",function(){if(MXI_DEBUG&&j.debug.runtime){j.log("Runtime '%s' failed to initialize",n.type)}n.destroy();o(s)});if(MXI_DEBUG&&j.debug.runtime){j.log("\tselected mode: %s",n.mode)}if(!n.mode){n.trigger("Error");return}n.init()}if(m.typeOf(r)==="string"){q=r}else{if(m.typeOf(r.ruid)==="string"){q=r.ruid}}if(q){n=l.getRuntime(q);if(n){n.clients++;return n}else{throw new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR)}}o((r.runtime_order||l.order).split(/\s*,\s*/))},disconnectRuntime:function(){if(n&&--n.clients<=0){n.destroy()}n=null},getRuntime:function(){if(n&&n.uid){return n}return n=null},exec:function(){if(n){return n.exec.apply(this,arguments)}return null}})}});h("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(j,o,m,l,q,s,k,i,p){var r=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];function n(w){if(MXI_DEBUG){o.log("Instantiating FileInput...")}var u=this,t,v,x;if(j.inArray(j.typeOf(w),["string","node"])!==-1){w={browse_button:w}}v=l.get(w.browse_button);if(!v){throw new q.DOMException(q.DOMException.NOT_FOUND_ERR)}x={accept:[{title:k.translate("All Files"),extensions:"*"}],name:"file",multiple:false,required_caps:false,container:v.parentNode||document.body};w=j.extend({},x,w);if(typeof(w.required_caps)==="string"){w.required_caps=i.parseCaps(w.required_caps)}if(typeof(w.accept)==="string"){w.accept=m.mimes2extList(w.accept)}t=l.get(w.container);if(!t){t=document.body}if(l.getStyle(t,"position")==="static"){t.style.position="relative"}t=v=null;p.call(u);j.extend(u,{uid:j.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){u.bind("RuntimeInit",function(z,y){u.ruid=y.uid;u.shimid=y.shimid;u.bind("Ready",function(){u.trigger("Refresh")},999);u.bind("Refresh",function(){var D,C,B,A;B=l.get(w.browse_button);A=l.get(y.shimid);if(B){D=l.getPos(B,l.get(w.container));C=l.getSize(B);if(A){j.extend(A.style,{top:D.y+"px",left:D.x+"px",width:C.w+"px",height:C.h+"px"})}}A=B=null});y.exec.call(u,"FileInput","init",w)});u.connectRuntime(j.extend({},w,{required_caps:{select_file:true}}))},disable:function(z){var y=this.getRuntime();if(y){y.exec.call(this,"FileInput","disable",j.typeOf(z)==="undefined"?true:z)}},refresh:function(){u.trigger("Refresh")},destroy:function(){var y=this.getRuntime();if(y){y.exec.call(this,"FileInput","destroy");this.disconnectRuntime()}if(j.typeOf(this.files)==="array"){j.each(this.files,function(z){z.destroy()})}this.files=null;this.unbindAll()}});this.handleEventProps(r)}n.prototype=s.instance;return n});h("moxie/core/utils/Encode",[],function(){var k=function(m){return unescape(encodeURIComponent(m))};var l=function(m){return decodeURIComponent(escape(m))};var j=function(t,y){if(typeof(window.atob)==="function"){return y?l(window.atob(t)):window.atob(t)}var p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o,n,m,x,w,v,u,z,s=0,A=0,q="",r=[];if(!t){return t}t+="";do{x=p.indexOf(t.charAt(s++));w=p.indexOf(t.charAt(s++));v=p.indexOf(t.charAt(s++));u=p.indexOf(t.charAt(s++));z=x<<18|w<<12|v<<6|u;o=z>>16&255;n=z>>8&255;m=z&255;if(v==64){r[A++]=String.fromCharCode(o)}else{if(u==64){r[A++]=String.fromCharCode(o,n)}else{r[A++]=String.fromCharCode(o,n,m)}}}while(s>18&63;y=B>>12&63;x=B>>6&63;w=B&63;s[C++]=q.charAt(z)+q.charAt(y)+q.charAt(x)+q.charAt(w)}while(u0){if(x){ac.upload.dispatchEvent(ag)}ac.dispatchEvent(ag)}else{D=true;ac.dispatchEvent("error")}ad()});O.bind("Abort",function(ag){ac.dispatchEvent(ag);ad()});O.bind("Error",function(ag){D=true;Z("readyState",v.DONE);ac.dispatchEvent("readystatechange");L=true;ac.dispatchEvent(ag);ad()});af.exec.call(O,"XMLHttpRequest","send",{url:J,method:P,async:X,user:S,password:G,headers:Q,mimeType:K,encoding:I,responseType:ac.responseType,withCredentials:ac.withCredentials,options:T},ae)}if(typeof(T.required_caps)==="string"){T.required_caps=o.parseCaps(T.required_caps)}T.required_caps=q.extend({},T.required_caps,{return_response_type:ac.responseType});if(ae instanceof z){T.required_caps.send_multipart=true}if(!q.isEmptyObj(Q)){T.required_caps.send_custom_headers=true}if(!H){T.required_caps.do_cors=true}if(T.ruid){ab(O.connectRuntime(T))}else{O.bind("RuntimeInit",function(ag,af){ab(af)});O.bind("RuntimeError",function(ag,af){ac.dispatchEvent("RuntimeError",af)});O.connectRuntime(T)}}function M(){Z("responseText","");Z("responseXML",null);Z("response",null);Z("status",0);Z("statusText","");N=W=null}}v.UNSENT=0;v.OPENED=1;v.HEADERS_RECEIVED=2;v.LOADING=3;v.DONE=4;v.prototype=p.instance;return v});h("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(l,i,j,m){function k(){var r,p,n,s,v,u;j.call(this);l.extend(this,{uid:l.guid("uid_"),state:k.IDLE,result:null,transport:function(A,z,y){var x=this;y=l.extend({chunk_size:204798},y);if((r=y.chunk_size%3)){y.chunk_size+=3-r}u=y.chunk_size;t.call(this);n=A;s=A.length;if(l.typeOf(y)==="string"||y.ruid){q.call(x,z,this.connectRuntime(y))}else{var w=function(C,B){x.unbind("RuntimeInit",w);q.call(x,z,B)};this.bind("RuntimeInit",w);this.connectRuntime(y)}},abort:function(){var w=this;w.state=k.IDLE;if(p){p.exec.call(w,"Transporter","clear");w.trigger("TransportingAborted")}t.call(w)},destroy:function(){this.unbindAll();p=null;this.disconnectRuntime();t.call(this)}});function t(){s=v=0;n=this.result=null}function q(x,y){var w=this;p=y;w.bind("TransportingProgress",function(z){v=z.loaded;if(vy){u=y}x=i.btoa(n.substr(v,u));p.exec.call(w,"Transporter","receive",x,s)}}k.IDLE=0;k.BUSY=1;k.DONE=2;k.prototype=m.instance;return k});h("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(k,n,t,r,u,j,s,m,q,w,l,p,o){var v=["progress","load","error","resize","embedded"];function i(){s.call(this);k.extend(this,{uid:k.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){z.apply(this,arguments)},downsize:function(D){var E={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:false,preserveHeaders:true,resample:false};if(typeof(D)==="object"){D=k.extend(E,D)}else{D=k.extend(E,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]})}try{if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}if(this.width>i.MAX_RESIZE_WIDTH||this.height>i.MAX_RESIZE_HEIGHT){throw new t.ImageError(t.ImageError.MAX_RESOLUTION_ERR)}this.exec("Image","downsize",D.width,D.height,D.crop,D.preserveHeaders)}catch(C){this.trigger("error",C.code)}},crop:function(E,C,D){this.downsize(E,C,true,D)},getAsCanvas:function(){if(!q.can("create_canvas")){throw new t.RuntimeError(t.RuntimeError.NOT_SUPPORTED_ERR)}var C=this.connectRuntime(this.ruid);return C.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(C,D){if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}return this.exec("Image","getAsBlob",C||"image/jpeg",D||90)},getAsDataURL:function(C,D){if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}return this.exec("Image","getAsDataURL",C||"image/jpeg",D||90)},getAsBinaryString:function(C,E){var D=this.getAsDataURL(C,E);return o.atob(D.substring(D.indexOf("base64,")+7))},embed:function(G,I){var D=this,H;I=k.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},I||{});function F(L,O){var J=this;if(q.can("create_canvas")){var K=J.getAsCanvas();if(K){G.appendChild(K);K=null;J.destroy();D.trigger("embedded");return}}var N=J.getAsDataURL(L,O);if(!N){throw new t.ImageError(t.ImageError.WRONG_FORMAT)}if(q.can("use_data_uri_of",N.length)){G.innerHTML='';J.destroy();D.trigger("embedded")}else{var M=new m();M.bind("TransportingComplete",function(){H=D.connectRuntime(this.result.ruid);D.bind("Embedded",function(){k.extend(H.getShimContainer().style,{top:"0px",left:"0px",width:J.width+"px",height:J.height+"px"});H=null},999);H.exec.call(D,"ImageView","display",this.result.uid,width,height);J.destroy()});M.transport(o.atob(N.substring(N.indexOf("base64,")+7)),L,{required_caps:{display_media:true},runtime_order:"flash,silverlight",container:G})}}try{if(!(G=n.get(G))){throw new t.DOMException(t.DOMException.INVALID_NODE_TYPE_ERR)}if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}if(this.width>i.MAX_RESIZE_WIDTH||this.height>i.MAX_RESIZE_HEIGHT){}var C=new i();C.bind("Resize",function(){F.call(this,I.type,I.quality)});C.bind("Load",function(){C.downsize(I)});if(this.meta.thumb&&this.meta.thumb.width>=I.width&&this.meta.thumb.height>=I.height){C.load(this.meta.thumb.data)}else{C.clone(this,false)}return C}catch(E){this.trigger("error",E.code)}},destroy:function(){if(this.ruid){this.getRuntime().exec.call(this,"Image","destroy");this.disconnectRuntime()}this.unbindAll()}});this.handleEventProps(v);this.bind("Load Resize",function(){y.call(this)},999);function y(C){if(!C){C=this.exec("Image","getInfo")}this.size=C.size;this.width=C.width;this.height=C.height;this.type=C.type;this.meta=C.meta;if(this.name===""){this.name=C.name}}function z(E){var D=k.typeOf(E);try{if(E instanceof i){if(!E.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}x.apply(this,arguments)}else{if(E instanceof l){if(!~k.inArray(E.type,["image/jpeg","image/png"])){throw new t.ImageError(t.ImageError.WRONG_FORMAT)}A.apply(this,arguments)}else{if(k.inArray(D,["blob","file"])!==-1){z.call(this,new p(null,E),arguments[1])}else{if(D==="string"){if(E.substr(0,5)==="data:"){z.call(this,new l(null,{data:E}),arguments[1])}else{B.apply(this,arguments)}}else{if(D==="node"&&E.nodeName.toLowerCase()==="img"){z.call(this,E.src,arguments[1])}else{throw new t.DOMException(t.DOMException.TYPE_MISMATCH_ERR)}}}}}}catch(C){this.trigger("error",C.code)}}function x(C,D){var E=this.connectRuntime(C.ruid);this.ruid=E.uid;E.exec.call(this,"Image","loadFromImage",C,(k.typeOf(D)==="undefined"?true:D))}function A(E,F){var D=this;D.name=E.name||"";function C(G){D.ruid=G.uid;G.exec.call(D,"Image","loadFromBlob",E)}if(E.isDetached()){this.bind("RuntimeInit",function(H,G){C(G)});if(F&&typeof(F.required_caps)==="string"){F.required_caps=j.parseCaps(F.required_caps)}this.connectRuntime(k.extend({required_caps:{access_image_binary:true,resize_image:true}},F))}else{C(this.connectRuntime(E.ruid))}}function B(E,D){var C=this,F;F=new u();F.open("get",E);F.responseType="blob";F.onprogress=function(G){C.trigger(G)};F.onload=function(){A.call(C,F.response,true)};F.onerror=function(G){C.trigger(G)};F.onloadend=function(){F.destroy()};F.bind("RuntimeError",function(H,G){C.trigger("RuntimeError",G)});F.send(null,D)}}i.MAX_RESIZE_WIDTH=8192;i.MAX_RESIZE_HEIGHT=8192;i.prototype=w.instance;return i});h("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(n,i,k,j){var m="html5",l={};function o(q){var p=this,t=k.capTest,s=k.capTrue;var r=n.extend({access_binary:t(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return p.can("access_binary")&&!!l.Image},display_media:t(j.can("create_canvas")||j.can("use_data_uri_over32kb")),do_cors:t(window.XMLHttpRequest&&"withCredentials" in new XMLHttpRequest()),drag_and_drop:t(function(){var u=document.createElement("div");return(("draggable" in u)||("ondragstart" in u&&"ondrop" in u))&&(j.browser!=="IE"||j.verComp(j.version,9,">"))}()),filter_by_extension:t(function(){return(j.browser==="Chrome"&&j.verComp(j.version,28,">="))||(j.browser==="IE"&&j.verComp(j.version,10,">="))||(j.browser==="Safari"&&j.verComp(j.version,7,">="))}()),return_response_headers:s,return_response_type:function(u){if(u==="json"&&!!window.JSON){return true}return j.can("return_response_type",u)},return_status_code:s,report_upload_progress:t(window.XMLHttpRequest&&new XMLHttpRequest().upload),resize_image:function(){return p.can("access_binary")&&j.can("create_canvas")},select_file:function(){return j.can("use_fileinput")&&window.File},select_folder:function(){return p.can("select_file")&&j.browser==="Chrome"&&j.verComp(j.version,21,">=")},select_multiple:function(){return p.can("select_file")&&!(j.browser==="Safari"&&j.os==="Windows")&&!(j.os==="iOS"&&j.verComp(j.osVersion,"7.0.0",">")&&j.verComp(j.osVersion,"8.0.0","<"))},send_binary_string:t(window.XMLHttpRequest&&(new XMLHttpRequest().sendAsBinary||(window.Uint8Array&&window.ArrayBuffer))),send_custom_headers:t(window.XMLHttpRequest),send_multipart:function(){return !!(window.XMLHttpRequest&&new XMLHttpRequest().upload&&window.FormData)||p.can("send_binary_string")},slice_blob:t(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return p.can("slice_blob")&&p.can("send_multipart")},summon_file_dialog:function(){return p.can("select_file")&&((j.browser==="Firefox"&&j.verComp(j.version,4,">="))||(j.browser==="Opera"&&j.verComp(j.version,12,">="))||(j.browser==="IE"&&j.verComp(j.version,10,">="))||!!~n.inArray(j.browser,["Chrome","Safari"]))},upload_filesize:s},arguments[2]);k.call(this,q,(arguments[1]||m),r);n.extend(this,{init:function(){this.trigger("Init")},destroy:(function(u){return function(){u.call(p);u=p=null}}(this.destroy))});n.extend(this.getShim(),l)}k.addConstructor(m,o);return l});h("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(o){var p={},l="moxie_"+o.guid();function k(){this.returnValue=false}function j(){this.cancelBubble=true}var m=function(u,q,v,s){var t,r;q=q.toLowerCase();if(u.addEventListener){t=v;u.addEventListener(q,t,false)}else{if(u.attachEvent){t=function(){var w=window.event;if(!w.target){w.target=w.srcElement}w.preventDefault=k;w.stopPropagation=j;v(w)};u.attachEvent("on"+q,t)}}if(!u[l]){u[l]=o.guid()}if(!p.hasOwnProperty(u[l])){p[u[l]]={}}r=p[u[l]];if(!r.hasOwnProperty(q)){r[q]=[]}r[q].push({func:t,orig:v,key:s})};var n=function(v,q,w){var t,s;q=q.toLowerCase();if(v[l]&&p[v[l]]&&p[v[l]][q]){t=p[v[l]][q]}else{return}for(var r=t.length-1;r>=0;r--){if(t[r].orig===w||t[r].key===w){if(v.removeEventListener){v.removeEventListener(q,t[r].func,false)}else{if(v.detachEvent){v.detachEvent("on"+q,t[r].func)}}t[r].orig=null;t[r].func=null;t.splice(r,1);if(w!==s){break}}}if(!t.length){delete p[v[l]][q]}if(o.isEmptyObj(p[v[l]])){delete p[v[l]];try{delete v[l]}catch(u){v[l]=s}}};var i=function(r,q){if(!r||!r[l]){return}o.each(p[r[l]],function(t,s){n(r,s,q)})};return{addEvent:m,removeEvent:n,removeAllEvents:i}});h("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(n,k,p,m,j,l,i){function o(){var q;p.extend(this,{init:function(A){var r=this,y=r.getRuntime(),x,t,u,z,w,v;q=A;u=q.accept.mimes||l.extList2mimes(q.accept,y.can("filter_by_extension"));t=y.getShimContainer();t.innerHTML='";x=m.get(y.uid);p.extend(x.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});z=m.get(q.browse_button);if(y.can("summon_file_dialog")){if(m.getStyle(z,"position")==="static"){z.style.position="relative"}w=parseInt(m.getStyle(z,"z-index"),10)||1;z.style.zIndex=w;t.style.zIndex=w-1;j.addEvent(z,"click",function(C){var B=m.get(y.uid);if(B&&!B.disabled){B.click()}C.preventDefault()},r.uid)}v=y.can("summon_file_dialog")?z:t;j.addEvent(v,"mouseover",function(){r.trigger("mouseenter")},r.uid);j.addEvent(v,"mouseout",function(){r.trigger("mouseleave")},r.uid);j.addEvent(v,"mousedown",function(){r.trigger("mousedown")},r.uid);j.addEvent(m.get(q.container),"mouseup",function(){r.trigger("mouseup")},r.uid);x.onchange=function s(B){r.files=[];p.each(this.files,function(E){var D="";if(q.directory){if(E.name=="."){return true}}if(E.webkitRelativePath){D="/"+E.webkitRelativePath.replace(/^\//,"")}E=new k(y.uid,E);E.relativePath=D;r.files.push(E)});if(i.browser!=="IE"&&i.browser!=="IEMobile"){this.value=""}else{var C=this.cloneNode(true);this.parentNode.replaceChild(C,this);C.onchange=s}if(r.files.length){r.trigger("change")}};r.trigger({type:"ready",async:true});t=null},disable:function(t){var s=this.getRuntime(),r;if((r=m.get(s.uid))){r.disabled=!!t}},destroy:function(){var s=this.getRuntime(),t=s.getShim(),r=s.getShimContainer();j.removeAllEvents(r,this.uid);j.removeAllEvents(q&&m.get(q.container),this.uid);j.removeAllEvents(q&&m.get(q.browse_button),this.uid);if(r){r.innerHTML=""}t.removeInstance(this.uid);q=r=t=null}})}return(n.FileInput=o)});h("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(j,k){function i(){function l(n,q,m){var o;if(window.File.prototype.slice){try{n.slice();return n.slice(q,m)}catch(p){return n.slice(q,m-q)}}else{if((o=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)){return o.call(n,q,m)}else{return null}}}this.slice=function(){return new k(this.getRuntime().uid,l.apply(this,arguments))}}return(j.Blob=i)});h("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(m,j,n,l,i,k){function o(){var r=[],u=[],z,v;n.extend(this,{init:function(C){var B=this,D;z=C;v=B.ruid;u=t(z.accept);D=z.container;i.addEvent(D,"dragover",function(E){if(!s(E)){return}E.preventDefault();E.dataTransfer.dropEffect="copy"},B.uid);i.addEvent(D,"drop",function(E){if(!s(E)){return}E.preventDefault();r=[];if(E.dataTransfer.items&&E.dataTransfer.items[0].webkitGetAsEntry){y(E.dataTransfer.items,function(){B.files=r;B.trigger("drop")})}else{n.each(E.dataTransfer.files,function(F){q(F)});B.files=r;B.trigger("drop")}},B.uid);i.addEvent(D,"dragenter",function(E){B.trigger("dragenter")},B.uid);i.addEvent(D,"dragleave",function(E){B.trigger("dragleave")},B.uid)},destroy:function(){i.removeAllEvents(z&&l.get(z.container),this.uid);v=r=u=z=null}});function s(C){if(!C.dataTransfer||!C.dataTransfer.types){return false}var B=n.toArray(C.dataTransfer.types||[]);return n.inArray("Files",B)!==-1||n.inArray("public.file-url",B)!==-1||n.inArray("application/x-moz-file",B)!==-1}function q(C,B){if(x(C)){var D=new j(v,C);D.relativePath=B||"";r.push(D)}}function t(D){var C=[];for(var B=0;B=")&&m.verComp(m.version,7,"<")),z=m.browser==="Android Browser",E=false;w=G.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase();y=x();y.open(G.method,G.url,G.async,G.user,G.password);if(D instanceof k){if(D.isDetached()){E=true}D=D.getSource()}else{if(D instanceof r){if(D.hasBlob()){if(D.getBlob().isDetached()){D=v.call(F,D);E=true}else{if((C||z)&&j.typeOf(D.getBlob().getSource())==="blob"&&window.FileReader){s.call(F,G,D);return}}}if(D instanceof r){var B=new window.FormData();D.each(function(I,H){if(I instanceof k){B.append(H,I.getSource())}else{B.append(H,I)}});D=B}}}if(y.upload){if(G.withCredentials){y.withCredentials=true}y.addEventListener("load",function(H){F.trigger(H)});y.addEventListener("error",function(H){F.trigger(H)});y.addEventListener("progress",function(H){F.trigger(H)});y.upload.addEventListener("progress",function(H){F.trigger({type:"UploadProgress",loaded:H.loaded,total:H.total})})}else{y.onreadystatechange=function A(){switch(y.readyState){case 1:break;case 2:break;case 3:var J,H;try{if(i.hasSameOrigin(G.url)){J=y.getResponseHeader("Content-Length")||0}if(y.responseText){H=y.responseText.length}}catch(I){J=H=0}F.trigger({type:"progress",lengthComputable:!!J,total:parseInt(J,10),loaded:H});break;case 4:y.onreadystatechange=function(){};if(y.status===0){F.trigger("error")}else{F.trigger("load")}break}}}if(!j.isEmptyObj(G.headers)){j.each(G.headers,function(H,I){y.setRequestHeader(I,H)})}if(""!==G.responseType&&"responseType" in y){if("json"===G.responseType&&!m.can("return_response_type","json")){y.responseType="text"}else{y.responseType=G.responseType}}if(!E){y.send(D)}else{if(y.sendAsBinary){y.sendAsBinary(D)}else{(function(){var H=new Uint8Array(D.length);for(var I=0;Ithis.length()){throw new Error("You are trying to read outside the source boundaries.")}m=this.littleEndian?0:-8*(p-1);for(o=0,q=0;othis.length()){throw new Error("You are trying to write outside the source boundaries.")}m=this.littleEndian?0:-8*(q-1);for(p=0;p>Math.abs(m+p*8))&255)}},BYTE:function(m){return this.read(m,1)},SHORT:function(m){return this.read(m,2)},LONG:function(m){return this.read(m,4)},SLONG:function(m){var n=this.read(m,4);return(n>2147483647?n-4294967296:n)},CHAR:function(m){return String.fromCharCode(this.read(m,1))},STRING:function(m,n){return this.asArray("CHAR",m,n).join("")},asArray:function(p,m,q){var n=[];for(var o=0;o0){o.set(new Uint8Array(m.slice(0,p)),0)}o.set(new Uint8Array(r),p);o.set(new Uint8Array(m.slice(p+q)),p+r.byteLength);this.clear();m=o.buffer;n=new DataView(m);break}default:return m}},length:function(){return m?m.byteLength:0},clear:function(){n=m=null}})}function l(n){k.extend(this,{readByteAt:function(o){return n.charCodeAt(o)},writeByteAt:function(o,p){m(String.fromCharCode(p),o,1)},SEGMENT:function(o,q,p){switch(arguments.length){case 1:return n.substr(o);case 2:return n.substr(o,q);case 3:m(p!==null?p:"",o,q);break;default:return n}},length:function(){return n?n.length:0},clear:function(){n=null}});function m(q,o,p){p=arguments.length===3?p:n.length-o-1;n=n.substr(0,o)+q+n.substr(p+o)}}return j});h("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(k,i){return function j(o){var q=[],p,l,m,n=0;p=new k(o);if(p.SHORT(0)!==65496){p.clear();throw new i.ImageError(i.ImageError.WRONG_FORMAT)}l=2;while(l<=p.length()){m=p.SHORT(l);if(m>=65488&&m<=65495){l+=2;continue}if(m===65498||m===65497){break}n=p.SHORT(l+2)+2;if(m>=65505&&m<=65519){q.push({hex:m,name:"APP"+(m&15),start:l,length:n,segment:p.SEGMENT(l,n)})}l+=n}p.clear();return{headers:q,restore:function(u){var r,t,s;s=new k(u);l=s.SHORT(2)==65504?4+s.SHORT(4):2;for(t=0,r=q.length;t=w.length){break}}},purge:function(){this.headers=q=[]}}}});h("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(l,k,i){function j(p){var t,u,q,o,s,v;k.call(this,p);u={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}};q={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};o={tiffHeader:10};s=o.tiffHeader;t={clear:this.clear};l.extend(this,{read:function(){try{return j.prototype.read.apply(this,arguments)}catch(w){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}},write:function(){try{return j.prototype.write.apply(this,arguments)}catch(w){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(w){return this.LONG(w)/this.LONG(w+4)},SRATIONAL:function(w){return this.SLONG(w)/this.SLONG(w+4)},ASCII:function(w){return this.CHAR(w)},TIFF:function(){return v||null},EXIF:function(){var x=null;if(o.exifIFD){try{x=r.call(this,o.exifIFD,u.exif)}catch(z){return null}if(x.ExifVersion&&l.typeOf(x.ExifVersion)==="array"){for(var y=0,w="";y4){y=A.LONG(y)+o.tiffHeader}if(y+J*D>=this.length()){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}if(E==="ASCII"){z[K]=l.trim(A.STRING(y,D).replace(/\0$/,""));continue}else{H=A.asArray(E,y,D);G=(D==1?H[0]:H);if(q.hasOwnProperty(K)&&typeof G!="object"){z[K]=q[K][G]}else{z[K]=G}}}return z}function n(E,G,D){var A,y,x,w=0;if(typeof(G)==="string"){var F=u[E.toLowerCase()];for(var z in F){if(F[z]===G){G=z;break}}}A=o[E.toLowerCase()+"IFD"];y=this.SHORT(A);for(var B=0;B=65472&&y<=65475){x+=5;return{height:z.SHORT(x),width:z.SHORT(x+=2)}}A=z.SHORT(x+=2);x+=A-2}return null}function t(){var y=r.thumb(),x,z;if(y){x=new m(y);z=v(x);x.clear();if(z){z.data=y;return z}}return null}function p(){if(!r||!u||!q){return}r.clear();u.purge();q.clear();w=u=r=q=null}}return l});h("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(i,l,k){function j(q){var s,n,p,o;s=new k(q);(function(){var u=0,w=0,v=[35152,20039,3338,6666];for(w=0;wv?v-w:G;var A=0;while(Ap?p-A:G;o.clearRect(0,0,G,G);o.drawImage(I,-A,-w);var t=(A*C/p+r)<<0;var u=Math.ceil(B*C/p);var s=(w*z/v/E+q)<<0;var F=Math.ceil(H*z/v/E);D.drawImage(l,0,0,B,H,t,s,u,F);A+=G}w+=G}l=o=null}function j(n){var m=n.naturalWidth,p=n.naturalHeight;if(m*p>1024*1024){var o=document.createElement("canvas");o.width=o.height=1;var l=o.getContext("2d");l.drawImage(n,-m+1,0);return l.getImageData(0,0,1,1).data[3]===0}else{return false}}function k(p,m,u){var l=document.createElement("canvas");l.width=1;l.height=u;var v=l.getContext("2d");v.drawImage(p,0,0);var o=v.getImageData(0,0,1,u).data;var s=0;var q=u;var t=u;while(t>s){var n=o[(t-1)*4+3];if(n===0){q=t}else{s=t}t=(q+s)>>1}l=null;var r=(t/u);return(r===0)?1:r}return{isSubsampled:j,renderTo:i}});h("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/MegaPixel","moxie/core/utils/Mime","moxie/core/utils/Env"],function(p,i,q,l,j,n,s,r,k,m){function o(){var D=this,C,H,B,x,F,J=false,u=true;i.extend(this,{loadFromBlob:function(M){var L=this,N=L.getRuntime(),K=arguments.length>1?arguments[1]:true;if(!N.can("access_binary")){throw new q.RuntimeError(q.RuntimeError.NOT_SUPPORTED_ERR)}F=M;if(M.isDetached()){x=M.getSource();A.call(this,x);return}else{G.call(this,M.getSource(),function(O){if(K){x=I(O)}A.call(L,O)})}},loadFromImage:function(K,L){this.meta=K.meta;F=new n(null,{name:K.name,size:K.size,type:K.type});A.call(this,L?(x=K.getAsBinaryString()):K.getAsDataURL())},getInfo:function(){var K=this.getRuntime(),L;if(!H&&x&&K.can("access_image_binary")){H=new s(x)}L={width:y().width||0,height:y().height||0,type:F.type||k.getFileMime(F.name),size:x&&x.length||F.size||0,name:F.name||"",meta:H&&H.meta||this.meta||{}};if(L.meta&&L.meta.thumb&&!(L.meta.thumb.data instanceof j)){L.meta.thumb.data=new j(null,{type:"image/jpeg",data:L.meta.thumb.data})}return L},downsize:function(){t.apply(this,arguments)},getAsCanvas:function(){if(B){B.id=this.uid+"_canvas"}return B},getAsBlob:function(K,L){if(K!==this.type){t.call(this,this.width,this.height,false)}return new n(null,{name:F.name||"",type:K,data:D.getAsBinaryString.call(this,K,L)})},getAsDataURL:function(L){var M=arguments[1]||90;if(!J){return C.src}if("image/jpeg"!==L){return B.toDataURL("image/png")}else{try{return B.toDataURL("image/jpeg",M/100)}catch(K){return B.toDataURL("image/jpeg")}}},getAsBinaryString:function(L,N){if(!J){if(!x){x=I(D.getAsDataURL(L,N))}return x}if("image/jpeg"!==L){x=I(D.getAsDataURL(L,N))}else{var M;if(!N){N=90}try{M=B.toDataURL("image/jpeg",N/100)}catch(K){M=B.toDataURL("image/jpeg")}x=I(M);if(H){x=H.stripHeaders(x);if(u){if(H.meta&&H.meta.exif){H.setExif({PixelXDimension:this.width,PixelYDimension:this.height})}x=H.writeHeaders(x)}H.purge();H=null}}J=false;return x},destroy:function(){D=null;v.call(this);this.getRuntime().getShim().removeInstance(this.uid)}});function y(){if(!B&&!C){throw new q.ImageError(q.DOMException.INVALID_STATE_ERR)}return B||C}function I(K){return l.atob(K.substring(K.indexOf("base64,")+7))}function E(L,K){return"data:"+(K||"")+";base64,"+l.btoa(L)}function A(L){var K=this;C=new Image();C.onerror=function(){v.call(this);K.trigger("error",q.ImageError.WRONG_FORMAT)};C.onload=function(){K.trigger("load")};C.src=L.substr(0,5)=="data:"?L:E(L,F.type)}function G(M,N){var L=this,K;if(window.FileReader){K=new FileReader();K.onload=function(){N(this.result)};K.onerror=function(){L.trigger("error",q.ImageError.WRONG_FORMAT)};K.readAsDataURL(M)}else{return N(M.getAsDataURL())}}function t(L,W,R,T){var X=this,O,N,U=0,S=0,Q,V,M,K;u=T;K=(this.meta&&this.meta.tiff&&this.meta.tiff.Orientation)||1;if(i.inArray(K,[5,6,7,8])!==-1){var P=L;L=W;W=P}Q=y();if(!R){O=Math.min(L/Q.width,W/Q.height)}else{L=Math.min(L,Q.width);W=Math.min(W,Q.height);O=Math.max(L/Q.width,W/Q.height)}if(O>1&&!R&&T){this.trigger("Resize");return}if(!B){B=document.createElement("canvas")}V=Math.round(Q.width*O);M=Math.round(Q.height*O);if(R){B.width=L;B.height=W;if(V>L){U=Math.round((V-L)/2)}if(M>W){S=Math.round((M-W)/2)}}else{B.width=V;B.height=M}if(!u){z(B.width,B.height,K)}w.call(this,Q,B,-U,-S,V,M);this.width=B.width;this.height=B.height;J=true;X.trigger("Resize")}function w(N,O,K,Q,M,P){if(m.OS==="iOS"){r.renderTo(N,O,{width:M,height:P,x:K,y:Q})}else{var L=O.getContext("2d");L.drawImage(N,K,Q,M,P)}}function z(N,K,M){switch(M){case 5:case 6:case 7:case 8:B.width=K;B.height=N;break;default:B.width=N;B.height=K}var L=B.getContext("2d");switch(M){case 2:L.translate(N,0);L.scale(-1,1);break;case 3:L.translate(N,K);L.rotate(Math.PI);break;case 4:L.translate(0,K);L.scale(1,-1);break;case 5:L.rotate(0.5*Math.PI);L.scale(1,-1);break;case 6:L.rotate(0.5*Math.PI);L.translate(0,-K);break;case 7:L.rotate(0.5*Math.PI);L.translate(N,-K);L.scale(-1,1);break;case 8:L.rotate(-0.5*Math.PI);L.translate(-N,0);break}}function v(){if(H){H.purge();H=null}x=C=B=F=null;J=false}}return(p.Image=o)});h("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(j,n,k,q,i){var o="flash",p={};function m(){var t;try{t=navigator.plugins["Shockwave Flash"];t=t.description}catch(v){try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(u){t="0.0"}}t=t.match(/\d+/g);return parseFloat(t[0]+"."+t[1])}function l(v){var u=k.get(v);if(u&&u.nodeName=="OBJECT"){if(n.browser==="IE"){u.style.display="none";(function t(){if(u.readyState==4){s(v)}else{setTimeout(t,10)}})()}else{u.parentNode.removeChild(u)}}}function s(v){var u=k.get(v);if(u){for(var t in u){if(typeof u[t]=="function"){u[t]=null}}u.parentNode.removeChild(u)}}function r(u){var t=this,v;u=j.extend({swf_url:n.swf_url},u);i.call(this,u,o,{access_binary:function(w){return w&&t.mode==="browser"},access_image_binary:function(w){return w&&t.mode==="browser"},display_media:i.capTrue,do_cors:i.capTrue,drag_and_drop:false,report_upload_progress:function(){return t.mode==="client"},resize_image:i.capTrue,return_response_headers:false,return_response_type:function(w){if(w==="json"&&!!window.JSON){return true}return !j.arrayDiff(w,["","text","document"])||t.mode==="browser"},return_status_code:function(w){return t.mode==="browser"||!j.arrayDiff(w,[200,404])},select_file:i.capTrue,select_multiple:i.capTrue,send_binary_string:function(w){return w&&t.mode==="browser"},send_browser_cookies:function(w){return w&&t.mode==="browser"},send_custom_headers:function(w){return w&&t.mode==="browser"},send_multipart:i.capTrue,slice_blob:function(w){return w&&t.mode==="browser"},stream_upload:function(w){return w&&t.mode==="browser"},summon_file_dialog:false,upload_filesize:function(w){return j.parseSizeStr(w)<=2097152||t.mode==="client"},use_http_method:function(w){return !j.arrayDiff(w,["GET","POST"])}},{access_binary:function(w){return w?"browser":"client"},access_image_binary:function(w){return w?"browser":"client"},report_upload_progress:function(w){return w?"browser":"client"},return_response_type:function(w){return j.arrayDiff(w,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(w){return j.arrayDiff(w,[200,404])?"browser":["client","browser"]},send_binary_string:function(w){return w?"browser":"client"},send_browser_cookies:function(w){return w?"browser":"client"},send_custom_headers:function(w){return w?"browser":"client"},stream_upload:function(w){return w?"client":"browser"},upload_filesize:function(w){return j.parseSizeStr(w)>=2097152?"client":"browser"}},"client");if(m()<10){if(MXI_DEBUG&&n.debug.runtime){n.log("\tFlash didn't meet minimal version requirement (10).")}this.mode=false}j.extend(this,{getShim:function(){return k.get(this.uid)},shimExec:function(x,y){var w=[].slice.call(arguments,2);return t.getShim().exec(this.uid,x,y,w)},init:function(){var x,y,w;w=this.getShimContainer();j.extend(w.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"});x='';if(n.browser==="IE"){y=document.createElement("div");w.appendChild(y);y.outerHTML=x;y=w=null}else{w.innerHTML=x}v=setTimeout(function(){if(t&&!t.initialized){t.trigger("Error",new q.RuntimeError(q.RuntimeError.NOT_INIT_ERR));if(MXI_DEBUG&&n.debug.runtime){n.log("\tFlash failed to initialize within a specified period of time (typically 5s).")}}},5000)},destroy:(function(w){return function(){l(t.uid);w.call(t);clearTimeout(v);u=v=w=t=null}}(this.destroy))},p)}i.addConstructor(o,r);return p});h("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(j,i,l){var k={init:function(o){var m=this,n=this.getRuntime();this.bind("Change",function(){var p=n.shimExec.call(m,"FileInput","getFiles");m.files=[];l.each(p,function(q){m.files.push(new i(n.uid,q))})},999);this.getRuntime().shimExec.call(this,"FileInput","init",{name:o.name,accept:o.accept,multiple:o.multiple});this.trigger("ready")}};return(j.FileInput=k)});h("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(j,k){var i={slice:function(n,p,l,o){var m=this.getRuntime();if(p<0){p=Math.max(n.size+p,0)}else{if(p>0){p=Math.min(p,n.size)}}if(l<0){l=Math.max(n.size+l,0)}else{if(l>0){l=Math.min(l,n.size)}}n=m.shimExec.call(this,"Blob","slice",p,l,o||"");if(n){n=new k(m.uid,n)}return n}};return(j.Blob=i)});h("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(k,i){function j(m,n){switch(n){case"readAsText":return i.atob(m,"utf8");case"readAsBinaryString":return i.atob(m);case"readAsDataURL":return m}return null}var l={read:function(o,n){var m=this;m.result="";if(o==="readAsDataURL"){m.result="data:"+(n.type||"")+";base64,"}m.bind("Progress",function(q,p){if(p){m.result+=j(p,o)}},999);return m.getRuntime().shimExec.call(this,"FileReader","readAsBase64",n.uid)}};return(k.FileReader=l)});h("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(k,i){function j(m,n){switch(n){case"readAsText":return i.atob(m,"utf8");case"readAsBinaryString":return i.atob(m);case"readAsDataURL":return m}return null}var l={read:function(p,o){var m,n=this.getRuntime();m=n.shimExec.call(this,"FileReaderSync","readAsBase64",o.uid);if(!m){return null}if(p==="readAsDataURL"){m="data:"+(o.type||"")+";base64,"+m}return j(m,p,o.type)}};return(k.FileReaderSync=l)});h("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter"],function(j,m,p,i,o,n,l){var k={send:function(x,s){var u=this,y=u.getRuntime();function r(){x.transport=y.mode;y.shimExec.call(u,"XMLHttpRequest","send",x,s)}function t(A,z){y.shimExec.call(u,"XMLHttpRequest","appendBlob",A,z.uid);s=null;r()}function v(A,z){var B=new l();B.bind("TransportingComplete",function(){z(this.result)});B.transport(A.getSource(),A.type,{ruid:y.uid})}if(!m.isEmptyObj(x.headers)){m.each(x.headers,function(z,A){y.shimExec.call(u,"XMLHttpRequest","setRequestHeader",A,z.toString())})}if(s instanceof n){var w;s.each(function(A,z){if(A instanceof p){w=z}else{y.shimExec.call(u,"XMLHttpRequest","append",z,A)}});if(!s.hasBlob()){s=null;r()}else{var q=s.getBlob();if(q.isDetached()){v(q,function(z){q.destroy();t(w,z)})}else{t(w,q)}}}else{if(s instanceof p){if(s.isDetached()){v(s,function(z){s.destroy();s=z.uid;r()})}else{s=s.uid;r()}}else{r()}}},getResponse:function(t){var q,s,r=this.getRuntime();s=r.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob");if(s){s=new i(r.uid,s);if("blob"===t){return s}try{q=new o();if(!!~m.inArray(t,["","text"])){return q.readAsText(s)}else{if("json"===t&&!!window.JSON){return JSON.parse(q.readAsText(s))}}}finally{s.destroy()}}return null},abort:function(r){var q=this.getRuntime();q.shimExec.call(this,"XMLHttpRequest","abort");this.dispatchEvent("readystatechange");this.dispatchEvent("abort")}};return(j.XMLHttpRequest=k)});h("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(i,k){var j={getAsBlob:function(n){var m=this.getRuntime(),l=m.shimExec.call(this,"Transporter","getAsBlob",n);if(l){return new k(m.uid,l)}return null}};return(i.Transporter=j)});h("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(j,l,k,n,m){var i={loadFromBlob:function(r){var q=this,p=q.getRuntime();function o(t){p.shimExec.call(q,"Image","loadFromBlob",t.uid);q=p=null}if(r.isDetached()){var s=new k();s.bind("TransportingComplete",function(){o(s.result.getSource())});s.transport(r.getSource(),r.type,{ruid:p.uid})}else{o(r.getSource())}},loadFromImage:function(p){var o=this.getRuntime();return o.shimExec.call(this,"Image","loadFromImage",p.uid)},getInfo:function(){var o=this.getRuntime(),p=o.shimExec.call(this,"Image","getInfo");if(p.meta&&p.meta.thumb&&!(p.meta.thumb.data instanceof n)){p.meta.thumb.data=new n(o.uid,p.meta.thumb.data)}return p},getAsBlob:function(q,r){var p=this.getRuntime(),o=p.shimExec.call(this,"Image","getAsBlob",q,r);if(o){return new n(p.uid,o)}return null},getAsDataURL:function(){var q=this.getRuntime(),p=q.Image.getAsBlob.apply(this,arguments),o;if(!p){return null}o=new m();return o.readAsDataURL(p)}};return(j.Image=i)});h("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(j,m,l,p,i){var n="silverlight",o={};function q(z){var C=false,v=null,r,s,t,B,u,x=0;try{try{v=new ActiveXObject("AgControl.AgControl");if(v.IsVersionSupported(z)){C=true}v=null}catch(y){var w=navigator.plugins["Silverlight Plug-In"];if(w){r=w.description;if(r==="1.0.30226.2"){r="2.0.30226.2"}s=r.split(".");while(s.length>3){s.pop()}while(s.length<4){s.push(0)}t=z.split(".");while(t.length>4){t.pop()}do{B=parseInt(t[x],10);u=parseInt(s[x],10);x++}while(x';t=setTimeout(function(){if(r&&!r.initialized){r.trigger("Error",new p.RuntimeError(p.RuntimeError.NOT_INIT_ERR));if(MXI_DEBUG&&m.debug.runtime){m.log("Silverlight failed to initialize within a specified period of time (5-10s).")}}},m.OS!=="Windows"?10000:5000)},destroy:(function(u){return function(){u.call(r);clearTimeout(t);s=t=u=r=null}}(this.destroy))},o)}i.addConstructor(n,k);return o});h("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(j,i,l){var k={init:function(p){var m=this,o=this.getRuntime();function n(r){var s="";for(var q=0;q="))||(k.browser==="IE"&&k.verComp(k.version,10,">="))||(k.browser==="Safari"&&k.verComp(k.version,7,">="))}()),resize_image:function(){return m.Image&&p.can("access_binary")&&k.can("create_canvas")},report_upload_progress:false,return_response_headers:false,return_response_type:function(t){if(t==="json"&&!!window.JSON){return true}return !!~o.inArray(t,["text","document",""])},return_status_code:function(t){return !o.arrayDiff(t,[200,404])},select_file:function(){return k.can("use_fileinput")},select_multiple:false,send_binary_string:false,send_custom_headers:false,send_multipart:true,slice_blob:false,stream_upload:function(){return p.can("select_file")},summon_file_dialog:function(){return p.can("select_file")&&((k.browser==="Firefox"&&k.verComp(k.version,4,">="))||(k.browser==="Opera"&&k.verComp(k.version,12,">="))||(k.browser==="IE"&&k.verComp(k.version,10,">="))||!!~o.inArray(k.browser,["Chrome","Safari"]))},upload_filesize:r,use_http_method:function(t){return !o.arrayDiff(t,["GET","POST"])}});o.extend(this,{init:function(){this.trigger("Init")},destroy:(function(t){return function(){t.call(p);t=p=null}}(this.destroy))});o.extend(this.getShim(),m)}l.addConstructor(n,j);return m});h("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(n,k,p,m,j,l,i){function o(){var s,t=[],q;function r(){var w=this,z=w.getRuntime(),y,x,u,B,v,A;A=p.guid("uid_");y=z.getShimContainer();if(s){u=m.get(s+"_form");if(u){p.extend(u.style,{top:"100%"})}}B=document.createElement("form");B.setAttribute("id",A+"_form");B.setAttribute("method","post");B.setAttribute("enctype","multipart/form-data");B.setAttribute("encoding","multipart/form-data");p.extend(B.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"});v=document.createElement("input");v.setAttribute("id",A);v.setAttribute("type","file");v.setAttribute("name",q.name||"Filedata");v.setAttribute("accept",t.join(","));p.extend(v.style,{fontSize:"999px",opacity:0});B.appendChild(v);y.appendChild(B);p.extend(v.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});if(i.browser==="IE"&&i.verComp(i.version,10,"<")){p.extend(v.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"})}v.onchange=function(){var C;if(!this.value){return}if(this.files){C=this.files[0];if(C.size===0){B.parentNode.removeChild(B);return}}else{C={name:this.value}}C=new k(z.uid,C);this.onchange=function(){};r.call(w);w.files=[C];v.setAttribute("id",C.uid);B.setAttribute("id",C.uid+"_form");w.trigger("change");v=B=null};if(z.can("summon_file_dialog")){x=m.get(q.browse_button);j.removeEvent(x,"click",w.uid);j.addEvent(x,"click",function(C){if(v&&!v.disabled){v.click()}C.preventDefault()},w.uid)}s=A;y=u=x=null}p.extend(this,{init:function(x){var u=this,w=u.getRuntime(),v;q=x;t=x.accept.mimes||l.extList2mimes(x.accept,w.can("filter_by_extension"));v=w.getShimContainer();(function(){var y,A,z;y=m.get(x.browse_button);if(w.can("summon_file_dialog")){if(m.getStyle(y,"position")==="static"){y.style.position="relative"}A=parseInt(m.getStyle(y,"z-index"),10)||1;y.style.zIndex=A;v.style.zIndex=A-1}z=w.can("summon_file_dialog")?y:v;j.addEvent(z,"mouseover",function(){u.trigger("mouseenter")},u.uid);j.addEvent(z,"mouseout",function(){u.trigger("mouseleave")},u.uid);j.addEvent(z,"mousedown",function(){u.trigger("mousedown")},u.uid);j.addEvent(m.get(x.container),"mouseup",function(){u.trigger("mouseup")},u.uid);y=null}());r.call(this);v=null;u.trigger({type:"ready",async:true})},disable:function(v){var u;if((u=m.get(s))){u.disabled=!!v}},destroy:function(){var v=this.getRuntime(),w=v.getShim(),u=v.getShimContainer();j.removeAllEvents(u,this.uid);j.removeAllEvents(q&&m.get(q.container),this.uid);j.removeAllEvents(q&&m.get(q.browse_button),this.uid);if(u){u.innerHTML=""}w.removeInstance(this.uid);s=t=q=u=w=null}})}return(n.FileInput=o)});h("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(i,j){return(i.FileReader=j)});h("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(m,j,l,i,n,p,k,q){function o(){var t,r,u;function s(v){var A=this,y,z,w,x,B=false;if(!u){return}y=u.id.replace(/_iframe$/,"");z=l.get(y+"_form");if(z){w=z.getElementsByTagName("input");x=w.length;while(x--){switch(w[x].getAttribute("type")){case"hidden":w[x].parentNode.removeChild(w[x]);break;case"file":B=true;break}}w=[];if(!B){z.parentNode.removeChild(z)}z=null}setTimeout(function(){p.removeEvent(u,"load",A.uid);if(u.parentNode){u.parentNode.removeChild(u)}var C=A.getRuntime().getShimContainer();if(!C.children.length){C.parentNode.removeChild(C)}C=u=null;v()},1)}j.extend(this,{send:function(D,x){var z=this,C=z.getRuntime(),y,w,B,v;t=r=null;function A(){var E=C.getShimContainer()||document.body,F=document.createElement("div");F.innerHTML='';u=F.firstChild;E.appendChild(u);p.addEvent(u,"load",function(){var H;try{H=u.contentWindow.document||u.contentDocument||window.frames[u.id].document;if(/^4(0[0-9]|1[0-7]|2[2346])\s/.test(H.title)){t=H.title.replace(/^(\d+).*$/,"$1")}else{t=200;r=j.trim(H.body.innerHTML);z.trigger({type:"progress",loaded:r.length,total:r.length});if(v){z.trigger({type:"uploadprogress",loaded:v.size||1025,total:v.size||1025})}}}catch(G){if(i.hasSameOrigin(D.url)){t=404}else{s.call(z,function(){z.trigger("error")});return}}s.call(z,function(){z.trigger("load")})},z.uid)}if(x instanceof q&&x.hasBlob()){v=x.getBlob();y=v.uid;B=l.get(y);w=l.get(y+"_form");if(!w){throw new n.DOMException(n.DOMException.NOT_FOUND_ERR)}}else{y=j.guid("uid_");w=document.createElement("form");w.setAttribute("id",y+"_form");w.setAttribute("method",D.method);w.setAttribute("enctype","multipart/form-data");w.setAttribute("encoding","multipart/form-data");C.getShimContainer().appendChild(w)}w.setAttribute("target",y+"_iframe");if(x instanceof q){x.each(function(G,E){if(G instanceof k){if(B){B.setAttribute("name",E)}}else{var F=document.createElement("input");j.extend(F,{type:"hidden",name:E,value:G});if(B){w.insertBefore(F,B)}else{w.appendChild(F)}}})}w.setAttribute("action",D.url);A();w.submit();z.trigger("loadstart")},getStatus:function(){return t},getResponse:function(v){if("json"===v){if(j.typeOf(r)==="string"&&!!window.JSON){try{return JSON.parse(r.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(w){return null}}}else{if("document"===v){}}return r},abort:function(){var v=this;if(u&&u.contentWindow){if(u.contentWindow.stop){u.contentWindow.stop()}else{if(u.contentWindow.document.execCommand){u.contentWindow.document.execCommand("Stop")}else{u.src="about:blank"}}}s.call(this,function(){v.dispatchEvent("abort")})}})}return(m.XMLHttpRequest=o)});h("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(j,i){return(j.Image=i)});a(["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/FileInput","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"])})(this);(function(a){var d={},c=a.moxie.core.utils.Basic.inArray;(function b(f){var e,g;for(e in f){g=typeof(f[e]);if(g==="object"&&!~c(e,["Exceptions","Env","Mime"])){b(f[e])}else{if(g==="function"){d[e]=f[e]}}}})(a.moxie);d.Env=a.moxie.core.utils.Env;d.Mime=a.moxie.core.utils.Mime;d.Exceptions=a.moxie.core.Exceptions;a.mOxie=d;if(!a.o){a.o=d}return d})(this); \ No newline at end of file diff --git a/static/admin/pagedown-extra.js b/static/admin/pagedown-extra.js new file mode 100644 index 0000000..7d09419 --- /dev/null +++ b/static/admin/pagedown-extra.js @@ -0,0 +1 @@ +(function(){var a=new RegExp(["^(<\\/?(a|abbr|acronym|applet|area|b|basefont|","bdo|big|button|cite|code|del|dfn|em|figcaption|","font|i|iframe|img|input|ins|kbd|label|map|","mark|meter|object|param|progress|q|ruby|rp|rt|s|","samp|script|select|small|span|strike|strong|","sub|sup|textarea|time|tt|u|var|wbr)[^>]*>|","<(br)\\s?\\/?>)$"].join(""),"i");if(!Array.indexOf){Array.prototype.indexOf=function(v){for(var u=0;u]*>?/gi,function(w){return w.match(v)?w:""})}function b(u,B){var A={};for(var z=0;z~X"+(this.hashBlocks.push(u)-1)+"X

    \n"};Markdown.Extra.prototype.hashExtraInline=function(u){return"~X"+(this.hashBlocks.push(u)-1)+"X"};Markdown.Extra.prototype.unHashExtraBlocks=function(w){var v=this;function u(){var x=false;w=w.replace(/(?:

    )?~X(\d+)X(?:<\/p>)?/g,function(y,z){x=true;var A=parseInt(z,10);return v.hashBlocks[A]});if(x===true){u()}}u();return w};Markdown.Extra.prototype.wrapHeaders=function(v){function u(w){return"\n"+w+"\n"}v=v.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm,u);v=v.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm,u);v=v.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm,u);return v};var e="\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}";var o=new RegExp("^(#{1,6}.*#{0,6})[ \\t]+"+e+"[ \\t]*(?:\\n|0x03)","gm");var n=new RegExp("^(.*)[ \\t]+"+e+"[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))","gm");var f=new RegExp("^(```[ \\t]*[^{\\s]*)[ \\t]+"+e+"[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))","gm");Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(w){var v=this;function u(y,z,x){return"

    ~XX"+(v.hashBlocks.push(x)-1)+"XX

    \n"+z+"\n"}w=w.replace(o,u);w=w.replace(n,u);return w};Markdown.Extra.prototype.hashFcbAttributeBlocks=function(w){var v=this;function u(y,z,x){return"

    ~XX"+(v.hashBlocks.push(x)-1)+"XX

    \n"+z+"\n"}return w.replace(f,u)};Markdown.Extra.prototype.applyAttributeBlocks=function(w){var u=this;var v=new RegExp('

    ~XX(\\d+)XX

    [\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?))',"gm");w=w.replace(v,function(F,B,I,H,y){if(!I){return""}var G=parseInt(B,10);var C=u.hashBlocks[G];var x=C.match(/#[^\s#.]+/g)||[];var E=x[0]?' id="'+x[0].substr(1,x[0].length-1)+'"':"";var z=C.match(/\.[^\s#.]+/g)||[];for(var D=0;D0){A=' class="'+z.join(" ")+'"'}return"<"+I+E+A+y});return w};Markdown.Extra.prototype.tables=function(y){var v=this;var u=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");var w=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");y=y.replace(u,x);y=y.replace(w,x);function x(I,P,E,K,F,z){P=P.replace(/^ *[|]/m,"");E=E.replace(/^ *[|]/m,"");K=K.replace(/^ *[|]/gm,"");P=P.replace(/[|] *$/m,"");E=E.replace(/[|] *$/m,"");K=K.replace(/[|] *$/gm,"");alignspecs=E.split(/ *[|] */);align=[];for(var Q=0;Q\n","\n","\n"].join("");for(Q=0;Q",A,"\n"].join("")}L+="\n\n";var J=K.split("\n");for(Q=0;Q\n";for(O=0;O",B,"\n"].join("")}L+="\n"}L+="\n";return v.hashExtraBlock(L)}return y};Markdown.Extra.prototype.stripFootnoteDefinitions=function(v){var u=this;v=v.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g,function(w,y,x){y=i(y);x+="\n";x=x.replace(/^[ ]{0,3}/g,"");u.footnotes[y]=x;return"\n"});return v};Markdown.Extra.prototype.doFootnotes=function(v){var u=this;if(u.isConvertingFootnote===true){return v}var w=0;v=v.replace(/\[\^(.+?)\]/g,function(x,y){var B=i(y);var A=u.footnotes[B];if(A===undefined){return x}w++;u.usedFootnotes.push(B);var z=''+w+"";return u.hashExtraInline(z)});return v};Markdown.Extra.prototype.printFootnotes=function(x){var v=this;if(v.usedFootnotes.length===0){return x}x+='\n\n
    \n
    \n
      \n\n';for(var w=0;w'+u+' \n\n'}x+="
    \n
    ";return x};Markdown.Extra.prototype.fencedCodeBlocks=function(w){function v(x){x=x.replace(/&/g,"&");x=x.replace(//g,">");x=x.replace(/~D/g,"$$");x=x.replace(/~T/g,"~");return x}var u=this;w=w.replace(/(?:^|\n)```[ \t]*(\S*)[ \t]*\n([\s\S]*?)\n```[ \t]*(?=\n)/g,function(A,z,y){var E=z,D=y;var x=u.googleCodePrettify?' class="prettyprint"':"";var C="";if(E){if(u.googleCodePrettify||u.highlightJs){C=' class="language-'+E+'"'}else{C=' class="'+E+'"'}}var B=["",v(D),""].join("");return u.hashExtraBlock(B)});return w};Markdown.Extra.prototype.educatePants=function(y){var w=this;var v="";var x=0;y.replace(/(?:)|(<)([a-zA-Z1-6]+)([^\n]*?>)([\s\S]*?)(<\/\2>)/g,function(B,D,C,A,z,G,F){var E=y.substring(x,F);v+=w.applyPants(E);w.smartyPantsLastChar=v.substring(v.length-1);x=F+B.length;if(!D){v+=B;return}if(!/code|kbd|pre|script|noscript|iframe|math|ins|del|pre/i.test(C)){z=w.educatePants(z)}else{w.smartyPantsLastChar=z.substring(z.length-1)}v+=D+C+A+z+G});var u=y.substring(x);v+=w.applyPants(u);w.smartyPantsLastChar=v.substring(v.length-1);return v};function s(u,v){var w=v;w=w.replace(/&\#8220;/g,'"');w=w.replace(/&\#8221;/g,'"');w=w.replace(/&\#8216;/g,"'");w=w.replace(/&\#8217;/g,"'");w=w.replace(/&\#8212;/g,"---");w=w.replace(/&\#8211;/g,"--");w=w.replace(/&\#8230;/g,"...");return w}Markdown.Extra.prototype.applyPants=function(u){u=u.replace(/---/g,"—").replace(/--/g,"–");u=u.replace(/\.\.\./g,"…").replace(/\.\s\.\s\./g,"…");u=u.replace(/``/g,"“").replace(/''/g,"”");if(/^'$/.test(u)){if(/\S/.test(this.smartyPantsLastChar)){return"’"}return"‘"}if(/^"$/.test(u)){if(/\S/.test(this.smartyPantsLastChar)){return"”"}return"“"}u=u.replace(/^'(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/,"’");u=u.replace(/^"(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/,"”");u=u.replace(/"'(?=\w)/g,"“‘");u=u.replace(/'"(?=\w)/g,"‘“");u=u.replace(/'(?=\d{2}s)/g,"’");u=u.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)'(?=\w)/g,"$1‘");u=u.replace(/([^\s\[\{\(\-])'/g,"$1’");u=u.replace(/'(?=\s|s\b)/g,"’");u=u.replace(/'/g,"‘");u=u.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)"(?=\w)/g,"$1“");u=u.replace(/([^\s\[\{\(\-])"/g,"$1”");u=u.replace(/"(?=\s)/g,"”");u=u.replace(/"/ig,"“");return u};Markdown.Extra.prototype.runSmartyPants=function(u){this.smartyPantsLastChar="";u=this.educatePants(u);u=u.replace(/(<([a-zA-Z1-6]+)\b([^\n>]*?)(\/)?>)/g,s);return u};Markdown.Extra.prototype.definitionLists=function(w){var v=new RegExp(["(\\x02\\n?|\\n\\n)","(?:","(","(","[ ]{0,3}","((?:[ \\t]*\\S.*\\n)+)","\\n?","[ ]{0,3}:[ ]+",")","([\\s\\S]+?)","(","(?=\\0x03)","|","(?=","\\n{2,}","(?=\\S)","(?!","[ ]{0,3}","(?:\\S.*\\n)+?","\\n?","[ ]{0,3}:[ ]+",")","(?!","[ ]{0,3}:[ ]+",")",")",")",")",")"].join(""),"gm");var u=this;w=p(w);w=w.replace(v,function(y,A,z){var x=m(u.processDefListItems(z));x="
    \n"+x+"\n
    ";return A+u.hashExtraBlock(x)+"\n\n"});return k(w)};Markdown.Extra.prototype.processDefListItems=function(v){var w=this;var x=new RegExp(["(\\x02\\n?|\\n\\n+)","(","[ ]{0,3}","(?![:][ ]|[ ])","(?:\\S.*\\n)+?",")","(?=\\n?[ ]{0,3}:[ ])"].join(""),"gm");var u=new RegExp(["\\n(\\n+)?","(","[ ]{0,3}","[:][ ]+",")","([\\s\\S]+?)","(?=\\n*","(?:","\\n[ ]{0,3}[:][ ]|","
    |\\x03",")",")"].join(""),"gm");v=p(v);v=v.replace(/\n{2,}(?=\\x03)/,"\n");v=v.replace(x,function(y,D,B){var C=m(B).split("\n");var E="";for(var A=0;A"+z+"
    "}return E+"\n"});v=v.replace(u,function(y,B,z,A){if(B||A.match(/\n{2,}/)){A=Array(z.length+1).join(" ")+A;A=h(A)+"\n\n";A="\n"+j(A,w)+"\n"}else{A=c(A);A=t(h(A),w)}return"\n
    "+A+"
    \n"});return k(v)};Markdown.Extra.prototype.strikethrough=function(u){return u.replace(/([\W_]|^)~T~T(?=\S)([^\r]*?\S[\*_]*)~T~T([\W_]|$)/g,"$1$2$3")};Markdown.Extra.prototype.newlines=function(u){return u.replace(/(<(?:br|\/li)>)?\n/g,function(v,w){return w?v:"
    \n"})}})(); \ No newline at end of file diff --git a/static/admin/pagedown.js b/static/admin/pagedown.js index c004456..a6d6d6d 100644 --- a/static/admin/pagedown.js +++ b/static/admin/pagedown.js @@ -1 +1 @@ -var Markdown;if(typeof exports==="object"&&typeof require==="function"){Markdown=exports}else{Markdown={}}(function(){function c(e){return e}function d(e){return false}function b(){}b.prototype={chain:function(g,f){var e=this[g];if(!e){throw new Error("unknown hook "+g)}if(e===c){this[g]=f}else{this[g]=function(i){var h=Array.prototype.slice.call(arguments,0);h[0]=e.apply(null,h);return f.apply(null,h)}}},set:function(f,e){if(!this[f]){throw new Error("unknown hook "+f)}this[f]=e},addNoop:function(e){this[e]=c},addFalse:function(e){this[e]=d}};Markdown.HookCollection=b;function a(){}a.prototype={set:function(e,f){this["s_"+e]=f},get:function(e){return this["s_"+e]}}})();(function(){var a={},u={},m={},w=window.document,n=window.RegExp,g=window.navigator,q={lineLength:72},v={isIE:/msie/.test(g.userAgent.toLowerCase()),isIE_5or6:/msie 6/.test(g.userAgent.toLowerCase())||/msie 5/.test(g.userAgent.toLowerCase()),isOpera:/opera/.test(g.userAgent.toLowerCase())};var i={bold:"Strong Ctrl+B",boldexample:"strong text",italic:"Emphasis Ctrl+I",italicexample:"emphasized text",link:"Hyperlink Ctrl+L",linkdescription:"enter link description here",linkdialog:'

    Insert Hyperlink

    http://example.com/ "optional title"

    ',linkname:null,quote:"Blockquote
    Ctrl+Q",quoteexample:"Blockquote",code:"Code Sample
     Ctrl+K",codeexample:"enter code here",image:"Image  Ctrl+G",imagedescription:"enter image description here",imagedialog:"

    Insert Image

    http://example.com/images/diagram.jpg \"optional title\"
    Need
    free image hosting?

    ",imagename:null,olist:"Numbered List
      Ctrl+O",ulist:"Bulleted List
        Ctrl+U",litem:"List item",heading:"Heading

        /

        Ctrl+H",headingexample:"Heading",more:"More contents Ctrl+M",fullscreen:"FullScreen Ctrl+J",exitFullscreen:"Exit FullScreen Ctrl+E",fullscreenUnsupport:"Sorry, the browser dont support fullscreen api",hr:"Horizontal Rule
        Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redo - Ctrl+Shift+Z",ok:"OK",cancel:"Cancel",help:"Markdown Editing Help"};var c="http://";var d="http://";Markdown.Editor=function(B,D,A){A=A||{};if(typeof A.handler==="function"){A={helpButton:A}}A.strings=A.strings||{};if(A.helpButton){A.strings.help=A.strings.help||A.helpButton.title}var y=function(F){var E=A.strings[F]||i[F];if("imagename"==F||"linkname"==F){A.strings[F]=null}return E};D=D||"";var x=this.hooks=new Markdown.HookCollection();x.addNoop("onPreviewRefresh");x.addNoop("postBlockquoteCreation");x.addFalse("insertImageDialog");x.addFalse("insertLinkDialog");x.addNoop("makeButton");x.addNoop("enterFullScreen");x.addNoop("enterFakeFullScreen");x.addNoop("exitFullScreen");this.getConverter=function(){return B};var C=this,z;this.run=function(){if(z){return}z=new k(D);var G=new l(x,y);var E=new h(B,z,function(){x.onPreviewRefresh()});var H,F;if(!/\?noundo/.test(w.location.href)){H=new e(function(){E.refresh();if(F){F.setUndoRedoButtonStates()}},z);this.textOperation=function(J){H.setCommandMode();J();C.refreshPreview()}}fullScreenManager=new o(x,y);F=new t(D,z,x,H,E,G,fullScreenManager,A.helpButton,y);F.setUndoRedoButtonStates();var I=C.refreshPreview=function(){E.refresh(true)};I()}};function s(){}s.prototype.findTags=function(y,A){var x=this;var z;if(y){z=a.extendRegExp(y,"","$");this.before=this.before.replace(z,function(B){x.startTag=x.startTag+B;return""});z=a.extendRegExp(y,"^","");this.selection=this.selection.replace(z,function(B){x.startTag=x.startTag+B;return""})}if(A){z=a.extendRegExp(A,"","$");this.selection=this.selection.replace(z,function(B){x.endTag=B+x.endTag;return""});z=a.extendRegExp(A,"^","");this.after=this.after.replace(z,function(B){x.endTag=B+x.endTag;return""})}};s.prototype.trimWhitespace=function(y){var x,A,z=this;if(y){x=A=""}else{x=function(B){z.before+=B;return""};A=function(B){z.after=B+z.after;return""}}this.selection=this.selection.replace(/^(\s*)/,x).replace(/(\s*)$/,A)};s.prototype.skipLines=function(z,y,x){if(z===undefined){z=1}if(y===undefined){y=1}z++;y++;var A;var B;if(navigator.userAgent.match(/Chrome/)){"X".match(/()./)}this.selection=this.selection.replace(/(^\n*)/,"");this.startTag=this.startTag+n.$1;this.selection=this.selection.replace(/(\n*$)/,"");this.endTag=this.endTag+n.$1;this.startTag=this.startTag.replace(/(^\n*)/,"");this.before=this.before+n.$1;this.endTag=this.endTag.replace(/(\n*$)/,"");this.after=this.after+n.$1;if(this.before){A=B="";while(z--){A+="\\n?";B+="\n"}if(x){A="\\n*"}this.before=this.before.replace(new n(A+"$",""),B)}if(this.after){A=B="";while(y--){A+="\\n?";B+="\n"}if(x){A="\\n*"}this.after=this.after.replace(new n(A,""),B)}};function k(x){this.buttonBar=w.getElementById("wmd-button-bar"+x);this.preview=w.getElementById("wmd-preview"+x);this.input=w.getElementById("text")}a.isVisible=function(x){if(window.getComputedStyle){return window.getComputedStyle(x,null).getPropertyValue("display")!=="none"}else{if(x.currentStyle){return x.currentStyle.display!=="none"}}};a.addEvent=function(y,x,z){if(y.attachEvent){y.attachEvent("on"+x,z)}else{y.addEventListener(x,z,false)}};a.removeEvent=function(y,x,z){if(y.detachEvent){y.detachEvent("on"+x,z)}else{y.removeEventListener(x,z,false)}};a.fixEolChars=function(x){x=x.replace(/\r\n/g,"\n");x=x.replace(/\r/g,"\n");return x};a.extendRegExp=function(z,B,y){if(B===null||B===undefined){B=""}if(y===null||y===undefined){y=""}var A=z.toString();var x;A=A.replace(/\/([gim]*)$/,function(C,D){x=D;return""});A=A.replace(/(^\/|\/$)/g,"");A=B+A+y;return new n(A,x)};u.getTop=function(z,y){var x=z.offsetTop;if(!y){while(z=z.offsetParent){x+=z.offsetTop}}return x};u.getHeight=function(x){return x.offsetHeight||x.scrollHeight};u.getWidth=function(x){return x.offsetWidth||x.scrollWidth};u.getPageSize=function(){var y,z;var x,C;if(self.innerHeight&&self.scrollMaxY){y=w.body.scrollWidth;z=self.innerHeight+self.scrollMaxY}else{if(w.body.scrollHeight>w.body.offsetHeight){y=w.body.scrollWidth;z=w.body.scrollHeight}else{y=w.body.offsetWidth;z=w.body.offsetHeight}}if(self.innerHeight){x=self.innerWidth;C=self.innerHeight}else{if(w.documentElement&&w.documentElement.clientHeight){x=w.documentElement.clientWidth;C=w.documentElement.clientHeight}else{if(w.body){x=w.body.clientWidth;C=w.body.clientHeight}}}var B=Math.max(y,x);var A=Math.max(z,C);return[B,A,x,C]};function e(J,G){var M=this;var H=[];var E=0;var D="none";var y;var z;var C;var x=function(O,N){if(D!=O){D=O;if(!N){A()}}if(!v.isIE||D!="moving"){z=setTimeout(F,1)}else{C=null}};var F=function(N){C=new b(G,N);z=undefined};this.setCommandMode=function(){D="command";A();z=setTimeout(F,0)};this.canUndo=function(){return E>1};this.canRedo=function(){if(H[E+1]){return true}return false};this.undo=function(){if(M.canUndo()){if(y){y.restore();y=null}else{H[E]=new b(G);H[--E].restore();if(J){J()}}}D="none";G.input.focus();F()};this.redo=function(){if(M.canRedo()){H[++E].restore();if(J){J()}}D="none";G.input.focus();F()};var A=function(){var N=C||new b(G);if(!N){return false}if(D=="moving"){if(!y){y=N}return}if(y){if(H[E-1].text!=y.text){H[E++]=y}y=null}H[E++]=N;H[E+1]=null;if(J){J()}};var I=function(N){var P=false;if((N.ctrlKey||N.metaKey)&&!N.altKey){var O=N.charCode||N.keyCode;var Q=String.fromCharCode(O);switch(Q.toLowerCase()){case"y":M.redo();P=true;break;case"z":if(!N.shiftKey){M.undo()}else{M.redo()}P=true;break}}if(P){if(N.preventDefault){N.preventDefault()}if(window.event){window.event.returnValue=false}return}};var L=function(N){if(!N.ctrlKey&&!N.metaKey){var O=N.keyCode;if((O>=33&&O<=40)||(O>=63232&&O<=63235)){x("moving")}else{if(O==8||O==46||O==127){x("deleting")}else{if(O==13){x("newlines")}else{if(O==27){x("escape")}else{if((O<16||O>20)&&O!=91){x("typing")}}}}}}};var B=function(){a.addEvent(G.input,"keypress",function(O){if((O.ctrlKey||O.metaKey)&&!O.altKey&&(O.keyCode==89||O.keyCode==90)){O.preventDefault()}});var N=function(){if(v.isIE||(C&&C.text!=G.input.value)){if(z==undefined){D="paste";A();F()}}};a.addEvent(G.input,"keydown",I);a.addEvent(G.input,"keydown",L);a.addEvent(G.input,"mousedown",function(){x("moving")});G.input.onpaste=N;G.input.ondrop=N};var K=function(){B();F(true);A()};K()}function b(y,A){var x=this;var z=y.input;this.init=function(){if(!a.isVisible(z)){return}if(!A&&w.activeElement&&w.activeElement!==z){return}this.setInputAreaSelectionStartEnd();this.scrollTop=z.scrollTop;if(!this.text&&z.selectionStart||z.selectionStart===0){this.text=z.value}};this.setInputAreaSelection=function(){if(!a.isVisible(z)){return}if(z.selectionStart!==undefined&&!v.isOpera){z.focus();z.selectionStart=x.start;z.selectionEnd=x.end;z.scrollTop=x.scrollTop}else{if(w.selection){if(w.activeElement&&w.activeElement!==z){return}z.focus();var B=z.createTextRange();B.moveStart("character",-z.value.length);B.moveEnd("character",-z.value.length);B.moveEnd("character",x.end);B.moveStart("character",x.start);B.select()}}};this.setInputAreaSelectionStartEnd=function(){if(!y.ieCachedRange&&(z.selectionStart||z.selectionStart===0)){x.start=z.selectionStart;x.end=z.selectionEnd}else{if(w.selection){x.text=a.fixEolChars(z.value);var E=y.ieCachedRange||w.selection.createRange();var F=a.fixEolChars(E.text);var D="\x07";var C=D+F+D;E.text=C;var G=a.fixEolChars(z.value);E.moveStart("character",-C.length);E.text=F;x.start=G.indexOf(D);x.end=G.lastIndexOf(D)-D.length;var B=x.text.length-a.fixEolChars(z.value).length;if(B){E.moveStart("character",-F.length);while(B--){F+="\n";x.end+=1}E.text=F}if(y.ieCachedRange){x.scrollTop=y.ieCachedScrollTop}y.ieCachedRange=null;this.setInputAreaSelection()}}};this.restore=function(){if(x.text!=undefined&&x.text!=z.value){z.value=x.text}this.setInputAreaSelection();z.scrollTop=x.scrollTop};this.getChunks=function(){var B=new s();B.before=a.fixEolChars(x.text.substring(0,x.start));B.startTag="";B.selection=a.fixEolChars(x.text.substring(x.start,x.end));B.endTag="";B.after=a.fixEolChars(x.text.substring(x.end));B.scrollTop=x.scrollTop;return B};this.setChunks=function(B){B.before=B.before+B.startTag;B.after=B.endTag+B.after;this.start=B.before.length;this.end=B.before.length+B.selection.length;this.text=B.before+B.selection+B.after;this.scrollTop=B.scrollTop};this.init()}function h(R,A,L){var y=this;var F;var E;var O;var z=3000;var G="delayed";var C=function(T,U){a.addEvent(T,"input",U);T.onpaste=U;T.ondrop=U;a.addEvent(T,"keypress",U);a.addEvent(T,"keydown",U)};var K=function(){var T=0;if(window.innerHeight){T=window.pageYOffset}else{if(w.documentElement&&w.documentElement.scrollTop){T=w.documentElement.scrollTop}else{if(w.body){T=w.body.scrollTop}}}return T};var D=function(){if(!A.preview){return}var V=A.input.value;if(V&&V==O){return}else{O=V}var U=new Date().getTime();V=R.makeHtml(V);var T=new Date().getTime();E=T-U;x(V)};var Q=function(){if(F){clearTimeout(F);F=undefined}if(G!=="manual"){var T=0;if(G==="delayed"){T=E}if(T>z){T=z}F=setTimeout(D,T)}};var B=function(T){if(T.scrollHeight<=T.clientHeight){return 1}return T.scrollTop/(T.scrollHeight-T.clientHeight)};var S=function(){if(A.preview){A.preview.scrollTop=(A.preview.scrollHeight-A.preview.clientHeight)*B(A.preview)}};this.refresh=function(T){if(T){O="";D()}else{Q()}};this.processingTime=function(){return E};var H=true;var I=function(W){var V=A.preview;var U=V.parentNode;var T=V.nextSibling;U.removeChild(V);V.innerHTML=W;if(!T){U.appendChild(V)}else{U.insertBefore(V,T)}};var N=function(T){A.preview.innerHTML=T};var J;var M=function(U){if(J){return J(U)}try{N(U);J=N}catch(T){J=I;J(U)}};var x=function(V){var T=u.getTop(A.input)-K();if(A.preview){M(V);L()}S();if(H){H=false;return}var U=u.getTop(A.input)-K();if(v.isIE){setTimeout(function(){window.scrollBy(0,U-T)},0)}else{window.scrollBy(0,U-T)}};var P=function(){C(A.input,Q);D();if(A.preview){A.preview.scrollTop=0}};P()}m.createBackground=function(){var y=w.createElement("div"),z=y.style;y.className="wmd-prompt-background";z.position="absolute";z.top="0";z.zIndex="1000";if(v.isIE){z.filter="alpha(opacity=50)"}else{z.opacity="0.5"}var x=u.getPageSize();z.height=x[1]+"px";if(v.isIE){z.left=w.documentElement.scrollLeft;z.width=w.documentElement.clientWidth}else{z.left="0";z.width="100%"}w.body.appendChild(y);return y};m.dialog=function(A,E,z,B){var y;var D=function(F){var G=(F.charCode||F.keyCode);if(G===27){C(true)}};var C=function(F){a.removeEvent(w.body,"keydown",D);y.parentNode.removeChild(y);E(F);return false};var x=function(){y=w.createElement("div");y.className="wmd-prompt-dialog";y.setAttribute("role","dialog");var F=w.createElement("div");var H=w.createElement("form"),G=H.style;H.onsubmit=function(){return C(false)};y.appendChild(H);H.appendChild(F);if("function"==typeof(A)){A.call(this,F)}else{F.innerHTML=A}var J=w.createElement("button");J.type="button";J.className="btn btn-s primary";J.onclick=function(){return C(false)};J.innerHTML=z;var I=w.createElement("button");I.type="button";I.className="btn btn-s";I.onclick=function(){return C(true)};I.innerHTML=B;H.appendChild(J);H.appendChild(I);a.addEvent(w.body,"keydown",D);w.body.appendChild(y)};setTimeout(function(){x()},0)};m.prompt=function(C,G,A,y,E){var x;var z;if(G===undefined){G=""}var B=function(H){var I=(H.charCode||H.keyCode);if(I===27){D(true)}};var D=function(H){a.removeEvent(w.body,"keydown",B);var I=z.value;if(H){I=null}else{I=I.replace(/^http:\/\/(https?|ftp):\/\//,"$1://");if(!/^(?:https?|ftp):\/\//.test(I)){I="http://"+I}}x.parentNode.removeChild(x);A(I);return false};var F=function(){x=w.createElement("div");x.className="wmd-prompt-dialog";x.setAttribute("role","dialog");var H=w.createElement("div");H.innerHTML=C;x.appendChild(H);var J=w.createElement("form"),I=J.style;J.onsubmit=function(){return D(false)};x.appendChild(J);z=w.createElement("input");z.type="text";z.value=G;J.appendChild(z);var L=w.createElement("button");L.type="button";L.className="btn btn-s primary";L.onclick=function(){return D(false)};L.innerHTML=y;var K=w.createElement("button");K.type="button";K.className="btn btn-s";K.onclick=function(){return D(true)};K.innerHTML=E;J.appendChild(L);J.appendChild(K);a.addEvent(w.body,"keydown",B);w.body.appendChild(x)};setTimeout(function(){F();var I=G.length;if(z.selectionStart!==undefined){z.selectionStart=0;z.selectionEnd=I}else{if(z.createTextRange){var H=z.createTextRange();H.collapse(false);H.moveStart("character",-I);H.moveEnd("character",I);H.select()}}z.focus()},0)};function t(K,E,L,N,A,J,I,D,y){var C=E.input,G={};B();var F="keydown";if(v.isOpera){F="keypress"}a.addEvent(C,F,function(P){if((P.ctrlKey||P.metaKey)&&!P.altKey&&!P.shiftKey){var R=P.charCode||P.keyCode;var O=String.fromCharCode(R).toLowerCase();switch(O){case"b":M(G.bold);break;case"i":M(G.italic);break;case"l":M(G.link);break;case"q":M(G.quote);break;case"k":M(G.code);break;case"g":M(G.image);break;case"o":M(G.olist);break;case"u":M(G.ulist);break;case"m":M(G.more);break;case"j":M(G.fullscreen);break;case"e":M(G.exitFullscreen);break;case"h":M(G.heading);break;case"r":M(G.hr);break;case"y":M(G.redo);break;case"z":if(P.shiftKey){M(G.redo)}else{M(G.undo)}break;default:return}if(P.preventDefault){P.preventDefault()}if(window.event){window.event.returnValue=false}}else{if(P.keyCode==9){var Q={};Q.textOp=z("doTab");M(Q);if(P.preventDefault){P.preventDefault()}if(window.event){window.event.returnValue=false}}}});a.addEvent(C,"keyup",function(P){if(P.shiftKey&&!P.ctrlKey&&!P.metaKey){var Q=P.charCode||P.keyCode;if(Q===13){var O={};O.textOp=z("doAutoindent");M(O)}}});if(v.isIE){a.addEvent(C,"keydown",function(O){var P=O.keyCode;if(P===27){return false}})}function M(P){C.focus();if(P.textOp){if(N){N.setCommandMode()}var R=new b(E);if(!R){return}var S=R.getChunks();var O=function(){C.focus();if(S){R.setChunks(S)}R.restore();A.refresh()};var Q=P.textOp(S,O);if(!Q){O()}}if(P.execute){P.execute(N)}}function x(O,Q){var R="0px";var T="-20px";var P="-40px";var S=O.getElementsByTagName("span")[0];if(Q){S.style.backgroundPosition=O.XShift+" "+R;O.onmouseover=function(){S.style.backgroundPosition=this.XShift+" "+P};O.onmouseout=function(){S.style.backgroundPosition=this.XShift+" "+R};if(v.isIE){O.onmousedown=function(){if(w.activeElement&&w.activeElement!==E.input){return}E.ieCachedRange=document.selection.createRange();E.ieCachedScrollTop=E.input.scrollTop}}if(!O.isHelp){O.onclick=function(){if(this.onmouseout){this.onmouseout()}M(this);return false}}}else{S.style.backgroundPosition=O.XShift+" "+T;O.onmouseover=O.onmouseout=O.onclick=function(){}}}function z(O){if(typeof O==="string"){O=J[O]}return function(){O.apply(J,arguments)}}function B(){var S=E.buttonBar;var W="0px";var R="-20px";var U="-40px";var V=document.createElement("ul");V.id="wmd-button-row"+K;V.className="wmd-button-row";V=S.appendChild(V);var O=0;var X=function(ae,ac,ab,ad){var aa=document.createElement("li");aa.className="wmd-button";aa.style.left=O+"px";O+=25;var Z=document.createElement("span");aa.id=ae+K;aa.appendChild(Z);aa.title=ac;aa.XShift=ab;if(ad){aa.textOp=ad}x(aa,true);V.appendChild(aa);return aa};var Q=function(aa){var Z=document.createElement("li");Z.className="wmd-spacer wmd-spacer"+aa;Z.id="wmd-spacer"+aa+K;V.appendChild(Z);O+=25};G.bold=X("wmd-bold-button",y("bold"),"0px",z("doBold"));G.italic=X("wmd-italic-button",y("italic"),"-20px",z("doItalic"));Q(1);G.link=X("wmd-link-button",y("link"),"-40px",z(function(Z,aa){return this.doLinkOrImage(Z,aa,false)}));G.quote=X("wmd-quote-button",y("quote"),"-60px",z("doBlockquote"));G.code=X("wmd-code-button",y("code"),"-80px",z("doCode"));G.image=X("wmd-image-button",y("image"),"-100px",z(function(Z,aa){return this.doLinkOrImage(Z,aa,true)}));Q(2);G.olist=X("wmd-olist-button",y("olist"),"-120px",z(function(Z,aa){this.doList(Z,aa,true)}));G.ulist=X("wmd-ulist-button",y("ulist"),"-140px",z(function(Z,aa){this.doList(Z,aa,false)}));G.heading=X("wmd-heading-button",y("heading"),"-160px",z("doHeading"));G.hr=X("wmd-hr-button",y("hr"),"-180px",z("doHorizontalRule"));G.more=X("wmd-more-button",y("more"),"-280px",z("doMore"));Q(3);G.undo=X("wmd-undo-button",y("undo"),"-200px",null);G.undo.execute=function(Z){if(Z){Z.undo()}};var Y=/win/.test(g.platform.toLowerCase())?y("redo"):y("redomac");G.redo=X("wmd-redo-button",Y,"-220px",null);G.redo.execute=function(Z){if(Z){Z.redo()}};Q(4);G.fullscreen=X("wmd-fullscreen-button",y("fullscreen"),"-240px",null);G.fullscreen.execute=function(){I.doFullScreen(G,true)};G.exitFullscreen=X("wmd-exit-fullscreen-button",y("exitFullscreen"),"-260px",null);G.exitFullscreen.style.display="none";G.exitFullscreen.execute=function(){I.doFullScreen(G,false)};L.makeButton(G,X,z,m);if(D){var T=document.createElement("li");var P=document.createElement("span");T.appendChild(P);T.className="wmd-button wmd-help-button";T.id="wmd-help-button"+K;T.XShift="-300px";T.isHelp=true;T.style.right="0px";T.title=y("help");T.onclick=D.handler;x(T,true);V.appendChild(T);G.help=T}H()}function H(){if(N){x(G.undo,N.canUndo());x(G.redo,N.canRedo())}}this.setUndoRedoButtonStates=H}function l(y,x){this.hooks=y;this.getString=x}var f=l.prototype;f.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)";f.unwrap=function(y){var x=new n("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");y.selection=y.selection.replace(x,"$1 $2")};f.wrap=function(y,x){this.unwrap(y);var A=new n("(.{1,"+x+"})( +|$\\n?)","gm"),z=this;y.selection=y.selection.replace(A,function(B,C){if(new n("^"+z.prefixes,"").test(B)){return B}return C+"\n"});y.selection=y.selection.replace(/\s+$/,"")};f.doBold=function(x,y){return this.doBorI(x,y,2,this.getString("boldexample"))};f.doItalic=function(x,y){return this.doBorI(x,y,1,this.getString("italicexample"))};f.doBorI=function(D,B,C,x){D.trimWhitespace();D.selection=D.selection.replace(/\n{2,}/g,"\n");var A=/(\**$)/.exec(D.before)[0];var y=/(^\**)/.exec(D.after)[0];var E=Math.min(A.length,y.length);if((E>=C)&&(E!=2||C!=1)){D.before=D.before.replace(n("[*]{"+C+"}$",""),"");D.after=D.after.replace(n("^[*]{"+C+"}",""),"")}else{if(!D.selection&&y){D.after=D.after.replace(/^([*_]*)/,"");D.before=D.before.replace(/(\s?)$/,"");var z=n.$1;D.before=D.before+y+z}else{if(!D.selection&&!y){D.selection=x}var F=C<=1?"*":"**";D.before=D.before+F;D.after=F+D.after}}return};f.stripLinkDefs=function(y,x){y=y.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(C,D,z,A,B){x[D]=C.replace(/\s*$/,"");if(A){x[D]=C.replace(/["(](.+?)[")]$/,"");return A+B}return""});return y};f.addLinkDef=function(E,A){var x=0;var z={};E.before=this.stripLinkDefs(E.before,z);E.selection=this.stripLinkDefs(E.selection,z);E.after=this.stripLinkDefs(E.after,z);var y="";var D=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g;var C=function(G){x++;G=G.replace(/^[ ]{0,3}\[(\d+)\]:/," ["+x+"]:");y+="\n"+G};var B=function(H,K,I,J,L,G){I=I.replace(D,B);if(z[L]){C(z[L]);return K+I+J+x+G}return H};E.before=E.before.replace(D,B);if(A){C(A)}else{E.selection=E.selection.replace(D,B)}var F=x;E.after=E.after.replace(D,B);if(E.after){E.after=E.after.replace(/\n*$/,"")}if(!E.after){E.selection=E.selection.replace(/\n*$/,"")}E.after+="\n\n"+y;return F};function p(x){return x.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,function(z,y,B){var A=false;y=y.replace(/%(?:[\da-fA-F]{2})|\?|\+|[^\w\d-./]/g,function(C){if(C.length===3&&C.charAt(0)=="%"){return C.toUpperCase()}switch(C){case"?":A=true;return"?";break;case"+":if(A){return"%20"}break}return encodeURI(C)});if(B){B=B.trim?B.trim():B.replace(/^\s*/,"").replace(/\s*$/,"");B=B.replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")}return B?y+' "'+B+'"':y})}f.doLinkOrImage=function(x,z,C){x.trimWhitespace();x.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var y;if(x.endTag.length>1&&x.startTag.length>0){x.startTag=x.startTag.replace(/!?\[/,"");x.endTag="";this.addLinkDef(x,null)}else{x.selection=x.startTag+x.selection+x.endTag;x.startTag=x.endTag="";if(/\n\n/.test(x.selection)){this.addLinkDef(x,null);return}var A=this;var B=function(G){y.parentNode.removeChild(y);if(G!==null){x.selection=(" "+x.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1);var F=" [999]: "+p(G);var E=A.addLinkDef(x,F);x.startTag=C?"![":"[";x.endTag="]["+E+"]";if(!x.selection){if(C){var H=A.getString("imagename");x.selection=H||A.getString("imagedescription")}else{var D=A.getString("linkname");x.selection=D||A.getString("linkdescription")}}}z()};y=m.createBackground();if(C){if(!this.hooks.insertImageDialog(B)){m.prompt(this.getString("imagedialog"),c,B,this.getString("ok"),this.getString("cancel"))}}else{if(!this.hooks.insertLinkDialog(B)){m.prompt(this.getString("linkdialog"),d,B,this.getString("ok"),this.getString("cancel"))}}return true}};f.doAutoindent=function(z,A){var y=this,x=false;z.before=z.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n");z.before=z.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n");z.before=z.before.replace(/(\n|^)[ \t]+\n$/,"\n\n");if(!z.selection&&!/^[ \t]*(?:\n|$)/.test(z.after)){z.after=z.after.replace(/^[^\n]*/,function(B){z.selection=B;return""});x=true}if(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(z.before)){if(y.doList){y.doList(z)}}if(/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(z.before)){if(y.doBlockquote){y.doBlockquote(z)}}if(/(\n|^)(\t|[ ]{4,}).*\n$/.test(z.before)){if(y.doCode){y.doCode(z)}}if(x){z.after=z.selection+z.after;z.selection=""}};f.doBlockquote=function(E,z){E.selection=E.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(K,J,I,H){E.before+=J;E.after=H+E.after;return I});E.before=E.before.replace(/(>[ \t]*)$/,function(I,H){E.selection=H+E.selection;return""});E.selection=E.selection.replace(/^(\s|>)+$/,"");E.selection=E.selection||this.getString("quoteexample");var D="",C="",F;if(E.before){var G=E.before.replace(/\n$/,"").split("\n");var B=false;for(var A=0;A0;if(/^>/.test(F)){y=true;if(!B&&F.length>1){B=true}}else{if(/^[ \t]*$/.test(F)){y=true}else{y=B}}if(y){D+=F+"\n"}else{C+=D+F;D="\n"}}if(!/(^|\n)>/.test(D)){C+=D;D=""}}E.startTag=D;E.before=C;if(E.after){E.after=E.after.replace(/^\n?/,"\n")}E.after=E.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(H){E.endTag=H;return""});var x=function(I){var H=I?"> ":"";if(E.startTag){E.startTag=E.startTag.replace(/\n((>|\s)*)\n$/,function(K,J){return"\n"+J.replace(/^[ ]{0,3}>?[ \t]*$/gm,H)+"\n"})}if(E.endTag){E.endTag=E.endTag.replace(/^\n((>|\s)*)\n/,function(K,J){return"\n"+J.replace(/^[ ]{0,3}>?[ \t]*$/gm,H)+"\n"})}};if(/^(?![ ]{0,3}>)/m.test(E.selection)){this.wrap(E,q.lineLength-2);E.selection=E.selection.replace(/^/gm,"> ");x(true);E.skipLines()}else{E.selection=E.selection.replace(/^[ ]{0,3}> ?/gm,"");this.unwrap(E);x(false);if(!/^(\n|^)[ ]{0,3}>/.test(E.selection)&&E.startTag){E.startTag=E.startTag.replace(/\n{0,2}$/,"\n\n")}if(!/(\n|^)[ ]{0,3}>.*$/.test(E.selection)&&E.endTag){E.endTag=E.endTag.replace(/^\n{0,2}/,"\n\n")}}E.selection=this.hooks.postBlockquoteCreation(E.selection);if(!/\n/.test(E.selection)){E.selection=E.selection.replace(/^(> *)/,function(H,I){E.startTag+=I;return""})}};f.doCode=function(x,y){var A=/\S[ ]*$/.test(x.before);var C=/^[ ]*\S/.test(x.after);if((!C&&!A)||/\n/.test(x.selection)){x.before=x.before.replace(/[ ]{4}$/,function(D){x.selection=D+x.selection;return""});var B=1;var z=1;if(/(\n|^)(\t|[ ]{4,}).*\n$/.test(x.before)){B=0}if(/^\n(\t|[ ]{4,})/.test(x.after)){z=0}x.skipLines(B,z);if(!x.selection){x.startTag=" ";x.selection=this.getString("codeexample")}else{if(/^[ ]{0,3}\S/m.test(x.selection)){if(/\n/.test(x.selection)){x.selection=x.selection.replace(/^/gm," ")}else{x.before+=" "}}else{x.selection=x.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,"")}}}else{x.trimWhitespace();x.findTags(/`/,/`/);if(!x.startTag&&!x.endTag){x.startTag=x.endTag="`";if(!x.selection){x.selection=this.getString("codeexample")}}else{if(x.endTag&&!x.startTag){x.before+=x.endTag;x.endTag=""}else{x.startTag=x.endTag=""}}}};f.doList=function(I,B,A){var K=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/;var J=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/;var x="-";var F=1;var D=function(){var L;if(A){L=" "+F+". ";F++}else{L=" "+x+" "}return L};var E=function(L){if(A===undefined){A=/^\s*\d/.test(L)}L=L.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(M){return D()});return L};I.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null);if(I.before&&!/\n$/.test(I.before)&&!/^\n/.test(I.startTag)){I.before+=I.startTag;I.startTag=""}if(I.startTag){var z=/\d+[.]/.test(I.startTag);I.startTag="";I.selection=I.selection.replace(/\n[ ]{4}/g,"\n");this.unwrap(I);I.skipLines();if(z){I.after=I.after.replace(J,E)}if(A==z){return}}var C=1;I.before=I.before.replace(K,function(L){if(/^\s*([*+-])/.test(L)){x=n.$1}C=/[^\n]\n\n[^\n]/.test(L)?1:0;return E(L)});if(!I.selection){I.selection=this.getString("litem")}var G=D();var y=1;I.after=I.after.replace(J,function(L){y=/[^\n]\n\n[^\n]/.test(L)?1:0;return E(L)});I.trimWhitespace(true);I.skipLines(C,y,true);I.startTag=G;var H=G.replace(/./g," ");this.wrap(I,q.lineLength-H.length);I.selection=I.selection.replace(/\n/g,"\n"+H)};f.doHeading=function(z,A){z.selection=z.selection.replace(/\s+/g," ");z.selection=z.selection.replace(/(^\s+|\s+$)/g,"");if(!z.selection){z.startTag="## ";z.selection=this.getString("headingexample");z.endTag=" ##";return}var B=0;z.findTags(/#+[ ]*/,/[ ]*#+/);if(/#+/.test(z.startTag)){B=n.lastMatch.length}z.startTag=z.endTag="";z.findTags(null,/\s?(-+|=+)/);if(/=+/.test(z.endTag)){B=1}if(/-+/.test(z.endTag)){B=2}z.startTag=z.endTag="";z.skipLines(1,1);var C=B==0?2:B-1;if(C>0){var y=C>=2?"-":"=";var x=z.selection.length;if(x>q.lineLength){x=q.lineLength}z.endTag="\n";while(x--){z.endTag+=y}}};f.doHorizontalRule=function(x,y){x.startTag="----------\n";x.selection="";x.skipLines(2,1,true)};f.doMore=function(x,y){x.startTag="\n\n";x.selection="";x.skipLines(2,0,true)};f.doTab=function(x,y){x.startTag=" ";x.selection=""};function o(x,y){this.fullScreenBind=false;this.hooks=x;this.getString=y;this.isFakeFullScreen=false}function j(){var y={fullScreenChange:["onfullscreenchange","onwebkitfullscreenchange","onmozfullscreenchange","onmsfullscreenchange"],requestFullscreen:["requestFullscreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullScreen"],cancelFullscreen:["cancelFullscreen","exitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msCancelFullScreen"]},z={};for(var A in y){var x=y[A].length,C=false;for(var B=0;B0){ag=(ai%51)+ad;if(ag>=Z){ag++}if(ag>ab){ag+=aa}ah=String.fromCharCode(ag)+ah;ai=ai/51|0}return"Q"+ah+"Q"})};r=function(ae){return ae.replace(/Q([A-PR-Za-z]{1,3})Q/g,function(af,ai){var aj=0;var ag;for(var ah=0;ahab){ag-=aa}if(ag>Z){ag--}ag-=ad;aj=(aj*51)+ag}return String.fromCharCode(aj)})}})()}var D=Y.asteriskIntraWordEmphasis?v:t;this.makeHtml=function(Z){if(B){throw new Error("Recursive call to converter.makeHtml")}B=new a();q=new a();e=[];F=0;Z=l.preConversion(Z);Z=Z.replace(/~/g,"~T");Z=Z.replace(/\$/g,"~D");Z=Z.replace(/\r\n/g,"\n");Z=Z.replace(/\r/g,"\n");Z="\n\n"+Z+"\n\n";Z=P(Z);Z=Z.replace(/^[ \t]+$/mg,"");Z=l.postNormalization(Z);Z=s(Z);Z=p(Z);Z=h(Z);Z=T(Z);Z=Z.replace(/~D/g,"$$");Z=Z.replace(/~T/g,"~");Z=l.postConversion(Z);e=q=B=null;return Z};function p(Z){Z=Z.replace(/^[ ]{0,3}\[([^\[\]]+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(ac,ae,ad,ab,aa,af){ae=ae.toLowerCase();B.set(ae,H(ad));if(aa){return ab}else{if(af){q.set(ae,af.replace(/"/g,"""))}}return""});return Z}function s(ab){var aa="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";var Z="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";ab=ab.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,Q);ab=ab.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,Q);ab=ab.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,Q);ab=ab.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,Q);ab=ab.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,Q);return ab}function V(Z){Z=Z.replace(/(^\n+|\n+$)/g,"");return"\n\n~K"+(e.push(Z)-1)+"K\n\n"}function Q(Z,aa){return V(aa)}var g=function(Z){return h(Z)};function h(ab,aa){ab=l.preBlockGamut(ab,g);ab=k(ab);var Z="
        \n";ab=ab.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,Z);ab=ab.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,Z);ab=ab.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,Z);ab=S(ab);ab=w(ab);ab=i(ab);ab=l.postBlockGamut(ab,g);ab=s(ab);ab=O(ab,aa);return ab}function m(Z){Z=l.preSpanGamut(Z);Z=x(Z);Z=A(Z);Z=M(Z);Z=I(Z);Z=J(Z);Z=R(Z);Z=Z.replace(/~P/g,"://");Z=H(Z);Z=D(Z);Z=Z.replace(/ +\n/g,"
        \n");Z=l.postSpanGamut(Z);return Z}function A(aa){var Z=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;aa=aa.replace(Z,function(ac){var ab=ac.replace(/(.)<\/?code>(?=.)/g,"$1`");ab=E(ab,ac.charAt(1)=="!"?"\\`*_/":"\\`*_");return ab});return aa}function J(Z){if(Z.indexOf("[")===-1){return Z}Z=Z.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,j);Z=Z.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,j);Z=Z.replace(/(\[([^\[\]]+)\])()()()()()/g,j);return Z}function j(af,al,ak,aj,ai,ah,ae,ad){if(ad==undefined){ad=""}var ac=al;var aa=ak.replace(/:\/\//g,"~P");var ab=aj.toLowerCase();var Z=ai;var ag=ad;if(Z==""){if(ab==""){ab=aa.toLowerCase().replace(/ ?\n/g," ")}Z="#"+ab;if(B.get(ab)!=undefined){Z=B.get(ab);if(q.get(ab)!=undefined){ag=q.get(ab)}}else{if(ac.search(/\(\s*\)$/m)>-1){Z=""}else{return ac}}}Z=o(Z);var am='";return am}function I(Z){if(Z.indexOf("![")===-1){return Z}Z=Z.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,K);Z=Z.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,K);return Z}function L(Z){return Z.replace(/>/g,">").replace(/"+m(ab)+"

        \n\n"});Z=Z.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(ab,aa){return"

        "+m(aa)+"

        \n\n"});Z=Z.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(aa,ad,ac){var ab=ad.length;return""+m(ac)+"\n\n"});return Z}function S(ab,Z){ab+="~0";var aa=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;if(F){ab=ab.replace(aa,function(ae,ai,ah){var aj=ai;var ag=(ah.search(/[*+-]/g)>-1)?"ul":"ol";var af;if(ag==="ol"){af=parseInt(ah,10)}var ad=n(aj,ag,Z);ad=ad.replace(/\s+$/,"");var ac="<"+ag;if(af&&af!==1){ac+=' start="'+af+'"'}ad=ac+">"+ad+"\n";return ad})}else{aa=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;ab=ab.replace(aa,function(ag,ak,aj,ah){var ai=ak;var af=aj;var ad=(ah.search(/[*+-]/g)>-1)?"ul":"ol";var ae;if(ad==="ol"){ae=parseInt(ah,10)}var al=n(af,ad);var ac="<"+ad;if(ae&&ae!==1){ac+=' start="'+ae+'"'}al=ai+ac+">\n"+al+"\n";return al})}ab=ab.replace(/~0/,"");return ab}var u={ol:"\\d+[.]",ul:"[*+-]"};function n(ab,aa,ae){F++;ab=ab.replace(/\n{2,}$/,"\n");ab+="~0";var Z=u[aa];var ac=new RegExp("(^[ \\t]*)("+Z+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+Z+")[ \\t]+))","gm");var ad=false;ab=ab.replace(ac,function(ag,ai,ah,af){var al=af;var am=ai;var ak=/\n\n$/.test(al);var aj=ak||al.search(/\n{2,}/)>-1;if(aj||ad){al=h(z(al),true)}else{al=S(z(al),true);al=al.replace(/\n$/,"");if(!ae){al=m(al)}}ad=ak;return"
      • "+al+"
      • \n"});ab=ab.replace(/~0/g,"");F--;return ab}function w(Z){Z+="~0";Z=Z.replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(aa,ac,ab){var ad=ac;var ae=ab;ad=G(z(ad));ad=P(ad);ad=ad.replace(/^\n+/g,"");ad=ad.replace(/\n+$/g,"");ad="
        "+ad+"\n
        ";return"\n\n"+ad+"\n\n"+ae});Z=Z.replace(/~0/,"");return Z}function x(Z){Z=Z.replace(/(^|[^\\`])(`+)(?!`)([^\r]*?[^`])\2(?!`)/gm,function(ac,ae,ad,ab,aa){var af=ab;af=af.replace(/^([ \t]*)/g,"");af=af.replace(/[ \t]*$/g,"");af=G(af);af=af.replace(/:\/\//g,"~P");return ae+""+af+""});return Z}function G(Z){Z=Z.replace(/&/g,"&");Z=Z.replace(//g,">");Z=E(Z,"*_{}[]\\",false);return Z}function t(Z){if(Z.indexOf("*")===-1&&Z.indexOf("_")===-1){return Z}Z=W(Z);Z=Z.replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)\2(?=\S)([^\r]*?\S)\2\2(?!\2)(?=[\W_]|$)/g,"$1$3");Z=Z.replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)(?=\S)((?:(?!\2)[^\r])*?\S)\2(?!\2)(?=[\W_]|$)/g,"$1$3");return r(Z)}function v(Z){if(Z.indexOf("*")===-1&&Z.indexOf("_")===-1){return Z}Z=W(Z);Z=Z.replace(/(?=[^\r][*_]|[*_])(^|(?=\W__|(?!\*)[\W_]\*\*|\w\*\*\w)[^\r])(\*\*|__)(?!\2)(?=\S)((?:|[^\r]*?(?!\2)[^\r])(?=\S_|\w|\S\*\*(?:[\W_]|$)).)(?=__(?:\W|$)|\*\*(?:[^*]|$))\2/g,"$1$3");Z=Z.replace(/(?=[^\r][*_]|[*_])(^|(?=\W_|(?!\*)(?:[\W_]\*|\D\*(?=\w)\D))[^\r])(\*|_)(?!\2\2\2)(?=\S)((?:(?!\2)[^\r])*?(?=[^\s_]_|(?=\w)\D\*\D|[^\s*]\*(?:[\W_]|$)).)(?=_(?:\W|$)|\*(?:[^*]|$))\2/g,"$1$3");return r(Z)}function i(Z){Z=Z.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(aa,ab){var ac=ab;ac=ac.replace(/^[ \t]*>[ \t]?/gm,"~0");ac=ac.replace(/~0/g,"");ac=ac.replace(/^[ \t]+$/gm,"");ac=h(ac);ac=ac.replace(/(^|\n)/g,"$1 ");ac=ac.replace(/(\s*
        [^\r]+?<\/pre>)/gm,function(ad,ae){var af=ae;af=af.replace(/^  /mg,"~0");af=af.replace(/~0/g,"");return af});return V("
        \n"+ac+"\n
        ")});return Z}function O(ag,Z){ag=ag.replace(/^\n+/g,"");ag=ag.replace(/\n+$/g,"");var ah=ag.split(/\n{2,}/g);var ae=[];var aa=/~K(\d+)K/;var ab=ah.length;for(var ac=0;ac");ad+="

        ";ae.push(ad)}}}if(!Z){ab=ae.length;for(var ac=0;ac#+-.!])/g,y);return Z}var C="[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",X="[-A-Z0-9+&@#/%=~_|[\\])]",N=new RegExp('(="|<)?\\b(https?|ftp)(://'+C+"*"+X+")(?=$|\\W)","gi"),U=new RegExp(X,"i");function f(ad,ag,ai,ac){if(ag){return ad}if(ac.charAt(ac.length-1)!==")"){return"<"+ai+ac+">"}var ae=ac.match(/[()]/g);var Z=0;for(var aa=0;aa"+ab}function R(aa){aa=aa.replace(N,f);var Z=function(ad,ac){var ab=o(ac);return'
        '+l.plainLinkText(ac)+""};aa=aa.replace(/<((https?|ftp):[^'">\s]+)>/gi,Z);return aa}function T(Z){Z=Z.replace(/~E(\d+)E/g,function(aa,ac){var ab=parseInt(ac);return String.fromCharCode(ab)});return Z}function z(Z){Z=Z.replace(/^(\t|[ ]{1,4})/gm,"~0");Z=Z.replace(/~0/g,"");return Z}function P(ac){if(!/\t/.test(ac)){return ac}var ab=[" "," "," "," "],aa=0,Z;return ac.replace(/[\n\t]/g,function(ad,ae){if(ad==="\n"){aa=ae+1;return ad}Z=(ae-aa)%4;aa=ae+1;return ab[Z]})}function o(Z){Z=L(Z);Z=E(Z,"*_:()[]");return Z}function E(ad,aa,ab){var Z="(["+aa.replace(/([\[\]\\])/g,"\\$1")+"])";if(ab){Z="\\\\"+Z}var ac=new RegExp(Z,"g");ad=ad.replace(ac,y);return ad}function y(Z,ab){var aa=ab.charCodeAt(0);return"~E"+aa+"E"}}})();(function(){var a={},u={},m={},w=window.document,n=window.RegExp,g=window.navigator,q={lineLength:72},v={isIE:/msie/.test(g.userAgent.toLowerCase()),isIE_5or6:/msie 6/.test(g.userAgent.toLowerCase())||/msie 5/.test(g.userAgent.toLowerCase()),isOpera:/opera/.test(g.userAgent.toLowerCase())};var i={bold:"Strong Ctrl+B",boldexample:"strong text",italic:"Emphasis Ctrl+I",italicexample:"emphasized text",link:"Hyperlink Ctrl+L",linkdescription:"enter link description here",linkdialog:'

        Insert Hyperlink

        http://example.com/ "optional title"

        ',linkname:null,quote:"Blockquote
        Ctrl+Q",quoteexample:"Blockquote",code:"Code Sample
         Ctrl+K",codeexample:"enter code here",image:"Image  Ctrl+G",imagedescription:"enter image description here",imagedialog:"

        Insert Image

        http://example.com/images/diagram.jpg \"optional title\"
        Need
        free image hosting?

        ",imagename:null,olist:"Numbered List
          Ctrl+O",ulist:"Bulleted List
            Ctrl+U",litem:"List item",heading:"Heading

            /

            Ctrl+H",headingexample:"Heading",more:"More contents Ctrl+M",fullscreen:"FullScreen Ctrl+J",exitFullscreen:"Exit FullScreen Ctrl+E",fullscreenUnsupport:"Sorry, the browser dont support fullscreen api",hr:"Horizontal Rule
            Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redo - Ctrl+Shift+Z",ok:"OK",cancel:"Cancel",help:"Markdown Editing Help"};var c="http://";var d="http://";Markdown.Editor=function(B,D,A){A=A||{};if(typeof A.handler==="function"){A={helpButton:A}}A.strings=A.strings||{};if(A.helpButton){A.strings.help=A.strings.help||A.helpButton.title}var y=function(F){var E=A.strings[F]||i[F];if("imagename"==F||"linkname"==F){A.strings[F]=null}return E};D=D||"";var x=this.hooks=new Markdown.HookCollection();x.addNoop("onPreviewRefresh");x.addNoop("postBlockquoteCreation");x.addFalse("insertImageDialog");x.addFalse("insertLinkDialog");x.addNoop("makeButton");x.addNoop("enterFullScreen");x.addNoop("enterFakeFullScreen");x.addNoop("exitFullScreen");this.getConverter=function(){return B};var C=this,z;this.run=function(){if(z){return}z=new k(D);var G=new l(x,y);var E=new h(B,z,function(){x.onPreviewRefresh()});var H,F;if(!/\?noundo/.test(w.location.href)){H=new e(function(){E.refresh();if(F){F.setUndoRedoButtonStates()}},z);this.textOperation=function(J){H.setCommandMode();J();C.refreshPreview()}}fullScreenManager=new o(x,y);F=new t(D,z,x,H,E,G,fullScreenManager,A.helpButton,y);F.setUndoRedoButtonStates();var I=C.refreshPreview=function(){E.refresh(true)};I()}};function s(){}s.prototype.findTags=function(y,A){var x=this;var z;if(y){z=a.extendRegExp(y,"","$");this.before=this.before.replace(z,function(B){x.startTag=x.startTag+B;return""});z=a.extendRegExp(y,"^","");this.selection=this.selection.replace(z,function(B){x.startTag=x.startTag+B;return""})}if(A){z=a.extendRegExp(A,"","$");this.selection=this.selection.replace(z,function(B){x.endTag=B+x.endTag;return""});z=a.extendRegExp(A,"^","");this.after=this.after.replace(z,function(B){x.endTag=B+x.endTag;return""})}};s.prototype.trimWhitespace=function(y){var x,A,z=this;if(y){x=A=""}else{x=function(B){z.before+=B;return""};A=function(B){z.after=B+z.after;return""}}this.selection=this.selection.replace(/^(\s*)/,x).replace(/(\s*)$/,A)};s.prototype.skipLines=function(z,y,x){if(z===undefined){z=1}if(y===undefined){y=1}z++;y++;var A;var B;if(navigator.userAgent.match(/Chrome/)){"X".match(/()./)}this.selection=this.selection.replace(/(^\n*)/,"");this.startTag=this.startTag+n.$1;this.selection=this.selection.replace(/(\n*$)/,"");this.endTag=this.endTag+n.$1;this.startTag=this.startTag.replace(/(^\n*)/,"");this.before=this.before+n.$1;this.endTag=this.endTag.replace(/(\n*$)/,"");this.after=this.after+n.$1;if(this.before){A=B="";while(z--){A+="\\n?";B+="\n"}if(x){A="\\n*"}this.before=this.before.replace(new n(A+"$",""),B)}if(this.after){A=B="";while(y--){A+="\\n?";B+="\n"}if(x){A="\\n*"}this.after=this.after.replace(new n(A,""),B)}};function k(x){this.buttonBar=w.getElementById("wmd-button-bar"+x);this.preview=w.getElementById("wmd-preview"+x);this.input=w.getElementById("text")}a.isVisible=function(x){if(window.getComputedStyle){return window.getComputedStyle(x,null).getPropertyValue("display")!=="none"}else{if(x.currentStyle){return x.currentStyle.display!=="none"}}};a.addEvent=function(y,x,z){if(y.attachEvent){y.attachEvent("on"+x,z)}else{y.addEventListener(x,z,false)}};a.removeEvent=function(y,x,z){if(y.detachEvent){y.detachEvent("on"+x,z)}else{y.removeEventListener(x,z,false)}};a.fixEolChars=function(x){x=x.replace(/\r\n/g,"\n");x=x.replace(/\r/g,"\n");return x};a.extendRegExp=function(z,B,y){if(B===null||B===undefined){B=""}if(y===null||y===undefined){y=""}var A=z.toString();var x;A=A.replace(/\/([gim]*)$/,function(C,D){x=D;return""});A=A.replace(/(^\/|\/$)/g,"");A=B+A+y;return new n(A,x)};u.getTop=function(z,y){var x=z.offsetTop;if(!y){while(z=z.offsetParent){x+=z.offsetTop}}return x};u.getHeight=function(x){return x.offsetHeight||x.scrollHeight};u.getWidth=function(x){return x.offsetWidth||x.scrollWidth};u.getPageSize=function(){var y,z;var x,C;if(self.innerHeight&&self.scrollMaxY){y=w.body.scrollWidth;z=self.innerHeight+self.scrollMaxY}else{if(w.body.scrollHeight>w.body.offsetHeight){y=w.body.scrollWidth;z=w.body.scrollHeight}else{y=w.body.offsetWidth;z=w.body.offsetHeight}}if(self.innerHeight){x=self.innerWidth;C=self.innerHeight}else{if(w.documentElement&&w.documentElement.clientHeight){x=w.documentElement.clientWidth;C=w.documentElement.clientHeight}else{if(w.body){x=w.body.clientWidth;C=w.body.clientHeight}}}var B=Math.max(y,x);var A=Math.max(z,C);return[B,A,x,C]};function e(J,G){var M=this;var H=[];var E=0;var D="none";var y;var z;var C;var x=function(O,N){if(D!=O){D=O;if(!N){A()}}if(!v.isIE||D!="moving"){z=setTimeout(F,1)}else{C=null}};var F=function(N){C=new b(G,N);z=undefined};this.setCommandMode=function(){D="command";A();z=setTimeout(F,0)};this.canUndo=function(){return E>1};this.canRedo=function(){if(H[E+1]){return true}return false};this.undo=function(){if(M.canUndo()){if(y){y.restore();y=null}else{H[E]=new b(G);H[--E].restore();if(J){J()}}}D="none";G.input.focus();F()};this.redo=function(){if(M.canRedo()){H[++E].restore();if(J){J()}}D="none";G.input.focus();F()};var A=function(){var N=C||new b(G);if(!N){return false}if(D=="moving"){if(!y){y=N}return}if(y){if(H[E-1].text!=y.text){H[E++]=y}y=null}H[E++]=N;H[E+1]=null;if(J){J()}};var I=function(N){var P=false;if((N.ctrlKey||N.metaKey)&&!N.altKey){var O=N.charCode||N.keyCode;var Q=String.fromCharCode(O);switch(Q.toLowerCase()){case"y":M.redo();P=true;break;case"z":if(!N.shiftKey){M.undo()}else{M.redo()}P=true;break}}if(P){if(N.preventDefault){N.preventDefault()}if(window.event){window.event.returnValue=false}return}};var L=function(N){if(!N.ctrlKey&&!N.metaKey){var O=N.keyCode;if((O>=33&&O<=40)||(O>=63232&&O<=63235)){x("moving")}else{if(O==8||O==46||O==127){x("deleting")}else{if(O==13){x("newlines")}else{if(O==27){x("escape")}else{if((O<16||O>20)&&O!=91){x("typing")}}}}}}};var B=function(){a.addEvent(G.input,"keypress",function(O){if((O.ctrlKey||O.metaKey)&&!O.altKey&&(O.keyCode==89||O.keyCode==90)){O.preventDefault()}});var N=function(){if(v.isIE||(C&&C.text!=G.input.value)){if(z==undefined){D="paste";A();F()}}};a.addEvent(G.input,"keydown",I);a.addEvent(G.input,"keydown",L);a.addEvent(G.input,"mousedown",function(){x("moving")});G.input.onpaste=N;G.input.ondrop=N};var K=function(){B();F(true);A()};K()}function b(y,A){var x=this;var z=y.input;this.init=function(){if(!a.isVisible(z)){return}if(!A&&w.activeElement&&w.activeElement!==z){return}this.setInputAreaSelectionStartEnd();this.scrollTop=z.scrollTop;if(!this.text&&z.selectionStart||z.selectionStart===0){this.text=z.value}};this.setInputAreaSelection=function(){if(!a.isVisible(z)){return}if(z.selectionStart!==undefined&&!v.isOpera){z.focus();z.selectionStart=x.start;z.selectionEnd=x.end;z.scrollTop=x.scrollTop}else{if(w.selection){if(w.activeElement&&w.activeElement!==z){return}z.focus();var B=z.createTextRange();B.moveStart("character",-z.value.length);B.moveEnd("character",-z.value.length);B.moveEnd("character",x.end);B.moveStart("character",x.start);B.select()}}};this.setInputAreaSelectionStartEnd=function(){if(!y.ieCachedRange&&(z.selectionStart||z.selectionStart===0)){x.start=z.selectionStart;x.end=z.selectionEnd}else{if(w.selection){x.text=a.fixEolChars(z.value);var E=y.ieCachedRange||w.selection.createRange();var F=a.fixEolChars(E.text);var D="\x07";var C=D+F+D;E.text=C;var G=a.fixEolChars(z.value);E.moveStart("character",-C.length);E.text=F;x.start=G.indexOf(D);x.end=G.lastIndexOf(D)-D.length;var B=x.text.length-a.fixEolChars(z.value).length;if(B){E.moveStart("character",-F.length);while(B--){F+="\n";x.end+=1}E.text=F}if(y.ieCachedRange){x.scrollTop=y.ieCachedScrollTop}y.ieCachedRange=null;this.setInputAreaSelection()}}};this.restore=function(){if(x.text!=undefined&&x.text!=z.value){z.value=x.text}this.setInputAreaSelection();z.scrollTop=x.scrollTop};this.getChunks=function(){var B=new s();B.before=a.fixEolChars(x.text.substring(0,x.start));B.startTag="";B.selection=a.fixEolChars(x.text.substring(x.start,x.end));B.endTag="";B.after=a.fixEolChars(x.text.substring(x.end));B.scrollTop=x.scrollTop;return B};this.setChunks=function(B){B.before=B.before+B.startTag;B.after=B.endTag+B.after;this.start=B.before.length;this.end=B.before.length+B.selection.length;this.text=B.before+B.selection+B.after;this.scrollTop=B.scrollTop};this.init()}function h(R,A,L){var y=this;var F;var E;var O;var z=3000;var G="delayed";var C=function(T,U){a.addEvent(T,"input",U);T.onpaste=U;T.ondrop=U;a.addEvent(T,"keypress",U);a.addEvent(T,"keydown",U)};var K=function(){var T=0;if(window.innerHeight){T=window.pageYOffset}else{if(w.documentElement&&w.documentElement.scrollTop){T=w.documentElement.scrollTop}else{if(w.body){T=w.body.scrollTop}}}return T};var D=function(){if(!A.preview){return}var V=A.input.value;if(V&&V==O){return}else{O=V}var U=new Date().getTime();V=R.makeHtml(V);var T=new Date().getTime();E=T-U;x(V)};var Q=function(){if(F){clearTimeout(F);F=undefined}if(G!=="manual"){var T=0;if(G==="delayed"){T=E}if(T>z){T=z}F=setTimeout(D,T)}};var B=function(T){if(T.scrollHeight<=T.clientHeight){return 1}return T.scrollTop/(T.scrollHeight-T.clientHeight)};var S=function(){if(A.preview){A.preview.scrollTop=(A.preview.scrollHeight-A.preview.clientHeight)*B(A.preview)}};this.refresh=function(T){if(T){O="";D()}else{Q()}};this.processingTime=function(){return E};var H=true;var I=function(W){var V=A.preview;var U=V.parentNode;var T=V.nextSibling;U.removeChild(V);V.innerHTML=W;if(!T){U.appendChild(V)}else{U.insertBefore(V,T)}};var N=function(T){A.preview.innerHTML=T};var J;var M=function(U){if(J){return J(U)}try{N(U);J=N}catch(T){J=I;J(U)}};var x=function(V){var T=u.getTop(A.input)-K();if(A.preview){M(V);L()}S();if(H){H=false;return}var U=u.getTop(A.input)-K();if(v.isIE){setTimeout(function(){window.scrollBy(0,U-T)},0)}else{window.scrollBy(0,U-T)}};var P=function(){C(A.input,Q);D();if(A.preview){A.preview.scrollTop=0}};P()}m.createBackground=function(){var y=w.createElement("div"),z=y.style;y.className="wmd-prompt-background";z.position="absolute";z.top="0";z.zIndex="1000";if(v.isIE){z.filter="alpha(opacity=50)"}else{z.opacity="0.5"}var x=u.getPageSize();z.height=x[1]+"px";if(v.isIE){z.left=w.documentElement.scrollLeft;z.width=w.documentElement.clientWidth}else{z.left="0";z.width="100%"}w.body.appendChild(y);return y};m.dialog=function(A,E,z,B){var y;var D=function(F){var G=(F.charCode||F.keyCode);if(G===27){C(true)}};var C=function(F){a.removeEvent(w.body,"keydown",D);y.parentNode.removeChild(y);E(F);return false};var x=function(){y=w.createElement("div");y.className="wmd-prompt-dialog";y.setAttribute("role","dialog");var F=w.createElement("div");var H=w.createElement("form"),G=H.style;H.onsubmit=function(){return C(false)};y.appendChild(H);H.appendChild(F);if("function"==typeof(A)){A.call(this,F)}else{F.innerHTML=A}var J=w.createElement("button");J.type="button";J.className="btn btn-s primary";J.onclick=function(){return C(false)};J.innerHTML=z;var I=w.createElement("button");I.type="button";I.className="btn btn-s";I.onclick=function(){return C(true)};I.innerHTML=B;H.appendChild(J);H.appendChild(I);a.addEvent(w.body,"keydown",D);w.body.appendChild(y)};setTimeout(function(){x()},0)};m.prompt=function(C,G,A,y,E){var x;var z;if(G===undefined){G=""}var B=function(H){var I=(H.charCode||H.keyCode);if(I===27){D(true)}};var D=function(H){a.removeEvent(w.body,"keydown",B);var I=z.value;if(H){I=null}else{I=I.replace(/^http:\/\/(https?|ftp):\/\//,"$1://");if(!/^(?:https?|ftp):\/\//.test(I)){I="http://"+I}}x.parentNode.removeChild(x);A(I);return false};var F=function(){x=w.createElement("div");x.className="wmd-prompt-dialog";x.setAttribute("role","dialog");var H=w.createElement("div");H.innerHTML=C;x.appendChild(H);var J=w.createElement("form"),I=J.style;J.onsubmit=function(){return D(false)};x.appendChild(J);z=w.createElement("input");z.type="text";z.value=G;J.appendChild(z);var L=w.createElement("button");L.type="button";L.className="btn btn-s primary";L.onclick=function(){return D(false)};L.innerHTML=y;var K=w.createElement("button");K.type="button";K.className="btn btn-s";K.onclick=function(){return D(true)};K.innerHTML=E;J.appendChild(L);J.appendChild(K);a.addEvent(w.body,"keydown",B);w.body.appendChild(x)};setTimeout(function(){F();var I=G.length;if(z.selectionStart!==undefined){z.selectionStart=0;z.selectionEnd=I}else{if(z.createTextRange){var H=z.createTextRange();H.collapse(false);H.moveStart("character",-I);H.moveEnd("character",I);H.select()}}z.focus()},0)};function t(K,E,L,N,A,J,I,D,y){var C=E.input,G={};B();var F="keydown";if(v.isOpera){F="keypress"}a.addEvent(C,F,function(P){if((P.ctrlKey||P.metaKey)&&!P.altKey&&!P.shiftKey){var R=P.charCode||P.keyCode;var O=String.fromCharCode(R).toLowerCase();switch(O){case"b":M(G.bold);break;case"i":M(G.italic);break;case"l":M(G.link);break;case"q":M(G.quote);break;case"k":M(G.code);break;case"g":M(G.image);break;case"o":M(G.olist);break;case"u":M(G.ulist);break;case"m":M(G.more);break;case"j":M(G.fullscreen);break;case"e":M(G.exitFullscreen);break;case"h":M(G.heading);break;case"r":M(G.hr);break;case"y":M(G.redo);break;case"z":if(P.shiftKey){M(G.redo)}else{M(G.undo)}break;default:return}if(P.preventDefault){P.preventDefault()}if(window.event){window.event.returnValue=false}}else{if(P.keyCode==9&&window.fullScreenEntered){var Q={};Q.textOp=z("doTab");M(Q);if(P.preventDefault){P.preventDefault()}if(window.event){window.event.returnValue=false}}}});a.addEvent(C,"keyup",function(P){if(P.shiftKey&&!P.ctrlKey&&!P.metaKey){var Q=P.charCode||P.keyCode;if(Q===13){var O={};O.textOp=z("doAutoindent");M(O)}}});if(v.isIE){a.addEvent(C,"keydown",function(O){var P=O.keyCode;if(P===27){return false}})}function M(P){C.focus();if(P.textOp){if(N){N.setCommandMode()}var R=new b(E);if(!R){return}var S=R.getChunks();var O=function(){C.focus();if(S){R.setChunks(S)}R.restore();A.refresh()};var Q=P.textOp(S,O);if(!Q){O()}}if(P.execute){P.execute(N)}}function x(O,Q){var R="0px";var T="-20px";var P="-40px";var S=O.getElementsByTagName("span")[0];if(Q){S.style.backgroundPosition=O.XShift+" "+R;O.onmouseover=function(){S.style.backgroundPosition=this.XShift+" "+P};O.onmouseout=function(){S.style.backgroundPosition=this.XShift+" "+R};if(v.isIE){O.onmousedown=function(){if(w.activeElement&&w.activeElement!==E.input){return}E.ieCachedRange=document.selection.createRange();E.ieCachedScrollTop=E.input.scrollTop}}if(!O.isHelp){O.onclick=function(){if(this.onmouseout){this.onmouseout()}M(this);return false}}}else{S.style.backgroundPosition=O.XShift+" "+T;O.onmouseover=O.onmouseout=O.onclick=function(){}}}function z(O){if(typeof O==="string"){O=J[O]}return function(){O.apply(J,arguments)}}function B(){var S=E.buttonBar;var W="0px";var R="-20px";var U="-40px";var V=document.createElement("ul");V.id="wmd-button-row"+K;V.className="wmd-button-row";V=S.appendChild(V);var O=0;var X=function(ae,ac,ab,ad){var aa=document.createElement("li");aa.className="wmd-button";aa.style.left=O+"px";O+=25;var Z=document.createElement("span");aa.id=ae+K;aa.appendChild(Z);aa.title=ac;aa.XShift=ab;if(ad){aa.textOp=ad}x(aa,true);V.appendChild(aa);return aa};var Q=function(aa){var Z=document.createElement("li");Z.className="wmd-spacer wmd-spacer"+aa;Z.id="wmd-spacer"+aa+K;V.appendChild(Z);O+=25};G.bold=X("wmd-bold-button",y("bold"),"0px",z("doBold"));G.italic=X("wmd-italic-button",y("italic"),"-20px",z("doItalic"));Q(1);G.link=X("wmd-link-button",y("link"),"-40px",z(function(Z,aa){return this.doLinkOrImage(Z,aa,false)}));G.quote=X("wmd-quote-button",y("quote"),"-60px",z("doBlockquote"));G.code=X("wmd-code-button",y("code"),"-80px",z("doCode"));G.image=X("wmd-image-button",y("image"),"-100px",z(function(Z,aa){return this.doLinkOrImage(Z,aa,true)}));Q(2);G.olist=X("wmd-olist-button",y("olist"),"-120px",z(function(Z,aa){this.doList(Z,aa,true)}));G.ulist=X("wmd-ulist-button",y("ulist"),"-140px",z(function(Z,aa){this.doList(Z,aa,false)}));G.heading=X("wmd-heading-button",y("heading"),"-160px",z("doHeading"));G.hr=X("wmd-hr-button",y("hr"),"-180px",z("doHorizontalRule"));G.more=X("wmd-more-button",y("more"),"-280px",z("doMore"));Q(3);G.undo=X("wmd-undo-button",y("undo"),"-200px",null);G.undo.execute=function(Z){if(Z){Z.undo()}};var Y=/win/.test(g.platform.toLowerCase())?y("redo"):y("redomac");G.redo=X("wmd-redo-button",Y,"-220px",null);G.redo.execute=function(Z){if(Z){Z.redo()}};Q(4);G.fullscreen=X("wmd-fullscreen-button",y("fullscreen"),"-240px",null);G.fullscreen.execute=function(){I.doFullScreen(G,true)};G.exitFullscreen=X("wmd-exit-fullscreen-button",y("exitFullscreen"),"-260px",null);G.exitFullscreen.style.display="none";G.exitFullscreen.execute=function(){I.doFullScreen(G,false)};L.makeButton(G,X,z,m);if(D){var T=document.createElement("li");var P=document.createElement("span");T.appendChild(P);T.className="wmd-button wmd-help-button";T.id="wmd-help-button"+K;T.XShift="-300px";T.isHelp=true;T.style.right="0px";T.title=y("help");T.onclick=D.handler;x(T,true);V.appendChild(T);G.help=T}H()}function H(){if(N){x(G.undo,N.canUndo());x(G.redo,N.canRedo())}}this.setUndoRedoButtonStates=H}function l(y,x){this.hooks=y;this.getString=x}var f=l.prototype;f.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)";f.unwrap=function(y){var x=new n("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");y.selection=y.selection.replace(x,"$1 $2")};f.wrap=function(y,x){this.unwrap(y);var A=new n("(.{1,"+x+"})( +|$\\n?)","gm"),z=this;y.selection=y.selection.replace(A,function(B,C){if(new n("^"+z.prefixes,"").test(B)){return B}return C+"\n"});y.selection=y.selection.replace(/\s+$/,"")};f.doBold=function(x,y){return this.doBorI(x,y,2,this.getString("boldexample"))};f.doItalic=function(x,y){return this.doBorI(x,y,1,this.getString("italicexample"))};f.doBorI=function(D,B,C,x){D.trimWhitespace();D.selection=D.selection.replace(/\n{2,}/g,"\n");var A=/(\**$)/.exec(D.before)[0];var y=/(^\**)/.exec(D.after)[0];var E=Math.min(A.length,y.length);if((E>=C)&&(E!=2||C!=1)){D.before=D.before.replace(n("[*]{"+C+"}$",""),"");D.after=D.after.replace(n("^[*]{"+C+"}",""),"")}else{if(!D.selection&&y){D.after=D.after.replace(/^([*_]*)/,"");D.before=D.before.replace(/(\s?)$/,"");var z=n.$1;D.before=D.before+y+z}else{if(!D.selection&&!y){D.selection=x}var F=C<=1?"*":"**";D.before=D.before+F;D.after=F+D.after}}return};f.stripLinkDefs=function(y,x){y=y.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(C,D,z,A,B){x[D]=C.replace(/\s*$/,"");if(A){x[D]=C.replace(/["(](.+?)[")]$/,"");return A+B}return""});return y};f.addLinkDef=function(E,A){var x=0;var z={};E.before=this.stripLinkDefs(E.before,z);E.selection=this.stripLinkDefs(E.selection,z);E.after=this.stripLinkDefs(E.after,z);var y="";var D=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g;var C=function(G){x++;G=G.replace(/^[ ]{0,3}\[(\d+)\]:/," ["+x+"]:");y+="\n"+G};var B=function(H,K,I,J,L,G){I=I.replace(D,B);if(z[L]){C(z[L]);return K+I+J+x+G}return H};E.before=E.before.replace(D,B);if(A){C(A)}else{E.selection=E.selection.replace(D,B)}var F=x;E.after=E.after.replace(D,B);if(E.after){E.after=E.after.replace(/\n*$/,"")}if(!E.after){E.selection=E.selection.replace(/\n*$/,"")}E.after+="\n\n"+y;return F};function p(x){return x.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,function(z,y,B){var A=false;y=y.replace(/%(?:[\da-fA-F]{2})|\?|\+|[^\w\d-./[\]]/g,function(C){if(C.length===3&&C.charAt(0)=="%"){return C.toUpperCase()}switch(C){case"?":A=true;return"?";break;case"+":if(A){return"%20"}break}return encodeURI(C)});if(B){B=B.trim?B.trim():B.replace(/^\s*/,"").replace(/\s*$/,"");B=B.replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")}return B?y+' "'+B+'"':y})}f.doLinkOrImage=function(x,z,C){x.trimWhitespace();x.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var y;if(x.endTag.length>1&&x.startTag.length>0){x.startTag=x.startTag.replace(/!?\[/,"");x.endTag="";this.addLinkDef(x,null)}else{x.selection=x.startTag+x.selection+x.endTag;x.startTag=x.endTag="";if(/\n\n/.test(x.selection)){this.addLinkDef(x,null);return}var A=this;var B=function(G){y.parentNode.removeChild(y);if(G!==null){x.selection=(" "+x.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1);var F=" [999]: "+p(G);var E=A.addLinkDef(x,F);x.startTag=C?"![":"[";x.endTag="]["+E+"]";if(!x.selection){if(C){var H=A.getString("imagename");x.selection=H||A.getString("imagedescription")}else{var D=A.getString("linkname");x.selection=D||A.getString("linkdescription")}}}z()};y=m.createBackground();if(C){if(!this.hooks.insertImageDialog(B)){m.prompt(this.getString("imagedialog"),c,B,this.getString("ok"),this.getString("cancel"))}}else{if(!this.hooks.insertLinkDialog(B)){m.prompt(this.getString("linkdialog"),d,B,this.getString("ok"),this.getString("cancel"))}}return true}};f.doAutoindent=function(z,A){var y=this,x=false;z.before=z.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n");z.before=z.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n");z.before=z.before.replace(/(\n|^)[ \t]+\n$/,"\n\n");if(!z.selection&&!/^[ \t]*(?:\n|$)/.test(z.after)){z.after=z.after.replace(/^[^\n]*/,function(B){z.selection=B;return""});x=true}if(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(z.before)){if(y.doList){y.doList(z)}}if(/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(z.before)){if(y.doBlockquote){y.doBlockquote(z)}}if(/(\n|^)(\t|[ ]{4,}).*\n$/.test(z.before)){if(y.doCode){y.doCode(z)}}if(x){z.after=z.selection+z.after;z.selection=""}};f.doBlockquote=function(E,z){E.selection=E.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(K,J,I,H){E.before+=J;E.after=H+E.after;return I});E.before=E.before.replace(/(>[ \t]*)$/,function(I,H){E.selection=H+E.selection;return""});E.selection=E.selection.replace(/^(\s|>)+$/,"");E.selection=E.selection||this.getString("quoteexample");var D="",C="",F;if(E.before){var G=E.before.replace(/\n$/,"").split("\n");var B=false;for(var A=0;A0;if(/^>/.test(F)){y=true;if(!B&&F.length>1){B=true}}else{if(/^[ \t]*$/.test(F)){y=true}else{y=B}}if(y){D+=F+"\n"}else{C+=D+F;D="\n"}}if(!/(^|\n)>/.test(D)){C+=D;D=""}}E.startTag=D;E.before=C;if(E.after){E.after=E.after.replace(/^\n?/,"\n")}E.after=E.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(H){E.endTag=H;return""});var x=function(I){var H=I?"> ":"";if(E.startTag){E.startTag=E.startTag.replace(/\n((>|\s)*)\n$/,function(K,J){return"\n"+J.replace(/^[ ]{0,3}>?[ \t]*$/gm,H)+"\n"})}if(E.endTag){E.endTag=E.endTag.replace(/^\n((>|\s)*)\n/,function(K,J){return"\n"+J.replace(/^[ ]{0,3}>?[ \t]*$/gm,H)+"\n"})}};if(/^(?![ ]{0,3}>)/m.test(E.selection)){this.wrap(E,q.lineLength-2);E.selection=E.selection.replace(/^/gm,"> ");x(true);E.skipLines()}else{E.selection=E.selection.replace(/^[ ]{0,3}> ?/gm,"");this.unwrap(E);x(false);if(!/^(\n|^)[ ]{0,3}>/.test(E.selection)&&E.startTag){E.startTag=E.startTag.replace(/\n{0,2}$/,"\n\n")}if(!/(\n|^)[ ]{0,3}>.*$/.test(E.selection)&&E.endTag){E.endTag=E.endTag.replace(/^\n{0,2}/,"\n\n")}}E.selection=this.hooks.postBlockquoteCreation(E.selection);if(!/\n/.test(E.selection)){E.selection=E.selection.replace(/^(> *)/,function(H,I){E.startTag+=I;return""})}};f.doCode=function(x,y){var A=/\S[ ]*$/.test(x.before);var C=/^[ ]*\S/.test(x.after);if((!C&&!A)||/\n/.test(x.selection)){x.before=x.before.replace(/[ ]{4}$/,function(D){x.selection=D+x.selection;return""});var B=1;var z=1;if(/(\n|^)(\t|[ ]{4,}).*\n$/.test(x.before)){B=0}if(/^\n(\t|[ ]{4,})/.test(x.after)){z=0}x.skipLines(B,z);if(!x.selection){x.startTag=" ";x.selection=this.getString("codeexample")}else{if(/^[ ]{0,3}\S/m.test(x.selection)){if(/\n/.test(x.selection)){x.selection=x.selection.replace(/^/gm," ")}else{x.before+=" "}}else{x.selection=x.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,"")}}}else{x.trimWhitespace();x.findTags(/`/,/`/);if(!x.startTag&&!x.endTag){x.startTag=x.endTag="`";if(!x.selection){x.selection=this.getString("codeexample")}}else{if(x.endTag&&!x.startTag){x.before+=x.endTag;x.endTag=""}else{x.startTag=x.endTag=""}}}};f.doList=function(I,B,A){var K=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/;var J=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/;var x="-";var F=1;var D=function(){var L;if(A){L=" "+F+". ";F++}else{L=" "+x+" "}return L};var E=function(L){if(A===undefined){A=/^\s*\d/.test(L)}L=L.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(M){return D()});return L};I.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null);if(I.before&&!/\n$/.test(I.before)&&!/^\n/.test(I.startTag)){I.before+=I.startTag;I.startTag=""}if(I.startTag){var z=/\d+[.]/.test(I.startTag);I.startTag="";I.selection=I.selection.replace(/\n[ ]{4}/g,"\n");this.unwrap(I);I.skipLines();if(z){I.after=I.after.replace(J,E)}if(A==z){return}}var C=1;I.before=I.before.replace(K,function(L){if(/^\s*([*+-])/.test(L)){x=n.$1}C=/[^\n]\n\n[^\n]/.test(L)?1:0;return E(L)});if(!I.selection){I.selection=this.getString("litem")}var G=D();var y=1;I.after=I.after.replace(J,function(L){y=/[^\n]\n\n[^\n]/.test(L)?1:0;return E(L)});I.trimWhitespace(true);I.skipLines(C,y,true);I.startTag=G;var H=G.replace(/./g," ");this.wrap(I,q.lineLength-H.length);I.selection=I.selection.replace(/\n/g,"\n"+H)};f.doHeading=function(z,A){z.selection=z.selection.replace(/\s+/g," ");z.selection=z.selection.replace(/(^\s+|\s+$)/g,"");if(!z.selection){z.startTag="## ";z.selection=this.getString("headingexample");z.endTag=" ##";return}var B=0;z.findTags(/#+[ ]*/,/[ ]*#+/);if(/#+/.test(z.startTag)){B=n.lastMatch.length}z.startTag=z.endTag="";z.findTags(null,/\s?(-+|=+)/);if(/=+/.test(z.endTag)){B=1}if(/-+/.test(z.endTag)){B=2}z.startTag=z.endTag="";z.skipLines(1,1);var C=B==0?2:B-1;if(C>0){var y=C>=2?"-":"=";var x=z.selection.length;if(x>q.lineLength){x=q.lineLength}z.endTag="\n";while(x--){z.endTag+=y}}};f.doHorizontalRule=function(x,y){x.startTag="----------\n";x.selection="";x.skipLines(2,1,true)};f.doMore=function(x,y){x.startTag="\n\n";x.selection="";x.skipLines(2,0,true)};f.doTab=function(x,y){x.startTag=" ";x.selection=""};function o(x,y){this.fullScreenBind=false;this.hooks=x;this.getString=y;this.isFakeFullScreen=false}function j(){var y={fullScreenChange:["onfullscreenchange","onwebkitfullscreenchange","onmozfullscreenchange","onmsfullscreenchange"],requestFullscreen:["requestFullscreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullScreen"],cancelFullscreen:["cancelFullscreen","exitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msCancelFullScreen"]},z={};for(var A in y){var x=y[A].length,C=false;for(var B=0;B0){k.slice_blob=true}if(j.resize.enabled){k.send_binary_string=true}c.each(j,function(n,m){l(m,!!n,true)})}}}return k}var c={VERSION:"2.1.1",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,IMAGE_MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:h.mimes,ua:h.ua,typeOf:h.typeOf,extend:h.extend,guid:h.guid,get:function b(m){var k=[],l;if(h.typeOf(m)!=="array"){m=[m]}var j=m.length;while(j--){l=h.get(m[j]);if(l){k.push(l)}}return k.length?k:null},each:h.each,getPos:h.getPos,getSize:h.getSize,xmlEncode:function(j){var k={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return j?(""+j).replace(i,function(l){return k[l]?"&"+k[l]+";":l}):j},toArray:h.toArray,inArray:h.inArray,addI18n:h.addI18n,translate:h.translate,isEmptyObj:h.isEmptyObj,hasClass:h.hasClass,addClass:h.addClass,removeClass:h.removeClass,getStyle:h.getStyle,addEvent:h.addEvent,removeEvent:h.removeEvent,removeAllEvents:h.removeAllEvents,cleanName:function(j){var k,l;l=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(k=0;k0?"&":"?")+k}return j},formatSize:function(j){if(j===e||/\D/.test(j)){return c.translate("N/A")}function i(m,l){return Math.round(m*Math.pow(10,l))/Math.pow(10,l)}var k=Math.pow(1024,4);if(j>k){return i(j/k,1)+" "+c.translate("tb")}if(j>(k/=1024)){return i(j/k,1)+" "+c.translate("gb")}if(j>(k/=1024)){return i(j/k,1)+" "+c.translate("mb")}if(j>1024){return Math.round(j/1024)+" "+c.translate("kb")}return j+" "+c.translate("b")},parseSize:h.parseSizeStr,predictRuntime:function(k,j){var i,l;i=new c.Uploader(k);l=h.Runtime.thatCan(i.getOption().required_features,j||k.runtimes);i.destroy();return l},addFileFilter:function(j,i){g[j]=i}};c.addFileFilter("mime_types",function(k,j,i){if(k.length&&!k.regexp.test(j.name)){this.trigger("Error",{code:c.FILE_EXTENSION_ERROR,message:c.translate("File extension error."),file:j});i(false)}else{i(true)}});c.addFileFilter("max_file_size",function(l,j,i){var k;l=c.parseSize(l);if(j.size!==k&&l&&j.size>l){this.trigger("Error",{code:c.FILE_SIZE_ERROR,message:c.translate("File size error."),file:j});i(false)}else{i(true)}});c.addFileFilter("prevent_duplicates",function(l,j,i){if(l){var k=this.files.length;while(k--){if(j.name===this.files[k].name&&j.size===this.files[k].size){this.trigger("Error",{code:c.FILE_DUPLICATE_ERROR,message:c.translate("Duplicate file error."),file:j});i(false);return}}}i(true)});c.Uploader=function(l){var t=c.guid(),G,p=[],x={},F=[],w=[],C,K,n=false,v;function J(){var M,N=0,L;if(this.state==c.STARTED){for(L=0;L0?Math.ceil(L.loaded/L.size*100):100;j()}function j(){var M,L;K.reset();for(M=0;M0?Math.ceil(K.uploaded/p.length*100):0}else{K.bytesPerSec=Math.ceil(K.loaded/((+new Date()-C||1)/1000));K.percent=K.size>0?Math.ceil(K.loaded/K.size*100):0}}function I(){var L=F[0]||w[0];if(L){return L.getRuntime().uid}return false}function E(M,L){if(M.ruid){var N=h.Runtime.getInfo(M.ruid);if(N){return N.can(L)}}return false}function y(){this.bind("FilesAdded",H);this.bind("CancelUpload",i);this.bind("BeforeUpload",B);this.bind("UploadFile",D);this.bind("UploadProgress",u);this.bind("StateChanged",A);this.bind("QueueChanged",j);this.bind("Error",r);this.bind("FileUploaded",s);this.bind("Destroy",q)}function z(Q,N){var O=this,M=0,L=[];var P={accept:Q.filters.mime_types,runtime_order:Q.runtimes,required_caps:Q.required_features,preferred_caps:x,swf_url:Q.flash_swf_url,xap_url:Q.silverlight_xap_url};c.each(Q.runtimes.split(/\s*,\s*/),function(R){if(Q[R]){P[R]=Q[R]}});if(Q.browse_button){c.each(Q.browse_button,function(R){L.push(function(S){var T=new h.FileInput(c.extend({},P,{name:Q.file_data_name,multiple:Q.multi_selection,container:Q.container,browse_button:R}));T.onready=function(){var U=h.Runtime.getInfo(this.ruid);h.extend(O.features,{chunks:U.can("slice_blob"),multipart:U.can("send_multipart"),multi_selection:U.can("select_multiple")});M++;F.push(this);S()};T.onchange=function(){O.addFile(this.files)};T.bind("mouseenter mouseleave mousedown mouseup",function(U){if(!n){if(Q.browse_button_hover){if("mouseenter"===U.type){h.addClass(R,Q.browse_button_hover)}else{if("mouseleave"===U.type){h.removeClass(R,Q.browse_button_hover)}}}if(Q.browse_button_active){if("mousedown"===U.type){h.addClass(R,Q.browse_button_active)}else{if("mouseup"===U.type){h.removeClass(R,Q.browse_button_active)}}}}});T.bind("error runtimeerror",function(){T=null;S()});T.init()})})}if(Q.drop_element){c.each(Q.drop_element,function(R){L.push(function(S){var T=new h.FileDrop(c.extend({},P,{drop_zone:R}));T.onready=function(){var U=h.Runtime.getInfo(this.ruid);O.features.dragdrop=U.can("drag_and_drop");M++;w.push(this);S()};T.ondrop=function(){O.addFile(this.files)};T.bind("error runtimeerror",function(){T=null;S()});T.init()})})}h.inSeries(L,function(){if(typeof(N)==="function"){N(M)}})}function o(N,P,L){var M=new h.Image();try{M.onload=function(){M.downsize(P.width,P.height,P.crop,P.preserve_headers)};M.onresize=function(){L(this.getAsBlob(N.type,P.quality));this.destroy()};M.onerror=function(){L(N)};M.load(N)}catch(O){L(N)}}function m(N,P,Q){var M=this,L=false;function O(S,T,U){var R=G[S];switch(S){case"max_file_size":if(S==="max_file_size"){G.max_file_size=G.filters.max_file_size=T}break;case"chunk_size":if(T=c.parseSize(T)){G[S]=T}break;case"filters":if(c.typeOf(T)==="array"){T={mime_types:T}}if(U){c.extend(G.filters,T)}else{G.filters=T}if(T.mime_types){G.filters.mime_types.regexp=(function(V){var W=[];c.each(V,function(X){c.each(X.extensions.split(/,/),function(Y){if(/^\s*\*\s*$/.test(Y)){W.push("\\.*")}else{W.push("\\."+Y.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))}})});return new RegExp("("+W.join("|")+")$","i")}(G.filters.mime_types))}break;case"resize":if(U){c.extend(G.resize,T,{enabled:true})}else{G.resize=T}break;case"prevent_duplicates":G.prevent_duplicates=G.filters.prevent_duplicates=!!T;break;case"browse_button":case"drop_element":T=c.get(T);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":G[S]=T;if(!U){L=true}break;default:G[S]=T}if(!U){M.trigger("OptionChanged",S,T,R)}}if(typeof(N)==="object"){c.each(N,function(S,R){O(R,S,Q)})}else{O(N,P,Q)}if(Q){G.required_features=a(c.extend({},G));x=a(c.extend({},G,{required_features:true}))}else{if(L){M.trigger("Destroy");z.call(M,G,function(R){if(R){M.runtime=h.Runtime.getInfo(I()).type;M.trigger("Init",{runtime:M.runtime});M.trigger("PostInit")}else{M.trigger("Error",{code:c.INIT_ERROR,message:c.translate("Init error.")})}})}}}function H(M,L){[].push.apply(p,L);M.trigger("QueueChanged");M.refresh()}function B(L,M){if(G.unique_names){var O=M.name.match(/\.([^.]+)$/),N="part";if(O){N=O[1]}M.target_name=M.id+"."+N}}function D(T,Q){var N=T.settings.url,R=T.settings.chunk_size,U=T.settings.max_retries,O=T.features,S=0,L;if(Q.loaded){S=Q.loaded=R*Math.floor(Q.loaded/R)}function P(){if(U-->0){d(M,1000)}else{Q.loaded=S;T.trigger("Error",{code:c.HTTP_ERROR,message:c.translate("HTTP Error."),file:Q,response:v.responseText,status:v.status,responseHeaders:v.getAllResponseHeaders()})}}function M(){var X,W,V,Y;if(Q.status==c.DONE||Q.status==c.FAILED||T.state==c.STOPPED){return}V={name:Q.target_name||Q.name};if(R&&O.chunks&&L.size>R){Y=Math.min(R,L.size-S);X=L.slice(S,S+Y)}else{Y=L.size;X=L}if(R&&O.chunks){if(T.settings.send_chunk_number){V.chunk=Math.ceil(S/R);V.chunks=Math.ceil(L.size/R)}else{V.offset=S;V.total=L.size}}v=new h.XMLHttpRequest();if(v.upload){v.upload.onprogress=function(Z){Q.loaded=Math.min(Q.size,S+Z.loaded);T.trigger("UploadProgress",Q)}}v.onload=function(){if(v.status>=400){P();return}U=T.settings.max_retries;if(Y=L.size){if(Q.size!=Q.origSize){L.destroy();L=null}T.trigger("UploadProgress",Q);Q.status=c.DONE;T.trigger("FileUploaded",Q,{response:v.responseText,status:v.status,responseHeaders:v.getAllResponseHeaders()})}else{d(M,1)}};v.onerror=function(){P()};v.onloadend=function(){this.destroy();v=null};if(T.settings.multipart&&O.multipart){V.name=Q.target_name||Q.name;v.open("post",N,true);c.each(T.settings.headers,function(aa,Z){v.setRequestHeader(Z,aa)});W=new h.FormData();c.each(c.extend(V,T.settings.multipart_params),function(aa,Z){W.append(Z,aa)});W.append(T.settings.file_data_name,X);v.send(W,{runtime_order:T.settings.runtimes,required_caps:T.settings.required_features,preferred_caps:x,swf_url:T.settings.flash_swf_url,xap_url:T.settings.silverlight_xap_url})}else{N=c.buildUrl(T.settings.url,c.extend(V,T.settings.multipart_params));v.open("post",N,true);v.setRequestHeader("Content-Type","application/octet-stream");c.each(T.settings.headers,function(aa,Z){v.setRequestHeader(Z,aa)});v.send(X,{runtime_order:T.settings.runtimes,required_caps:T.settings.required_features,preferred_caps:x,swf_url:T.settings.flash_swf_url,xap_url:T.settings.silverlight_xap_url})}}L=Q.getSource();if(T.settings.resize.enabled&&E(L,"send_binary_string")&&!!~h.inArray(L.type,["image/jpeg","image/png"])){o.call(this,L,T.settings.resize,function(V){L=V;Q.size=V.size;M()})}else{M()}}function u(L,M){k(M)}function A(L){if(L.state==c.STARTED){C=(+new Date())}else{if(L.state==c.STOPPED){for(var M=L.files.length-1;M>=0;M--){if(L.files[M].status==c.UPLOADING){L.files[M].status=c.QUEUED;j()}}}}}function i(){if(v){v.abort()}}function s(L){j();d(function(){J.call(L)},1)}function r(L,M){if(M.file){M.file.status=c.FAILED;k(M.file);if(L.state==c.STARTED){L.trigger("CancelUpload");d(function(){J.call(L)},1)}}}function q(L){L.stop();c.each(p,function(M){M.destroy()});p=[];if(F.length){c.each(F,function(M){M.destroy()});F=[]}if(w.length){c.each(w,function(M){M.destroy()});w=[]}x={};n=false;C=v=null;K.reset()}G={runtimes:h.Runtime.order,max_retries:0,chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:false,max_file_size:0},resize:{enabled:false,preserve_headers:true,crop:false},send_chunk_number:true};m.call(this,l,null,true);K=new c.QueueProgress();c.extend(this,{id:t,uid:t,state:c.STOPPED,features:{},runtime:null,files:p,settings:G,total:K,init:function(){var L=this;if(typeof(G.preinit)=="function"){G.preinit(L)}else{c.each(G.preinit,function(N,M){L.bind(M,N)})}if(!G.browse_button||!G.url){this.trigger("Error",{code:c.INIT_ERROR,message:c.translate("Init error.")});return}y.call(this);z.call(this,G,function(M){if(typeof(G.init)=="function"){G.init(L)}else{c.each(G.init,function(O,N){L.bind(N,O)})}if(M){L.runtime=h.Runtime.getInfo(I()).type;L.trigger("Init",{runtime:L.runtime});L.trigger("PostInit")}else{L.trigger("Error",{code:c.INIT_ERROR,message:c.translate("Init error.")})}})},setOption:function(L,M){m.call(this,L,M,!this.runtime)},getOption:function(L){if(!L){return G}return G[L]},refresh:function(){if(F.length){c.each(F,function(L){L.trigger("Refresh")})}this.trigger("Refresh")},start:function(){if(this.state!=c.STARTED){this.state=c.STARTED;this.trigger("StateChanged");J.call(this)}},stop:function(){if(this.state!=c.STOPPED){this.state=c.STOPPED;this.trigger("StateChanged");this.trigger("CancelUpload")}},disableBrowse:function(){n=arguments[0]!==e?arguments[0]:true;if(F.length){c.each(F,function(L){L.disable(n)})}this.trigger("DisableBrowse",n)},getFile:function(M){var L;for(L=p.length-1;L>=0;L--){if(p[L].id===M){return p[L]}}},addFile:function(P,S){var M=this,L=[],R=[],N;function Q(V,U){var T=[];h.each(M.settings.filters,function(X,W){if(g[W]){T.push(function(Y){g[W].call(M,X,V,function(Z){Y(!Z)})})}});h.inSeries(T,U)}function O(T){var U=h.typeOf(T);if(T instanceof h.File){if(!T.ruid&&!T.isDetached()){if(!N){return false}T.ruid=N;T.connectRuntime(N)}O(new c.File(T))}else{if(T instanceof h.Blob){O(T.getSource());T.destroy()}else{if(T instanceof c.File){if(S){T.name=S}L.push(function(V){Q(T,function(W){if(!W){R.push(T);M.trigger("FileFiltered",T)}d(V,1)})})}else{if(h.inArray(U,["file","blob"])!==-1){O(new h.File(null,T))}else{if(U==="node"&&h.typeOf(T.files)==="filelist"){h.each(T.files,O)}else{if(U==="array"){S=null;h.each(T,O)}}}}}}}N=I();O(P);if(L.length){h.inSeries(L,function(){if(R.length){M.trigger("FilesAdded",R)}})}},removeFile:function(M){var N=typeof(M)==="string"?M:M.id;for(var L=p.length-1;L>=0;L--){if(p[L].id===N){return this.splice(L,1)[0]}}},splice:function(O,L){var M=p.splice(O===e?0:O,L===e?p.length:L);var N=false;if(this.state==c.STARTED){N=true;this.stop()}this.trigger("FilesRemoved",M);c.each(M,function(P){P.destroy()});this.trigger("QueueChanged");this.refresh();if(N){this.start()}return M},bind:function(M,O,N){var L=this;c.Uploader.prototype.bind.call(this,M,function(){var P=[].slice.call(arguments);P.splice(0,1,L);return O.apply(this,P)},0,N)},destroy:function(){this.trigger("Destroy");G=K=null;this.unbindAll()}})};c.Uploader.prototype=h.EventTarget.instance;c.File=(function(){var j={};function i(k){c.extend(this,{id:c.guid(),name:k.name||k.fileName,type:k.type||"",size:k.size||k.fileSize,origSize:k.size||k.fileSize,loaded:0,percent:0,status:c.QUEUED,lastModifiedDate:k.lastModifiedDate||(new Date()).toLocaleString(),getNative:function(){var l=this.getSource().getSource();return h.inArray(h.typeOf(l),["blob","file"])!==-1?l:null},getSource:function(){if(!j[this.id]){return null}return j[this.id]},destroy:function(){var l=this.getSource();if(l){l.destroy();delete j[this.id]}}});j[this.id]=k}return i}());c.QueueProgress=function(){var i=this;i.size=0;i.loaded=0;i.uploaded=0;i.failed=0;i.queued=0;i.percent=0;i.bytesPerSec=0;i.reset=function(){i.size=i.loaded=i.uploaded=i.failed=i.queued=i.percent=i.bytesPerSec=0}};f.plupload=c}(window,mOxie)); \ No newline at end of file +(function(f,h,e){var d=f.setTimeout,g={};function a(j){var i=j.required_features,k={};function l(n,o,m){var p={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};if(p[n]){k[p[n]]=o}else{if(!m){k[n]=o}}}if(typeof(i)==="string"){c.each(i.split(/\s*,\s*/),function(m){l(m,true)})}else{if(typeof(i)==="object"){c.each(i,function(n,m){l(m,n)})}else{if(i===true){if(j.chunk_size>0){k.slice_blob=true}if(j.resize.enabled||!j.multipart){k.send_binary_string=true}c.each(j,function(n,m){l(m,!!n,true)})}}}return k}var c={VERSION:"2.1.8",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:h.mimes,ua:h.ua,typeOf:h.typeOf,extend:h.extend,guid:h.guid,get:function b(m){var k=[],l;if(h.typeOf(m)!=="array"){m=[m]}var j=m.length;while(j--){l=h.get(m[j]);if(l){k.push(l)}}return k.length?k:null},each:h.each,getPos:h.getPos,getSize:h.getSize,xmlEncode:function(j){var k={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return j?(""+j).replace(i,function(l){return k[l]?"&"+k[l]+";":l}):j},toArray:h.toArray,inArray:h.inArray,addI18n:h.addI18n,translate:h.translate,isEmptyObj:h.isEmptyObj,hasClass:h.hasClass,addClass:h.addClass,removeClass:h.removeClass,getStyle:h.getStyle,addEvent:h.addEvent,removeEvent:h.removeEvent,removeAllEvents:h.removeAllEvents,cleanName:function(j){var k,l;l=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(k=0;k0?"&":"?")+k}return j},formatSize:function(j){if(j===e||/\D/.test(j)){return c.translate("N/A")}function i(m,l){return Math.round(m*Math.pow(10,l))/Math.pow(10,l)}var k=Math.pow(1024,4);if(j>k){return i(j/k,1)+" "+c.translate("tb")}if(j>(k/=1024)){return i(j/k,1)+" "+c.translate("gb")}if(j>(k/=1024)){return i(j/k,1)+" "+c.translate("mb")}if(j>1024){return Math.round(j/1024)+" "+c.translate("kb")}return j+" "+c.translate("b")},parseSize:h.parseSizeStr,predictRuntime:function(k,j){var i,l;i=new c.Uploader(k);l=h.Runtime.thatCan(i.getOption().required_features,j||k.runtimes);i.destroy();return l},addFileFilter:function(j,i){g[j]=i}};c.addFileFilter("mime_types",function(k,j,i){if(k.length&&!k.regexp.test(j.name)){this.trigger("Error",{code:c.FILE_EXTENSION_ERROR,message:c.translate("File extension error."),file:j});i(false)}else{i(true)}});c.addFileFilter("max_file_size",function(l,j,i){var k;l=c.parseSize(l);if(j.size!==k&&l&&j.size>l){this.trigger("Error",{code:c.FILE_SIZE_ERROR,message:c.translate("File size error."),file:j});i(false)}else{i(true)}});c.addFileFilter("prevent_duplicates",function(l,j,i){if(l){var k=this.files.length;while(k--){if(j.name===this.files[k].name&&j.size===this.files[k].size){this.trigger("Error",{code:c.FILE_DUPLICATE_ERROR,message:c.translate("Duplicate file error."),file:j});i(false);return}}}i(true)});c.Uploader=function(l){var t=c.guid(),G,p=[],x={},F=[],w=[],C,J,n=false,v;function I(){var L,M=0,K;if(this.state==c.STARTED){for(K=0;K0?Math.ceil(K.loaded/K.size*100):100;j()}function j(){var L,K;J.reset();for(L=0;L0?Math.ceil(J.uploaded/p.length*100):0}else{J.bytesPerSec=Math.ceil(J.loaded/((+new Date()-C||1)/1000));J.percent=J.size>0?Math.ceil(J.loaded/J.size*100):0}}function H(){var K=F[0]||w[0];if(K){return K.getRuntime().uid}return false}function E(L,K){if(L.ruid){var M=h.Runtime.getInfo(L.ruid);if(M){return M.can(K)}}return false}function y(){this.bind("FilesAdded FilesRemoved",function(K){K.trigger("QueueChanged");K.refresh()});this.bind("CancelUpload",i);this.bind("BeforeUpload",B);this.bind("UploadFile",D);this.bind("UploadProgress",u);this.bind("StateChanged",A);this.bind("QueueChanged",j);this.bind("Error",r);this.bind("FileUploaded",s);this.bind("Destroy",q)}function z(P,M){var N=this,L=0,K=[];var O={runtime_order:P.runtimes,required_caps:P.required_features,preferred_caps:x,swf_url:P.flash_swf_url,xap_url:P.silverlight_xap_url};c.each(P.runtimes.split(/\s*,\s*/),function(Q){if(P[Q]){O[Q]=P[Q]}});if(P.browse_button){c.each(P.browse_button,function(Q){K.push(function(R){var S=new h.FileInput(c.extend({},O,{accept:P.filters.mime_types,name:P.file_data_name,multiple:P.multi_selection,container:P.container,browse_button:Q}));S.onready=function(){var T=h.Runtime.getInfo(this.ruid);h.extend(N.features,{chunks:T.can("slice_blob"),multipart:T.can("send_multipart"),multi_selection:T.can("select_multiple")});L++;F.push(this);R()};S.onchange=function(){N.addFile(this.files)};S.bind("mouseenter mouseleave mousedown mouseup",function(T){if(!n){if(P.browse_button_hover){if("mouseenter"===T.type){h.addClass(Q,P.browse_button_hover)}else{if("mouseleave"===T.type){h.removeClass(Q,P.browse_button_hover)}}}if(P.browse_button_active){if("mousedown"===T.type){h.addClass(Q,P.browse_button_active)}else{if("mouseup"===T.type){h.removeClass(Q,P.browse_button_active)}}}}});S.bind("mousedown",function(){N.trigger("Browse")});S.bind("error runtimeerror",function(){S=null;R()});S.init()})})}if(P.drop_element){c.each(P.drop_element,function(Q){K.push(function(R){var S=new h.FileDrop(c.extend({},O,{drop_zone:Q}));S.onready=function(){var T=h.Runtime.getInfo(this.ruid);N.features.dragdrop=T.can("drag_and_drop");L++;w.push(this);R()};S.ondrop=function(){N.addFile(this.files)};S.bind("error runtimeerror",function(){S=null;R()});S.init()})})}h.inSeries(K,function(){if(typeof(M)==="function"){M(L)}})}function o(M,O,K){var L=new h.Image();try{L.onload=function(){if(O.width>this.width&&O.height>this.height&&O.quality===e&&O.preserve_headers&&!O.crop){this.destroy();return K(M)}L.downsize(O.width,O.height,O.crop,O.preserve_headers)};L.onresize=function(){K(this.getAsBlob(M.type,O.quality));this.destroy()};L.onerror=function(){K(M)};L.load(M)}catch(N){K(M)}}function m(M,O,P){var L=this,K=false;function N(R,S,T){var Q=G[R];switch(R){case"max_file_size":if(R==="max_file_size"){G.max_file_size=G.filters.max_file_size=S}break;case"chunk_size":if(S=c.parseSize(S)){G[R]=S;G.send_file_name=true}break;case"multipart":G[R]=S;if(!S){G.send_file_name=true}break;case"unique_names":G[R]=S;if(S){G.send_file_name=true}break;case"filters":if(c.typeOf(S)==="array"){S={mime_types:S}}if(T){c.extend(G.filters,S)}else{G.filters=S}if(S.mime_types){G.filters.mime_types.regexp=(function(U){var V=[];c.each(U,function(W){c.each(W.extensions.split(/,/),function(X){if(/^\s*\*\s*$/.test(X)){V.push("\\.*")}else{V.push("\\."+X.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))}})});return new RegExp("("+V.join("|")+")$","i")}(G.filters.mime_types))}break;case"resize":if(T){c.extend(G.resize,S,{enabled:true})}else{G.resize=S}break;case"prevent_duplicates":G.prevent_duplicates=G.filters.prevent_duplicates=!!S;break;case"browse_button":case"drop_element":S=c.get(S);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":G[R]=S;if(!T){K=true}break;default:G[R]=S}if(!T){L.trigger("OptionChanged",R,S,Q)}}if(typeof(M)==="object"){c.each(M,function(R,Q){N(Q,R,P)})}else{N(M,O,P)}if(P){G.required_features=a(c.extend({},G));x=a(c.extend({},G,{required_features:true}))}else{if(K){L.trigger("Destroy");z.call(L,G,function(Q){if(Q){L.runtime=h.Runtime.getInfo(H()).type;L.trigger("Init",{runtime:L.runtime});L.trigger("PostInit")}else{L.trigger("Error",{code:c.INIT_ERROR,message:c.translate("Init error.")})}})}}}function B(K,L){if(K.settings.unique_names){var N=L.name.match(/\.([^.]+)$/),M="part";if(N){M=N[1]}L.target_name=L.id+"."+M}}function D(S,P){var M=S.settings.url,Q=S.settings.chunk_size,T=S.settings.max_retries,N=S.features,R=0,K;if(P.loaded){R=P.loaded=Q?Q*Math.floor(P.loaded/Q):0}function O(){if(T-->0){d(L,1000)}else{P.loaded=R;S.trigger("Error",{code:c.HTTP_ERROR,message:c.translate("HTTP Error."),file:P,response:v.responseText,status:v.status,responseHeaders:v.getAllResponseHeaders()})}}function L(){var W,V,U={},X;if(P.status!==c.UPLOADING||S.state===c.STOPPED){return}if(S.settings.send_file_name){U.name=P.target_name||P.name}if(Q&&N.chunks&&K.size>Q){X=Math.min(Q,K.size-R);W=K.slice(R,R+X)}else{X=K.size;W=K}if(Q&&N.chunks){if(S.settings.send_chunk_number){U.chunk=Math.ceil(R/Q);U.chunks=Math.ceil(K.size/Q)}else{U.offset=R;U.total=K.size}}v=new h.XMLHttpRequest();if(v.upload){v.upload.onprogress=function(Y){P.loaded=Math.min(P.size,R+Y.loaded);S.trigger("UploadProgress",P)}}v.onload=function(){if(v.status>=400){O();return}T=S.settings.max_retries;if(X=K.size){if(P.size!=P.origSize){K.destroy();K=null}S.trigger("UploadProgress",P);P.status=c.DONE;S.trigger("FileUploaded",P,{response:v.responseText,status:v.status,responseHeaders:v.getAllResponseHeaders()})}else{d(L,1)}};v.onerror=function(){O()};v.onloadend=function(){this.destroy();v=null};if(S.settings.multipart&&N.multipart){v.open("post",M,true);c.each(S.settings.headers,function(Z,Y){v.setRequestHeader(Y,Z)});V=new h.FormData();c.each(c.extend(U,S.settings.multipart_params),function(Z,Y){V.append(Y,Z)});V.append(S.settings.file_data_name,W);v.send(V,{runtime_order:S.settings.runtimes,required_caps:S.settings.required_features,preferred_caps:x,swf_url:S.settings.flash_swf_url,xap_url:S.settings.silverlight_xap_url})}else{M=c.buildUrl(S.settings.url,c.extend(U,S.settings.multipart_params));v.open("post",M,true);v.setRequestHeader("Content-Type","application/octet-stream");c.each(S.settings.headers,function(Z,Y){v.setRequestHeader(Y,Z)});v.send(W,{runtime_order:S.settings.runtimes,required_caps:S.settings.required_features,preferred_caps:x,swf_url:S.settings.flash_swf_url,xap_url:S.settings.silverlight_xap_url})}}K=P.getSource();if(S.settings.resize.enabled&&E(K,"send_binary_string")&&!!~h.inArray(K.type,["image/jpeg","image/png"])){o.call(this,K,S.settings.resize,function(U){K=U;P.size=U.size;L()})}else{L()}}function u(K,L){k(L)}function A(K){if(K.state==c.STARTED){C=(+new Date())}else{if(K.state==c.STOPPED){for(var L=K.files.length-1;L>=0;L--){if(K.files[L].status==c.UPLOADING){K.files[L].status=c.QUEUED;j()}}}}}function i(){if(v){v.abort()}}function s(K){j();d(function(){I.call(K)},1)}function r(K,L){if(L.code===c.INIT_ERROR){K.destroy()}else{if(L.code===c.HTTP_ERROR){L.file.status=c.FAILED;k(L.file);if(K.state==c.STARTED){K.trigger("CancelUpload");d(function(){I.call(K)},1)}}}}function q(K){K.stop();c.each(p,function(L){L.destroy()});p=[];if(F.length){c.each(F,function(L){L.destroy()});F=[]}if(w.length){c.each(w,function(L){L.destroy()});w=[]}x={};n=false;C=v=null;J.reset()}G={runtimes:h.Runtime.order,max_retries:0,chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:false,max_file_size:0},resize:{enabled:false,preserve_headers:true,crop:false},send_file_name:true,send_chunk_number:true};m.call(this,l,null,true);J=new c.QueueProgress();c.extend(this,{id:t,uid:t,state:c.STOPPED,features:{},runtime:null,files:p,settings:G,total:J,init:function(){var K=this;if(typeof(G.preinit)=="function"){G.preinit(K)}else{c.each(G.preinit,function(M,L){K.bind(L,M)})}y.call(this);if(!G.browse_button||!G.url){this.trigger("Error",{code:c.INIT_ERROR,message:c.translate("Init error.")});return}z.call(this,G,function(L){if(typeof(G.init)=="function"){G.init(K)}else{c.each(G.init,function(N,M){K.bind(M,N)})}if(L){K.runtime=h.Runtime.getInfo(H()).type;K.trigger("Init",{runtime:K.runtime});K.trigger("PostInit")}else{K.trigger("Error",{code:c.INIT_ERROR,message:c.translate("Init error.")})}})},setOption:function(K,L){m.call(this,K,L,!this.runtime)},getOption:function(K){if(!K){return G}return G[K]},refresh:function(){if(F.length){c.each(F,function(K){K.trigger("Refresh")})}this.trigger("Refresh")},start:function(){if(this.state!=c.STARTED){this.state=c.STARTED;this.trigger("StateChanged");I.call(this)}},stop:function(){if(this.state!=c.STOPPED){this.state=c.STOPPED;this.trigger("StateChanged");this.trigger("CancelUpload")}},disableBrowse:function(){n=arguments[0]!==e?arguments[0]:true;if(F.length){c.each(F,function(K){K.disable(n)})}this.trigger("DisableBrowse",n)},getFile:function(L){var K;for(K=p.length-1;K>=0;K--){if(p[K].id===L){return p[K]}}},addFile:function(P,R){var M=this,K=[],L=[],N;function Q(U,T){var S=[];h.each(M.settings.filters,function(W,V){if(g[V]){S.push(function(X){g[V].call(M,W,U,function(Y){X(!Y)})})}});h.inSeries(S,T)}function O(S){var T=h.typeOf(S);if(S instanceof h.File){if(!S.ruid&&!S.isDetached()){if(!N){return false}S.ruid=N;S.connectRuntime(N)}O(new c.File(S))}else{if(S instanceof h.Blob){O(S.getSource());S.destroy()}else{if(S instanceof c.File){if(R){S.name=R}K.push(function(U){Q(S,function(V){if(!V){p.push(S);L.push(S);M.trigger("FileFiltered",S)}d(U,1)})})}else{if(h.inArray(T,["file","blob"])!==-1){O(new h.File(null,S))}else{if(T==="node"&&h.typeOf(S.files)==="filelist"){h.each(S.files,O)}else{if(T==="array"){R=null;h.each(S,O)}}}}}}}N=H();O(P);if(K.length){h.inSeries(K,function(){if(L.length){M.trigger("FilesAdded",L)}})}},removeFile:function(L){var M=typeof(L)==="string"?L:L.id;for(var K=p.length-1;K>=0;K--){if(p[K].id===M){return this.splice(K,1)[0]}}},splice:function(N,K){var L=p.splice(N===e?0:N,K===e?p.length:K);var M=false;if(this.state==c.STARTED){c.each(L,function(O){if(O.status===c.UPLOADING){M=true;return false}});if(M){this.stop()}}this.trigger("FilesRemoved",L);c.each(L,function(O){O.destroy()});if(M){this.start()}return L},dispatchEvent:function(N){var O,L,K;N=N.toLowerCase();O=this.hasEventListener(N);if(O){O.sort(function(Q,P){return P.priority-Q.priority});L=[].slice.call(arguments);L.shift();L.unshift(this);for(var M=0;M?@[\\\\\\]^_`{|}~-]";var I="\\\\"+r;var aj='"('+I+'|[^"\\x00])*"';var D="'("+I+"|[^'\\x00])*'";var aq="\\(("+I+"|[^)\\x00])*\\)";var ad="[^\\\\()\\x00-\\x20]";var Q="\\(("+ad+"|"+I+")*\\)";var aE="[A-Za-z][A-Za-z0-9]*";var ay="(?:article|header|aside|hgroup|iframe|blockquote|hr|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)";var ae="[a-zA-Z_:][a-zA-Z0-9:._-]*";var x="[^\"'=<>`\\x00-\\x20]+";var U="'[^']*'";var B='"[^"]*"';var ac="(?:"+x+"|"+U+"|"+B+")";var X="(?:\\s*=\\s*"+ac+")";var at="(?:\\s+"+ae+X+"?)";var aA="<"+aE+at+"*\\s*/?>";var al="]";var aC="<"+ay+at+"*\\s*/?>";var ak="]";var e="";var V="[<][?].*?[?][>]";var au="]*>";var o="])*\\]\\]>";var t="(?:"+aA+"|"+al+"|"+e+"|"+V+"|"+au+"|"+o+")";var g="<(?:"+ay+"[\\s/>]|/"+ay+"[\\s>]|[?!])";var p=new RegExp("^"+t,"i");var N=new RegExp("^"+g,"i");var E=new RegExp('^(?:"('+I+'|[^"\\x00])*"|\'('+I+"|[^'\\x00])*'|\\(("+I+"|[^)\\x00])*\\))");var M=new RegExp("^(?:[<](?:[^<>\\n\\\\\\x00]|"+I+"|\\\\)*[>])");var F=new RegExp("^(?:"+ad+"+|"+I+"|"+Q+")*");var w=new RegExp(r);var G=new RegExp("\\\\("+r+")","g");var i=new RegExp("^\\\\("+r+")");var az=/\t/g;var l=/^(?:(?:\* *){3,}|(?:_ *){3,}|(?:- *){3,}) *$/;var m=/^(?:[\n`\[\]\\!<&*_]|[^\n`\[\]\\!<&*_]+)/m;var aD=function(aI){return aI.replace(G,"$1")};var q=function(aI){return/^\s*$/.test(aI)};var aa=function(aI){return aI.trim().replace(/\s+/," ").toUpperCase()};var aH=function(aK,aJ,aL){var aI=aJ.slice(aL).match(aK);if(aI){return aL+aI.index}else{return null}};var u=function(aJ){if(aJ.indexOf("\t")==-1){return aJ}else{var aI=0;return aJ.replace(az,function(aL,aM){var aK=" ".slice((aM-aI)%4);aI=aM+1;return aK})}};var an=function(aJ){var aI=aJ.exec(this.subject.slice(this.pos));if(aI){this.pos+=aI.index+aI[0].length;return aI[0]}else{return null}};var av=function(){return this.subject.charAt(this.pos)||null};var h=function(){this.match(/^ *(?:\n *)?/);return 1};var H=function(aK){var aN=this.pos;var aM=this.match(/^`+/);if(!aM){return 0}var aJ=this.pos;var aI=false;var aL;while(!aI&&(aL=this.match(/`+/m))){if(aL==aM){aK.push({t:"Code",c:this.subject.slice(aJ,this.pos-aM.length).replace(/[ \n]+/g," ").trim()});return(this.pos-aN)}}aK.push({t:"Str",c:aM});this.pos=aJ;return(this.pos-aN)};var S=function(aJ){var aI=this.subject,aK=this.pos;if(aI.charAt(aK)==="\\"){if(aI.charAt(aK+1)==="\n"){aJ.push({t:"Hardbreak"});this.pos=this.pos+2;return 2}else{if(w.test(aI.charAt(aK+1))){aJ.push({t:"Str",c:aI.charAt(aK+1)});this.pos=this.pos+2;return 2}else{this.pos++;aJ.push({t:"Str",c:"\\"});return 1}}}else{return 0}};var K=function(aJ){var aI;var aK;if((aI=this.match(/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/))){aK=aI.slice(1,-1);aJ.push({t:"Link",label:[{t:"Str",c:aK}],destination:"mailto:"+aK});return aI.length}else{if((aI=this.match(/^<(?:coap|doi|javascript|aaa|aaas|about|acap|cap|cid|crid|data|dav|dict|dns|file|ftp|geo|go|gopher|h323|http|https|iax|icap|im|imap|info|ipp|iris|iris.beep|iris.xpc|iris.xpcs|iris.lwz|ldap|mailto|mid|msrp|msrps|mtqp|mupdate|news|nfs|ni|nih|nntp|opaquelocktoken|pop|pres|rtsp|service|session|shttp|sieve|sip|sips|sms|snmp|soap.beep|soap.beeps|tag|tel|telnet|tftp|thismessage|tn3270|tip|tv|urn|vemmi|ws|wss|xcon|xcon-userid|xmlrpc.beep|xmlrpc.beeps|xmpp|z39.50r|z39.50s|adiumxtra|afp|afs|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|chrome|chrome-extension|com-eventbrite-attendee|content|cvs|dlna-playsingle|dlna-playcontainer|dtn|dvb|ed2k|facetime|feed|finger|fish|gg|git|gizmoproject|gtalk|hcp|icon|ipn|irc|irc6|ircs|itms|jar|jms|keyparc|lastfm|ldaps|magnet|maps|market|message|mms|ms-help|msnim|mumble|mvn|notes|oid|palm|paparazzi|platform|proxy|psyc|query|res|resource|rmi|rsync|rtmp|secondlife|sftp|sgn|skype|smb|soldat|spotify|ssh|steam|svn|teamspeak|things|udp|unreal|ut2004|ventrilo|view-source|webcal|wtai|wyciwyg|xfire|xri|ymsgr):[^<>\x00-\x20]*>/i))){aK=aI.slice(1,-1);aJ.push({t:"Link",label:[{t:"Str",c:aK}],destination:aK});return aI.length}else{return 0}}};var d=function(aJ){var aI=this.match(p);if(aI){aJ.push({t:"Html",c:aI});return aI.length}else{return 0}};var ai=function(aP){var aO=0;var aK=0;var aN,aJ;var aL=this.pos;aN=this.pos===0?"\n":this.subject.charAt(this.pos-1);while(this.peek()===aP){aO++;this.pos++}aJ=this.peek()||"\n";var aM=aO>0&&aO<=3&&!(/\s/.test(aJ));var aI=aO>0&&aO<=3&&!(/\s/.test(aN));if(aP==="_"){aM=aM&&!((/[a-z0-9]/i).test(aN));aI=aI&&!((/[a-z0-9]/i).test(aJ))}this.pos=aL;return{numdelims:aO,can_open:aM,can_close:aI}};var Y=function(aK){var aM=this.pos;var aP;var aN=0;var aJ=this.peek();if(aJ=="*"||aJ=="_"){aP=aJ}else{return 0}var aO;var aL;res=this.scanDelims(aP);aO=res.numdelims;this.pos+=aO;aK.push({t:"Str",c:this.subject.substr(this.pos-aO,aO)});aL=aK.length-1;if(!res.can_open||aO===0){return 0}var aI=0;switch(aO){case 1:while(true){res=this.scanDelims(aP);if(res.numdelims>=1&&res.can_close){this.pos+=1;aK[aL].t="Emph";aK[aL].c=aK.slice(aL+1);aK.splice(aL+1,aK.length-aL-1);break}else{if(this.parseInline(aK)===0){break}}}return(this.pos-aM);case 2:while(true){res=this.scanDelims(aP);if(res.numdelims>=2&&res.can_close){this.pos+=2;aK[aL].t="Strong";aK[aL].c=aK.slice(aL+1);aK.splice(aL+1,aK.length-aL-1);break}else{if(this.parseInline(aK)===0){break}}}return(this.pos-aM);case 3:while(true){res=this.scanDelims(aP);if(res.numdelims>=1&&res.numdelims<=3&&res.can_close&&res.numdelims!=aI){if(aI===1&&aO>2){res.numdelims=2}else{if(aI===2){res.numdelims=1}else{if(res.numdelims===3){res.numdelims=1}}}this.pos+=res.numdelims;if(aN>0){aK[aL].t=aI===1?"Strong":"Emph";aK[aL].c=[{t:aI===1?"Emph":"Strong",c:aK.slice(aL+1,aN)}].concat(aK.slice(aN+1));aK.splice(aL+1);break}else{aK.push({t:"Str",c:this.subject.slice(this.pos-res.numdelims,this.pos)});aN=aK.length-1;aI=res.numdelims}}else{if(this.parseInline(aK)===0){break}}}return(this.pos-aM);default:return res}return 0};var A=function(){var aI=this.match(E);if(aI){return aD(aI.substr(1,aI.length-2))}else{return null}};var J=function(){var aI=this.match(M);if(aI){return aD(aI.substr(1,aI.length-2))}else{aI=this.match(F);if(aI!==null){return aD(aI)}else{return null}}};var y=function(){if(this.peek()!="["){return 0}var aJ=this.pos;var aI=0;if(this.label_nest_level>0){this.label_nest_level--;return 0}this.pos++;var aK;while((aK=this.peek())&&(aK!="]"||aI>0)){switch(aK){case"`":this.parseBackticks([]);break;case"<":this.parseAutolink([])||this.parseHtmlTag([])||this.parseString([]);break;case"[":aI++;this.pos++;break;case"]":aI--;this.pos++;break;case"\\":this.parseEscaped([]);break;default:this.parseString([])}}if(aK==="]"){this.label_nest_level=0;this.pos++;return this.pos-aJ}else{if(!aK){this.label_nest_level=aI}this.pos=aJ;return 0}};var O=function(aI){return new j().parse(aI.substr(1,aI.length-2),{})};var Z=function(aN){var aM=this.pos;var aK;var aJ;var aS;var aR;aJ=this.parseLinkLabel();if(aJ===0){return 0}var aP=this.pos;var aL=this.subject.substr(aM,aJ);if(this.peek()=="("){this.pos++;if(this.spnl()&&((aS=this.parseLinkDestination())!==null)&&this.spnl()&&(/^\s/.test(this.subject.charAt(this.pos-1))&&(aR=this.parseLinkTitle()||"")||true)&&this.spnl()&&this.match(/^\)/)){aN.push({t:"Link",destination:aS,title:aR,label:O(aL)});return this.pos-aM}else{this.pos=aM;return 0}}var aI=this.pos;this.spnl();var aO=this.pos;aJ=this.parseLinkLabel();if(aJ==2){aK=aL}else{if(aJ>0){aK=this.subject.slice(aO,aO+aJ)}else{this.pos=aI;aK=aL}}var aQ=this.refmap[aa(aK)];if(aQ){aN.push({t:"Link",destination:aQ.destination,title:aQ.title,label:O(aL)});return this.pos-aM}else{this.pos=aM;return 0}this.pos=aM;return 0};var aB=function(aJ){var aI;if((aI=this.match(/^&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});/i))){aJ.push({t:"Entity",c:aI});return aI.length}else{return 0}};var a=function(aJ){var aI;if((aI=this.match(m))){aJ.push({t:"Str",c:aI});return aI.length}else{return 0}};var c=function(aI){if(this.peek()=="\n"){this.pos++;var aJ=aI[aI.length-1];if(aJ&&aJ.t=="Str"&&aJ.c.slice(-2)==" "){aJ.c=aJ.c.replace(/ *$/,"");aI.push({t:"Hardbreak"})}else{if(aJ&&aJ.t=="Str"&&aJ.c.slice(-1)==" "){aJ.c=aJ.c.slice(0,-1)}aI.push({t:"Softbreak"})}return 1}else{return 0}};var aF=function(aI){if(this.match(/^!/)){var aJ=this.parseLink(aI);if(aJ===0){aI.push({t:"Str",c:"!"});return 1}else{if(aI[aI.length-1]&&aI[aI.length-1].t=="Link"){aI[aI.length-1].t="Image";return aJ+1}else{throw"Shouldn't happen"}}}else{return 0}};var ab=function(aR,aM){this.subject=aR;this.pos=0;var aJ;var aP;var aN;var aQ;var aK=this.pos;var aI;aQ=this.parseLinkLabel();if(aQ===0){return 0}else{aJ=this.subject.substr(0,aQ)}if(this.peek()===":"){this.pos++}else{this.pos=aK;return 0}this.spnl();aP=this.parseLinkDestination();if(aP===null||aP.length===0){this.pos=aK;return 0}var aL=this.pos;this.spnl();aN=this.parseLinkTitle();if(aN===null){aN="";this.pos=aL}if(this.match(/^ *(?:\n|$)/)===null){this.pos=aK;return 0}var aO=aa(aJ);if(!aM[aO]){aM[aO]={destination:aP,title:aN}}return this.pos-aK};var L=function(aI){var aK=this.peek();var aJ;switch(aK){case"\n":aJ=this.parseNewline(aI);break;case"\\":aJ=this.parseEscaped(aI);break;case"`":aJ=this.parseBackticks(aI);break;case"*":case"_":aJ=this.parseEmphasis(aI);break;case"[":aJ=this.parseLink(aI);break;case"!":aJ=this.parseImage(aI);break;case"<":aJ=this.parseAutolink(aI)||this.parseHtmlTag(aI);break;case"&":aJ=this.parseEntity(aI);break;default:}return aJ||this.parseString(aI)};var W=function(aJ,aK){this.subject=aJ;this.pos=0;this.refmap=aK||{};var aI=[];while(this.parseInline(aI)){}return aI};function j(){return{subject:"",label_nest_level:0,pos:0,refmap:{},match:an,peek:av,spnl:h,parseBackticks:H,parseEscaped:S,parseAutolink:K,parseHtmlTag:d,scanDelims:ai,parseEmphasis:Y,parseLinkTitle:A,parseLinkDestination:J,parseLinkLabel:y,parseLink:Z,parseEntity:aB,parseString:a,parseNewline:c,parseImage:aF,parseReference:ab,parseInline:L,parse:W}}var z=function(aI,aK,aJ){return{t:aI,open:true,last_line_blank:false,start_line:aK,start_column:aJ,end_line:aK,children:[],parent:null,string_content:"",strings:[],inline_content:[]}};var s=function(aJ,aI){return(aJ=="Document"||aJ=="BlockQuote"||aJ=="ListItem"||(aJ=="List"&&aI=="ListItem"))};var P=function(aI){return(aI=="Paragraph"||aI=="IndentedCode"||aI=="FencedCode")};var aw=function(aI){if(aI.last_line_blank){return true}if((aI.t=="List"||aI.t=="ListItem")&&aI.children.length>0){return aw(aI.children[aI.children.length-1])}else{return false}};var k=function(aL,aJ){var aI=aL;var aK=null;do{if(aI.t==="List"){aK=aI}aI=aI.parent}while(aI);if(aK){while(aL!=aK){this.finalize(aL,aJ);aL=aL.parent}this.finalize(aK,aJ);this.tip=aK.parent}};var ao=function(aJ,aK){var aI=aJ.slice(aK);if(!(this.tip.open)){throw ({msg:"Attempted to add line ("+aJ+") to closed container."})}this.tip.strings.push(aI)};var ar=function(aI,aJ,aK){while(!s(this.tip.t,aI)){this.finalize(this.tip,aJ)}var aM=aK+1;var aL=z(aI,aJ,aM);this.tip.children.push(aL);aL.parent=this.tip;this.tip=aL;return aL};var C=function(aL,aO){var aK=aL.slice(aO);var aJ;var aN;var aM={};if(aK.match(l)){return null}if((aJ=aK.match(/^[*+-]( +|$)/))){aN=aJ[1].length;aM.type="Bullet";aM.bullet_char=aJ[0].charAt(0)}else{if((aJ=aK.match(/^(\d+)([.)])( +|$)/))){aN=aJ[3].length;aM.type="Ordered";aM.start=parseInt(aJ[1]);aM.delimiter=aJ[2]}else{return null}}var aI=aJ[0].length===aK.length;if(aN>=5||aN<1||aI){aM.padding=aJ[0].length-aN+1}else{aM.padding=aJ[0].length}return aM};var b=function(aJ,aI){return(aJ.type===aI.type&&aJ.delimiter===aI.delimiter&&aJ.bullet_char===aI.bullet_char)};var n=function(aQ,a0){var aL=true;var aW;var aV;var aM=0;var aN;var aZ;var aO;var aR;var aK;var aY;var aT=4;var aS=this.doc;var aX=this.tip;aQ=u(aQ);while(aS.children.length>0){aW=aS.children[aS.children.length-1];if(!aW.open){break}aS=aW;aN=aH(/[^ ]/,aQ,aM);if(aN===null){aV=aQ.length;aO=true}else{aV=aN;aO=false}aR=aV-aM;switch(aS.t){case"BlockQuote":var aP=aR<=3&&aQ.charAt(aV)===">";if(aP){aM=aV+1;if(aQ.charAt(aM)===" "){aM++}}else{aL=false}break;case"ListItem":if(aR>=aS.list_data.marker_offset+aS.list_data.padding){aM+=aS.list_data.marker_offset+aS.list_data.padding}else{if(aO){aM=aV}else{aL=false}}break;case"IndentedCode":if(aR>=aT){aM+=aT}else{if(aO){aM=aV}else{aL=false}}break;case"ATXHeader":case"SetextHeader":case"HorizontalRule":aL=false;break;case"FencedCode":aY=aS.fence_offset;while(aY>0&&aQ.charAt(aM)===" "){aM++;aY--}break;case"HtmlBlock":if(aO){aL=false}break;case"Paragraph":if(aO){aS.last_line_blank=true;aL=false}break;default:}if(!aL){aS=aS.parent;break}}aK=aS;var aI=function(a1){while(!a2&&aX!=aK){a1.finalize(aX,a0);aX=aX.parent}var a2=true};if(aO&&aS.last_line_blank){this.breakOutOfLists(aS,a0)}while(aS.t!="FencedCode"&&aS.t!="IndentedCode"&&aS.t!="HtmlBlock"&&aH(/^[ #`~*+_=<>0-9-]/,aQ,aM)!==null){aN=aH(/[^ ]/,aQ,aM);if(aN===null){aV=aQ.length;aO=true}else{aV=aN;aO=false}aR=aV-aM;if(aR>=aT){if(this.tip.t!="Paragraph"&&!aO){aM+=aT;aI(this);aS=this.addChild("IndentedCode",a0,aM)}else{break}}else{if(aQ.charAt(aV)===">"){aM=aV+1;if(aQ.charAt(aM)===" "){aM++}aI(this);aS=this.addChild("BlockQuote",a0,aM)}else{if((aN=aQ.slice(aV).match(/^#{1,6}(?: +|$)/))){aM=aV+aN[0].length;aI(this);aS=this.addChild("ATXHeader",a0,aV);aS.level=aN[0].trim().length;aS.strings=[aQ.slice(aM).replace(/(?:(\\#) *#*| *#+) *$/,"$1")];break}else{if((aN=aQ.slice(aV).match(/^`{3,}(?!.*`)|^~{3,}(?!.*~)/))){var aU=aN[0].length;aI(this);aS=this.addChild("FencedCode",a0,aV);aS.fence_length=aU;aS.fence_char=aN[0].charAt(0);aS.fence_offset=aV-aM;aM=aV+aU;break}else{if(aH(N,aQ,aV)!==null){aI(this);aS=this.addChild("HtmlBlock",a0,aV);break}else{if(aS.t=="Paragraph"&&aS.strings.length===1&&((aN=aQ.slice(aV).match(/^(?:=+|-+) *$/)))){aI(this);aS.t="SetextHeader";aS.level=aN[0].charAt(0)==="="?1:2;aM=aQ.length}else{if(aH(l,aQ,aV)!==null){aI(this);aS=this.addChild("HorizontalRule",a0,aV);aM=aQ.length-1;break}else{if((aZ=C(aQ,aV))){aI(this);aZ.marker_offset=aR;aM=aV+aZ.padding;if(aS.t!=="List"||!(b(aS.list_data,aZ))){aS=this.addChild("List",a0,aV);aS.list_data=aZ}aS=this.addChild("ListItem",a0,aV);aS.list_data=aZ}else{break}}}}}}}}if(P(aS.t)){break}}aN=aH(/[^ ]/,aQ,aM);if(aN===null){aV=aQ.length;aO=true}else{aV=aN;aO=false}aR=aV-aM;if(this.tip!==aK&&!aO&&this.tip.t=="Paragraph"&&this.tip.strings.length>0){this.last_line_blank=false;this.addLine(aQ,aM)}else{aI(this);aS.last_line_blank=aO&&!(aS.t=="BlockQuote"||aS.t=="FencedCode"||(aS.t=="ListItem"&&aS.children.length===0&&aS.start_line==a0));var aJ=aS;while(aJ.parent){aJ.parent.last_line_blank=false;aJ=aJ.parent}switch(aS.t){case"IndentedCode":case"HtmlBlock":this.addLine(aQ,aM);break;case"FencedCode":aN=(aR<=3&&aQ.charAt(aV)==aS.fence_char&&aQ.slice(aV).match(/^(?:`{3,}|~{3,})(?= *$)/));if(aN&&aN[0].length>=aS.fence_length){this.finalize(aS,a0)}else{this.addLine(aQ,aM)}break;case"ATXHeader":case"SetextHeader":case"HorizontalRule":break;default:if(P(aS.t)){this.addLine(aQ,aV)}else{if(aO){}else{if(aS.t!="HorizontalRule"&&aS.t!="SetextHeader"){aS=this.addChild("Paragraph",a0,aV);this.addLine(aQ,aV)}else{console.log("Line "+a0.toString()+" with container type "+aS.t+" did not match any condition.")}}}}}};var aG=function(aK,aI){var aN;if(!aK.open){return 0}aK.open=false;if(aI>aK.start_line){aK.end_line=aI-1}else{aK.end_line=aI}switch(aK.t){case"Paragraph":aK.string_content=aK.strings.join("\n").replace(/^ */m,"");while(aK.string_content.charAt(0)==="["&&(aN=this.inlineParser.parseReference(aK.string_content,this.refmap))){aK.string_content=aK.string_content.slice(aN);if(q(aK.string_content)){aK.t="ReferenceDef";break}}break;case"ATXHeader":case"SetextHeader":case"HtmlBlock":aK.string_content=aK.strings.join("\n");break;case"IndentedCode":aK.string_content=aK.strings.join("\n").replace(/(\n *)*$/,"\n");break;case"FencedCode":aK.info=aD(aK.strings[0].trim());if(aK.strings.length==1){aK.string_content=""}else{aK.string_content=aK.strings.slice(1).join("\n")+"\n"}break;case"List":aK.tight=true;var aQ=aK.children.length;var aM=0;while(aM",aM,"")}else{if(aL){aI=aI+" />"}else{aI=aI.concat(">")}}return aI};var ap=function(aJ){var aI;switch(aJ.t){case"Str":return this.escape(aJ.c);case"Softbreak":return this.softbreak;case"Hardbreak":return T("br",[],"",true)+"\n";case"Emph":return T("em",[],this.renderInlines(aJ.c));case"Strong":return T("strong",[],this.renderInlines(aJ.c));case"Html":return aJ.c;case"Entity":return aJ.c;case"Link":aI=[["href",this.escape(aJ.destination,true)]];if(aJ.title){aI.push(["title",this.escape(aJ.title,true)])}return T("a",aI,this.renderInlines(aJ.label));case"Image":aI=[["src",this.escape(aJ.destination,true)],["alt",this.escape(this.renderInlines(aJ.label))]];if(aJ.title){aI.push(["title",this.escape(aJ.title,true)])}return T("img",aI,"",true);case"Code":return T("code",[],this.escape(aJ.c));default:console.log("Uknown inline type "+aJ.t);return""}};var v=function(aJ){var aI="";for(var aK=0;aK]/g,">").replace(/["]/g,""")}else{return aI.replace(/[&]/g,"&").replace(/[<]/g,"<").replace(/[>]/g,">").replace(/["]/g,""")}},renderInline:ap,renderInlines:v,renderBlock:ag,renderBlocks:am,render:ag}}R.DocParser=af;R.HtmlRenderer=ax})(typeof exports==="undefined"?this.stmd={}:exports); \ No newline at end of file diff --git a/static/admin/style.css b/static/admin/style.css index 7c9a118..0ae6e3a 100644 --- a/static/admin/style.css +++ b/static/admin/style.css @@ -1 +1,3 @@ +/*!normalize.css v2.1.3 | MIT License | git.io/normalize */ article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden],template{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a{background:transparent;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;} +.container,.row [class*="col-"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}.container{margin-left:auto;margin-right:auto;padding-left:10px;padding-right:10px;}.row{margin-right:-10px;margin-left:-10px;}.row [class*="col-"]{float:left;min-height:1px;padding-right:10px;padding-left:10px;}.row [class*="-push-"],.row [class*="-pull-"]{position:relative;}.col-mb-1{width:8.33333%;}.col-mb-2{width:16.66667%;}.col-mb-3{width:25%;}.col-mb-4{width:33.33333%;}.col-mb-5{width:41.66667%;}.col-mb-6{width:50%;}.col-mb-7{width:58.33333%;}.col-mb-8{width:66.66667%;}.col-mb-9{width:75%;}.col-mb-10{width:83.33333%;}.col-mb-11{width:91.66667%;}.col-mb-12{width:100%;}@media(min-width:768px){.container{max-width:728px;}.col-tb-1{width:8.33333%;}.col-tb-2{width:16.66667%;}.col-tb-3{width:25%;}.col-tb-4{width:33.33333%;}.col-tb-5{width:41.66667%;}.col-tb-6{width:50%;}.col-tb-7{width:58.33333%;}.col-tb-8{width:66.66667%;}.col-tb-9{width:75%;}.col-tb-10{width:83.33333%;}.col-tb-11{width:91.66667%;}.col-tb-12{width:100%;}.col-tb-offset-0{margin-left:0;}.col-tb-offset-1{margin-left:8.33333%;}.col-tb-offset-2{margin-left:16.66667%;}.col-tb-offset-3{margin-left:25%;}.col-tb-offset-4{margin-left:33.33333%;}.col-tb-offset-5{margin-left:41.66667%;}.col-tb-offset-6{margin-left:50%;}.col-tb-offset-7{margin-left:58.33333%;}.col-tb-offset-8{margin-left:66.66667%;}.col-tb-offset-9{margin-left:75%;}.col-tb-offset-10{margin-left:83.33333%;}.col-tb-offset-11{margin-left:91.66667%;}.col-tb-offset-12{margin-left:100%;}.col-tb-pull-0{right:0;}.col-tb-pull-1{right:8.33333%;}.col-tb-pull-2{right:16.66667%;}.col-tb-pull-3{right:25%;}.col-tb-pull-4{right:33.33333%;}.col-tb-pull-5{right:41.66667%;}.col-tb-pull-6{right:50%;}.col-tb-pull-7{right:58.33333%;}.col-tb-pull-8{right:66.66667%;}.col-tb-pull-9{right:75%;}.col-tb-pull-10{right:83.33333%;}.col-tb-pull-11{right:91.66667%;}.col-tb-pull-12{right:100%;}.col-tb-push-0{left:0;}.col-tb-push-1{left:8.33333%;}.col-tb-push-2{left:16.66667%;}.col-tb-push-3{left:25%;}.col-tb-push-4{left:33.33333%;}.col-tb-push-5{left:41.66667%;}.col-tb-push-6{left:50%;}.col-tb-push-7{left:58.33333%;}.col-tb-push-8{left:66.66667%;}.col-tb-push-9{left:75%;}.col-tb-push-10{left:83.33333%;}.col-tb-push-11{left:91.66667%;}.col-tb-push-12{left:100%;}}@media(min-width:992px){.container{max-width:952px;}.col-1{width:8.33333%;}.col-2{width:16.66667%;}.col-3{width:25%;}.col-4{width:33.33333%;}.col-5{width:41.66667%;}.col-6{width:50%;}.col-7{width:58.33333%;}.col-8{width:66.66667%;}.col-9{width:75%;}.col-10{width:83.33333%;}.col-11{width:91.66667%;}.col-12{width:100%;}.col-offset-0{margin-left:0;}.col-offset-1{margin-left:8.33333%;}.col-offset-2{margin-left:16.66667%;}.col-offset-3{margin-left:25%;}.col-offset-4{margin-left:33.33333%;}.col-offset-5{margin-left:41.66667%;}.col-offset-6{margin-left:50%;}.col-offset-7{margin-left:58.33333%;}.col-offset-8{margin-left:66.66667%;}.col-offset-9{margin-left:75%;}.col-offset-10{margin-left:83.33333%;}.col-offset-11{margin-left:91.66667%;}.col-offset-12{margin-left:100%;}.col-pull-0{right:0;}.col-pull-1{right:8.33333%;}.col-pull-2{right:16.66667%;}.col-pull-3{right:25%;}.col-pull-4{right:33.33333%;}.col-pull-5{right:41.66667%;}.col-pull-6{right:50%;}.col-pull-7{right:58.33333%;}.col-pull-8{right:66.66667%;}.col-pull-9{right:75%;}.col-pull-10{right:83.33333%;}.col-pull-11{right:91.66667%;}.col-pull-12{right:100%;}.col-push-0{left:0;}.col-push-1{left:8.33333%;}.col-push-2{left:16.66667%;}.col-push-3{left:25%;}.col-push-4{left:33.33333%;}.col-push-5{left:41.66667%;}.col-push-6{left:50%;}.col-push-7{left:58.33333%;}.col-push-8{left:66.66667%;}.col-push-9{left:75%;}.col-push-10{left:83.33333%;}.col-push-11{left:91.66667%;}.col-push-12{left:100%;}}@media(min-width:1200px){.container{max-width:1160px;}.col-wd-1{width:8.33333%;}.col-wd-2{width:16.66667%;}.col-wd-3{width:25%;}.col-wd-4{width:33.33333%;}.col-wd-5{width:41.66667%;}.col-wd-6{width:50%;}.col-wd-7{width:58.33333%;}.col-wd-8{width:66.66667%;}.col-wd-9{width:75%;}.col-wd-10{width:83.33333%;}.col-wd-11{width:91.66667%;}.col-wd-12{width:100%;}.col-wd-offset-0{margin-left:0;}.col-wd-offset-1{margin-left:8.33333%;}.col-wd-offset-2{margin-left:16.66667%;}.col-wd-offset-3{margin-left:25%;}.col-wd-offset-4{margin-left:33.33333%;}.col-wd-offset-5{margin-left:41.66667%;}.col-wd-offset-6{margin-left:50%;}.col-wd-offset-7{margin-left:58.33333%;}.col-wd-offset-8{margin-left:66.66667%;}.col-wd-offset-9{margin-left:75%;}.col-wd-offset-10{margin-left:83.33333%;}.col-wd-offset-11{margin-left:91.66667%;}.col-wd-offset-12{margin-left:100%;}.col-wd-pull-0{right:0;}.col-wd-pull-1{right:8.33333%;}.col-wd-pull-2{right:16.66667%;}.col-wd-pull-3{right:25%;}.col-wd-pull-4{right:33.33333%;}.col-wd-pull-5{right:41.66667%;}.col-wd-pull-6{right:50%;}.col-wd-pull-7{right:58.33333%;}.col-wd-pull-8{right:66.66667%;}.col-wd-pull-9{right:75%;}.col-wd-pull-10{right:83.33333%;}.col-wd-pull-11{right:91.66667%;}.col-wd-pull-12{right:100%;}.col-wd-push-0{left:0;}.col-wd-push-1{left:8.33333%;}.col-wd-push-2{left:16.66667%;}.col-wd-push-3{left:25%;}.col-wd-push-4{left:33.33333%;}.col-wd-push-5{left:41.66667%;}.col-wd-push-6{left:50%;}.col-wd-push-7{left:58.33333%;}.col-wd-push-8{left:66.66667%;}.col-wd-push-9{left:75%;}.col-wd-push-10{left:83.33333%;}.col-wd-push-11{left:91.66667%;}.col-wd-push-12{left:100%;}}@media(max-width:767px){.kit-hidden-mb{display:none;}}@media(max-width:991px){.kit-hidden-tb{display:none;}}@media(max-width:1199px){.kit-hidden{display:none;}}.clearfix,.row{zoom:1;}.clearfix:before,.row:before,.clearfix:after,.row:after{content:" ";display:table;}.clearfix:after,.row:after{clear:both;} @charset "UTF-8";html{height:100%;}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;background:#F6F6F3;color:#444;font-size:87.5%;line-height:1.5;}a{color:#467B96;text-decoration:none;}a:hover{color:#499BC3;text-decoration:underline;}code,pre,.mono{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;}.p{margin:1em 0;}.body-100{height:100%;}a.balloon-button{display:inline-block;padding:0 6px;min-width:12px;height:18px;line-height:18px;background:#D8E7EE;font-size:.85714em;text-align:center;text-decoration:none;zoom:1;-moz-border-radius:30px;-webkit-border-radius:30px;border-radius:30px;}a.button:hover,a.balloon-button:hover{background-color:#A5CADC;color:#FFF;text-decoration:none;}input[type=text],input[type=password],input[type=email],textarea{background:#FFF;border:1px solid #D9D9D6;padding:7px;border-radius:2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}textarea{resize:vertical;line-height:1.5;}input[type="radio"],input[type="checkbox"]{margin-right:3px;}input.text-s,textarea.text-s{padding:5px;}input.text-l,textarea.text-l{padding:10px;font-size:1.14286em;}.w-10{width:10%;}.w-20{width:20%;}.w-30{width:30%;}.w-40{width:40%;}.w-50{width:50%;}.w-60{width:60%;}.w-70{width:70%;}.w-80{width:80%;}.w-90{width:90%;}.w-100{width:100%;}select{border:1px solid #CCC;height:28px;}.btn,#ui-datepicker-div .ui-datepicker-current,#ui-datepicker-div .ui-datepicker-close{border:none;background-color:#E9E9E6;cursor:pointer;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;display:inline-block;padding:0 12px;height:32px;color:#666;vertical-align:middle;zoom:1;}.btn:hover,#ui-datepicker-div .ui-datepicker-current:hover,#ui-datepicker-div .ui-datepicker-close:hover{-moz-transition-duration:.4s;-o-transition-duration:.4s;-webkit-transition-duration:.4s;transition-duration:.4s;background-color:#dbdbd6;}.btn:active,#ui-datepicker-div .ui-datepicker-current:active,#ui-datepicker-div .ui-datepicker-close:active,.btn.active,#ui-datepicker-div .active.ui-datepicker-current,#ui-datepicker-div .active.ui-datepicker-close{background-color:#d6d6d0;}.btn:disabled,#ui-datepicker-div .ui-datepicker-current:disabled,#ui-datepicker-div .ui-datepicker-close:disabled{background-color:#f7f7f6;cursor:default;}.btn:disabled,#ui-datepicker-div .ui-datepicker-current:disabled,#ui-datepicker-div .ui-datepicker-close:disabled{color:#999;}.btn-xs,#ui-datepicker-div .ui-datepicker-current,#ui-datepicker-div .ui-datepicker-close{padding:0 10px;height:25px;font-size:13px;}.btn-s{height:28px;}.btn-l{height:40px;font-size:1.14286em;font-weight:bold;}.primary{border:none;background-color:#467B96;cursor:pointer;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;color:#FFF;}.primary:hover{-moz-transition-duration:.4s;-o-transition-duration:.4s;-webkit-transition-duration:.4s;transition-duration:.4s;background-color:#3c6a81;}.primary:active,.primary.active{background-color:#39647a;}.primary:disabled{background-color:#508cab;cursor:default;}.btn-group{display:inline-block;}.btn-warn{border:none;background-color:#B94A48;cursor:pointer;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;color:#FFF;}.btn-warn:hover{-moz-transition-duration:.4s;-o-transition-duration:.4s;-webkit-transition-duration:.4s;transition-duration:.4s;background-color:#a4403f;}.btn-warn:active,.btn-warn.active{background-color:#9c3e3c;}.btn-warn:disabled{background-color:#c1605e;cursor:default;}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active,.btn-link.active{background-color:transparent;}.btn-drop{position:relative;}.dropdown-toggle{padding-right:8px;}.dropdown-menu{list-style:none;position:absolute;z-index:2;left:0;margin:0;padding:0;border:1px solid #D9D9D6;background:#FFF;text-align:left;min-width:108px;display:none;}.dropdown-menu li{white-space:nowrap;}.dropdown-menu li.multiline{padding:5px 12px 12px;}.dropdown-menu a{display:block;padding:5px 12px;color:#666;}.dropdown-menu a:hover{background:#F6F6F3;text-decoration:none!important;}.message{padding:8px 10px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;}.message a{font-weight:bold;text-decoration:underline;}.error{background:#FBE3E4;color:#8A1F11;}.error a{color:#8A1F11;}.notice{background:#FFF6BF;color:#8A6D3B;}.notice a{color:#8A6D3B;}.success{background:#E6EFC2;color:#264409;}.success a{color:#264409;}.balloon{display:inline-block;padding:0 4px;min-width:10px;height:14px;line-height:14px;background:#B9B9B6;vertical-align:text-top;text-align:center;font-size:12px;color:#FFF;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;}.typecho-pager{list-style:none;float:right;margin:0;padding:0;line-height:1;text-align:center;zoom:1;}.typecho-pager li{display:inline-block;margin:0 3px;height:28px;line-height:28px;}.typecho-pager a{display:block;padding:0 10px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;}.typecho-pager a:hover{text-decoration:none;background:#E9E9E6;}.typecho-pager li.current a{background:#E9E9E6;color:#444;}.typecho-head-nav{padding:0 10px;background:#292D33;}.typecho-head-nav a{color:#BBB;}.typecho-head-nav a:hover,.typecho-head-nav a:focus{color:#FFF;text-decoration:none;}#typecho-nav-list{float:left;}#typecho-nav-list ul{list-style:none;margin:0;padding:0;}#typecho-nav-list ul:first-child{border-left:1px solid #383D45;}#typecho-nav-list .root{position:relative;float:left;}#typecho-nav-list .parent a{display:block;float:left;padding:0 20px;border-right:1px solid #383D45;height:36px;line-height:36px;color:#BBB;}#typecho-nav-list .parent a:hover,#typecho-nav-list .focus .parent a,#typecho-nav-list .root:hover .parent a{background:#202328;color:#FFF;text-decoration:none;}#typecho-nav-list .focus .parent a{font-weight:bold;}#typecho-nav-list .child{position:absolute;top:36px;display:none;margin:0;min-width:160px;max-width:240px;background:#202328;z-index:250;}#typecho-nav-list .root:hover .child{display:block;}#typecho-nav-list .child li a{color:#BBB;display:block;padding:0 20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:36px;line-height:36px;}#typecho-nav-list .child li a:hover,#typecho-nav-list .child li a:focus{background:#292D33;color:#FFF;}#typecho-nav-list .child li.focus a{color:#6DA1BB;font-weight:bold;}.typecho-head-nav .operate{float:right;}.typecho-head-nav .operate a{display:inline-block;margin-left:-1px;padding:0 20px;border:1px solid #383D45;border-width:0 1px;line-height:36px;color:#BBB;}.typecho-head-nav .operate a:hover{background-color:#202328;color:#FFF;}.typecho-foot{padding:4em 0 3em;color:#999;line-height:1.8;text-align:center;}.typecho-foot .copyright p{margin:10px 0 0;}.typecho-foot .resource{color:#CCC;}.typecho-foot .resource a{margin:0 3px;color:#999;}.browsehappy{border:none;text-align:center;}.popup{display:none;position:absolute;top:0;left:0;margin:0;padding:8px 0;border:none;width:100%;z-index:10;text-align:center;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;}.popup ul{list-style:none;margin:0;padding:0;text-align:center;}.popup ul li{display:inline-block;margin-right:10px;}.loading{padding-left:20px!important;background:transparent url(../img/ajax-loader.gif) no-repeat left center;}.typecho-option{list-style:none;margin:1em 0;padding:0;}.typecho-option-submit li{border-bottom:none;}.typecho-option label.typecho-label{display:block;margin-bottom:.5em;font-weight:bold;}.typecho-option label.required:after{content:" *";color:#B94A48;}.typecho-option span{margin-right:15px;}.typecho-option .description{margin:.5em 0 0;color:#999;font-size:.92857em;}.front-archive{padding-left:1.5em;}.profile-avatar{border:1px dashed #D9D9D6;max-width:100%;}.typecho-install{padding-bottom:2em;}.typecho-install-patch{margin-bottom:2em;padding:2em 0;background-color:#292D33;color:#FFF;text-align:center;}.typecho-install-patch ol{list-style:none;margin:3em 0 1em;padding:0;color:#999;}.typecho-install-patch li{display:inline-block;margin:0 .8em;}.typecho-install-patch span{display:inline-block;margin-right:5px;width:20px;height:20px;line-height:20px;border:2px solid #999;text-align:center;border-radius:2em;}.typecho-install-patch li.current{color:#FFF;font-weight:bold;}.typecho-install-patch li.current span{border-color:#FFF;}.typecho-install .typecho-install-body input{width:100%;}.typecho-install-body .typecho-option li{margin:1em 0;}#typecho-welcome{margin:1em 0;padding:1em 2em;background-color:#E9E9E6;}.welcome-board{color:#999;font-size:1.15em;}.welcome-board em{color:#444;font-size:2em;font-style:normal;font-family:Georgia,serif;}#start-link{margin-bottom:25px;padding:0 0 35px;border-bottom:1px solid #ECECEC;}#start-link li{float:left;margin-right:1.5em;}#start-link .balloon{margin-top:2px;}.latest-link li{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.latest-link span{display:inline-block;margin-right:4px;padding-right:8px;border-right:1px solid #ECECEC;width:37px;text-align:right;color:#999;}.update-check{font-size:14px;}.typecho-login-wrap{display:table;margin:0 auto;height:100%;}.typecho-login{display:table-cell;padding:30px 0 100px;width:280px;text-align:center;vertical-align:middle;}.typecho-login h1{margin:0 0 1em;}.typecho-login .more-link{margin-top:2em;color:#CCC;}.typecho-login .more-link a{margin:0 3px;}.typecho-page-title h2{margin:25px 0 10px;font-size:1.28571em;}.typecho-page-title h2 a{margin-left:10px;padding:3px 8px;background:#E9E9E6;font-size:.8em;border-radius:2px;}.typecho-page-title h2 a:hover{text-decoration:none;}.typecho-dashboard ul{list-style:none;padding:0;}.typecho-dashboard li{margin-bottom:5px;}.typecho-option-tabs{list-style:none;margin:1em 0 0;padding:0;font-size:13px;text-align:center;}.typecho-option-tabs.fix-tabs{margin-bottom:1em;}.typecho-option-tabs a{display:block;margin-right:-1px;border:1px solid #D9D9D6;padding:0 15px;height:26px;line-height:26px;color:#666;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}.typecho-option-tabs a:hover{background-color:#E9E9E6;color:#666;text-decoration:none;}.typecho-option-tabs li{float:left;}.typecho-option-tabs li:first-child a{-moz-border-radius:2px 0 0 2px;-webkit-border-radius:2px;border-radius:2px 0 0 2px;}.typecho-option-tabs li:last-child a{-moz-border-radius:0 2px 2px 0;-webkit-border-radius:0;border-radius:0 2px 2px 0;}.typecho-option-tabs.right{float:right;}.typecho-option-tabs li.current a,.typecho-option-tabs li.active a{background-color:#E9E9E6;}.typecho-list-operate{margin:1em 0;}.typecho-list-operate input,.typecho-list-operate button,.typecho-list-operate select{vertical-align:bottom;}.typecho-list-operate input[type="checkbox"]{vertical-align:text-top;}.typecho-list-operate .operate{float:left;}.typecho-list-operate .search{float:right;}.typecho-list-operate span.operate-delete,a.operate-delete,.typecho-list-operate span.operate-button-delete,a.operate-button-delete{color:#B94A48;}a.operate-edit{color:#070;}a.operate-reply{color:#545c30;}.typecho-list-operate a:hover{text-decoration:none;}.typecho-list-table-title{margin:1em 0;color:#999;text-align:center;}.typecho-table-wrap{padding:30px;background:#FFF;}.typecho-list-table{width:100%;}.typecho-list-table.deactivate{color:#999;}.typecho-list-table .right{text-align:right;}.typecho-list-table th{padding:0 10px 10px;border-bottom:2px solid #F0F0EC;text-align:left;}.typecho-list-table td{padding:10px;border-top:1px solid #F0F0EC;word-break:break-all;}.typecho-list-table .status{margin-left:5px;color:#999;font-size:.92857em;font-style:normal;}.typecho-list-table tbody tr:hover td{background-color:#F6F6F3;}.typecho-list-table tbody tr.checked td{background-color:#FFF9E8;}.warning{color:#B94A48;}.typecho-list-table tr td .hidden-by-mouse{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);opacity:0;}.typecho-list-table tr:hover td .hidden-by-mouse{filter:progid:DXImageTransform.Microsoft.Alpha(enabled=false);opacity:1;}.comment-reply-content{position:relative;margin:1em 0;padding:0 1em;border:1px solid transparent;background-color:#F0F0EC;}.comment-reply-content:after{position:absolute;right:1em;border:8px solid #F0F0EC;border-color:#F0F0EC #F0F0EC transparent transparent;content:" ";}.comment-meta span,.comment-date{font-size:.92857em;color:#999;}.comment-action a,.comment-action span{margin-right:4px;}.comment-edit label{display:block;}#typecho-respond{padding:10px;display:none;}.typecho-theme-list img{margin:1em 0;max-width:100%;max-height:240px;}.typecho-theme-list cite{font-style:normal;color:#999;}.typecho-theme-list tbody tr.current td{background-color:#FFF9E8;}.typecho-page-main .typecho-option input.text{width:100%;}.typecho-page-main .typecho-option input.num{width:40px;}.typecho-page-main .typecho-option textarea{width:100%;height:100px;}.typecho-page-main .typecho-option .multiline{display:block;margin:.3em 0;}.typecho-page-main .typecho-option .multiline.hidden{display:none;}.typecho-select-theme{height:25px;line-height:25px;margin:15px 0;}.typecho-select-theme h5{color:#E47E00;font-weight:bold;float:left;font-size:14px;width:120px;margin-right:10px;}.typecho-select-theme select{width:150px;}.typecho-edit-theme ul{list-style:none;margin:0;padding:0;}.typecho-edit-theme li{padding:3px 10px;}.typecho-edit-theme .current{background-color:#E6E6E3;}.typecho-edit-theme .current a{color:#444;}.typecho-edit-theme textarea{font-size:.92857em;line-height:1.2;height:500px;}.typecho-post-area .edit-draft-notice{color:#999;font-size:.92857em;}.typecho-post-area .edit-draft-notice a{color:#B94A48;}.typecho-post-area .typecho-label{display:block;margin:1em 0 -0.5em;font-weight:bold;}.typecho-post-area #auto-save-message{display:block;margin-top:.5em;color:#999;font-size:.92857em;}.typecho-post-area .submit .right button{margin-left:5px;}.typecho-post-area .right{float:right;padding-left:24px;}.typecho-post-area .left{float:left;}.typecho-post-area .out-date{border:1px solid #D3DBB3;padding:3px;background:#fff;}.typecho-post-area input.title{font-size:1.17em;font-weight:bold;}.typecho-post-area .url-slug{margin-top:-0.5em;color:#AAA;font-size:.92857em;word-break:break-word;}.typecho-post-area #slug{padding:2px;border:none;background:#FFFBCC;color:#666;}.typecho-post-area #text{resize:none;}#advance-panel{display:none;}#custom-field{margin:1em 0;padding:10px 15px;background:#FFF;}#custom-field.fold table,#custom-field.fold .description{display:none;}#custom-field .description{margin-top:10px;text-align:right;}#custom-field .description button{float:left;}#custom-field p.description{text-align:left;}#custom-field .typecho-label{margin:0;}#custom-field .typecho-label a{display:block;color:#444;}#custom-field .typecho-label a:hover{color:#467B96;text-decoration:none;}#custom-field table{margin-top:10px;}#custom-field td{padding:10px 5px;font-size:.92857em;border-bottom:1px solid #F0F0EC;vertical-align:top;}#custom-field td label{font-size:1em;font-weight:normal;}#custom-field select{height:27px;}.typecho-post-area .is-draft{background:#FFF1A8;}.typecho-post-option .description{margin-top:-0.5em;color:#999;font-size:.92857em;}.category-option ul{list-style:none;border:1px solid #D9D9D6;padding:6px 12px;max-height:240px;overflow:auto;background-color:#FFF;border-radius:2px;}.category-option li{margin:3px 0;}.visibility-option ul,.allow-option ul{list-style:none;padding:0;}.typecho-page-main ul.tag-list{list-style:none;margin:0;padding:20px;background-color:#FFF;}.typecho-page-main ul.tag-list li{display:inline-block;margin:0 0 5px 0;padding:5px 5px 5px 10px;cursor:pointer;}.typecho-page-main ul.tag-list li:hover{background-color:#E9E9E6;}.typecho-page-main ul.tag-list li input{display:none;}.typecho-page-main ul.tag-list li.checked{background-color:#FFFBCC;}.typecho-page-main ul.tag-list li.size-5{font-size:1em;}.typecho-page-main ul.tag-list li.size-10{font-size:1.2em;}.typecho-page-main ul.tag-list li.size-20{font-size:1.4em;}.typecho-page-main ul.tag-list li.size-30{font-size:1.6em;}.typecho-page-main ul.tag-list li.size-0{font-size:1.8em;}.typecho-page-main .tag-edit-link{visibility:hidden;}.typecho-page-main li:hover .tag-edit-link{visibility:visible;}.typecho-attachment-photo{border:1px solid #E6E6E3;max-width:100%;}#upload-panel{border:1px dashed #D9D9D6;background-color:#FFF;color:#999;font-size:.92857em;}#upload-panel.drag{background-color:#FFFBCC;}.upload-area{padding:15px;text-align:center;}#file-list{list-style:none;margin:0 10px;padding:0;max-height:450px;overflow:auto;word-break:break-all;}#file-list li,#file-list .insert{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}#file-list li{padding:8px 0;border-top:1px dashed #D9D9D6;}#file-list .insert{display:block;max-width:100%;}#file-list .file{margin-left:5px;}#file-list .info{text-transform:uppercase;}#btn-fullscreen-upload{visibility:hidden;}.edit-media button{margin-right:6px;}.resize{display:block;margin:2px auto 0;padding:2px 0;border:1px solid #D9D9D6;border-width:1px 0;width:60px;cursor:row-resize;}.resize i{display:block;height:1px;background-color:#D9D9D6;}.tDnD_whileDrag{background-color:#FFFBCC;}.i-edit,.i-delete,.i-exlink,.mime-office,.mime-text,.mime-image,.mime-html,.mime-archive,.mime-application,.mime-audio,.mime-script,.mime-video,.mime-unknow,.i-upload,.i-upload-active{display:inline-block;vertical-align:text-bottom;text-indent:-9999em;background-image:url('../img/icons-s0c4f1c5ae6.png');background-repeat:no-repeat;}.i-edit:hover,.i-delete:hover,.i-exlink:hover,.mime-office:hover,.mime-text:hover,.mime-image:hover,.mime-html:hover,.mime-archive:hover,.mime-application:hover,.mime-audio:hover,.mime-script:hover,.mime-video:hover,.mime-unknow:hover,.i-upload:hover,.i-upload-active:hover{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=75);opacity:.75;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.i-edit,.i-delete,.i-exlink,.mime-office,.mime-text,.mime-image,.mime-html,.mime-archive,.mime-application,.mime-audio,.mime-script,.mime-video,.mime-unknow,.i-upload,.i-upload-active{-moz-background-size:auto 256px;-o-background-size:auto 256px;-webkit-background-size:auto 256px;background-size:auto 256px;background-image:url('../img/icons-2x-s481937020b.png');}}.i-edit,.i-delete,.i-exlink,.mime-office,.mime-text,.mime-image,.mime-html,.mime-archive,.mime-application,.mime-audio,.mime-script,.mime-video,.mime-unknow{width:16px;height:16px;}.i-upload,.i-upload-active{width:24px;height:24px;}.i-edit{background-position:0 -16px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.i-edit{background-position:0 -16px;}}.i-delete{background-position:0 0;}.i-upload{background-position:0 -72px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.i-upload{background-position:0 -72px;}}.i-upload-active{background-position:0 -48px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.i-upload-active{background-position:0 -48px;}}.i-caret-up,.i-caret-down,.i-caret-left,.i-caret-right{display:inline-block;border-style:solid;border-color:transparent transparent #BBB transparent;border-width:3px 4px 5px;}.i-caret-down{border-color:#BBB transparent transparent transparent;border-width:5px 4px 3px;}.i-caret-left{border-color:transparent #BBB transparent transparent;border-width:4px 5px 4px 3px;}.i-caret-right{border-color:transparent transparent transparent #BBB;border-width:4px 3px 4px 5px;}.i-exlink{background-position:0 -32px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.i-exlink{background-position:0 -32px;}}.mime-office{background-position:0 -176px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-office{background-position:0 -176px;}}.mime-text{background-position:0 -208px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-text{background-position:0 -208px;}}.mime-image{background-position:0 -160px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-image{background-position:0 -160px;}}.mime-html{background-position:0 -144px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-html{background-position:0 -144px;}}.mime-archive{background-position:0 -112px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-archive{background-position:0 -112px;}}.mime-application{background-position:0 -96px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-application{background-position:0 -96px;}}.mime-audio{background-position:0 -128px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-audio{background-position:0 -128px;}}.mime-script{background-position:0 -192px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-script{background-position:0 -192px;}}.mime-video{background-position:0 -240px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-video{background-position:0 -240px;}}.mime-unknow{background-position:0 -224px;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.mime-unknow{background-position:0 -224px;}}.i-logo,.i-logo-s{width:169px;height:40px;display:inline-block;background:url("../img/typecho-logo.svg") no-repeat;text-indent:-9999em;-moz-background-size:auto 40px;-o-background-size:auto 40px;-webkit-background-size:auto 40px;background-size:auto 40px;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=15);opacity:.15;}.i-logo:hover,.i-logo-s:hover{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=20);opacity:.2;}.i-logo-s{width:26px;height:26px;-moz-background-size:auto 26px;-o-background-size:auto 26px;-webkit-background-size:auto 26px;background-size:auto 26px;}.editor{margin-bottom:-0.5em;}.wmd-button-row{list-style:none;margin:0;padding:0;height:26px;line-height:1;}.wmd-button-row li{display:inline-block;margin-right:4px;padding:3px;cursor:pointer;vertical-align:middle;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;}.wmd-button-row li:hover{background-color:#E9E9E6;}.wmd-button-row li.wmd-spacer{height:20px;margin:0 10px 0 6px;padding:0;width:1px;background:#E9E9E6;cursor:default;}#wmd-button-row span{display:block;width:20px;height:20px;background:transparent url(../img/editor.png) no-repeat;}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#wmd-button-row span{background-image:url(../img/editor@2x.png);-moz-background-size:320px auto;-o-background-size:320px auto;-webkit-background-size:320px auto;background-size:320px auto;}}.wmd-edittab{float:right;margin-top:3px;font-size:.92857em;}.wmd-edittab a{display:inline-block;padding:0 8px;margin-left:5px;height:20px;line-height:20px;}.wmd-edittab a:hover{text-decoration:none;}.wmd-edittab a.active{background:#E9E9E6;color:#999;}.wmd-hidetab{display:none;}.wmd-visualhide{visibility:hidden;}.wmd-prompt-background{background-color:#000;}.wmd-prompt-dialog{position:fixed;z-index:1001;top:50%;left:50%;margin-top:-95px;margin-left:-200px;padding:20px;width:360px;background:#F6F6F3;}.wmd-prompt-dialog p{margin:0 0 5px;}.wmd-prompt-dialog form{margin-top:10px;}.wmd-prompt-dialog input[type="text"]{margin-bottom:10px;width:100%;}.wmd-prompt-dialog button{margin-right:10px;}#wmd-preview{background:#FFF;margin:1em 0;padding:0 15px;word-wrap:break-word;overflow:auto;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;}#wmd-preview img{max-width:100%;}#wmd-preview code,#wmd-preview pre{padding:2px 4px;background:#F3F3F0;font-size:.92857em;}#wmd-preview code{color:#C13;}#wmd-preview pre{padding:1em;}#wmd-preview pre code{padding:0;color:#444;}#wmd-preview blockquote{margin:1em 1.5em;padding-left:1.5em;border-left:4px solid #E9E9E6;color:#777;}#wmd-preview hr{margin:2em auto;width:100px;border:1px solid #E9E9E6;border-width:2px 0 0 0;}#wmd-preview .summary:after{display:block;margin:2em 0;background:#FFF9E8;color:#ce9900;font-size:.85714em;text-align:center;content:"- more -";}@keyframes fullscreen-upload{0%{right:-280px;}100%{right:-1px;}}@-moz-keyframes fullscreen-upload{0%{right:-280px;}100%{right:-1px;}}@-webkit-keyframes fullscreen-upload{0%{right:-280px;}100%{right:-1px;}}@-o-keyframes fullscreen-upload{0%{right:-280px;}100%{right:-1px;}}.fullscreen #wmd-button-bar,.fullscreen #text,.fullscreen #wmd-preview,.fullscreen .submit{position:absolute;top:0;width:50%;background:#FFF;z-index:999;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;}.fullscreen #wmd-button-bar{left:0;padding:13px 20px;border-bottom:1px solid #F3F3F0;z-index:1000;}.fullscreen #text{top:53px;left:0;padding:20px;border:none;outline:none;}.fullscreen #wmd-preview{top:53px;right:0;margin:0;padding:5px 20px;border:none;border-left:1px solid #F3F3F0;background:#F6F6F3;overflow:auto;}.fullscreen #wmd-preview code,.fullscreen #wmd-preview pre{background:#F0F0EC;}.fullscreen .submit{right:0;margin:0;padding:10px 20px;border-bottom:1px solid #F3F3F0;}.fullscreen #upload-panel{-webkit-box-shadow:0 4px 16px rgba(0,0,0,0.225);box-shadow:0 4px 16px rgba(0,0,0,0.225);border-style:solid;}.fullscreen #tab-files{position:absolute;top:52px;right:-1px;width:280px;z-index:1001;animation:fullscreen-upload .5s;-moz-animation:fullscreen-upload .5s;-webkit-animation:fullscreen-upload .5s;-o-animation:fullscreen-upload .5s;}.fullscreen .wmd-edittab,.fullscreen .typecho-post-option,.fullscreen .title,.fullscreen .url-slug,.fullscreen .typecho-page-title,.fullscreen .typecho-head-nav,.fullscreen .message{display:none;}.fullscreen .wmd-hidetab{display:block;}.fullscreen .wmd-visualhide,.fullscreen #btn-fullscreen-upload{visibility:visible;}#ui-datepicker-div{display:none;margin-top:-1px;padding:10px;border:1px solid #D9D9D6;background:#FFF;}.ui-timepicker-div .ui-widget-header{margin-bottom:8px;}.ui-timepicker-div dl{text-align:left;}.ui-timepicker-div dl dt{float:left;clear:left;}.ui-timepicker-div dl dd{margin:0 0 10px 40%;}.ui-tpicker-grid-label{background:none;border:none;margin:0;padding:0;}#ui-datepicker-div .ui-datepicker-header{margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid #EEE;}#ui-datepicker-div .ui-datepicker-prev{float:left;cursor:pointer;}#ui-datepicker-div .ui-datepicker-next{float:right;cursor:pointer;}#ui-datepicker-div .ui-datepicker-title{font-weight:bold;text-align:center;}#ui-datepicker-div .ui-datepicker-calendar th{line-height:24px;}#ui-datepicker-div .ui-datepicker-calendar a{display:block;width:30px;background-color:#F3F3F0;line-height:24px;text-align:center;}#ui-datepicker-div .ui-datepicker-calendar a:hover{background-color:#E9E9E6;text-decoration:none;}#ui-datepicker-div .ui-datepicker-today a{background-color:#E9E9E6;color:#444;}#ui-datepicker-div .ui-datepicker-current-day a{background-color:#467B96!important;color:#FFF;}#ui-datepicker-div .ui-timepicker-div{margin-top:20px;border-top:1px solid #EEE;}#ui-datepicker-div .ui-slider{position:relative;margin-top:18px;border:1px solid #E9E9E6;background-color:#F6F6F3;height:4px;}#ui-datepicker-div .ui-slider .ui-slider-handle{position:absolute;top:-7px;margin-left:-5px;z-index:2;width:10px;height:16px;background-color:#467B96;}#ui-datepicker-div .ui-datepicker-buttonpane{padding-top:10px;border-top:1px solid #EEE;}#ui-datepicker-div .ui-datepicker-current,#ui-datepicker-div .ui-datepicker-close{float:left;}#ui-datepicker-div .ui-datepicker-close{float:right;}.ui-effects-transfer{border:2px dotted #ccc;}ul.token-input-list{list-style:none;margin:0;padding:0 4px;min-height:32px;border:1px solid #D9D9D6;cursor:text;z-index:999;background-color:#FFF;clear:left;border-radius:2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}ul.token-input-list li{margin:4px 0;}ul.token-input-list li input{padding:0;border:0;width:100%;-webkit-appearance:caret;}li.token-input-token{padding:0 6px;height:27px;line-height:27px;background-color:#F3F3F0;cursor:default;font-size:.92857em;text-align:right;white-space:nowrap;}li.token-input-token p{float:left;display:inline;margin:0;}li.token-input-token span{color:#BBB;font-weight:bold;cursor:pointer;}li.token-input-selected-token{background-color:#E9E9E6;}li.token-input-input-token{padding:0 4px;}div.token-input-dropdown{position:absolute;background-color:#FFF;overflow:hidden;border:1px solid #D9D9D6;border-top-width:0;cursor:default;z-index:1;font-size:.92857em;}div.token-input-dropdown p{margin:0;padding:5px 10px;color:#777;font-weight:bold;}div.token-input-dropdown ul{list-style:none;margin:0;padding:0;}div.token-input-dropdown ul li{padding:4px 10px;background-color:#FFF;}div.token-input-dropdown ul li.token-input-dropdown-item{background-color:#FFF;}div.token-input-dropdown ul li em{font-style:normal;}div.token-input-dropdown ul li.token-input-selected-dropdown-item{background-color:#467B96;color:#FFF;}.hidden{display:none;}.sr-only{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}.sr-only.focusable:active,.sr-only.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto;}.invisible{visibility:hidden;} \ No newline at end of file diff --git a/views/admin/backLayout.html b/views/admin/backLayout.html index 27f379d..9dda973 100644 --- a/views/admin/backLayout.html +++ b/views/admin/backLayout.html @@ -8,7 +8,6 @@ {{.Title}} - '); + if (html.indexOf('') > 0) { var parts = html.split(/\s*<\!\-\-more\-\->\s*/), summary = parts.shift(), details = parts.join(''); - html = '
            ' + summary + '
            ' + '
            ' + details + '
            '; + html = '
            ' + summary + '
            ' + + '
            ' + details + '
            '; } @@ -443,22 +438,18 @@ $(document).ready(function() { last = html; if (diffs.length > 0) { - var stack = [], - markStr = mark; - - for (var i = 0; i < diffs.length; i++) { - var diff = diffs[i], - op = diff[0], - str = diff[1] - sp = str.lastIndexOf('<'), ep = str.lastIndexOf('>'); + var stack = [], markStr = mark; + + for (var i = 0; i < diffs.length; i ++) { + var diff = diffs[i], op = diff[0], str = diff[1] + sp = str.lastIndexOf('<'), ep = str.lastIndexOf('>'); if (op != 0) { - if (sp >= 0 && sp > ep) { + if (sp >=0 && sp > ep) { if (op > 0) { stack.push(str.substring(0, sp) + markStr + str.substring(sp)); } else { - var lastStr = stack[stack.length - 1], - lastSp = lastStr.lastIndexOf('<'); + var lastStr = stack[stack.length - 1], lastSp = lastStr.lastIndexOf('<'); stack[stack.length - 1] = lastStr.substring(0, lastSp) + markStr + lastStr.substring(lastSp); } } else { @@ -468,7 +459,7 @@ $(document).ready(function() { stack.push(markStr); } } - + markStr = ''; } else { stack.push(str); @@ -478,11 +469,9 @@ $(document).ready(function() { html = stack.join(''); if (!markStr) { - var pos = html.indexOf(mark), - prev = html.substring(0, pos), + var pos = html.indexOf(mark), prev = html.substring(0, pos), next = html.substr(pos + mark.length), - sp = prev.lastIndexOf('<'), - ep = prev.lastIndexOf('>'); + sp = prev.lastIndexOf('<'), ep = prev.lastIndexOf('>'); if (sp >= 0 && sp > ep) { html = prev.substring(0, sp) + span + prev.substring(sp) + next; @@ -491,55 +480,54 @@ $(document).ready(function() { } } } - // 替换img - html = html.replace(/<(img)\s+([^>]*)\s*src="([^"]+)"([^>]*)>/ig, function(all, tag, prefix, src, suffix) { + html = html.replace(/<(img)\s+([^>]*)\s*src="([^"]+)"([^>]*)>/ig, function (all, tag, prefix, src, suffix) { if (!cache[src]) { cache[src] = false; } else { - return ''; + return ''; } return all; }); // 替换block - html = html.replace(/<(iframe|embed)\s+([^>]*)>/ig, function(all, tag, src) { + html = html.replace(/<(iframe|embed)\s+([^>]*)>/ig, function (all, tag, src) { if (src[src.length - 1] == '/') { src = src.substring(0, src.length - 1); } - return '
            ' + tag + ' : ' + $.trim(src) + '
            '; + return '
            ' + + tag + ' : ' + $.trim(src) + '
            '; }); return html; }); function cacheResize() { - var t = $(this), - w = parseInt(t.data('width')), - h = parseInt(t.data('height')), + var t = $(this), w = parseInt(t.data('width')), h = parseInt(t.data('height')), ow = t.width(); t.height(h * ow / w); } var to; - editor.hooks.chain('onPreviewRefresh', function() { - var diff = $('.diff', preview), - scrolled = false; + editor.hooks.chain('onPreviewRefresh', function () { + var diff = $('.diff', preview), scrolled = false; if (to) { clearTimeout(to); } - $('img', preview).load(function() { - var t = $(this), - src = t.attr('src'); + $('img', preview).load(function () { + var t = $(this), src = t.attr('src'); if (scrolled) { preview.scrollTo(diff, { - offset: -50 + offset : - 50 }); } @@ -549,64 +537,62 @@ $(document).ready(function() { }); $('.cache', preview).resize(cacheResize).each(cacheResize); - + var changed = $('.diff', preview).parent(); if (!changed.is(preview)) { changed.css('background-color', 'rgba(255,230,0,0.5)'); - to = setTimeout(function() { + to = setTimeout(function () { changed.css('background-color', 'transparent'); }, 4500); } if (diff.length > 0) { - var p = diff.position(), - lh = diff.parent().css('line-height'); + var p = diff.position(), lh = diff.parent().css('line-height'); lh = !!lh ? parseInt(lh) : 0; if (p.top < 0 || p.top > preview.height() - lh) { preview.scrollTo(diff, { - offset: -50 + offset : - 50 }); scrolled = true; } } }); + + var input = $('#text'), th = textarea.height(), ph = preview.height(), + uploadBtn = $('') + .prependTo('.submit .right') + .click(function() { + $('a', $('.typecho-option-tabs li').not('.active')).trigger('click'); + return false; + }); - var input = $('#text'), - th = textarea.height(), - ph = preview.height(), - uploadBtn = $('') - .prependTo('.submit .right') - .click(function() { - $('a', $('.typecho-option-tabs li').not('.active')).trigger('click'); - return false; - }); - - $('.typecho-option-tabs li').click(function() { + $('.typecho-option-tabs li').click(function () { uploadBtn.find('i').toggleClass('i-upload-active', $('#tab-files-btn', this).length > 0); }); - editor.hooks.chain('enterFakeFullScreen', function() { + editor.hooks.chain('enterFakeFullScreen', function () { th = textarea.height(); ph = preview.height(); $(document.body).addClass('fullscreen'); var h = $(window).height() - toolbar.outerHeight(); - + textarea.css('height', h); preview.css('height', h); }); - editor.hooks.chain('enterFullScreen', function() { + editor.hooks.chain('enterFullScreen', function () { $(document.body).addClass('fullscreen'); - + var h = window.screen.height - toolbar.outerHeight(); textarea.css('height', h); preview.css('height', h); }); - editor.hooks.chain('exitFullScreen', function() { + editor.hooks.chain('exitFullScreen', function () { $(document.body).removeClass('fullscreen'); textarea.height(th); preview.height(ph); @@ -618,13 +604,13 @@ $(document).ready(function() { var imageButton = $('#wmd-image-button'), linkButton = $('#wmd-link-button'); - Typecho.insertFileToEditor = function(file, url, isImage) { + Typecho.insertFileToEditor = function (file, url, isImage) { var button = isImage ? imageButton : linkButton; options.strings[isImage ? 'imagename' : 'linkname'] = file; button.trigger('click'); - var checkDialog = setInterval(function() { + var checkDialog = setInterval(function () { if ($('.wmd-prompt-dialog').length > 0) { $('.wmd-prompt-dialog input').val(url).select(); clearInterval(checkDialog); @@ -633,7 +619,7 @@ $(document).ready(function() { }, 10); }; - Typecho.uploadComplete = function(file) { + Typecho.uploadComplete = function (file) { Typecho.insertFileToEditor(file.title, file.url, file.isImage); }; @@ -645,7 +631,7 @@ $(document).ready(function() { $(".wmd-edittab a").removeClass('active'); $(this).addClass("active"); $("#wmd-editarea, #wmd-preview").addClass("wmd-hidetab"); - + var selected_tab = $(this).attr("href"), selected_el = $(selected_tab).removeClass("wmd-hidetab"); @@ -669,7 +655,7 @@ $(document).ready(function() {