diff --git a/infoport/homestead.html b/infoport/homestead.html new file mode 100644 index 0000000..f37a740 --- /dev/null +++ b/infoport/homestead.html @@ -0,0 +1,256 @@ + + + + + + 乳山农村支援信息港 + + + + + + + + + + + + +
+ +
+

+ +

+
+ + + +
+ + +
+ +
+ +
+ + + +
+
+
+
+

+
+
+
+
+ +
+ + + + + + +
+ + + \ No newline at end of file diff --git a/infoport/homesteadDetail.html b/infoport/homesteadDetail.html new file mode 100644 index 0000000..0421363 --- /dev/null +++ b/infoport/homesteadDetail.html @@ -0,0 +1,206 @@ + + + + + + 乳山农村支援信息港 + + + + + + + + + + + +
+ +
+

+ +

+ +
+ +
+ + + + + + +
+ + + + +
+ + + \ No newline at end of file diff --git a/infoport/index.html b/infoport/index.html new file mode 100644 index 0000000..8b7d431 --- /dev/null +++ b/infoport/index.html @@ -0,0 +1,143 @@ + + + + + + 乳山农村支援信息港 + + + + + + + + + +
+ +
+

+ +

+ +
+ + + +
+
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+

今日资讯

+

2023.03.15

+
+ +
+ +
+ +
+ +
+ + + + +
+ + + \ No newline at end of file diff --git a/infoport/newDetail.html b/infoport/newDetail.html new file mode 100644 index 0000000..9ef4e19 --- /dev/null +++ b/infoport/newDetail.html @@ -0,0 +1,87 @@ + + + + + + 乳山农村支援信息港 + + + + + + + + + + +
+ +
+
+
+ +

+
+
+

+

+
+
+ +
+
+
+
新闻列表
+
+ +
+
+
+ + + + +
+ + + \ No newline at end of file diff --git a/infoport/property.html b/infoport/property.html new file mode 100644 index 0000000..9b1ed9f --- /dev/null +++ b/infoport/property.html @@ -0,0 +1,238 @@ + + + + + + 乳山农村支援信息港 + + + + + + + + + + + + +
+ +
+

+ +

+
+ + + +
+ + +
+ +
+ +
+ + + +
+
+
+
+

+
+
+
+
+ +
+ + + + + + +
+ + + \ No newline at end of file diff --git a/infoport/resource.html b/infoport/resource.html new file mode 100644 index 0000000..6a8b4b2 --- /dev/null +++ b/infoport/resource.html @@ -0,0 +1,233 @@ + + + + + + 乳山农村支援信息港 + + + + + + + + + + + + +
+ +
+

+ +

+
+ + + +
+ + +
+ +
+ +
+ + +
+
+
+
+

+
+
+
+
+ +
+ + + + + + +
+ + + \ No newline at end of file diff --git a/infoport/static/css/dateTime.css b/infoport/static/css/dateTime.css new file mode 100644 index 0000000..0cb2dc0 --- /dev/null +++ b/infoport/static/css/dateTime.css @@ -0,0 +1,153 @@ +.dateTimeWrap{ + display: none; + -webkit-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + -o-user-select:none; + user-select:none; + background: #494a4a; + padding:10px; + position: fixed; + left:0; + top:0; + z-index:999; + font-size:14px; + color:#e2e2e2; + width:240px; +} +.dateTimeWrap .datePart li.curDay{ + color:#1ea0fa; +} +.dateTimeWrap #dayDat li:hover{ + border:2px double #fff; + background: #1ea0fa; + color:#fff; +} +.dateTimeWrap #dateTime{ + *float:left +} +.dateTimeWrap .dateTimeHead{ + *overflow:hidden; + padding:8px 0px 4px; +} +.dateTimeWrap .datePart li{ + border:2px double transparent; + float: left; + cursor: default; + vertical-align: middle; + width: 30px; + height: 26px; + text-align: center; + line-height: 26px; +} +.dateTimeWrap .datePart ul{ + overflow: hidden; +} +.dateTimeWrap .changeMonth{ + float: right +} +.dateTimeWrap .changeMonth #pre,.changeMonth #next{ + display: inline-block; + width:20px; + height:20px; + cursor: default; + color:#333; + background: #fff; + text-align: center; + line-height:20px; +} +.dateTimeWrap .changeMonth #next{ + margin-left: 10px; +} +.dateTimeWrap .dateTimeFoot span,.timeFooter span{ + cursor: pointer; + display: inline-block; + background: #fff; + color: #333; + height:20px; + line-height: 20px; + width:50px; + text-align: center; + margin-left: 6px; + float:right; +} +.dateTimeWrap .timePart{ + text-align:center; + color:#333; + line-height: 22px; +} +.dateTimeWrap .timePart p,.timePart ul{ + background: #fff; +} +.dateTimeWrap .timePart>ul>li{ + float: left; + width:119px; + background: #fff; + color:#333; + border:1px solid #ccc; + border-right:none; +} +.dateTimeWrap .timePart ul{ + overflow: hidden; +} +.dateTimeWrap .timePart>ul>li p{ + line-height: 30px; + border-bottom:1px solid #ccc; +} +.dateTimeWrap .timePart ol{ + height:180px; + overflow-y: hidden; + *overflow-y: auto; + overflow-x: hidden; +} +.dateTimeWrap .timePart ol:hover{ + overflow-y:auto; +} +.dateTimeWrap .timePart ol:hover li{ + padding-left:17px; + *padding-left:0; +} +.dateTimeWrap .timePart ol li{ + line-height: 30px; +} +.dateTimeWrap .timePart ol li.cur{ + background: #1ea0fa; + color: #fff +} +.dateTimeWrap .dateTimeFoot,.timeFooter{ + overflow:hidden; + margin-top: 10px; + height: 20px; +} +.dateTimeWrap .timeFooter span{ + width:80px; +} +.dateTimeWrap .timeFooter #ensure{ + width:50px; +} +.dateTimeWrap .dateTimeFoot .selTime,.timeFooter .selTime{ + float:left; + margin-left:0; + display:none; +} +.dateTimeWrap .selTime{ + width:80px!important; +} +.dateTimeWrap #yearSelect{ + margin-right: 6px; + width:auto; + color: #FFF; +} +.dateTimeWrap #yearSelect option{ + color: #000; +} +.dateTimeWrap #monthSelect option{ + color: #000; +} +.dateTimeWrap #monthSelect{ + width: auto; + color: #FFF; +} +.dateTimeWrap .darkgrey{ + color:#d0d0d0 !important; +} \ No newline at end of file diff --git a/infoport/static/css/default.css b/infoport/static/css/default.css new file mode 100644 index 0000000..3f72660 --- /dev/null +++ b/infoport/static/css/default.css @@ -0,0 +1,1147 @@ +/* common */ +.ke-inline-block { + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-clearfix { + zoom: 1; +} +.ke-clearfix:after { + content: "."; + display: block; + clear: both; + font-size: 0; + height: 0; + line-height: 0; + visibility: hidden; +} +.ke-shadow { + box-shadow: 1px 1px 3px #A0A0A0; + -moz-box-shadow: 1px 1px 3px #A0A0A0; + -webkit-box-shadow: 1px 1px 3px #A0A0A0; + filter: progid:DXImageTransform.Microsoft.Shadow(color='#A0A0A0', Direction=135, Strength=3); + background-color: #F0F0EE; +} +.ke-menu a, +.ke-menu a:hover, +.ke-dialog a, +.ke-dialog a:hover { + color: #337FE5; + text-decoration: none; +} +/* icons */ +.ke-icon-source { + background-position: 0px 0px; + width: 16px; + height: 16px; +} +.ke-icon-preview { + background-position: 0px -16px; + width: 16px; + height: 16px; +} +.ke-icon-print { + background-position: 0px -32px; + width: 16px; + height: 16px; +} +.ke-icon-undo { + background-position: 0px -48px; + width: 16px; + height: 16px; +} +.ke-icon-redo { + background-position: 0px -64px; + width: 16px; + height: 16px; +} +.ke-icon-cut { + background-position: 0px -80px; + width: 16px; + height: 16px; +} +.ke-icon-copy { + background-position: 0px -96px; + width: 16px; + height: 16px; +} +.ke-icon-paste { + background-position: 0px -112px; + width: 16px; + height: 16px; +} +.ke-icon-selectall { + background-position: 0px -128px; + width: 16px; + height: 16px; +} +.ke-icon-justifyleft { + background-position: 0px -144px; + width: 16px; + height: 16px; +} +.ke-icon-justifycenter { + background-position: 0px -160px; + width: 16px; + height: 16px; +} +.ke-icon-justifyright { + background-position: 0px -176px; + width: 16px; + height: 16px; +} +.ke-icon-justifyfull { + background-position: 0px -192px; + width: 16px; + height: 16px; +} +.ke-icon-insertorderedlist { + background-position: 0px -208px; + width: 16px; + height: 16px; +} +.ke-icon-insertunorderedlist { + background-position: 0px -224px; + width: 16px; + height: 16px; +} +.ke-icon-indent { + background-position: 0px -240px; + width: 16px; + height: 16px; +} +.ke-icon-outdent { + background-position: 0px -256px; + width: 16px; + height: 16px; +} +.ke-icon-subscript { + background-position: 0px -272px; + width: 16px; + height: 16px; +} +.ke-icon-superscript { + background-position: 0px -288px; + width: 16px; + height: 16px; +} +.ke-icon-date { + background-position: 0px -304px; + width: 25px; + height: 16px; +} +.ke-icon-time { + background-position: 0px -320px; + width: 25px; + height: 16px; +} +.ke-icon-formatblock { + background-position: 0px -336px; + width: 25px; + height: 16px; +} +.ke-icon-fontname { + background-position: 0px -352px; + width: 21px; + height: 16px; +} +.ke-icon-fontsize { + background-position: 0px -368px; + width: 23px; + height: 16px; +} +.ke-icon-forecolor { + background-position: 0px -384px; + width: 20px; + height: 16px; +} +.ke-icon-hilitecolor { + background-position: 0px -400px; + width: 23px; + height: 16px; +} +.ke-icon-bold { + background-position: 0px -416px; + width: 16px; + height: 16px; +} +.ke-icon-italic { + background-position: 0px -432px; + width: 16px; + height: 16px; +} +.ke-icon-underline { + background-position: 0px -448px; + width: 16px; + height: 16px; +} +.ke-icon-strikethrough { + background-position: 0px -464px; + width: 16px; + height: 16px; +} +.ke-icon-removeformat { + background-position: 0px -480px; + width: 16px; + height: 16px; +} +.ke-icon-image { + background-position: 0px -496px; + width: 16px; + height: 16px; +} +.ke-icon-flash { + background-position: 0px -512px; + width: 16px; + height: 16px; +} +.ke-icon-media { + background-position: 0px -528px; + width: 16px; + height: 16px; +} +.ke-icon-div { + background-position: 0px -544px; + width: 16px; + height: 16px; +} +.ke-icon-formula { + background-position: 0px -576px; + width: 16px; + height: 16px; +} +.ke-icon-hr { + background-position: 0px -592px; + width: 16px; + height: 16px; +} +.ke-icon-emoticons { + background-position: 0px -608px; + width: 16px; + height: 16px; +} +.ke-icon-link { + background-position: 0px -624px; + width: 16px; + height: 16px; +} +.ke-icon-unlink { + background-position: 0px -640px; + width: 16px; + height: 16px; +} +.ke-icon-fullscreen { + background-position: 0px -656px; + width: 16px; + height: 16px; +} +.ke-icon-about { + background-position: 0px -672px; + width: 16px; + height: 16px; +} +.ke-icon-plainpaste { + background-position: 0px -704px; + width: 16px; + height: 16px; +} +.ke-icon-wordpaste { + background-position: 0px -720px; + width: 16px; + height: 16px; +} +.ke-icon-table { + background-position: 0px -784px; + width: 16px; + height: 16px; +} +.ke-icon-tablemenu { + background-position: 0px -768px; + width: 16px; + height: 16px; +} +.ke-icon-tableinsert { + background-position: 0px -784px; + width: 16px; + height: 16px; +} +.ke-icon-tabledelete { + background-position: 0px -800px; + width: 16px; + height: 16px; +} +.ke-icon-tablecolinsertleft { + background-position: 0px -816px; + width: 16px; + height: 16px; +} +.ke-icon-tablecolinsertright { + background-position: 0px -832px; + width: 16px; + height: 16px; +} +.ke-icon-tablerowinsertabove { + background-position: 0px -848px; + width: 16px; + height: 16px; +} +.ke-icon-tablerowinsertbelow { + background-position: 0px -864px; + width: 16px; + height: 16px; +} +.ke-icon-tablecoldelete { + background-position: 0px -880px; + width: 16px; + height: 16px; +} +.ke-icon-tablerowdelete { + background-position: 0px -896px; + width: 16px; + height: 16px; +} +.ke-icon-tablecellprop { + background-position: 0px -912px; + width: 16px; + height: 16px; +} +.ke-icon-tableprop { + background-position: 0px -928px; + width: 16px; + height: 16px; +} +.ke-icon-checked { + background-position: 0px -944px; + width: 16px; + height: 16px; +} +.ke-icon-code { + background-position: 0px -960px; + width: 16px; + height: 16px; +} +.ke-icon-map { + background-position: 0px -976px; + width: 16px; + height: 16px; +} +.ke-icon-baidumap { + background-position: 0px -976px; + width: 16px; + height: 16px; +} +.ke-icon-lineheight { + background-position: 0px -992px; + width: 16px; + height: 16px; +} +.ke-icon-clearhtml { + background-position: 0px -1008px; + width: 16px; + height: 16px; +} +.ke-icon-pagebreak { + background-position: 0px -1024px; + width: 16px; + height: 16px; +} +.ke-icon-insertfile { + background-position: 0px -1040px; + width: 16px; + height: 16px; +} +.ke-icon-quickformat { + background-position: 0px -1056px; + width: 16px; + height: 16px; +} +.ke-icon-template { + background-position: 0px -1072px; + width: 16px; + height: 16px; +} +.ke-icon-tablecellsplit { + background-position: 0px -1088px; + width: 16px; + height: 16px; +} +.ke-icon-tablerowmerge { + background-position: 0px -1104px; + width: 16px; + height: 16px; +} +.ke-icon-tablerowsplit { + background-position: 0px -1120px; + width: 16px; + height: 16px; +} +.ke-icon-tablecolmerge { + background-position: 0px -1136px; + width: 16px; + height: 16px; +} +.ke-icon-tablecolsplit { + background-position: 0px -1152px; + width: 16px; + height: 16px; +} +.ke-icon-anchor { + background-position: 0px -1168px; + width: 16px; + height: 16px; +} +.ke-icon-search { + background-position: 0px -1184px; + width: 16px; + height: 16px; +} +.ke-icon-new { + background-position: 0px -1200px; + width: 16px; + height: 16px; +} +.ke-icon-specialchar { + background-position: 0px -1216px; + width: 16px; + height: 16px; +} +.ke-icon-multiimage { + background-position: 0px -1232px; + width: 16px; + height: 16px; +} +/* container */ +.ke-container { + display: block; + border: 1px solid #CCCCCC; + background-color: #FFF; + overflow: hidden; + margin: 0; + padding: 0; +} +/* toolbar */ +.ke-toolbar { + border-bottom: 1px solid #CCC; + background-color: #F0F0EE; + padding: 2px 5px; + text-align: left; + overflow: hidden; + zoom: 1; +} +.ke-toolbar-icon { + background-repeat: no-repeat; + font-size: 0; + line-height: 0; + overflow: hidden; + display: block; +} +.ke-toolbar-icon-url { + background-image: url(default.png); +} +.ke-toolbar .ke-outline { + border: 1px solid #F0F0EE; + margin: 1px; + padding: 1px 2px; + font-size: 0; + line-height: 0; + overflow: hidden; + cursor: pointer; + display: block; + float: left; +} +.ke-toolbar .ke-on { + border: 1px solid #5690D2; +} +.ke-toolbar .ke-selected { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} +.ke-toolbar .ke-disabled { + cursor: default; +} +.ke-toolbar .ke-separator { + height: 16px; + margin: 2px 3px; + border-left: 1px solid #A0A0A0; + border-right: 1px solid #FFFFFF; + border-top:0; + border-bottom:0; + width: 0; + font-size: 0; + line-height: 0; + overflow: hidden; + display: block; + float: left; +} +.ke-toolbar .ke-hr { + overflow: hidden; + height: 1px; + clear: both; +} +/* edit */ +.ke-edit { + padding: 0; +} +.ke-edit-iframe, +.ke-edit-textarea { + border: 0; + margin: 0; + padding: 0; + overflow: auto; +} +.ke-edit-textarea { + font: 12px/1.5 "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; + color: #000; + overflow: auto; + resize: none; +} +.ke-edit-textarea:focus { + outline: none; +} +/* statusbar */ +.ke-statusbar { + position: relative; + background-color: #F0F0EE; + border-top: 1px solid #CCCCCC; + font-size: 0; + line-height: 0; + *height: 12px; + overflow: hidden; + text-align: center; + cursor: s-resize; +} +.ke-statusbar-center-icon { + background-position: -0px -754px; + width: 15px; + height: 11px; + background-image: url(default.png); +} +.ke-statusbar-right-icon { + position: absolute; + right: 0; + bottom: 0; + cursor: se-resize; + background-position: -5px -741px; + width: 11px; + height: 11px; + background-image: url(default.png); +} +/* menu */ +.ke-menu { + border: 1px solid #A0A0A0; + background-color: #F1F1F1; + color: #222222; + padding: 2px; + font-family: "sans serif",tahoma,verdana,helvetica; + font-size: 12px; + text-align: left; + overflow: hidden; +} +.ke-menu-item { + border: 1px solid #F1F1F1; + background-color: #F1F1F1; + color: #222222; + height: 24px; + overflow: hidden; + cursor: pointer; +} +.ke-menu-item-on { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} +.ke-menu-item-left { + width: 27px; + text-align: center; + overflow: hidden; +} +.ke-menu-item-center { + width: 0; + height: 24px; + border-left: 1px solid #E3E3E3; + border-right: 1px solid #FFFFFF; + border-top: 0; + border-bottom: 0; +} +.ke-menu-item-center-on { + border-left: 1px solid #E9EFF6; + border-right: 1px solid #E9EFF6; +} +.ke-menu-item-right { + border: 0; + padding: 0 0 0 5px; + line-height: 24px; + text-align: left; + overflow: hidden; +} +.ke-menu-separator { + margin: 2px 0; + height: 0; + overflow: hidden; + border-top: 1px solid #CCCCCC; + border-bottom: 1px solid #FFFFFF; + border-left: 0; + border-right: 0; +} +/* colorpicker */ +.ke-colorpicker { + border: 1px solid #A0A0A0; + background-color: #F1F1F1; + color: #222222; + padding: 2px; +} +.ke-colorpicker-table { + border:0; + margin:0; + padding:0; + border-collapse: separate; +} +.ke-colorpicker-cell { + font-size: 0; + line-height: 0; + border: 1px solid #F0F0EE; + cursor: pointer; + margin:3px; + padding:0; +} +.ke-colorpicker-cell-top { + font-family: "sans serif",tahoma,verdana,helvetica; + font-size: 12px; + line-height: 24px; + border: 1px solid #F0F0EE; + cursor: pointer; + margin:0; + padding:0; + text-align: center; +} +.ke-colorpicker-cell-on { + border: 1px solid #5690D2; +} +.ke-colorpicker-cell-selected { + border: 1px solid #2446AB; +} +.ke-colorpicker-cell-color { + width: 14px; + height: 14px; + margin: 3px; + padding: 0; + border: 0; +} +/* dialog */ +.ke-dialog { + position: absolute; + margin: 0; + padding: 0; +} +.ke-dialog .ke-header { + width: 100%; + margin-bottom: 10px; +} +.ke-dialog .ke-header .ke-left { + float: left; +} +.ke-dialog .ke-header .ke-right { + float: right; +} +.ke-dialog .ke-header label { + margin-right: 0; + cursor: pointer; + font-weight: normal; + display: inline; + vertical-align: top; +} +.ke-dialog-content { + background-color: #FFF; + width: 100%; + height: 100%; + color: #333; + border: 1px solid #A0A0A0; +} +.ke-dialog-shadow { + position: absolute; + z-index: -1; + top: 0; + left: 0; + width: 100%; + height: 100%; + box-shadow: 3px 3px 7px #999; + -moz-box-shadow: 3px 3px 7px #999; + -webkit-box-shadow: 3px 3px 7px #999; + filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius='3', MakeShadow='true', ShadowOpacity='0.4'); + background-color: #F0F0EE; +} +.ke-dialog-header { + border:0; + margin:0; + padding: 0 10px; + background: url(background.png) repeat scroll 0 0 #F0F0EE; + border-bottom: 1px solid #CFCFCF; + height: 24px; + font: 12px/24px "sans serif",tahoma,verdana,helvetica; + text-align: left; + color: #222; + cursor: move; +} +.ke-dialog-icon-close { + display: block; + background: url(default.png) no-repeat scroll 0px -688px; + width: 16px; + height: 16px; + position: absolute; + right: 6px; + top: 6px; + cursor: pointer; +} +.ke-dialog-body { + font: 12px/1.5 "sans serif",tahoma,verdana,helvetica; + text-align: left; + overflow: hidden; + width: 100%; +} +.ke-dialog-body textarea { + display: block; + overflow: auto; + padding: 0; + resize: none; +} +.ke-dialog-body textarea:focus, +.ke-dialog-body input:focus, +.ke-dialog-body select:focus { + outline: none; +} +.ke-dialog-body label { + margin-right: 10px; + cursor: pointer; + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-dialog-body img { + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-dialog-body select { + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; + width: auto; +} +.ke-dialog-body .ke-textarea { + display: block; + width: 408px; + height: 260px; + font-family: "sans serif",tahoma,verdana,helvetica; + font-size: 12px; + border-color: #848484 #E0E0E0 #E0E0E0 #848484; + border-style: solid; + border-width: 1px; +} +.ke-dialog-body .ke-form { + margin: 0; + padding: 0; +} +.ke-dialog-loading { + position: absolute; + top: 0; + left: 1px; + z-index: 1; + text-align: center; +} +.ke-dialog-loading-content { + background: url("../common/loading.gif") no-repeat; + color: #666; + font-size: 14px; + font-weight: bold; + height: 31px; + line-height: 31px; + padding-left: 36px; +} +.ke-dialog-row { + margin-bottom: 10px; +} +.ke-dialog-footer { + font: 12px/1 "sans serif",tahoma,verdana,helvetica; + text-align: right; + padding:0 0 5px 0; + background-color: #FFF; + width: 100%; +} +.ke-dialog-preview, +.ke-dialog-yes { + margin: 5px; +} +.ke-dialog-no { + margin: 5px 10px 5px 5px; +} +.ke-dialog-mask { + background-color:#FFF; + filter:alpha(opacity=50); + opacity:0.5; +} +.ke-button-common { + background: url(background.png) no-repeat; + cursor: pointer; + height: 23px; + line-height: 23px; + overflow: visible; + display: inline-block; + vertical-align: top; + cursor: pointer; +} +.ke-button-outer { + background-position: 0 -25px; + padding: 0; + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-button { + background-position: right -25px; + padding: 0 14px 0 12px; + margin: 0 0 0 2px; + font-family: "sans serif",tahoma,verdana,helvetica; + border: 0 none; + color: #333; + font-size: 12px; + text-decoration: none; +} +/* inputbox */ +.ke-input-text { + background-color:#FFFFFF; + font-family: "sans serif",tahoma,verdana,helvetica; + font-size: 12px; + line-height: 17px; + height: 17px; + padding: 2px 4px; + border-color: #848484 #E0E0E0 #E0E0E0 #848484; + border-style: solid; + border-width: 1px; + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-input-number { + width: 50px; +} +.ke-input-color { + border: 1px solid #A0A0A0; + background-color: #FFFFFF; + font-size: 12px; + width: 60px; + height: 20px; + line-height: 20px; + padding-left: 5px; + overflow: hidden; + cursor: pointer; + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-upload-button { + position: relative; +} +.ke-upload-area { + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + *height: 25px; +} +.ke-upload-area .ke-upload-file { + position: absolute; + font-size: 60px; + top: 0; + right: 0; + padding: 0; + margin: 0; + z-index: 811212; + border: 0 none; + opacity: 0; + filter: alpha(opacity=0); +} +/* tabs */ +.ke-tabs { + font: 12px/1 "sans serif",tahoma,verdana,helvetica; + border-bottom:1px solid #A0A0A0; + padding-left:5px; + margin-bottom:20px; +} +.ke-tabs-ul { + list-style-image:none; + list-style-position:outside; + list-style-type:none; + margin:0; + padding:0; +} +.ke-tabs-li { + position: relative; + border: 1px solid #A0A0A0; + background-color: #F0F0EE; + margin: 0 2px -1px 0; + padding: 0 20px; + float: left; + line-height: 25px; + text-align: center; + color: #555555; + cursor: pointer; +} +.ke-tabs-li-selected { + background-color: #FFF; + border-bottom: 1px solid #FFF; + color: #000; + cursor: default; +} +.ke-tabs-li-on { + background-color: #FFF; + color: #000; +} +/* progressbar */ +.ke-progressbar { + position: relative; + margin: 0; + padding: 0; +} +.ke-progressbar-bar { + border: 1px solid #6FA5DB; + width: 80px; + height: 5px; + margin: 10px 10px 0 10px; + padding: 0; +} +.ke-progressbar-bar-inner { + width: 0; + height: 5px; + background-color: #6FA5DB; + overflow: hidden; + margin: 0; + padding: 0; +} +.ke-progressbar-percent { + position: absolute; + top: 0; + left: 40%; + display: none; +} +/* swfupload */ +.ke-swfupload-top { + position: relative; + margin-bottom: 10px; + _width: 608px; +} +.ke-swfupload-button { + height: 23px; + line-height: 23px; +} +.ke-swfupload-desc { + padding: 0 10px; + height: 23px; + line-height: 23px; +} +.ke-swfupload-startupload { + position: absolute; + top: 0; + right: 0; +} +.ke-swfupload-body { + overflow: scroll; + background-color:#FFFFFF; + border-color: #848484 #E0E0E0 #E0E0E0 #848484; + border-style: solid; + border-width: 1px; + width: auto; + height: 370px; + padding: 5px; +} +.ke-swfupload-body .ke-item { + width: 100px; + margin: 5px; +} +.ke-swfupload-body .ke-photo { + position: relative; + border: 1px solid #DDDDDD; + background-color:#FFFFFF; + padding: 10px; +} +.ke-swfupload-body .ke-delete { + display: block; + background: url(default.png) no-repeat scroll 0px -688px; + width: 16px; + height: 16px; + position: absolute; + right: 0; + top: 0; + cursor: pointer; +} +.ke-swfupload-body .ke-status { + position: absolute; + left: 0; + bottom: 5px; + width: 100px; + height: 17px; +} +.ke-swfupload-body .ke-message { + width: 100px; + text-align: center; + overflow: hidden; + height:17px; +} +.ke-swfupload-body .ke-error { + color: red; +} +.ke-swfupload-body .ke-name { + width: 100px; + text-align: center; + overflow: hidden; + height:16px; +} +.ke-swfupload-body .ke-on { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} + +/* emoticons */ +.ke-plugin-emoticons { + position: relative; +} +.ke-plugin-emoticons .ke-preview { + position: absolute; + text-align: center; + margin: 2px; + padding: 10px; + top: 0; + border: 1px solid #A0A0A0; + background-color: #FFFFFF; + display: none; +} +.ke-plugin-emoticons .ke-preview-img { + border:0; + margin:0; + padding:0; +} +.ke-plugin-emoticons .ke-table { + border:0; + margin:0; + padding:0; + border-collapse:separate; +} +.ke-plugin-emoticons .ke-cell { + margin:0; + padding:1px; + border:1px solid #F0F0EE; + cursor:pointer; +} +.ke-plugin-emoticons .ke-on { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} +.ke-plugin-emoticons .ke-img { + display:block; + background-repeat:no-repeat; + overflow:hidden; + margin:2px; + width:24px; + height:24px; + margin: 0; + padding: 0; + border: 0; +} +.ke-plugin-emoticons .ke-page { + text-align: right; + margin: 5px; + padding: 0; + border: 0; + font: 12px/1 "sans serif",tahoma,verdana,helvetica; + color: #333; + text-decoration: none; +} +.ke-plugin-plainpaste-textarea, +.ke-plugin-wordpaste-iframe { + display: block; + width: 408px; + height: 260px; + font-family: "sans serif",tahoma,verdana,helvetica; + font-size: 12px; + border-color: #848484 #E0E0E0 #E0E0E0 #848484; + border-style: solid; + border-width: 1px; +} +/* filemanager */ +.ke-plugin-filemanager-header { + width: 100%; + margin-bottom: 10px; +} +.ke-plugin-filemanager-header .ke-left { + float: left; +} +.ke-plugin-filemanager-header .ke-right { + float: right; +} +.ke-plugin-filemanager-body { + overflow: scroll; + background-color:#FFFFFF; + border-color: #848484 #E0E0E0 #E0E0E0 #848484; + border-style: solid; + border-width: 1px; + width: auto; + height: 370px; + padding: 5px; +} +.ke-plugin-filemanager-body .ke-item { + width: 100px; + margin: 5px; +} +.ke-plugin-filemanager-body .ke-photo { + border: 1px solid #DDDDDD; + background-color:#FFFFFF; + padding: 10px; +} +.ke-plugin-filemanager-body .ke-name { + width: 100px; + text-align: center; + overflow: hidden; + height:16px; +} +.ke-plugin-filemanager-body .ke-on { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} +.ke-plugin-filemanager-body .ke-table { + width: 95%; + border: 0; + margin: 0; + padding: 0; + border-collapse: separate; +} +.ke-plugin-filemanager-body .ke-table .ke-cell { + margin: 0; + padding: 0; + border: 0; +} +.ke-plugin-filemanager-body .ke-table .ke-name { + width: 55%; + text-align: left; +} +.ke-plugin-filemanager-body .ke-table .ke-size { + width: 15%; + text-align: left; +} +.ke-plugin-filemanager-body .ke-table .ke-datetime { + width: 30%; + text-align: center; +} + diff --git a/infoport/static/css/homesteadDetail.css b/infoport/static/css/homesteadDetail.css new file mode 100644 index 0000000..6f1f106 --- /dev/null +++ b/infoport/static/css/homesteadDetail.css @@ -0,0 +1,151 @@ +#page{ + overflow-y: scroll; +} + +.homeDetail{ + background: #ffffff; + padding-bottom: 4vh; +} + +.dialog_table{ + background: #ffffff; + padding: 2vh; + display: flex; + justify-content: space-between; +} +.dialog_table_left{ + width: 70%; +} +.dialog_table_right{ + width: 28%; +} +.dialog_header{ + display: flex; + align-items: center; +} + +.dialog_header .name{ + font-size: 16px; + color: #11234f; + margin-left: 5px; +} + +.dialog_header .bigWin{ + background: #ffb400; + height: 2.5vh; + width: 5%; + display: flex; + justify-content: center; + align-items: center; + border-radius: 2vh; + margin-left: 20px; +} + +.detail_header{ + display: flex; + align-items: center; + border-bottom: 2px solid #11234f; + width: calc(100% - 4vh); + margin: 0 auto; + padding: 2vh 0; +} + +.detail_tit{ + font-size: 26px; + color: #333333; +} + +.phoneIcon{ + background: #3fd227; + height: 2.5vh; + width: 5%; + display: flex; + justify-content: center; + align-items: center; + border-radius: 2vh; + margin-left: 20px; +} + +.phone{ + background: #3fd227; + line-height: 3vh; + color: #ffffff; + padding: 0 1%; + border-radius: 5px; +} +.sanjiao-left{ + border-right-color: #3fd227; + margin-left: 5px; +} +.dialog_main{ + margin-bottom: 2vh; +} + +.dialog_main table{ + margin-top: 1vh; +} +.dialog_main table tr td{ + padding: 1vh 0; +} +.dialog_main table tr td:nth-child(odd){ + color: #6f6f6f; + text-align: right; + padding-right: 1%; +} +.dialog_main table tr td:nth-child(even){ +} + +.dialog_img{ + display: flex; + align-items: center; + flex-wrap: wrap; + margin-top: 2vh; +} + +.dialog_img img{ + width: 30%; + margin-right: 5%; + margin-bottom: 3vh; +} + +.dialog_img img:nth-child(3n){ + margin-right: 0; +} + +.center_table{ + margin: 2vh 0; +} + +.center_table table tr td{ + padding: 1vh 0; + text-align: center; + border-top: 1px solid #b9c2d3; +} + +.center_table table tr td:first-child{ + border-left: 1px solid #b9c2d3; +} + +.center_table table tr td:last-child{ + border-right: 1px solid #b9c2d3; +} + +.center_table table tr:last-child td{ + border-bottom: 1px solid #b9c2d3; +} + +.center_table table tr:first-child td{ + background: #e4edfe; +} +#container { + overflow: hidden; + width: 100%; + height: 50vh; + margin: 0; + font-family: "微软雅黑"; + margin-top: 2vh; + border-radius: 15px; +} +.footer{ + margin-top: 0; +} \ No newline at end of file diff --git a/infoport/static/css/iconfont.css b/infoport/static/css/iconfont.css new file mode 100644 index 0000000..556969e --- /dev/null +++ b/infoport/static/css/iconfont.css @@ -0,0 +1,405 @@ +@font-face {font-family: "iconfont"; + src: url('iconfont.eot?t=1562233009305'); /* IE9 */ + src: url('iconfont.eot?t=1562233009305#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAADKIAAsAAAAAW8gAADI1AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCOWAqBkgDyZgE2AiQDgwgLgUYABCAFhG0HiVsbn0plhhhsHAA43r4RIypGlSjqpOREZP9/QtI1RozLDUC16t+oyLSq6porVhcmSEnbsJJwjFmEkttQmHY/hRu37Lw4ww8qnGlfyXlMY4ZDDOA1u73m5aLLkHcIYtO+e3rbKEcmjxzv/NL7D1g1+CFJ0YQE1vQeWx4jV5pZM2MmTMIDz/3e+6J/tC2T5g38j6+oxTYdN9holEYt8Hkgjr3vR2H1RfUizQfeJiMa4AY2EHDbwBMx/0dUUmaIn9vfixGrosc2IlVSQBA3WBI5BhhkTlAmiDBKQQUJkRJFmxl/xrcQxUZFxcYAsQLEKhYAfkz3Ajn8hRxf3Lb61mHt1Kmc+r9rSGZ2ZTueUBFTAloIFMwqsi/SVbrCBqitHdvJA0yB4Ena8/uQ5jXnaZ7u3+b/9wOtGGuf+VCYLp7IInLSgJAIxbOXTiRUpuveLipE1O2mvZ8QgkRjKowkbzzP9JecmjstfZgYFts5J337vtddgDjkgESOE23+28zgCtcvkdZDdE1OYvfWM11Rq8E1XPFkZirgkREjQerCh7d73cF5oY86xAggoJ3Cib9JqF2XRHFYOpyOaTcKN8IBzRw3/zq1VQoUgHV9Lmw0LO2t0//fjqMvWU0khWSVFJZdsOyC1aTkssu8dTye9a0D2yWphHaBpmPabup4gMPCwzAA2jbCTj8eNgDVs9ZT2/xnzMX7tAYeGRoRsk65MccxNtv2XWZRccojLu4RQN64scCeKEgGXDFxFUBwkpmeCFyjigMhkJfUsYzvoEYYefgZfhLwq74P/sVs4AglEfHo+liYAsQXcN20kWph1EadrwGDFSIYh5jw1dmDF0g9xoWUszegwRfApLqwxpekOcyYGS4Hs7gQCxIjyXa9/q6ub77DdWkjIIRNjc3ZnG+zyxNPD+awo8Q+sG5ubVvEZw8/hRfJ/GvVmvMAIrFSJVBTVwhlWpJS0gqKSiqq4lKJpgk1GVk5eWV1DU0tbR1dPX0DQyNjE1MzcwtLK2sbO3tbB0cnZxdXrt2QFF8gFIklUplcoVSpNVqdUW8wmS1Wm93hdLk9Xh5BCtsiEN/y+QMBCRGCIEYI5BEKBYSBAOlCEelBCZEhh4whRGaJNtkcUI3YUIM4UIu4UIdsoBnZQguyg1ZkD+3IATrQLMgiF0iRGBIUBFUoBrpQEnSibVCPtkMD2gWNaDc0oV5oQ0+gG41DD3oKvegZ9KHn0I9ewAB6CYPoFQyh1zCM3sAIeguj6B2Mofcwjj7ABJqASTQJU+gjTKMpmEGfYBZ9hjn0BebRV1hA32AJfYdl9AMW0U9YQb9gFf2GNfQH1tFf2EDTsIm0sIUBbMMQ7MAw7MIo7MEY2Id14ADWhUNYD45gfTiGsXAC4+AUxsMZTIBzmAgXMAkuYTJcwRS4hqlwA9PgFjaFB9gM7mAW3MPm8Ahz4AnmwjNsAS+wJbzCVvAGW8M7bAMfsC18wnbwBdvDN+wAP3Bd8C0oA1TKo/wBgiGg8RpwM/woKtSzahKGLFYvtCqRhQ2nFZIopBL7fED1Wk5BlbxLpWXbUKgABKt5RapnbEE7kcKxjCVOwabwEkJxuGWUq0znRTZnEqXAF4ZBvW4GEFSRJue69+sB7DGzo8ZyhX+4qg2MktO0XtXis58NYYyvpw0lk6ZYUIfRv3UwmvgiMqHqGVNSswO4P92neepVVsR4XoEzpaDtuBQ37IHjcKWpKFbKpJ6y9EMI/qqGM/K0mPxWCsqq0WLDrQFaUzQGExbuuihLxuVCE4oI2LRiRO10nMMAwZleD80CYFwdUzJxlQaIwGLKDTATc/8QXWlXRBr229F7vrbLXc+1Hvox4d1sannNmalFhZZdp4NO4WNXEA2ZE5uR2fv2koN9Rs3m21/ouzdvtRvjLh1b5DNEvzDKQN/nMK2CIXCvzSG4/heBPnguA+Y8VSz6GyBj8TBpbwYLKJ0WAso5a+48zMKENfDW8an9lBxQLyGoKz2JAqgN42UWg2GiSkOcTlB+9clcEK+oVCowj2D2fvnM2uvBImLOhjuAQfnPvV/q/hD/L52LqZyqlF8iVs8XMBcipDbv9tAl5tAIn7FYAVkWQXqqq+gar5V+ywx/Y+fGsOyV2pn0Ij4W00/0SPvahf8Ou1nKT2prro38L+KC9mDZ5pl1Butl7+GSOp2cyaHHWY7deiJWs7YYCCj/98Ox3Q8WDz8a1/e4hfK3QMxni2JkmwvufNiQzSIZWWfVXO70CTuntcKwbBF6n2CzK0UxfJDnizEV0KJazUBSCXalbBzWvMKEwC2yJf5Wk4O38+tQAQjE4EUMUBsOIPXLkPfJKKH5pVNKFxer+viHV9heGFK3tnd43OvawjhaTQlmnJcC3LWIbbZeqDTXFVRngNECd+Vrfe5/lI0caZcdBTkSRY1CFCru0Cnb4zrOln8CrwciPCYX65/kS4df4s3Yvf13Uk/rhI/axI31JhVTYldsTzYhaiEAaq+zZkcs0j+bDO1MzEXTVxFLYgzj2vYkSpPhAZsHllnYzZb0WxEZ4EJPvN0XN2oheg3UIYeGSWGvpGJqg0HvMzErZ50VKV7k/iYrCCtEDpeKfXev49eDtgwQcf5bHWj1XjVybBBBtWsFWbJogU/XWn7wx2WjwLPEuO349YE7R+Q/9/8Y9CAAYeS3xUC+5G3RQglrarhFAy5p89/7ZHaMIr99B44tAFWzWLuvQ+jasJWZpBxX2EgW5vqc0pexwYojYNF5uk/K9Ojn0QqUQ76bzxZc5B6/4pUp+dfxF0s+DZd8GmkbzGaUyczsqV9z/93s40nFaDtGtQ1ApogZU83d0QclfbDKu2bXppZNkfboYwViGtPx0GH0sEw7muX31R2ten8n5ZaeZvlvgCQ5fkyO/pzN6I534ieuHVypOD7qXKiKfkWY2BfHf5Op9wkpTapOzTEYHzstDVg2aB9xPWTJ38X0hwXvnNZ97K5cXSbrCFD68vFpoAgDowCCfcW8O8WlIA5EgLIeZxlzt+B/U4G8PuKG0vbzyr+BCcoDpQVxv0WBEYgBpW/7Kbqq3cRm4+7Lw/VhxrjRikfEPCPvJzFA/hwjbvhLfj7tSqdc+WT84fG1mdzqbGaNml2XyyOoGwwyNAAQdGKKMhWGpVBHyMU4SRnunP4VDcdgFGLgqBRTxYdCm6L5ywXRUQYhPcpyt6pMz094BIMhybr7ZIf7JjuKyuLThAqleN4k1g8EtOyU0E2fKsAWcG2DzK4qBhq7fPQuc1utITefhjiInr4FlaEOc+1A6VP09DX86Ai6sxcnEMT9P+L2EuIYoK4uhggi8IVBgUhw3aPDG0oNgGFkrykPO0OIM2OIbWAxRn1ikZNXELFeaKjj5vWeb/LDXfhkVK5/zXPgrxeoTFiZIIYIZM3uQbdt4KgfOQs/kesIYM/dzfPN3d/7973Y3u+NHvphAAe05pAw+6kZPEMeYSOB7t5LFJvdcDRAPyXRdI8NsQIQTM62CW/Kh4MLiQusI8HDluuXVMH/cA1Bs63cyEzOoqWc1QUbQA6DXMx3Gx2c1mzfUKrK+CNned1nalY2F3EzqB7VaTZ4ZUbGKoN6G35+DthmcQmrXef+TDSnmWH7QhCwxZiPPmDilZtoS9+oecNJ4TvFtvjrmhjqz64GesJOekhopwa3jv9MXHf58kLdMYw+XvVVGwdvvXk1JVG+0H+r9bx21ZfC+ZoFgOuzX3IpV6UfFp6XQbLoIJyoc+OLrxKOpesaWP0JG57XvvQUDU/y7RChIjCfm2ZkDEcsFsE7ohBwcTKuIcM9zvijopkogMXNsfbS24spFmRiJCJSArj0bPNSYJMtMdOpVgvju0hAuRA1ppWYCOjqJVW29g8SjpnW+nvF0HQ2YvaNw4qzuuGIDT1Xr3JVO1UtNW5sDtCGIVQKdHjfZ+hOqCPR+2jfIaxTIejDiD0PzX/GB3F9R8jejTL1PlpqbJXqog2dU+avB2OaHsoSc1a9lHOMwIEXbB6cL2wsYCDUt0pBt2rSCB9IhFTUynrNNS41Oi0B6FgERsEJHEaE4HSse6bFcIO9HJD0DacS/pG7/5u5h96B7+4d84/LNAyo+cHIrZ0u0cJtpbn7674hj4jzyBvgFgGFqGA4JjBOKY1C7WmIsRKjL2GvKKhZ/PN9LmwWOShrLvLBX6xMIwZADY7cTIXRpECkH69W5ashvAmu3Ogx6et6E9TInh+ZsqF9w7A4LjtLV3/u359QSKsc/jXgMNTNK02DT6v/Dlb4Urne1KxQvHgfMMB/U+3vYsDy9vzZAdg6XLOyOitf6jeNjHol34/syYjbN9v+n8un87p5bdgxkHMNNYpJdbTbbKx3VnK/sYRDyvPse71nrEYosWRrYdVw9SDH2GKrGNsWa8R4CTax/dkOb1Ow6dTBpFxgA5AaxceD76Oj88bi5WMdZJlgfJNgydLZ4wbqy8bNXDbDPsopJoDu3c0hI0tmjVlSqI2Zu1hUm9j4OdNNOGOsY6MR+c1+gu/vdQzVgY+JKdcJS5aOx80wHlFV2jDaYmre3E2q1ifp7FkjKuJYbh9fSlfrCXNcXZPJrcu/rf3muM/l12yFj6405TLla0/0jpobPJden5lVh64+1ppbhlBLxmJgiCMa/dlthlQVojcPrmV1B3qP5MrGJ/OfeSkc1GSKoJBHyYTm9nw6qAeiR10jDIESBM+9DS+1SXAQYfvTn/knCGnfmsUxjA0KHb76m4shrBygeRS2QRmFfrECRD607kzu4OJ+SflBkx6wkpSrLPZHpmC+qGV3BEXb8u3XJ4uKy/8P1CD9UgYL0bY9HdIjvujJFhteAshRBHUuklKKRjvqsaGcACG3MrSkI4O5/Co/e+6M9wWUO0XOMOqpSApeYy5xYFtOP8BMCaxywrFNDVLbApXCadR9GY7qnXRJDOCemToV0jTQ2jcuiSEiUBmAMawHjXjRq6lzawqgVGJqGCSzN0Px8HndsSigSQJT6ZAoQ2ClHKuKDmimTaviuiCgoGMhkZSYUHUNK8hUoDuqRYeTHWFi2f/6dqqAWVvXTJRrzutcWJB+Qz8BG3dBjODpxEWdaSM+ja9KTrqhasxDskVqR8C6emvwemwVzV/JRSB6kC5mjLTAUUiVUPbe0SKCOggJKj54FPQSG/N/N+BmPNybvBQtRFQSm0RzETr09lr/spVbOqS2g3nye6AwUOr0HBO0kPYb09jASvVY1+2pyeJyiexgBX/dsF5iUYyKXBDnVxD7tOgrya1piDDK2XZbJLEiBgmOPtZDKfX01bsGzcneYbULMA+j9Jw9yXcat1mHRc6zAFh27vTi0NNi13TRN2zzwyocx9WoBrnq1eJeby76WBzUtAG7GBSlkVG9+ySZNhUBYa2l+S206WM3B/rVlug2VCX70nzwHLS16sgnK9RdEEuyFVrmF0rp2UW4uz3nwvFAosS91aTb+VYjm9BPGILhSlHMuBlBXEp36iymHv0r2pa0VJ/VFhKMbWxT5ox3XErFYpvoVQ9WW7xhdSEg5rivrLRytknKV5rY4LnOOmJrYCQ+KdYNzcSwRR+T2fRqBh461xbqRWdaeU0Vh6jw3LRw49FvpZChO4Q7K08783wKLwGWStjTjT4bM69XP800PioajQsADM8I+4AWc/huuhMCk0Lax0Y75xoN6pDYovwb/mPbNElDnQUy5X+MyxqRWVvEs5iT6CxD8kMRP+tyx4yPDUCyHOvHWzMUE6yCwXXeyKl6OEeAA6s8E90geuUNEk9429sb8nMiAnO+JPamMR0vTGbbzWC7FNisLe8dpx3DtQpzDawAJOgHsUzfwNxXtyGw4P/PVTPPqQN3p0/cDmDfvNi1u7fjXMvlpofuznBX3A/mfzFHwHJdflPvk1buNDXYqLNyCcSafLNy08J1sN6BHU365CvPHDnUEeCGw3HrGPiUEC0eZKilW1gVfXTS6Zkqm3QjHCxZJPgfXnCViGiFoarXi2mTLls+kRMkDJ9nyhrIo41cJUCXRopigbOCtQDKlfaIiRoXUMRGDGFsorA1GHFgvj82FAGtJ7+Gg5j+BPCwQ7HPi2eeam8c632kfMBWivEAVCFDOzr4XASDuYptj3cBGhhPjiHHFwKMi2WbB+1nqD58Uj6P7/2PuQ9jev5tQxlFzdlEGG9t90X7npxFN0MFKIhBXor5IDOafG53H6jnckOKeg/EtSnTggFF7phUaIxiuQrzhXaGoD4Ly4HzUHqNMfXHEgxNghl7Ah4YEWklPN0FLtQ9puz6AGN9ro6qrC7XyDK0kaZBbYkARaUGOgisqJgKddsWeW2APgkyuJVYjFU4yjlSRNSnr+Bqnu+AAmCKEIUytYED97ibFPr3+G4xHvUQVepm2DWe9raGFHh4PvAomxC/necd/FIjlKeZxS7BWK2KUiiw5Rt2L3eVtCBC/FXvY/60GBvqzteSEGlSX0EH7wzlQHt0JH4gDXUqYrqzM6k3lpQdqCN2VxjyI66+EJV64hdNB1daLjjHFGVCneXijBCUh4TYV5RzRCDr+DETlCy8JDBXUK3W/a/EpU25q6SFEdFCzxIgLtzQEMQB69PLgGIQYXn+EI+UUhoeK8ZUiLFozpZSIakrhcgN8XllousyJl7tYzUo16fTQJ67WO3Fgr5RZtoRkwNwFsKLV7GJe2mpvJa955H5cx+oSy615v5hS5Zxozx+Pt+SZFhfDC+S3pz55oL2EK9ZY+S3rCvyEadNxMLG2nB+fRNvEooiAQva6pePyXwHXd6XG794cxH7tkgxPluqGS4M3wapSu/+lk21Z52eizOVG03oW43GHRaBdHAGQ5fHV0Jcyhf+cmlaY28bCsT6USwKlLeBgiPdQLxDgl5UhA2K6mnbDf2vfWp49vBU4P6p2wfyJVJMKURfPlB1BD8wz3Q2zwcapphQgLqdphVTwCSmP2yCOtLYTlOn/4X3M0bBhgja9MvtJBVMhPVjJilATNVOjH2JE+C/htq7glxHIoEXnVeu4KaZ0zg6/CPzI86IA+/U8NKNXUupwV1dMEldG7W7jRv/LoWSqquToGSoqhpOgpOrqpJxAdVVD4j9tCNO+5NX9CMXnfcBFeYBmz2CPsBcm6AjRADaoIgzO0H8rP8E0MInz0q6dvhwu5GLcceVKx2rJ+li1A5Izo7L1uaEgCqZXWBzhKrpdzJvSRIP26jiV9gFVcuy60gd/MKoYbN7eb186aCeEes8yLzg0V2afIh5yeNC6abznm6VL/Qpqe1yiDygzlzq4LomIMg+e9WsXtreqI5V2b2z9tCC7WtDFcYObcmn6iJdNVUS4FguldQZc43bJVOUtvdxHRJZFoCNJGn68Lg+TWHcm0ovTigHblbDZQgoa1K35hu65CGCxCfBxonJesnvBdbb370NjGauwcwLcJlVpmdt25S0xcDBT5Mt2Z1q5BWnsPAjvGYLUPyZpoYZYO5z43GB+W1zwbirZifeJwrMXfmuTUGBzDuGQQGNdY3OHR3+cdCeFwkpwiGBWtA7Wvuw9mt7XUcd2aGOUgc8e7p5RrUcPx2/mvjj/vAavFA/ibsoz4p+wj/4bTG7bc5qA6c1VmPKNytwX6KOvcwMjrWKMdxYZbrRMcbniH6cKdl1LgdJaDyOwedj9/DCUK4vIZQBx8p5noPglSc6nzHXzImdyO4p1dPP17+nN80dO56GW+Rgl2CDve/a4oe43seKFwEB1x9Wbu0phYVgiVeFINR+wempG3xdJKzE3ZvhJnnA9+V+tB5N/OACYNhi0mbUepqLIcNjPFZrMATrAgZeCwjfu49Asau/epuK2K3t0ENsNw6do6C23cUQz1s8d+nGKdkPPdJbgW8UQ4vFBPrdH2INCXR1SW/5c6N42lDUwyFzM4O3YByrpde9v2o+RG/T68tzLLpHB8khm342k1z4uVyeWI+G/7HgwQjC3hQCP7azP00UowcnVVckQcOttgGWM6bealtXnbCvU2T+XvrmvGQOn3LjwhU2AHsip0OpSlMp2znMsK+uZPW57T0TvfuOyk5ea9MgPMOH3evYuOLp5XHW+xKozf1/dl9E9fRQshc7xBI6YtYDlM1GAW9IEKV8BjD/ohoZciM3MS9xI06zof+JnzBchDytrH9ZA5NZauT5c2QPoi6s7kMNARC5Z14DcvIkwrHrT/Y3wPVwf/+9bug/qabitUZa/As8CbcHrzXUak7gY/1LZjlThl8gECzAy2ZayjanXaHsNWqJBTtE0nn6TcjLGFp0fU65w1vdIfrfJlSU1kfTYuqXV+gzC/E1/Jw3fM9G364A45C4o8fi+FvhGBhVb+Wj++1R/rsO/44hMo3Ps97G9uaAEWkcS9jVTbYLnnPEbI6Z0hQTAvqYpjPNLGh25v88co3ophytAfpPP/kZmDWQrI/+M9ByTOkmcbNZ/+xgN1uzuKk+oBNiumqf/9RH5tgGu0S7A68eXdEuEIGoMSHO/9xXdutFmEZr2tj8kSX/6x71cJzelDR/sS/1208vV5W9Xna+fIFutCiQtPkkp0y2N03H5A5Pj4KLJBxlvgvwjFGQ/c0LPfs4EfGLUsDfC1bymQcoMmsR85h+YqSCyoNXQ8bWm7J14Qi/dLV1tp6NwE+63c6dIsd+cpcCi0X3d9/HV7EWuVAM3kJ7NP3bFxBaZzE3916pcr5D3UCoDoc9oYjKGb/ZcKfTvT2eTZW15QBSg/+RwFju/dJ03+q+Yncm0OR47dgREEtsZtn+7zVz7zF9C1bzbJ/ut4uijM0TRrZf+Fpa21lGkIvNm72SmQl6QfCvqIWhC2cmETJxmZTN9uUJ32zyXUCzFryfgzsqxNKro4PZLXrLWIQpog9xCs+aYuFrKwJrmeaL7m3sPMWtmVnnNm4eVEW6ZX7L59ayZSyiNihqCWk8gbNESN6xluAzgPPKs0+17AVKSkpA0p3xXizV4YWAKWShbdiCB3Dp9u3L4T4F8M50iIhwzPI+4s3yiIgNe9tvhUSwIZ/z98FpSSBPcT3oz/sFvnVVS0y3xkX2OLhF6yklBlBEYx6lhGXZfAQ51rpzDsFWP5icsr4+Epvn6PV8+9qn9TvGzhwzPkQsrF/SPSdkw0KaX4LGOtMmz+UQTd2jtgywzJD/hw75HrLpNO9qUe4uNs7aUXQ5cGPBxsDxq+d75R8qZQGytcTSDHNG+G2ykxBExt05UJthk3HAOsUmhXc9s5G9yntzucu3Lr30gBP9uizBE/KVUtJqzcI77m4UyWJanpnk36+LQvFdcZncy2H/AL2O+82gjpKHHmsP6IT4ICAASCD/HwG/0A5CJrnEOohl+tRJ55rAxdtSEOp7X+BwdL80287AydQ/2JMvoofePBH4zPX48uOIqP9l8MvBZcSw5/SAhQvB/Lis1dBmcXpLQNL42ODyQdFg8SCj+Hgx0JbcR1ksVNl7vd99zD0MBHsfEYTCs2dRxLQzyFlkD5/ZKOhZdN2iN2gfdpQxiu2FDQKnBObFmGDagNKbVudAuKmGw5zW5cBuCy0lAuvY9wsYw4db1x+WmvYAqZnOz/8JTAE+I7yeFRBms1DnQeAjjID6LQKTYwtCWJKyjEgBAXiN65PTyCxKGieVwiKngsg6AO1XO3E4F/uv0Qb1GJZQdDVUqD/s1H/p9BcyUFPwTrNwOKdcJ/JpPBunITdS3ChW4jvaCJNjB4KDD6QVmEeOViRKpDo3dTlGgiJBLDW4yXzJ1GW6IcpxpOOW002kc1wJvLeZtlKiKbHOARmTPrHbDjBbarSu9ExLQ/MTe9a5D6nIvcd1nXMpwSBgKcHBmQ2F2e62cpe2UuPfEi4BMT7DGbGUBeRAp2EpFGav5niID9HlpBingFjPuxHux8y8Az1CWZpQz48rkyQ3mS2t426UDL/FSlqS8003eqF/aD4xBAqQrN+Caa52ZoPL5STXKSlTJmNKp1zXuZEFJMn3FMxhEpJg9tMdUshkm/PlQRZZOf0OpeXLOGAdl8838KD1oxZgnZXfTzc6k58MSXU84nX64VFaC6St+h9bPbZsyodhqmLcn2y9wB/a53zroTSsewtmSsriHCvclq04jrl1CzbXqmfr1p4cHzwI+Ijq6e4Z+Y5p564+62BlzOp4inueSj9JBwy1vRoFqHoRoA/Rq5A9dn1dY5wgATdrPxW7Ewy6avCyv78F2x7djm3pXfNsh6GmHTsD264xvnS326H+5SVj04HhjmdgoHyi+YSZ17NBmuaR9SNamq7L/ge05Q9Rc3O0sQ8FYgltiSmIVbT5wPEqVTzkQG3geJ6iraB+vMMXO4H1sY0zMLrkOkXfEL2B3jc1vY+OoCammPvHN0t9w+sUnJfnXXffXt85V7yuep1fXnL3n/zu8hv/1pdFOwXzeN6vXzVt5IaDA/yeyaEQdjj3YA//k4Ydwo046Ld5bCiUE845FA6PG756dZW9iiPaIal0T011r2p0r0xNe4Y1VbinpUU0uatoZO5uBdz9uAtgRX1DDuyg4mHFAqTu7PUmFAB2ReY6FgkjCRY6BzAqFaYsDi8fwGqKzI6z3AzI8eC8yCYaKlTAUZ9bP0MReQoZar3MhidQ2v4XBSs2ty6DBUgjrIDztSWYrXjxEZIkJEqg1QFGPST5eHSbrrVJgKSZ4yWXh5U+BRFs6dhCsJU5AdvF6aWb9C3mgAciSd39b5uc3grLQQByd08qhZfDO7bDpYHC8ibw/3ef1I3RNXMhHiVxzZjA3en8sgXiYtmwCxtM/k7yPGqTvyhvy05eVq5usKNrfU0yw+xN4m6rKZv3b4w9FBnSXbz9rDvDyxseO8BevxNWxQcCt8IF4M8RB17UYe5bV1lHSzDq6UeDYGIMMYgaIOGJURAXYbrWUmQpkKc34rpW7lyx3yt3rh/gLD4ebTT0xwSeOZd25mYmYU+9UYvThrH9Z8CfCRG4oMkghQ1nh44MzGZH+/mLdoM4zGUGYRi9ieqbBL0cL9rt70/JNyzHVuTcUsRTD0LrKOdVP0T6rS4YpPkAegfVTdTQewor0KZKHR3X9fqiH6rtGuWys3C54vaCxeuXKPTOzbHutUVKpn+3ei69cK8Hy+koDhfp+sXZ9ElnXVvzzDjY4yL8Z8EM/wcPkoVX7vGHY/cYhLjoiCtir2tmxsqL5U7YxnsXlnrWYKdLvry7KCu2qgQllm5LyN1w1VQuZ2mkmyqENs8DuhYqUwMV0DOobnpApQItoCMzDIGhqSRoyhL3HV79hOzQGp9M7Nm784BXB5Ygt7xkWbrv6anU0uU+aurUad/0kmWbRROsVICNqEYwbDZmBPN8eDWMzrWwLUg2RAXUvoMHl8nkWhqlXL9+xuxHnHZoCBw9P7j2w+VX60NrrK222237d6kXVlBggcNRjfX6UK9oU/tSv/xvrDqL2tu76iGdfnunRR3eWvnfCCnkKG4U2Ycs58rJ4Bzp3Kvzr1OtOddRhebStkP/DapOO9snoGyWR09Yz/vfe48MJ89IHt6l+aT97/gvf9mCxJsFBp1hEU8m6bHxwLeH4IhFyTxNouNzFITF88joc0dsH9YR4XVh+/RHc2w8q9+Hjekj1R9biT0BstRMFJIfrpoeuUfPUX9PdLVanyfi2yNdld0dcG8y20bcN7CW3cPuHv+ArLm4V7+GSBr23tXnmzm3LLux7x8ojd095dF9ZrhitUxt49aoxRFPPnC7atyMr/Ejlvjh5L6LNH8DYa0UtBsKqf4XBbwFvBLveYviRNgpRvyPLowpLKgDSTJUGUGyUm45uypCeYKnN1aiCNUp2XSqJGHXUr5BpGjoS/KAkoDA1t8Svjg6OIZ+vDJB1iU/UH/mtIoE476KxQqXTCnhDWFUjFFeOm+UofInXTwPN8GcxEVgJ5kTWHDISpWuejiD1F1P2oKbYEzg3PtxY8wxbA+2dIdb/4a4qYGoQ6rvJrm5Y0eZo1g/fVcmfXDAPQo72pPQOIF7hJuMuiePgHoqAaiBS7hHjcsBi5Wvgt88eBy00vWMS811v+NralwHXIvacmq4aZFpZZlF/GFaUXPJOHq6LKPlIbFhE/ErdpIxie390r3xE6GhgaCeOobKKO7rUWAnkTtt+UF0wgLNAfHpXfGzXxQ6rOej5db2kS4LmkEimjNhcXCkAG7fCC11UJsUwPoiwOV1S6WfQsdCmrnNIcFPtFy2TYFtQWcKA3uMNSxjYc+BBXsWSk+oqi9tNdwkQa7Gvq7PjDYniMU6brN7XD2gE2W1eeoEZyTRKDGVVxlgvtwsPu+U7PwMpK/tClq+Jmwz9IqZPNLbYiA18fcqbDm823/QrqIFjW229Rp7LTq1t/PK98SrNfX93FOZb5GY9zs3uXasbLvavs9UOKR86DKuZQ+TGzhkSxyYbZTFg+RyiDdTdXkUD0oz6Chn5uknisYXn3pS86S6ubS5rDwRqqiAyCZ2iCV0hFMglJICgQ1UiFJu8aoiTQ4VFkLymVFbWCCH5kUFNoXgcS7JleVKmiyzLjY5m8UfkkiDTmagj9iWD+537qsF5nFG8EmxdCibf/ZQa9mCe7ffvA/jrijjb5uPnPr9rw89if76h56a77ftY9pCT57w9r3sslZQ9JcCkSG5oB9OoCFrBDiKctWTasKrp/KplQ7Yj7gQ3CS+AT/JdC2uth638wh+DNeAoz7y3lVwEh8chI0xSuxkT0iPjcxDsecpeC9UmypxgLLyHKVVUzBuDE+sBnII1nzR4kA2G2BP++GMiFlpefN1CwrikNQ8/RzsX/4NLHWo1UVsrbRbkSathlOCLMvsi6JSrR0Ukm8hR9znNnuHhe8Wyo0DQoMOeEcEzJ/jH13yyzWXIZaE5YbRJSOJIRaHH3Y9PHUCJIETU7lADZqll7E2hvPF3ehU3I7KrbRtw2/eEIFR+XWUSkWvodcLX+9DDQEQeW3GMfTrV5Tdj339FkS/fcOr99vXtSNF9Gl6ulzJKFI3LmWniSVKujItRb38aG9aahRRLpZENRXsa5bjo+WhYiU6ySuSBElAqpjy3PUZZfFiCIk5r3Qm0DJQisViRRTvGjEdkJFgcO2gAVW49NzoNF6kTieCayMlD4Dr5nRATFejhcuhngnmRM/ym41S0o67DZ8WbjlujDGGKxkiPRghMYhv3hLpQ6eXj+hJnvQzqF1kQjeMvU5NQmQYpzO97DmgI7G9xJFnmNv3QSZc9S6uO3feXGd355ycjHTubC5Wl+dUWRQVH1LHm8vVi+TQJ7B6ozZjSxdP2ky6DF8XCtUUXc7wDWV/n1DYwdWlzlCRutfdzQGQ2XXUdnRpwQczhD4aHGRoEBJs5u/u7cfAt4L0ExCdBs+e1JOEr2w8QJqeejk1TTret+PdSytpocWm5uPbyxrS3GXfGw4PN0s2Cw+7+fImHZrxd0nkJgHhwQd4wb4lyXa6dYQ6XbvRvZbYXqvTQaw1cDvy5uz8nI64YPwQ+lSdb52WnMZNt0jnpgHBp6T4NT30qoH0tjybIrTvPZhmf3LfEnS79cVdnecKfNbkrjksbz/W5Vh4tlOffwTL7zxb6NjVfgx4P43l+zqjWes25IJstHUdyO2lzUGampAcZ18+EpyeEwqC22jpIBQOzrimEDgz83tK5xZzZ17dLs2x81/EO71Y4xn1MYwYJ6tw1+WZb+nkCouffWpQt7x76bjE9FqJPOyXJ5+GlAi5Ns6+69TNP1C8OZ48BC0WAmeyV5vVs6SV2tW3Ua0WqzQgGSx78wVMel6e9/jy8rl8gErV44pVYV17VCqvQ3f0hvRU+n36Kgblikek1e+NosiP3pTT+qny3QOxRUe6flgOXJz/OlTCirqGbMjxqqf/1pUOHL4fdS2V788WsYnqPPoZVAF5WkEMFA1lLgbRZdVWujh3U5GpO24tzk0j0rjhksWKOf1G3vlPuR26kPJ/sahmaaA+SGwXWhcJl+3oLYUdlCO4LDK0TmzX5HToK7zNGzn45sN+FADNyEFveNtvHM4DTq1emQwLEBFO1TWrkiEBcmeBl5MHIqCzraQXLflW9y1dLJICyS9YMvJhUhT7BbmXdGFKwBZMXQgT+j+MIesDEnrMAbAIE8R2HqEIELCW4HG/fh8n/8AGBiaYfh5nIwbChQuFwEEFISGk4RrA2VZTk8v73fZdNmlMk6UD7fzLKA6HsvtlHG4JRPirkWfPELDqDlHKX5LLM6XfKQGDYE6iXpGC8DcvLnCumpYceTTbg1focPOQ7xzP5trhg50J/6mOVObLbmAXBqwuIs5tWLlvY3+tr8/OlOdnD+4KXDUa3OUIbBEV2c3cjTz12huDV+81MWS3dMlwc0NjiKPjMUzFpC4TMHUnFcz2Z7eLe+JGBG+NmF9wU/4s9/EH2IkPN+jVjV2mKQNdnb2dJp2duzsHUkz3ALf2MYFwdqhQOCoLm6j8uYcKhJPrVstshcJI2wqdyuRK8Pk1rGxozYVbg/x46oHQCMJeXKjDQE1ywNXlIo17kmmnSEeJJ9F04tlT473cdRys6xan2jaQ4uWdsTSAxg8sgleUQnHQIr1Qy80FW7ruDEbxjnvbHh4sXlS55lxFICCG6Q7wPHM/5TL3URWPQVzm2mimDm7zB7cP60x1ohlZ9SDu8WGXdGOivXM68OjpmpOhcFjKR3b9etKHeL+fT9Bd7n+O9SGCEo5vdVMug6dknOguVpFdyariRlLvnc/aKshKA27cwcoEnd1KP5yhjaGyRY+1MBLX+nx0eBXrDmvV8HzRKQl3CEqwMEgEla+9UDDraUeq8BGEM9xg7LVk5hIvo6SO5ZlQOugoMU7wSpkRaTTvdhYBekSmTe9ddnaZ4/rBd7TCsxbOflYQgGC+FdkJ2tvROJjf5Bvm3/m6xsrSDcx+Hv4fY5TJZj7macKGMGzGpObn/8OQMTR8mEgxoa7dGDoMmUDDoQTu1r0fdnFySnWoKkxxRBB/GA7+FYoARjlniJrC0AjwsvIVdzVRZqSWreMd5m2b83+Mt7NHzTvGH3QpUC9UEafAeJYD4HoAJriZuBHoKSYpwwSBiWARZCayHHskc1d90Q00Yms9nAlniftSyNhuwyJXoygxP2UslP7K9pVNmm3a4ygaY22Od+S9oUVkyCjrVI0KaoQHtiMrxOIlvBmc9CKf73Xm5KlmK3jJ1g7gfkCfayWU+Ca7VJutAwIyj7hvoV90vqiMP1ceoeFFEpkippWC3Sw2yXuUjhpGcioH/1C7TeeGS/hkIVmkU4BtLdQR+UaIq7gBOot7F7k5OKFwpirBLtZpQaZjvrFTTI/Hf9t8FiQ0+Zae/uP+C4IX3+yG74kvbm66blTsFbT22KW59ynR8/jRRpduNcz/fuvvcsvkuJF9Vzu9Y4u2zwnJEQ5+PhgkOn/gJYhya9BJ8L5XGlqQNfiei1JjZ/kBTZTVfup+5mDAD8TMpKHc94NZBaGlr7x1ErvnaSU41BQl5emUtexQwQ7qzDFleWSUBeNtp0F5+Q/tjeuz9uP7UXsh4qEWQGsBmFpEBU8DkCx98C7VYwBuHAjAqp5MeGByJEwObQ6No9df2NQG+qT90TLUDGnLrVQgEJguT5AkZmvTkThmowEklVHXH4lnVLSIKnzDAfjnYZDewP0AzFGnEHcw/zcfCWQO6kRi1Op1xMXcsRdxZE7aiQjUclJeDr3aX2QF1D2GTeapzUh4aAnyGqlJqUWGkAolo3Eh9YLHCG9li8w/LoWD6hp96KWS0W4I2mm1FYVMuSHHIbyhPsjCnEkmQrKfwOMmLzkNPFBqhUucuaINidAbChBjqOtN58AlpwWFmEvuICJmtR9IFFNTgKT3VLsaPm0A4RyH7gAJnnzINeXLNVoydsMaRq6jiyQyzVhICtcIVmtc+XH0k/e4FnZOqTJy2nwuvP28QaR3twgpg7qt8vMO7wddoO4pOA2B/W1jErcQC6W8gK9CbbMtJFymwH7EzGMF8L2U7g/h0ZkazYjknxJSp6L06YqvfL65GCYa//3TKHj9wnE5Q4TIConJAf+CIDZzA9R36dzPcWWxEZDVo2vhSq3LQVrgCatn7a1VndK6XOrl4R2S3f6jmiedJehaNacrEWY8ACmZIPfy5BduaGXBe6kMrwQUkNNDyBeb4N8hptX6u+yEhmRU4tzwDTyhzJgnkpul4+JVT6Ky4UnlNj15K56PX9D1whDECRj1yjyBlm9PqOHDE2n5oePiX09i4N+TagWFpzQMaNdQmQ9GUew7BI9Fmk0p5cKlsI+reX+j1Rrc0q+G/UfXUWNqDve7s34ho8uRoevtyfsyLZ006U92dljXkrZOzpj7Q+V9+348lq6Mh1yaRew7BF+OXqTZND7lwuWefWx9/L/Rag0ukHA2/n90Hamp+UuPhAn0L56TEh4Xc9fbkyelTKXupKmFn1zBughL2rrtzpj7Q9VCb9+PlKxM5Q+HLzR3HTxXvmWK7BUIXRaSpJZGWumk/6UUJ38epyZZvUWiAfiNzX9JQhkXUmljnQ9RnKRZXpRV3bRdP4zTvKzbfpzX/bzfL5UfhFGcpFlelFXdtF0/jNO8rNt+nNf9vJ9Y8kVgkW2hklx3iFAU12cC9qLj+nA7q5jmSfSyEYeUONo+l3Zat9t15k5lMylwEqNJB9ykybar4qX1GES1aDZ93QQDklIksLHkjB6iM+WVljooL+oWSCblidgOxbsxBQY14LlqTYsmyb5tK2Hc/amgxTHsKqLPOIZ1TVpH4bUV3Ql1bNqxsK008KKeQHbkjBtHn3TVPIslPoo0dRB3niEi24svzmcCrvjG2RqXGclco0Ei4eIvpQfaNkiegpoE1fBirogtkmMJVumuW7sBtAzE4p27BWqAQmWnNlGnMgMVtL/O0IVx0BrxBwJZrmkIr3nKTfww8SPxaWvRIYcVziorCSM2uFxmSlJCpVIAK5+LFIo/9tU2jgWjj6AJB2VzKBFONcMGwZFmZ9zUpLMRQsJ2JEOzrGiETU1XZ2LbAkEk3GhsxXZae6DkTFa0Bxc81rLX26xmLQgbvlrhcmxJbil+Kl4CFhLIg3sjTB6QZxqVrybRzwe/IZakCpubRpCJKJ6y8sql6bQt4ANoTSNej11CCfxJNt7OS+Nb8zkXeOVKLBDn5nplqDVNVjT3FtpNNA/bsERWjhDwykdSRsyJgb9tmCsKoAVnTJha4i2YEqCSTQK7J5CBFCDVSU7ZR3kIPi4AAAAA') format('woff2'), + url('iconfont.woff?t=1562233009305') format('woff'), + url('iconfont.ttf?t=1562233009305') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ + url('iconfont.svg?t=1562233009305#iconfont') format('svg'); /* iOS 4.1- */ +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-gengduo:before { + content: "\e605"; +} + +.icon-iconfontadd:before { + content: "\e61a"; +} + +.icon-jiantouxiangzuo:before { + content: "\e600"; +} + +.icon-jiantouxiangyou:before { + content: "\e601"; +} + +.icon-moreinfo-copy:before { + content: "\e647"; +} + +.icon-jia:before { + content: "\e632"; +} + +.icon-sousuo:before { + content: "\e61d"; +} + +.icon-yuan:before { + content: "\e62f"; +} + +.icon-xiaosanjiao:before { + content: "\e610"; +} + +.icon-shang:before { + content: "\e603"; +} + +.icon-xia:before { + content: "\e604"; +} + +.icon-shang1:before { + content: "\e607"; +} + +.icon-xia1:before { + content: "\e608"; +} + +.icon-weixiao:before { + content: "\e789"; +} + +.icon-guanbi3:before { + content: "\e64c"; +} + +.icon-jichufuwu:before { + content: "\e61f"; +} + +.icon-jishufuwu:before { + content: "\e620"; +} + +.icon-yunyingfuwu:before { + content: "\e621"; +} + +.icon-xuanchuanzhaoshang:before { + content: "\e622"; +} + +.icon-phone:before { + content: "\e6a3"; +} + +.icon-Shapex:before { + content: "\e6a4"; +} + +.icon-shijianx:before { + content: "\e6a7"; +} + +.icon-lliulanx:before { + content: "\e6a8"; +} + +.icon-gou:before { + content: "\e627"; +} + +.icon-gengdi:before { + content: "\e628"; +} + +.icon-nonghu:before { + content: "\e629"; +} + +.icon-toutiao:before { + content: "\e6a9"; +} + +.icon-guanbi:before { + content: "\e62a"; +} + +.icon-riqi:before { + content: "\e62b"; +} + +.icon-mianfeishiyong:before { + content: "\e662"; +} + +.icon-tixing:before { + content: "\e658"; +} + +.icon-ArtboardCopy:before { + content: "\e6df"; +} + +.icon-ArtboardCopy1:before { + content: "\e6e0"; +} + +.icon-nongjiaodongtai:before { + content: "\e6e1"; +} + +.icon-meiti:before { + content: "\e6e2"; +} + +.icon-lianjie:before { + content: "\e6e3"; +} + +.icon-zhengcefagui:before { + content: "\e6e4"; +} + +.icon-nongjiaowangbaogao:before { + content: "\e6e5"; +} + +.icon-paimai:before { + content: "\e6e6"; +} + +.icon-gengduo1:before { + content: "\e6e7"; +} + +.icon-suozaidi-:before { + content: "\e6e8"; +} + +.icon-biaodewuleixing:before { + content: "\e6e9"; +} + +.icon-sousuo1:before { + content: "\e6ea"; +} + +.icon-ArtboardCopy2:before { + content: "\e6eb"; +} + +.icon-ArtboardCopy3:before { + content: "\e6ec"; +} + +.icon-ArtboardCopy4:before { + content: "\e6ed"; +} + +.icon-ArtboardCopy5:before { + content: "\e6ee"; +} + +.icon-geren:before { + content: "\e6ef"; +} + +.icon-hezuoshe:before { + content: "\e6f0"; +} + +.icon-nongchang:before { + content: "\e6f1"; +} + +.icon-farendanwei:before { + content: "\e6f2"; +} + +.icon-xuankuang:before { + content: "\e6f3"; +} + +.icon-xuankuang1:before { + content: "\e6f4"; +} + +.icon-guanbi1:before { + content: "\e6f7"; +} + +.icon-wancheng:before { + content: "\e6f5"; +} + +.icon-tuichu:before { + content: "\e6f6"; +} + +.icon-huiyuan:before { + content: "\e6f8"; +} + +.icon-liuzhuanzhongxin:before { + content: "\e6f9"; +} + +.icon-xinxiguanli:before { + content: "\e6fa"; +} + +.icon-jingpaixiangmu:before { + content: "\e6fb"; +} + +.icon-gongzuotai:before { + content: "\e6fc"; +} + +.icon-jigouguanli:before { + content: "\e6fe"; +} + +.icon-morentu:before { + content: "\e6ff"; +} + +.icon-guanggaoweiguanli:before { + content: "\e700"; +} + +.icon-jingpaiguanli:before { + content: "\e701"; +} + +.icon-ArtboardCopy7:before { + content: "\e702"; +} + +.icon-tuichu1:before { + content: "\e704"; +} + +.icon-ArtboardCopy9:before { + content: "\e705"; +} + +.icon-xinwenzixun:before { + content: "\e706"; +} + +.icon-youqinglianjie:before { + content: "\e707"; +} + +.icon-xinxiguanli1:before { + content: "\e708"; +} + +.icon-jiaoyizhongxin:before { + content: "\e709"; +} + +.icon-tu:before { + content: "\e70a"; +} + +.icon-guanbi2:before { + content: "\e70b"; +} + +.icon-dakai:before { + content: "\e70c"; +} + +.icon-zuo:before { + content: "\e70d"; +} + +.icon-you:before { + content: "\e70e"; +} + +.icon-xuankuang2:before { + content: "\e70f"; +} + +.icon-xuanzhong:before { + content: "\e710"; +} + +.icon-ArtboardCopy6:before { + content: "\e711"; +} + +.icon-ArtboardCopy8:before { + content: "\e712"; +} + +.icon-jigoudenglu:before { + content: "\e713"; +} + +.icon-ArtboardCopy21:before { + content: "\e71d"; +} + +.icon-ArtboardCopy10:before { + content: "\e71e"; +} + +.icon-shoucang:before { + content: "\e71c"; +} + +.icon-fenxiang:before { + content: "\e71f"; +} + +.icon-jingpai:before { + content: "\e721"; +} + +.icon-chengjiao:before { + content: "\e722"; +} + +.icon-tongzhi:before { + content: "\e723"; +} + +.icon-dongtai:before { + content: "\e724"; +} + +.icon-shipin:before { + content: "\e725"; +} + +.icon-fagui:before { + content: "\e726"; +} + +.icon-ArtboardCopy11:before { + content: "\e727"; +} + +.icon-meitibaodao:before { + content: "\e728"; +} + +.icon-ArtboardCopy12:before { + content: "\e729"; +} + +.icon-ArtboardCopy13:before { + content: "\e72a"; +} + +.icon-ArtboardCopy14:before { + content: "\e72b"; +} + diff --git a/infoport/static/css/index.css b/infoport/static/css/index.css new file mode 100644 index 0000000..95de9f9 --- /dev/null +++ b/infoport/static/css/index.css @@ -0,0 +1,355 @@ +/*公共主题参数*/ +:root{ + --color:''; + --icon:''; + --logo:''; + /*--color:#e8041f;*/ +} +#page{ + height: 100vh; + overflow: hidden; + background: url("../images/page_bg.jpg") no-repeat center; + background-size: 100% 100%; +} +.header{ + text-align: center; + height: 15vh; + width: 90%; + margin: 0 auto; +} +.header p{ + color: #b6c8ff; + margin-top: 5px; +} + +.header i{ + display: block; + width: 2.7vh; + height: 2.7vh; + margin: 0 auto; + position: relative; + top: 50%; + transform: translateY(-50%); + transition: all 0.4s ease-in-out; +} + +#titContent{ + font-size: 4vh; + font-weight: bold; + color: #ffffff; + font-style: italic; +} + +.active .i1{ + background: url("../images/nav_5.png") no-repeat center; + background-size: 100% 100%; +} +.active .i2{ + background: url("../images/nav_6.png") no-repeat center; + background-size: 100% 100%; +} +.active .i3{ + background: url("../images/nav_7.png") no-repeat center; + background-size: 100% 100%; +} +.active .i4{ + background: url("../images/nav_8.png") no-repeat center; + background-size: 100% 100%; +} +.header .active{ + position: relative; +} +.header .header_nav div{ + width: 5vh; + height: 5vh; + margin: 0 auto; + position: relative; +} +.header .header_nav:hover .i1{ + background: url("../images/nav_5.png") no-repeat center; + background-size: 100% 100%; + transition: all 0.4s ease-in-out; +} +.header .header_nav:hover .i2{ + background: url("../images/nav_6.png") no-repeat center; + background-size: 100% 100%; + transition: all 0.4s ease-in-out; +} +.header .header_nav:hover .i3{ + background: url("../images/nav_7.png") no-repeat center; + background-size: 100% 100%; + transition: all 0.4s ease-in-out; +} +.header .header_nav:hover .i4{ + background: url("../images/nav_8.png") no-repeat center; + background-size: 100% 100%; + transition: all 0.4s ease-in-out; +} +.header .header_nav{ + cursor: pointer; +} +.header .header_nav:hover p{ + color: #46cdf3; + transition: all 0.4s ease-in-out; +} +.header .header_nav p{ + transition: all 0.4s ease-in-out; +} +.header .header_nav .i_bg{ + cursor: pointer; + display: none; + transition: all 0.4s ease-in-out; + width: 5vh; + height: 5vh; +} +.header .active .i_bg{ + display: block!important; + position: absolute; + top: 0; +} +.header .active p{ + color: #46cdf3; +} +.i1{ + background: url("../images/nav_1.png") no-repeat center; + background-size: 100% 100%; +} +.i2{ + background: url("../images/nav_2.png") no-repeat center; + background-size: 100% 100%; +} +.i3{ + background: url("../images/nav_3.png") no-repeat center; + background-size: 100% 100%; +} +.i4{ + background: url("../images/nav_4.png") no-repeat center; + background-size: 100% 100%; +} + + +.search{ + /*background-color: #e1e4ef;*/ + width: 75%; + margin: 0 auto; +} + +.search input[type="search"]{ + padding: 2vh 20px 2vh 4%; + width: 40%; + border-radius: 15px; + font-size: 16px; + background: #e1e4ef url("../images/search_icon.png") no-repeat left; + background-position-x: 4%; +} + +.new{ + width: 75%; + margin: 0 auto; + background: rgba(225,228,238,0.9); + height: 50vh; + margin-top: 3vh; + border-radius: 15px; + padding: 3vh; + display: flex; + align-items: center; +} + +.personalTit-banner { + width: 45%; + height: 100%; + border-radius: 15px; + overflow: hidden; +} + +.new_list{ + margin-left: 2%; + width: 53%; +} + +.new_list_tit{ + display: flex; + justify-content: space-between; + align-items: center; +} + +.new_list_tit p:first-child{ + font-size: 18px; + color: #1663ff; + border-left: 3px solid #1663ff; + padding-left: 10px; + font-weight: bold; + line-height: 1; +} + +.new_list_tit p:last-child{ + color: #848484; + padding-left: 20px; + line-height: 1; + background: url("../images/date.png") no-repeat left; +} + +.new_list_li{ + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 2.5vh; + cursor: pointer; +} + +.new_list_li:hover p{ + color: #1663ff!important; + transition: all 0.4s ease-in-out; +} + +.new_list_li:hover a{ + color: #1663ff!important; + transition: all 0.4s ease-in-out; +} + +.new_list_li p{ + transition: all 0.4s ease-in-out; +} + +.new_list_li a{ + font-size: 16px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + word-break: break-all; + overflow: hidden; + transition: all 0.4s ease-in-out; +} + +.new_list_li p:last-child{ + color: #848484; + flex-shrink: 0; +} + +.footer{ + height: 20vh; + background: #e1e4ef; + margin-top: 6.3vh; + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 4vh 2%; +} + +.footer_link_tit{ + background: url("../images/footer_icon_1.png") no-repeat left; + padding-left: 18px; + color: #939393; + font-size: 16px; +} + +.footer_link{ + display: flex; + align-items: center; +} + +.footer_link a{ + color: #6d6d6d; + font-size: 16px; + margin-left: 20px; +} +.footer_link_filings{ + display: flex; +} +.footer_link_filings_left{ + display: flex; +} +.footer_link_filings_right{ + display: flex; + margin-left: 40px; +} +.footer_link_filings_left p{ + background: url("../images/footer_filings.png") no-repeat left; + padding-left: 25px; +} + +.footer_link_filings p{ + color: #939393; + font-size: 16px; +} +.footer_link_filings a{ + color: #6d6d6d; + font-size: 16px; + margin-left: 20px; +} +.footer_link_company{ + display: flex; + align-items: center; +} +.footer_link_company div{ + display: flex; + align-items: center; + margin-right: 40px; +} +.footer_link_company p{ + color: #939393; + font-size: 16px; +} +.footer_link_company a{ + color: #6d6d6d; + font-size: 16px; + margin-left: 20px; +} +.xuanzhuan { + -webkit-transition-property: -webkit-transform; + -webkit-transition-duration: 1s; + -moz-transition-property: -moz-transform; + -moz-transition-duration: 1s; + -webkit-animation: opacity2 2s linear infinite; + -moz-animation: opacity2 2s linear infinite; + -o-animation: opacity2 2s linear infinite; + animation: opacity2 2s linear infinite; +} + +@-webkit-keyframes rotate { + from { + -webkit-transform: rotate(0deg) + } + to { + -webkit-transform: rotate(360deg) + } +} + +@-moz-keyframes rotate { + from { + -moz-transform: rotate(0deg) + } + to { + -moz-transform: rotate(359deg) + } +} + +@-o-keyframes rotate { + from { + -o-transform: rotate(0deg) + } + to { + -o-transform: rotate(359deg) + } +} + +@keyframes rotate { + from { + transform: rotate(0deg) + } + to { + transform: rotate(359deg) + } +} + +@keyframes opacity2 { + 0% { + opacity: 1; + } + 50% { + opacity: 0.5; + } + 100% { + opacity: 1; + } +} \ No newline at end of file diff --git a/infoport/static/css/login.css b/infoport/static/css/login.css new file mode 100644 index 0000000..ce68aa5 --- /dev/null +++ b/infoport/static/css/login.css @@ -0,0 +1,177 @@ +input:-webkit-autofill, + +input:-webkit-autofill:hover, + +input:-webkit-autofill:focus, + +input:-webkit-autofill:active { + -webkit-transition-delay: 111111s; + + -webkit-transition: color 11111s ease-out, background-color 111111s ease-out; + +} +.registerBody{ + background: url("../images/login_bg.jpg"); + width: 100%; + height: 100%; + background-size: 100% 100%; + text-align: center; +} +.loginView_bg{ + background: rgba(18,105,211,0.3); + text-align: center; + width: 440px; + margin: 0 auto; + padding: 50px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + border-radius: 8px; + height: 402px; +} +.loginView{ + background: #FFFFFF; + text-align: center; + width: 420px; + margin: 0 auto; + padding: 50px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + border-radius: 8px; + height: 382px; +} + +.loginView p{ + text-align: left; +} + +.loginView img{ + width: 100%; + height: 35px; +} + +.loginView table{ + width: 100%; + margin: 0 auto; +} + +.loginView table tr td:nth-child(2){ + text-align: left; +} + +.loginView table tr td{ + padding-top: 20px; + position: relative; +} +.nameIcon{ + width: 23px; + height: 23px; + display: block; + background: url('../images/login_01.png') no-repeat; + position: absolute; + bottom: 8px; +} +.passIcon{ + width: 23px; + height: 23px; + display: block; + background: url('../images/login_02.png') no-repeat; + position: absolute; + bottom: 8px; +} +.codeIcon{ + width: 23px; + height: 23px; + display: block; + background: url('../images/login_03.png') no-repeat; + position: absolute; + bottom: 8px; +} +.loginView table tr td input[type="text"],input[type="password"]{ + height: 35px; + border-bottom: 1px solid #cfcfcf; + padding-left: 30px; + width: 100%; +} + +.titleTab{ + background: var(--color); +} + +.titleTab p{ + float: left; + display: block; + line-height: 76px; + width: 50%; + text-align: center; + color: #7fbdba; +} + +.titleTab p:hover{ + cursor: pointer; +} + +.active{ + color: #ffffff!important; +} + +.remberPsw{ + width: 100%; + margin: 0 auto; + text-align: left; + margin-top: 50px; +} + +.remberPsw input[type="checkbox"]{ + position: relative; + top: 2px; +} + +.loginBtn{ + width: 100%; + padding: 10px 0; + border: none; + background: #1269d3; + color: #ffffff; + display: block; + margin: 0 auto; + margin-top: 20px; + cursor: pointer; +} + +.registerBtn{ + border: none; + padding: 10px 0; + display: block; + margin: 0 auto; + margin-top: 10px; + color: var(--color); + cursor: pointer; +} + +.fsYzm{ + height: 35px; + border: 1px solid #cfcfcf; + width: 100%; +} + +.topLogo{ + margin: 0 auto; + padding-top: 2%; +} + +.topLogo p{ + font-size: 60px; + font-weight: bold; + color: #1269d3; +} + +.bottomInformation_login{ + position: absolute; + bottom: 3%; + width: 100%; + color: #010101; +} \ No newline at end of file diff --git a/infoport/static/css/main.css b/infoport/static/css/main.css new file mode 100644 index 0000000..1e5d2f9 --- /dev/null +++ b/infoport/static/css/main.css @@ -0,0 +1,2581 @@ +::-webkit-scrollbar{width:0;padding: 0;height: 0} +/* nprogress公用CSS */ +#nprogress { + pointer-events: none; +} + +#nprogress .bar { + background: #29d; + position: fixed; + z-index: 1031; + top: 0; + left: 0; + width: 100%; + height: 2px; +} + +/* Fancy blur effect */ +#nprogress .peg { + display: block; + position: absolute; + right: 0px; + width: 100px; + height: 100%; + box-shadow: 0 0 10px #29d, 0 0 5px #29d; + opacity: 1.0; + -webkit-transform: rotate(3deg) translate(0px, -4px); + -ms-transform: rotate(3deg) translate(0px, -4px); + transform: rotate(3deg) translate(0px, -4px); +} + +/* Remove these to get rid of the spinner */ +#nprogress .spinner { + display: block; + position: fixed; + z-index: 1031; + top: 15px; + right: 15px; +} + +#nprogress .spinner-icon { + width: 18px; + height: 18px; + box-sizing: border-box; + border: solid 2px transparent; + border-top-color: #29d; + border-left-color: #29d; + border-radius: 50%; + -webkit-animation: nprogress-spinner 400ms linear infinite; + animation: nprogress-spinner 400ms linear infinite; +} + +.nprogress-custom-parent { + overflow: hidden; + position: relative; +} + +.nprogress-custom-parent #nprogress .spinner, +.nprogress-custom-parent #nprogress .bar { + position: absolute; +} + +@-webkit-keyframes nprogress-spinner { + 0% { + -webkit-transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + } +} + +@keyframes nprogress-spinner { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +html, +body, +div, +span, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +a, +address, +em, +img, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +tbody, +tfoot, +thead, +tr, +th, +td, +i, +b, +s { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-family: Source Han Sans CN,Helvetica, Arial; + word-break: break-all; +} + +html, +body { + height: 100%; + overflow: hidden; +} + +.font-yahei { + font-family: "微软雅黑"; +} + +body>.main { + overflow-y: auto; + height: 100%; +} + +ul, +ol { + list-style: none +} + +a img { + border: none; +} + +a, +a:link { + text-decoration: none; + color: #333 +} + +button { + overflow: visible; + padding: 0; + margin: 0; + border: 0 none; + background-color: transparent; + appearance: none; + -webkit-appearance: none; +} + +button::-moz-focus-inner { + padding: 0 +} + +textarea, +input { + background: none; + padding: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +input[type=number] { + appearance: none; + -webkit-appearance: none; + border: 0; +} + +input[type=search] { + appearance: none; + -webkit-appearance: none; + border: 0; +} + +input[type=text] { + appearance: none; + -webkit-appearance: none; + border: 0; +} + +input[type=tel] { + appearance: none; + -webkit-appearance: none; + border: 0; +} + +input[type=button] { + appearance: none; + -webkit-appearance: none; +} + +input[type=password] { + -webkit-text-security: disc; + appearance: none; + -webkit-appearance: none; + border: 0; +} + +input[type=submit] { + appearance: none; + -webkit-appearance: none; + border: 0; +} + +textarea:focus, +input:focus, +button:focus { + outline: none +} + +select{ + outline:none; +} + +body { + word-wrap: break-word; + font-size: 14px; + color: #000; + line-height: 1.5; + font-family: Helvetica +} + +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + overflow-scrolling: touch; + -webkit-overflow-scrolling: touch; + /*backface-visibility: hidden;*/ + /*-webkit-backface-visibility: hidden;*/ + box-sizing: border-box; +} + +[v-cloak] { + opacity: 0 !important; +} + +.w-1200 { + width: 1200px; + margin: 0 auto; +} + +.w-1000 { + width: 1000px; +} + +.w-800 { + width: 800px; +} + +.w-372 { + width: 372px; +} + +.inline_div { + display: inline-block; +} + +.block { + display: block !important; +} + +.txc { + text-align: center; +} + +.fl { + float: left; +} + +.fr { + float: right; +} + +.clear { + clear: both; + height: 0 !important; + padding: 0 !important; + margin: 0 !important; +} + +/*三角形*/ + +/*全局CSS*/ +.hide { + display: none; +} + +.show { + display: block; +} + +.bgimg_mid { + background-position: center; + background-repeat: no-repeat; +} + +.overflow_auto { + overflow: auto; + -webkit-overflow-scrolling: touch; + overflow-scrolling: touch; +} + +.overflow_hide { + overflow: hidden; +} + +/*IE8伪flex布局*/ +.container { + text-align: justify; +} + +.container:after { + content: ''; + display: inline-block; + width: 100%; +} + +.container-item { + display: inline-block; +} + +/*flex布局*/ +.flex_dom { + display: flex !important; + display: -webkit-box !important; + display: -webkit-flex !important; +} + +.flex_column { + display: flex !important; + display: -webkit-box !important; + display: -webkit-flex !important; + flex-direction: column; + -webkit-flex-direction: column; +} + +.flex_1 { + flex: 1; + -webkit-flex: 1; + display: block; + min-width: 0; +} + +.flex_2 { + flex: 2; + -webkit-flex: 2; + display: block; + min-width: 0; +} + +.flex_3 { + flex: 3; + -webkit-flex: 3; + display: block; + min-width: 0; +} + +.flex_4 { + flex: 4; + -webkit-flex: 4; + display: block; + min-width: 0; +} + +.flex_5 { + flex: 5; + -webkit-flex: 5; + display: block; + min-width: 0; +} + +.flex_item_between { + justify-content: space-between; + -webkit-justify-content: space-between; +} + +.flex_item_around { + justify-content: space-around; + -webkit-justify-content: space-around; +} + +.flex_item_end { + justify-content: flex-end; + -webkit-justify-content: flex-end; +} + +.flex_item_mid { + align-items: center; + -webkit-align-items: center; +} + +.flex_item_stretch { + align-items: stretch; + -webkit-align-items: stretch; +} + +.flex_item_center { + justify-content: center; + -webkit-justify-content: center; +} + +.flex_wrap { + flex-wrap: wrap; + -webkit-flex-wrap: wrap; +} + +/*三角*/ +.sanjiao-top { + display: inline-block; + border-bottom: 6px solid #000; + border-bottom-color: initial; + border-left: 3px solid transparent; + border-right: 3px solid transparent; +} + +.sanjiao-bottom { + display: inline-block; + border-top: 6px solid #000; + border-top-color: initial; + border-left: 3px solid transparent; + border-right: 3px solid transparent; +} + +.sanjiao-left { + display: inline-block; + border-right: 8px solid #000; + border-right-color: initial; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; +} + +.sanjiao-right { + display: inline-block; + border-left: 8px solid #000; + border-left-color: initial; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; +} + +.jiantou { + width: 10px; + height: 10px; + border-top: 1px solid #666666; + border-right: 1px solid #666666; + transform: rotate(45deg); + /*margin-top: 8px;*/ + /*margin-left: 10px;*/ + display: inline-block; +} + +/*字体和背景颜色库*/ +.bg-fff { + background-color: #fff; + !important +} + +.bg-f1 { + background-color: #f1f1f1; + !important +} + +.bg-f4 { + background-color: #f4f4f4; + !important +} + +.bg-f7 { + background-color: #F7F7F7; + !important +} + +.bg-000 { + background-color: #000000; + !important +} + +.bg-333 { + background-color: #333333; + !important +} + +.bg-ddd { + background-color: #DDDDDD; + !important +} + +.bg-666 { + background-color: #666666; + !important +} + +.bg-999 { + background-color: #999999; + !important +} + +.bg-eee { + background-color: #EEEEEE; + !important +} + +.bg-f5 { + background-color: #f5f5f5; +} + +.bg-red { + background-color: #FF0000; + !important +} + +.bg-orange { + background-color: #ffa127; + !important +} + +.bg-yellow { + background-color: #f5bc24; + !important +} + +.bg-green { + background-color: #008000 !important; +} + +.bg-lightgreen { + background-color: #90EE90 !important; +} + +.bg-blue { + background-color: #0a669b !important; +} + +.bg-purple { + background-color: #800080 !important; +} + +.bg-mengban { + background-color: rgba(68, 68, 68, 0.6); +} + +/**********阴影色***********/ +.shadow_fff { + box-shadow: 0px 2px 3px #fff; +} + +.shadow_f1 { + box-shadow: 0px 2px 3px #f1f1f1; +} + +.shadow_f7 { + box-shadow: 0px 2px 3px #f7f7f7; +} + +.shadow_000 { + box-shadow: 0px 2px 3px #000; +} + +.shadow_333 { + box-shadow: 0px 2px 3px #333; +} + +.shadow_ddd { + box-shadow: 0px 2px 3px #ddd; +} + +.shadow_666 { + box-shadow: 0px 2px 3px #666; +} + +.shadow_999 { + box-shadow: 0px 2px 3px #999; +} + +.shadow_red { + box-shadow: 0px 2px 3px #FF0000; +} + +.shadow_orange { + box-shadow: 0px 2px 3px #f8b03f; +} + +.shadow_yellow { + box-shadow: 0px 2px 3px #f5bc24; +} + +.shadow_green { + box-shadow: 0px 2px 3px #008000; +} + +.shadow_lightgreen { + box-shadow: 0px 2px 3px #90EE90; +} + +.shadow_purple { + box-shadow: 0px 2px 3px #800080; +} + +.shadow_orange { + box-shadow: 0px 2px 3px #f8b03f; +} + +/*字体样式库*/ +.fw_600 { + font-weight: 600; +} + +.fw_700 { + font-weight: 700; +} + +.font-w5 { + font-weight: 500; +} + +.font-w6 { + font-weight: bold; +} + +.color-ccc { + color: #ccc !important +} + +.color-eee { + color: #eee !important +} + +.color-fff { + color: #fff !important +} + +.color-000 { + color: #000 !important +} + +.color-333 { + color: #333 !important +} + +.color-555 { + color: #555 !important +} + +.color-666 { + color: #666 !important +} + +.color-999 { + color: #999 !important +} + +.color-9d { + color: #9d9d9d !important +} + +.color-168 { + color: #168a44 !important +} + +.color-parent { + color: inherit !important +} + + +.color-red { + color: #f35e57 !important +} + +.color-orange { + color: #ffa127 !important +} + +.color-yellow { + color: #f5bc24 !important; +} + +.color-green { + color: #32c52a !important; +} + +.color-lightgreen { + color: #90EE90 !important; +} + +.color-blue { + color: #3569c5 !important; +} + +.color-gray { + color: #999999 !important; +} + + +.font0 { + font-size: 0px !important; +} + +.font0>* { + font-size: initial; + display: inline-block; +} + +.font10 { + font-size: 10px !important; +} + +.font12 { + font-size: 12px !important; +} + +.font14 { + font-size: 14px !important; +} + +.font16 { + font-size: 16px !important; +} + +.font18 { + font-size: 18px !important; +} + +.font20 { + font-size: 20px !important; +} + +.font24 { + font-size: 24px !important; +} + +.font26 { + font-size: 26px !important; +} + +.font30 { + font-size: 30px !important; +} + +.font32 { + font-size: 32px !important; +} + +.font34 { + font-size: 34px !important; +} + +.font36 { + font-size: 36px !important; +} + +.font38 { + font-size: 38px !important; +} + +.font40 { + font-size: 40px !important; +} + +.font42 { + font-size: 42px !important; +} + +.font44 { + font-size: 44px !important; +} + +.font56 { + font-size: 56px !important; +} + +/*rem*/ +.font14r { + font-size: .14rem !important; +} + +.font15r { + font-size: .15rem !important; +} + +.font16r { + font-size: .16rem !important; +} + +.font18r { + font-size: .18rem !important; +} + +.font20r { + font-size: .2rem !important; +} + +.font22r { + font-size: .22rem !important; +} + +.font24r { + font-size: .24rem !important; +} + +.font25r { + font-size: .25rem !important; +} + +.font26r { + font-size: .26rem !important; +} + +.font28r { + font-size: .28rem !important; +} + +.font30r { + font-size: .3rem !important; +} + +.font32r { + font-size: .32rem !important; +} + +.font34r { + font-size: .34rem !important; +} + +.font36r { + font-size: .36rem !important; +} + +.font38r { + font-size: .38rem !important; +} + +.font40r { + font-size: .40rem !important; +} + +.font42r { + font-size: .42rem !important; +} + +.font44r { + font-size: .44rem !important; +} + +/*width,height */ +.wid5 { + width: 5% !important; + overflow-x: hidden; +} + +.wid10 { + width: 10% !important; + overflow-x: hidden; +} + +.wid20 { + width: 20% !important; + overflow-x: hidden; +} + +.wid25 { + width: 25% !important; + overflow-x: hidden; +} + +.wid30 { + width: 30% !important; + overflow-x: hidden; +} + +.wid33 { + width: 33% !important; + overflow-x: hidden; +} + +.wid40 { + width: 40% !important; + overflow-x: hidden; +} + +.wid45 { + width: 45% !important; + overflow-x: hidden; +} + +.wid50 { + width: 50% !important; +} + +.wid55 { + width: 55% !important; + overflow-x: hidden; +} + +.wid60 { + width: 60% !important; + overflow-x: hidden; +} + +.wid66 { + width: 66% !important; + overflow-x: hidden; +} + +.wid70 { + width: 70% !important; + overflow-x: hidden; +} + +.wid75 { + width: 75% !important; + overflow-x: hidden; +} + +.wid80 { + width: 80% !important; + overflow-x: hidden; +} + +.wid84 { + width: 84% !important; + overflow-x: hidden; +} + +.wid86 { + width: 86% !important; + overflow-x: hidden; +} + +.wid88 { + width: 88% !important; + overflow-x: hidden; +} + +.wid90 { + width: 90% !important; + overflow-x: hidden; +} + +.wid92 { + width: 92% !important; + overflow-x: hidden; +} + +.wid94 { + width: 94% !important; + overflow-x: hidden; +} + +.wid96 { + width: 96% !important; + overflow-x: hidden; +} + +.wid98 { + width: 98% !important; + overflow-x: hidden; +} + +.wid100 { + width: 100% !important; + overflow-x: hidden; +} + +.wid01rem { + width: 0.1rem !important +} + +.wid02rem { + width: 0.2rem !important +} + +.wid03rem { + width: 0.3rem !important +} + +.wid04rem { + width: 0.4rem !important +} + +.wid05rem { + width: 0.5rem !important +} + +.wid06rem { + width: 0.6rem !important +} + +.wid07rem { + width: 0.7rem !important +} + +.wid08rem { + width: 0.8rem !important +} + +.wid09rem { + width: 0.9rem !important +} + +.wid10rem { + width: 1rem !important +} + +.wid11rem { + width: 1.1rem !important +} + +.wid12rem { + width: 1.2rem !important +} + +.wid13rem { + width: 1.3rem !important +} + +.wid14rem { + width: 1.4rem !important +} + +.wid15rem { + width: 1.5rem !important +} + +.wid16rem { + width: 1.6rem !important +} + +.wid17rem { + width: 1.7rem !important +} + +.wid18rem { + width: 1.8rem !important +} + +.wid19rem { + width: 1.9rem !important +} + +.wid20rem { + width: 2rem !important +} + +.wid21rem { + width: 2.1rem !important +} + +.wid22rem { + width: 2.2rem !important +} + +.wid23rem { + width: 2.3rem !important +} + +.wid24rem { + width: 2.4rem !important +} + +.wid25rem { + width: 2.5rem !important +} + +.wid26rem { + width: 2.6rem !important +} + +.wid27rem { + width: 2.7rem !important +} + +.wid28rem { + width: 2.8rem !important +} + +.wid29rem { + width: 2.9rem !important +} + +.wid30rem { + width: 3rem !important +} + + +.hgt20 { + height: 20px !important; + overflow-y: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.hgt25 { + height: 25px !important; + overflow-y: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.hgt30 { + height: 30px !important; + overflow-y: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.hgt35 { + height: 35px !important; + overflow-y: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.hgt40 { + height: 40px !important; + overflow-y: hidden; +} + +.hgt45 { + height: 45px !important; + overflow-y: hidden; +} + +.hgt50 { + height: 50px !important; + overflow-y: hidden; +} + +.hgt60 { + height: 60px !important; + overflow-y: hidden; +} + +.hgt70 { + height: 70px !important; + overflow-y: hidden; +} + +.hgt80 { + height: 80px !important; + overflow-y: hidden; +} + +.hgt90 { + height: 90px !important; + overflow-y: hidden; +} + +.hgt100 { + height: 100px !important; + overflow-y: hidden; +} + +.hgt150 { + height: 150px !important; + overflow-y: hidden; +} + +.hgt_25 { + height: 25% !important; + overflow-y: hidden; +} + +.hgt_50 { + height: 50% !important; + overflow-y: hidden; +} + +.hgt_60 { + height: 60% !important; + overflow-y: hidden; +} + +.hgt_70 { + height: 70% !important; + overflow-y: hidden; +} + +.hgt_80 { + height: 80% !important; + overflow-y: hidden; +} + +.hgt_90 { + height: 90% !important; + overflow-y: hidden; +} + +.hgt_full { + height: 100% !important; + overflow-y: hidden; +} + + +.hgt03rem { + height: 0.3rem !important; + overflow-y: hidden; +} + +.hgt04rem { + height: 0.4rem !important; + overflow-y: hidden; +} + +.hgt05rem { + height: 0.5rem !important; + overflow-y: hidden; +} + +.hgt06rem { + height: 0.6rem !important; + overflow-y: hidden; +} + +.hgt07rem { + height: 0.7rem !important; + overflow-y: hidden; +} + +.hgt08rem { + height: 0.8rem !important; + overflow-y: hidden; +} + +.hgt09rem { + height: 0.9rem !important; + overflow-y: hidden; +} + +.hgt1rem { + height: 1rem !important; + overflow-y: hidden; +} + +.hgt11rem { + height: 1.1rem !important; + overflow-y: hidden; +} + +.hgt12rem { + height: 1.2rem !important; + overflow-y: hidden; +} + +.hgt13rem { + height: 1.3rem !important; + overflow-y: hidden; +} + +.hgt14rem { + height: 1.4rem !important; + overflow-y: hidden; +} + +.hgt15rem { + height: 1.5rem !important; + overflow-y: hidden; +} + +.hgt16rem { + height: 1.6rem !important; + overflow-y: hidden; +} + +.hgt17rem { + height: 1.7rem !important; + overflow-y: hidden; +} + +.hgt18rem { + height: 1.8rem !important; + overflow-y: hidden; +} + +.hgt19rem { + height: 1.9rem !important; + overflow-y: hidden; +} + +.hgt20rem { + height: 2rem !important; + overflow-y: hidden; +} + +.hgt21rem { + height: 2.1rem !important; + overflow-y: hidden; +} + +.hgt22rem { + height: 2.2rem !important; + overflow-y: hidden; +} + +.hgt23rem { + height: 2.3rem !important; + overflow-y: hidden; +} + +.hgt24rem { + height: 2.4rem !important; + overflow-y: hidden; +} + +.hgt25rem { + height: 2.5rem !important; + overflow-y: hidden; +} + +.hgt26rem { + height: 2.6rem !important; + overflow-y: hidden; +} + +.hgt27rem { + height: 2.7rem !important; + overflow-y: hidden; +} + +.hgt28rem { + height: 2.8rem !important; + overflow-y: hidden; +} + +.hgt29rem { + height: 2.9rem !important; + overflow-y: hidden; +} + +.hgt30rem { + height: 3rem !important; + overflow-y: hidden; +} + +.hgt35rem { + height: 3.5rem !important; + overflow-y: hidden; +} + +.hgt40rem { + height: 4rem !important; + overflow-y: hidden; +} + +.hgt45rem { + height: 4.5rem !important; + overflow-y: hidden; +} + +.hgt50rem { + height: 5rem !important; + overflow-y: hidden; +} + +.hgt60rem { + height: 6rem !important; + overflow-y: hidden; +} + +.hgt70rem { + height: 7rem !important; + overflow-y: hidden; +} + +.hgt80rem { + height: 8rem !important; + overflow-y: hidden; +} + +.hgt90rem { + height: 9rem !important; + overflow-y: hidden; +} + +.hgt100rem { + height: 10rem !important; + overflow-y: hidden; +} + + +.min_hgt20 { + min-height: 20px; +} + +.min_hgt25 { + min-height: 25px; +} + +.min_hgt30 { + min-height: 30px; +} + +.min_hgt35 { + min-height: 35px; +} + +.min_hgt40 { + min-height: 40px; +} + +.min_hgt50 { + min-height: 50px; +} + +.min_hgt100 { + min-height: 100px; +} + + +/****行高*****/ +.l-h-02rem { + line-height: 0.2rem; +} + +.l-h-03rem { + line-height: 0.3rem; +} + +.l-h-04rem { + line-height: 0.4rem; +} + +.l-h-05rem { + line-height: 0.5rem; +} + +.l-h-055rem { + line-height: 0.55rem; +} + +.l-h-06rem { + line-height: 0.6rem; +} + +.l-h-065rem { + line-height: 0.65rem; +} + +.l-h-07rem { + line-height: 0.7rem; +} + +.l-h-075rem { + line-height: 0.75rem; +} + +.l-h-08rem { + line-height: 0.8rem; +} + +.l-h-085rem { + line-height: 0.85rem; +} + +.l-h-09rem { + line-height: 0.9rem; +} + +.l-h-095rem { + line-height: 0.95rem; +} + +.l-h-10rem { + line-height: 1rem; +} + +.l-h-10rem { + line-height: 1rem; +} + +.l-h-11rem { + line-height: 1.1rem; +} + +.l-h-12rem { + line-height: 1.2rem; +} + +.l-h-13rem { + line-height: 1.3rem; +} + +.l-h-14rem { + line-height: 1.4rem; +} + +.l-h-15rem { + line-height: 1.5rem; +} + +.l-h-16rem { + line-height: 1.6rem; +} + +.l-h-17rem { + line-height: 1.7rem; +} + +.l-h-18rem { + line-height: 1.8rem; +} + +.l-h-19rem { + line-height: 1.9rem; +} + +.l-h-20rem { + line-height: 2rem; +} + +.l-h-21rem { + line-height: 2.1rem; +} + +.l-h-22rem { + line-height: 2.2rem; +} + +.l-h-23rem { + line-height: 2.3rem; +} + +.l-h-24rem { + line-height: 2.4rem; +} + +.l-h-25rem { + line-height: 2.5rem; +} + +.l-h-26rem { + line-height: 2.6rem; +} + +.l-h-27rem { + line-height: 2.6rem; +} + +.l-h-28rem { + line-height: 2.6rem; +} + +.l-h-29rem { + line-height: 2.6rem; +} + +.l-h-30rem { + line-height: 2.6rem; +} +.l-h-30{ + line-height: 30px; +} + +/*margin,padding 相关*/ +.m-b-no { + margin-bottom: 0 !important; +} + +.m-t-no { + margin-top: 0 !important; +} + +.m-l-no { + margin-left: 0 !important; +} + +.m-r-no { + margin-right: 0 !important; +} + +.marg0 { + margin: 0 !important; +} + +.marg5 { + margin: 5px !important; +} + +.marg10 { + margin: 10px !important; +} + +.marg15 { + margin: 15px !important; +} + +.marg20 { + margin: 20px !important; +} + +.marg25 { + margin: 25px !important; +} + +.marg30 { + margin: 30px !important; +} + +.m-l-5 { + margin-left: 5px !important; +} + +.m-l-10 { + margin-left: 10px !important; +} + +.m-l-15 { + margin-left: 15px !important; +} + +.m-l-20 { + margin-left: 20px !important; +} + +.m-l-25 { + margin-left: 25px !important; +} + +.m-l-30 { + margin-left: 30px !important; +} + +.m-r-5 { + margin-right: 5px !important; +} + +.m-r-10 { + margin-right: 10px !important; +} + +.m-r-15 { + margin-right: 15px !important; +} + +.m-r-20 { + margin-right: 20px !important; +} + +.m-r-25 { + margin-right: 25px !important; +} + +.m-r-30 { + margin-right: 30px !important; +} + +.m-r-60 { + margin-right: 60px !important; +} + +.m-t-5 { + margin-top: 5px !important; +} + +.m-t-10 { + margin-top: 10px !important; +} + +.m-t-15 { + margin-top: 15px !important; +} + +.m-t-20 { + margin-top: 20px !important; +} + +.m-t-25 { + margin-top: 25px !important; +} + +.m-t-30 { + margin-top: 30px !important; +} + +.m-t-35 { + margin-top: 35px !important; +} + +.m-t-40 { + margin-top: 40px !important; +} + +.m-t-45 { + margin-top: 45px !important; +} + +.m-t-50 { + margin-top: 50px !important; +} + +.m-b-5 { + margin-bottom: 5px !important; +} + +.m-b-10 { + margin-bottom: 10px !important; +} + +.m-b-15 { + margin-bottom: 15px !important; +} + +.m-b-20 { + margin-bottom: 20px !important; +} + +.m-b-25 { + margin-bottom: 25px !important; +} + +.m-b-30 { + margin-bottom: 30px !important; +} + +.m-v-5 { + margin-top: 5px !important; + margin-bottom: 5px !important; +} + +.m-v-10 { + margin-top: 10px !important; + margin-bottom: 10px !important; +} + +.m-v-15 { + margin-top: 15px !important; + margin-bottom: 15px !important; +} + +.m-v-20 { + margin-top: 20px !important; + margin-bottom: 20px !important; +} + +.m-v-25 { + margin-top: 25px !important; + margin-bottom: 25px !important; +} + +.m-v-30 { + margin-top: 30px !important; + margin-bottom: 30px !important; +} + +.m_both5 { + margin-left: 5px !important; + margin-right: 5px !important; +} + +.m_both10 { + margin-left: 10px !important; + margin-right: 10px !important; +} + +.m_both15 { + margin-left: 15px !important; + margin-right: 15px !important; +} + +.m_both20 { + margin-left: 20px !important; + margin-right: 20px !important; +} + +.m_both25 { + margin-left: 25px !important; + margin-right: 25px !important; +} + +.m_both30 { + margin-left: 30px !important; + margin-right: 30px !important; +} + +.m-l-5r { + margin-left: 0.05rem !important; +} + +.m-l-10r { + margin-left: .1rem !important; +} + +.m-l-15r { + margin-left: .15rem !important; +} + +.m-l-20r { + margin-left: .20rem !important; +} + +.m-l-25r { + margin-left: .25rem !important; +} + +.m-l-30r { + margin-left: .30rem !important; +} + +.m-r-5r { + margin-right: .05rem !important; +} + +.m-r-10r { + margin-right: .10rem !important; +} + +.m-r-15r { + margin-right: .15rem !important; +} + +.m-r-20r { + margin-right: .20rem !important; +} + +.m-r-25r { + margin-right: .25rem !important; +} + +.m-r-30r { + margin-right: .30rem !important; +} + +.m-t-5r { + margin-top: .05rem !important; +} + +.m-t-10r { + margin-top: .10rem !important; +} + +.m-t-15r { + margin-top: .15rem !important; +} + +.m-t-20r { + margin-top: .20rem !important; +} + +.m-t-25r { + margin-top: .25rem !important; +} + +.m-t-30r { + margin-top: .30rem !important; +} + +.m-t-35r { + margin-top: .35rem !important; +} + +.m-t-40r { + margin-top: .40rem !important; +} + +.m-t-45r { + margin-top: .45rem !important; +} + +.m-t-50r { + margin-top: .50rem !important; +} + +.m-t-60r { + margin-top: .60rem !important; +} + +.m-t-70r { + margin-top: .70rem !important; +} + +.m-t-80r { + margin-top: .80rem !important; +} + +.m-t-90r { + margin-top: .90rem !important; +} + +.m-b-5r { + margin-bottom: .05rem !important; +} + +.m-b-10r { + margin-bottom: .10rem !important; +} + +.m-b-15r { + margin-bottom: .15rem !important; +} + +.m-b-20r { + margin-bottom: .20rem !important; +} + +.m-b-25r { + margin-bottom: .25rem !important; +} + +.m-b-30r { + margin-bottom: .30rem !important; +} + +.m-b-35r { + margin-bottom: .35rem !important; +} + +.m-b-40r { + margin-bottom: .40rem !important; +} + +.m-b-45r { + margin-bottom: .45rem !important; +} + +.m-v-5r { + margin-top: .05rem !important; + margin-bottom: .05rem !important; +} + +.m-v-10r { + margin-top: .10rem !important; + margin-bottom: .10rem !important; +} + +.m-v-15r { + margin-top: .15rem !important; + margin-bottom: .15rem !important; +} + +.m-v-20r { + margin-top: .20rem !important; + margin-bottom: .20rem !important; +} + +.m-v-25r { + margin-top: .25rem !important; + margin-bottom: .25rem !important; +} + +.m-v-30r { + margin-top: .30rem !important; + margin-bottom: .30rem !important; +} + +.m_both02r { + margin-left: .2rem !important; + margin-right: .2rem !important; +} + +.m_both5r { + margin-left: .05rem !important; + margin-right: .05rem !important; +} + +.m_both10r { + margin-left: .10rem !important; + margin-right: .10rem !important; +} + +.m_both15r { + margin-left: .15rem !important; + margin-right: .15rem !important; +} + +.m_both20r { + margin-left: .20rem !important; + margin-right: .20rem !important; +} + +.m_both25r { + margin-left: .25rem !important; + margin-right: .25rem !important; +} + +.m_both30r { + margin-left: .30rem !important; + margin-right: .30rem !important; +} + +/*rem margin*/ +.mb01 { + margin-bottom: .1rem; +} + +.mb015 { + margin-bottom: .15rem; +} + +.mb02 { + margin-bottom: .2rem; +} + +.mb03 { + margin-bottom: .3rem; +} + +.mb04 { + margin-bottom: .4rem; +} + +.mb05 { + margin-bottom: .5rem; +} + +.ml01 { + margin-left: .1rem; +} + +.ml02 { + margin-left: .2rem; +} + +.ml03 { + margin-left: .3rem; +} + +.mr01 { + margin-right: .1rem; +} + +.mr02 { + margin-right: .2rem; +} + +.mr03 { + margin-right: .3rem; +} + +.mt01 { + margin-top: .1rem; +} + +.mt02 { + margin-top: .2rem; +} + +.mt03 { + margin-top: .3rem; +} + +.mt04 { + margin-top: .4rem; +} + +.p-l-no { + padding-left: 0 !important; +} + +.p-r-no { + padding-right: 0 !important; +} + +.p-t-no { + padding-top: 0 !important; +} + +.p-b-no { + padding-bottom: 0 !important; +} + +/*rem padding*/ +.pv01 { + padding-top: .1rem; + padding-bottom: .1rem; +} + +.pv02 { + padding-top: .2rem; + padding-bottom: .2rem; +} + +.pv03 { + padding-top: .3rem; + padding-bottom: .3rem; +} + +.ph01 { + padding-left: .1rem; + padding-right: .1rem; +} + +.ph02 { + padding-left: .2rem; + padding-right: .2rem; +} + +.ph03 { + padding-left: .3rem; + padding-right: .3rem; +} + +.pa01 { + padding: .1rem; +} + +.pa02 { + padding: .2rem; +} + +.pa03 { + padding: .3rem; +} + +.p0102 { + padding: .1rem .2rem; +} + +.p0203 { + padding: .2rem .3rem; +} + +.p-l-5 { + padding-left: 5px !important; +} + +.p-l-10 { + padding-left: 10px !important; +} + +.p-l-15 { + padding-left: 15px !important; +} + +.p-l-20 { + padding-left: 20px !important; +} + +.p-l-25 { + padding-left: 25px !important; +} + +.p-l-30 { + padding-left: 30px !important; +} + +.p-l-35 { + padding-left: 35px !important; +} + +.p-l-40 { + padding-left: 40px !important; +} + +.p-l-45 { + padding-left: 45px !important; +} + +.p-l-50 { + padding-left: 50px !important; +} + +.p-r-5 { + padding-right: 5px !important; +} + +.p-r-10 { + padding-right: 10px !important; +} + +.p-r-15 { + padding-right: 15px !important; +} + +.p-r-20 { + padding-right: 20px !important; +} + +.p-r-25 { + padding-right: 25px !important; +} + +.p-r-30 { + padding-right: 30px !important; +} + +.p-r-35 { + padding-right: 35px !important; +} + +.p-r-40 { + padding-right: 40px !important; +} + +.p-r-45 { + padding-right: 45px !important; +} + +.p-r-50 { + padding-right: 50px !important; +} + +.p-t-5 { + padding-top: 5px !important; +} + +.p-t-10 { + padding-top: 10px !important; +} + +.p-t-15 { + padding-top: 15px !important; +} + +.p-t-20 { + padding-top: 20px !important; +} + +.p-t-25 { + padding-top: 25px !important; +} + +.p-t-30 { + padding-top: 30px !important; +} + +.p-t-35 { + padding-top: 35px !important; +} + +.p-t-40 { + padding-top: 40px !important; +} + +.p-t-45 { + padding-top: 45px !important; +} + +.p-t-50 { + padding-top: 50px !important; +} + +.p-t-full { + padding-top: 100% !important; +} + +.p-b-5 { + padding-bottom: 5px !important; +} + +.p-b-10 { + padding-bottom: 10px !important; +} + +.p-b-15 { + padding-bottom: 15px !important; +} + +.p-b-20 { + padding-bottom: 20px !important; +} + +.p-b-25 { + padding-bottom: 25px !important; +} + +.p-b-30 { + padding-bottom: 30px !important; +} + +.p-b-35 { + padding-bottom: 35px !important; +} + +.p-b-40 { + padding-bottom: 40px !important; +} + +.p-b-45 { + padding-bottom: 45px !important; +} + +.p-b-50 { + padding-bottom: 50px !important; +} + +.min_hgt02r { + min-height: 0.2rem; +} + +.min_hgt03r { + min-height: 0.3rem; +} + +.min_hgt04r { + min-height: 0.4rem; +} + +.min_hgt05r { + min-height: 0.5rem; +} + +.min_hgt06r { + min-height: 0.6rem; +} + +.min_hgt07r { + min-height: 0.7rem; +} + +.min_hgt08r { + min-height: 0.8rem; +} + +.min_hgt09r { + min-height: 0.9rem; +} + +.min_hgt10r { + min-height: 1rem; +} + +.min_hgt20r { + min-height: 2rem; +} + +.min_hgt30r { + min-height: 3rem; +} + +.min_hgt40r { + min-height: 4rem; +} + +.min_hgt50r { + min-height: 5rem; +} + +.min_hgt60r { + min-height: 6rem; +} + +.min_hgt70r { + min-height: 7rem; +} + +.min_hgt80r { + min-height: 8rem; +} + +.min_hgt90r { + min-height: 9rem; +} + +.min_hgt100r { + min-height: 10rem; +} + +.max_hgt20 { + max-height: 20px; +} + +.max_hgt25 { + max-height: 25px; +} + +.max_hgt30 { + max-height: 30px; +} + +.max_hgt35 { + max-height: 35px; +} + +.max_hgt40 { + max-height: 40px; +} + +.max_hgt50 { + max-height: 50px; +} + +.max_hgt100 { + max-height: 100px; +} + +.max_hgt02r { + max-height: 0.2rem; +} + +.max_hgt03r { + max-height: 0.3rem; +} + +.max_hgt04r { + max-height: 0.4rem; +} + +.max_hgt05r { + max-height: 0.5rem; +} + +.max_hgt06r { + max-height: 0.6rem; +} + +.max_hgt07r { + max-height: 0.7rem; +} + +.max_hgt08r { + max-height: 0.8rem; +} + +.max_hgt09r { + max-height: 0.9rem; +} + +.max_hgt10r { + max-height: 1rem; +} + +.max_hgt20r { + max-height: 2rem; +} + +.max_hgt30r { + max-height: 3rem; +} + +.max_hgt40r { + max-height: 4rem; +} + +.max_hgt50r { + max-height: 5rem; +} + +.max_hgt60r { + max-height: 6rem; +} + +.max_hgt70r { + max-height: 7rem; +} + +.max_hgt80r { + max-height: 8rem; +} + +.max_hgt90r { + max-height: 9rem; +} + +.max_hgt100r { + max-height: 10rem; +} + +/*焦点图*/ +/* =============================================================== +Basic Swiper Styles +================================================================*/ +.swiper-container { + margin: 0 auto; + position: relative; + overflow: hidden; + direction: ltr; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + -o-backface-visibility: hidden; + backface-visibility: hidden; + /* Fix of Webkit flickering */ + z-index: 1; +} + +.swiper-wrapper { + position: relative; + width: 100%; + -webkit-transition-property: -webkit-transform, left, top; + -webkit-transition-duration: 0s; + -webkit-transform: translate3d(0px, 0, 0); + -webkit-transition-timing-function: ease; + + -moz-transition-property: -moz-transform, left, top; + -moz-transition-duration: 0s; + -moz-transform: translate3d(0px, 0, 0); + -moz-transition-timing-function: ease; + + -o-transition-property: -o-transform, left, top; + -o-transition-duration: 0s; + -o-transform: translate3d(0px, 0, 0); + -o-transition-timing-function: ease; + -o-transform: translate(0px, 0px); + + -ms-transition-property: -ms-transform, left, top; + -ms-transition-duration: 0s; + -ms-transform: translate3d(0px, 0, 0); + -ms-transition-timing-function: ease; + + transition-property: transform, left, top; + transition-duration: 0s; + transform: translate3d(0px, 0, 0); + transition-timing-function: ease; + + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.swiper-free-mode>.swiper-wrapper { + -webkit-transition-timing-function: ease-out; + -moz-transition-timing-function: ease-out; + -ms-transition-timing-function: ease-out; + -o-transition-timing-function: ease-out; + transition-timing-function: ease-out; + margin: 0 auto; +} + +.swiper-slide { + float: left; +} + +.swiper-slide p{ + position: absolute; + bottom: 0; + color: #FFF; + background: rgba(0,0,0,0.2); + width: 100%; + height: 50px; + line-height: 50px; + text-indent: 2em; +} + +.swiper-slide img { + width: 100%; + height: 100%; +} + +/* IE10 Windows Phone 8 Fixes */ +.swiper-wp8-horizontal { + -ms-touch-action: pan-y; +} + +.swiper-wp8-vertical { + -ms-touch-action: pan-x; +} + +.swiper-container { + width: 100%; + height: 100%; +} + +.page-pagination { + position: absolute; + z-index: 20; + left: 50%; + margin-left: -10px; + bottom: 10px; +} + +.swiper-pagination-switch { + display: inline-block; + width: 8px; + height: 8px; + border-radius: 8px; + background: #222; + margin-right: 5px; + opacity: 0.8; + border: 1px solid #fff; + cursor: pointer; +} + +.swiper-visible-switch { + background: #aaa; +} + +.swiper-active-switch { + background: #fff; +} \ No newline at end of file diff --git a/infoport/static/css/newDetail.css b/infoport/static/css/newDetail.css new file mode 100644 index 0000000..eab982d --- /dev/null +++ b/infoport/static/css/newDetail.css @@ -0,0 +1,96 @@ + +.new_content{ + height: 80vh; + background: #ffffff; + padding: 3vh; + display: flex; + justify-content: space-between; +} + +.new_content_left{ + width: 75%; + height: 75vh; + overflow-y: scroll; + +} + +.new_content_left_tit{ + display: flex; + align-items: center; + font-size: 24px; + font-weight: bold; +} + +.new_content_left_tit p{ + margin-left: 15px; +} + +.new_content_left_tit i{ + display: block; + width: 3vh; + height: 3vh; + background: url("../images/new_icon_back.png") no-repeat center; +} + +.new_content_left_come{ + display: flex; + align-items: center; + font-size: 12px; + margin-top: 2vh; +} + +.new_content_left_come p:nth-child(2){ + color: #4a7bde; +} + +.new_content_right{ + padding: 2vh; + box-shadow: 0px 0px 5px #dddddd; + width: 20%; + height: 75vh; + position: relative; +} + +.new_content_right .new_content_right_main{ + height: calc(69vh - 24px); + overflow-y: scroll; +} + +.new_content_right a{ + font-size: 16px; + color: #616161; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + word-break: break-all; + overflow: hidden; +} + +.new_content_right p{ + border-bottom: 1px dashed #616161; + padding: 2vh 0; +} + +.new_content_right p:first-child{ + padding-top: 0; +} + +.new_content_right_tit{ + color: #4a7bde; + font-size: 16px; + padding-bottom: 2vh; +} + +.new_content_content{ + line-height: 5vh; + margin-top: 2vh; +} + +.new_content_content p{ + text-indent: 2rem; + font-size: 16px; +} + +.footer{ + margin-top: 0!important; +} \ No newline at end of file diff --git a/infoport/static/css/page_common.css b/infoport/static/css/page_common.css new file mode 100644 index 0000000..26c708b --- /dev/null +++ b/infoport/static/css/page_common.css @@ -0,0 +1,60 @@ +.iconfont { + font-size:16px; +} + +.icon-you:before { + content: ">"; +} + +.icon-zuo:before { + content: "<"; +} + +.icon-most-left:before { + content: "<<"; +} + +.icon-most-right:before { + content: ">>"; +} + +.page_common_btn_style{ + font-family: '微软雅黑'; + display: inline-block; + min-width: 28px; + padding:0 2px; + height: 30px; + line-height: 30px; + text-align: center; + border-radius: 5px; + background: #f4f4f5; + color: #606266; + margin: 0 3px; + font-weight: 600; + font-size:14px; + cursor: pointer; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + -webkit-user-select: none; +} +a.page_common_btn_style:active{ + color:#1269d3; + background:#eee; +} + +.page_btn_box { + display: inline-block; + margin: 0 10px; +} +.page_common_btn_active{ + background:#1269d3; + color:#eee; +} +.pageNum{ + text-align: center; + margin-top: 10px; + position: absolute; + bottom: 60px; + left: 50%; + transform: translateX(-50%); +} \ No newline at end of file diff --git a/infoport/static/css/property.css b/infoport/static/css/property.css new file mode 100644 index 0000000..99a5e0c --- /dev/null +++ b/infoport/static/css/property.css @@ -0,0 +1,199 @@ +.new{ + height: 61vh; + margin-top: 0; + display: block; + position: relative; + padding: 1vh; +} +.footer{ + margin-top: 4.3vh; +} + +.new table tr:hover{ + background: #bbbecd; + cursor: pointer; +} + +.new table tr:first-child:hover{ + background: transparent; +} + +.new table td{ + text-align: center; + font-size: 14px; + padding: 1vh 0; + line-height: 1; +} +.new table tr:first-child td{ + color: #11234f; + font-size: 16px; + font-weight: bold; +} +.pageNum{ + position: relative!important; + bottom: 0!important; + margin: 10px 0!important; +} +#container { + overflow: hidden; + width: 100%; + height: 16vh; + margin: 0; + font-family: "微软雅黑"; +} +.table_main{ + height: calc( 43vh - 50px ); + overflow: hidden; + overflow-y: scroll; +} + +.select{ + margin-right: auto; + margin-left: 2vw; +} + +.select select{ + font-size: 16px; + background: #d6dae8; + padding: .5vh 2vh; + border-radius: 8px; + margin-right: 15px; +} + +.BMap_cpyCtrl +{ + display:none; +} +.anchorBL{ + display:none; +} + +.dialog{ + width: 100%; + height: 100vh; + position: fixed; + top: 0; + left: 0; + z-index: 999999999; +} + +.bg-mengban{ + width: 100%; + height: 100vh; +} + +.dialog_table{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + background: #ffffff; + width: 50%; + padding: 2vh; + border-radius: 10px; +} +.dialog_header{ + display: flex; + align-items: center; +} + +.dialog_header .name{ + font-size: 16px; + color: #11234f; + margin-left: 5px; +} + +.dialog_header .bigWin{ + background: #ffb400; + height: 2.5vh; + width: 5%; + display: flex; + justify-content: center; + align-items: center; + border-radius: 2vh; + margin-left: 20px; +} + +.dialog_header .phoneIcon{ + background: #3fd227; + height: 2.5vh; + width: 5%; + display: flex; + justify-content: center; + align-items: center; + border-radius: 2vh; + margin-left: 20px; +} + +.dialog_header .phone{ + background: #3fd227; + line-height: 3vh; + color: #ffffff; + padding: 0 1%; + border-radius: 5px; +} +.dialog_header .sanjiao-left{ + border-right-color: #3fd227; + margin-left: 5px; +} +.dialog_main{ + margin-bottom: 2vh; +} + +.dialog_main table{ + margin-top: 1vh; +} +.dialog_main table tr td{ + padding: 1vh 0; +} +.dialog_main table tr td:nth-child(odd){ + width: 15%; + color: #6f6f6f; +} +.dialog_main table tr td:nth-child(even){ + width: 18.3%; +} + +.dialog_img{ + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: wrap; + margin-top: 2vh; +} + +.dialog_img img{ + width: 10vw; + margin-bottom: 2vh; + height: 6vw; +} + +.dialog_img img:nth-child(4n){ + margin-right: 0; +} + +.center_table{ + margin: 2vh 0; +} + +.center_table table tr td{ + padding: 1vh 0; + text-align: center; + border-top: 1px solid #b9c2d3; +} + +.center_table table tr td:first-child{ + border-left: 1px solid #b9c2d3; +} + +.center_table table tr td:last-child{ + border-right: 1px solid #b9c2d3; +} + +.center_table table tr:last-child td{ + border-bottom: 1px solid #b9c2d3; +} + +.center_table table tr:first-child td{ + background: #e4edfe; +} \ No newline at end of file diff --git a/infoport/static/css/swiper-bundle.min.css b/infoport/static/css/swiper-bundle.min.css new file mode 100644 index 0000000..05a3c29 --- /dev/null +++ b/infoport/static/css/swiper-bundle.min.css @@ -0,0 +1,13 @@ +/** + * Swiper 6.4.15 + * Most modern mobile touch slider and framework with hardware accelerated transitions + * https://swiperjs.com + * + * Copyright 2014-2021 Vladimir Kharlampidi + * + * Released under the MIT License + * + * Released on: February 18, 2021 + */ + +@font-face{font-family:swiper-icons;src:url('data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA') format('woff');font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper-container{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-container-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{transform:translate3d(0px,0,0)}.swiper-container-multirow>.swiper-wrapper{flex-wrap:wrap}.swiper-container-multirow-column>.swiper-wrapper{flex-wrap:wrap;flex-direction:column}.swiper-container-free-mode>.swiper-wrapper{transition-timing-function:ease-out;margin:0 auto}.swiper-container-pointer-events{touch-action:pan-y}.swiper-container-pointer-events.swiper-container-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-container-autoheight,.swiper-container-autoheight .swiper-slide{height:auto}.swiper-container-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-container-3d{perspective:1200px}.swiper-container-3d .swiper-cube-shadow,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-container-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-container-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-container-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-container-horizontal.swiper-container-css-mode>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-container-vertical.swiper-container-css-mode>.swiper-wrapper{scroll-snap-type:y mandatory}:root{--swiper-navigation-size:44px}.swiper-button-next,.swiper-button-prev{position:absolute;top:50%;width:calc(var(--swiper-navigation-size)/ 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(-1 * var(--swiper-navigation-size)/ 2);z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color,var(--swiper-theme-color))}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-next:after,.swiper-button-prev:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none!important;letter-spacing:0;text-transform:none;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-container-rtl .swiper-button-next{left:10px;right:auto}.swiper-button-prev:after,.swiper-container-rtl .swiper-button-next:after{content:'prev'}.swiper-button-next,.swiper-container-rtl .swiper-button-prev{right:10px;left:auto}.swiper-button-next:after,.swiper-container-rtl .swiper-button-prev:after{content:'next'}.swiper-button-next.swiper-button-white,.swiper-button-prev.swiper-button-white{--swiper-navigation-color:#ffffff}.swiper-button-next.swiper-button-black,.swiper-button-prev.swiper-button-black{--swiper-navigation-color:#000000}.swiper-button-lock{display:none}.swiper-pagination{position:absolute;text-align:center;transition:.3s opacity;transform:translate3d(0,0,0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-container-horizontal>.swiper-pagination-bullets,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:50%;background:#000;opacity:.2}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet-active{opacity:1;background:var(--swiper-pagination-color,var(--swiper-theme-color))}.swiper-container-vertical>.swiper-pagination-bullets{right:10px;top:50%;transform:translate3d(0px,-50%,0)}.swiper-container-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:6px 0;display:block}.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:.2s transform,.2s top}.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 4px}.swiper-container-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap}.swiper-container-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s left}.swiper-container-horizontal.swiper-container-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s right}.swiper-pagination-progressbar{background:rgba(0,0,0,.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color,var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-container-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-container-horizontal>.swiper-pagination-progressbar,.swiper-container-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-container-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-container-vertical>.swiper-pagination-progressbar{width:4px;height:100%;left:0;top:0}.swiper-pagination-white{--swiper-pagination-color:#ffffff}.swiper-pagination-black{--swiper-pagination-color:#000000}.swiper-pagination-lock{display:none}.swiper-scrollbar{border-radius:10px;position:relative;-ms-touch-action:none;background:rgba(0,0,0,.1)}.swiper-container-horizontal>.swiper-scrollbar{position:absolute;left:1%;bottom:3px;z-index:50;height:5px;width:98%}.swiper-container-vertical>.swiper-scrollbar{position:absolute;right:3px;top:1%;z-index:50;width:5px;height:98%}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:rgba(0,0,0,.5);border-radius:10px;left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}.swiper-zoom-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center;text-align:center}.swiper-zoom-container>canvas,.swiper-zoom-container>img,.swiper-zoom-container>svg{max-width:100%;max-height:100%;object-fit:contain}.swiper-slide-zoomed{cursor:move}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;animation:swiper-preloader-spin 1s infinite linear;box-sizing:border-box;border:4px solid var(--swiper-preloader-color,var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper-lazy-preloader-white{--swiper-preloader-color:#fff}.swiper-lazy-preloader-black{--swiper-preloader-color:#000}@keyframes swiper-preloader-spin{100%{transform:rotate(360deg)}}.swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-container-fade.swiper-container-free-mode .swiper-slide{transition-timing-function:ease-out}.swiper-container-fade .swiper-slide{pointer-events:none;transition-property:opacity}.swiper-container-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-fade .swiper-slide-active,.swiper-container-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube{overflow:visible}.swiper-container-cube .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1;visibility:hidden;transform-origin:0 0;width:100%;height:100%}.swiper-container-cube .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-cube.swiper-container-rtl .swiper-slide{transform-origin:100% 0}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-next,.swiper-container-cube .swiper-slide-next+.swiper-slide,.swiper-container-cube .swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-container-cube .swiper-slide-shadow-bottom,.swiper-container-cube .swiper-slide-shadow-left,.swiper-container-cube .swiper-slide-shadow-right,.swiper-container-cube .swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0px;width:100%;height:100%;opacity:.6;z-index:0}.swiper-container-cube .swiper-cube-shadow:before{content:'';background:#000;position:absolute;left:0;top:0;bottom:0;right:0;-webkit-filter:blur(50px);filter:blur(50px)}.swiper-container-flip{overflow:visible}.swiper-container-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-container-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-flip .swiper-slide-active,.swiper-container-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-flip .swiper-slide-shadow-bottom,.swiper-container-flip .swiper-slide-shadow-left,.swiper-container-flip .swiper-slide-shadow-right,.swiper-container-flip .swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden} \ No newline at end of file diff --git a/infoport/static/css/ui-dialog.css b/infoport/static/css/ui-dialog.css new file mode 100644 index 0000000..b10d5bb --- /dev/null +++ b/infoport/static/css/ui-dialog.css @@ -0,0 +1,425 @@ +/*! + * ui-dialog.css + * Date: 2014-07-03 + * https://github.com/aui/artDialog + * (c) 2009-2014 TangBin, http://www.planeArt.cn + * + * This is licensed under the GNU LGPL, version 2.1 or later. + * For details, see: http://www.gnu.org/licenses/lgpl-2.1.html + */ +.ui-dialog { + *zoom:1; + _float: left; + position: relative; + background-color: #FFF; + border: 1px solid #999; + border-radius: 6px; + outline: 0; + background-clip: padding-box; + font-family: Helvetica, arial, sans-serif; + font-size: 14px; + line-height: 1.428571429; + color: #333; + opacity: 0; + -webkit-transform: scale(0); + transform: scale(0); + -webkit-transition: -webkit-transform .15s ease-in-out, opacity .15s ease-in-out; + transition: transform .15s ease-in-out, opacity .15s ease-in-out; +} +.ui-popup-show .ui-dialog { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); +} +.ui-popup-focus .ui-dialog { + box-shadow: 0 0 8px rgba(0, 0, 0, 0.1); +} +.ui-popup-modal .ui-dialog { + box-shadow: 0 0 8px rgba(0, 0, 0, 0.1), 0 0 256px rgba(255, 255, 255, .3); +} +.ui-dialog-grid { + width: auto; + margin: 0; + border: 0 none; + border-collapse:collapse; + border-spacing: 0; + background: transparent; +} +.ui-dialog-header, +.ui-dialog-body, +.ui-dialog-footer { + padding: 0; + border: 0 none; + text-align: left; + background: transparent; +} +.ui-dialog-header { + white-space: nowrap; + border-bottom: 1px solid #E5E5E5; +} +.ui-dialog-close { + position: relative; + _position: absolute; + float: right; + top: 13px; + right: 13px; + _height: 26px; + padding: 0 4px; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #FFF; + opacity: .2; + filter: alpha(opacity=20); + cursor: pointer; + background: transparent; + _background: #FFF; + border: 0; + -webkit-appearance: none; +} +.ui-dialog-close:hover, +.ui-dialog-close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + outline: 0; + opacity: 0.5; + filter: alpha(opacity=50); +} +.ui-dialog-title { + margin: 0; + line-height: 1.428571429; + min-height: 16.428571429px; + padding: 15px; + overflow:hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-weight: bold; + cursor: default; +} +.ui-dialog-body { + padding: 20px; + text-align: center; +} +.ui-dialog-content { + display: inline-block; + position: relative; + vertical-align: middle; + *zoom: 1; + *display: inline; + text-align: left; +} +.ui-dialog-footer { + padding: 0 20px 20px 20px; +} +.ui-dialog-statusbar { + float: left; + margin-right: 20px; + padding: 6px 0; + line-height: 1.428571429; + font-size: 14px; + color: #888; + white-space: nowrap; +} +.ui-dialog-statusbar label:hover { + color: #333; +} +.ui-dialog-statusbar input, +.ui-dialog-statusbar .label { + vertical-align: middle; +} +.ui-dialog-button { + float: right; + white-space: nowrap; +} +.ui-dialog-footer button+button { + margin-bottom: 0; + margin-left: 5px; +} +.ui-dialog-footer button { + width:auto; + overflow:visible; + display: inline-block; + padding: 6px 12px; + _margin-left: 5px; + margin-bottom: 0; + font-size: 14px; + font-weight: normal; + line-height: 1.428571429; + text-align: center; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +.ui-dialog-footer button:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.ui-dialog-footer button:hover, +.ui-dialog-footer button:focus { + color: #333333; + text-decoration: none; +} + +.ui-dialog-footer button:active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.ui-dialog-footer button[disabled] { + pointer-events: none; + cursor: not-allowed; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} + +.ui-dialog-footer button { + color: #333333; + background-color: #ffffff; + border-color: #cccccc; +} + +.ui-dialog-footer button:hover, +.ui-dialog-footer button:focus, +.ui-dialog-footer button:active { + color: #333333; + background-color: #ebebeb; + border-color: #adadad; +} + +.ui-dialog-footer button:active{ + background-image: none; +} + +.ui-dialog-footer button[disabled], +.ui-dialog-footer button[disabled]:hover, +.ui-dialog-footer button[disabled]:focus, +.ui-dialog-footer button[disabled]:active { + background-color: #ffffff; + border-color: #cccccc; +} + +.ui-dialog-footer button.ui-dialog-autofocus { + color: #ffffff; + background-color: #428bca; + border-color: #357ebd; +} + +.ui-dialog-footer button.ui-dialog-autofocus:hover, +.ui-dialog-footer button.ui-dialog-autofocus:focus, +.ui-dialog-footer button.ui-dialog-autofocus:active { + color: #ffffff; + background-color: #3276b1; + border-color: #285e8e; +} + +.ui-dialog-footer button.ui-dialog-autofocus:active { + background-image: none; +} +.ui-popup-top-left .ui-dialog, +.ui-popup-top .ui-dialog, +.ui-popup-top-right .ui-dialog { + top: -8px; +} +.ui-popup-bottom-left .ui-dialog, +.ui-popup-bottom .ui-dialog, +.ui-popup-bottom-right .ui-dialog { + top: 8px; +} +.ui-popup-left-top .ui-dialog, +.ui-popup-left .ui-dialog, +.ui-popup-left-bottom .ui-dialog { + left: -8px; +} +.ui-popup-right-top .ui-dialog, +.ui-popup-right .ui-dialog, +.ui-popup-right-bottom .ui-dialog { + left: 8px; +} + +.ui-dialog-arrow-a, +.ui-dialog-arrow-b { + position: absolute; + display: none; + width: 0; + height: 0; + overflow:hidden; + _color:#FF3FFF; + _filter:chroma(color=#FF3FFF); + border:8px dashed transparent; +} +.ui-popup-follow .ui-dialog-arrow-a, +.ui-popup-follow .ui-dialog-arrow-b{ + display: block; +} +.ui-popup-top-left .ui-dialog-arrow-a, +.ui-popup-top .ui-dialog-arrow-a, +.ui-popup-top-right .ui-dialog-arrow-a { + bottom: -16px; + border-top:8px solid #7C7C7C; +} +.ui-popup-top-left .ui-dialog-arrow-b, +.ui-popup-top .ui-dialog-arrow-b, +.ui-popup-top-right .ui-dialog-arrow-b { + bottom: -15px; + border-top:8px solid #fff; +} +.ui-popup-top-left .ui-dialog-arrow-a, +.ui-popup-top-left .ui-dialog-arrow-b { + left: 15px; +} +.ui-popup-top .ui-dialog-arrow-a, +.ui-popup-top .ui-dialog-arrow-b { + left: 50%; + margin-left: -8px; +} +.ui-popup-top-right .ui-dialog-arrow-a, +.ui-popup-top-right .ui-dialog-arrow-b { + right: 15px; +} +.ui-popup-bottom-left .ui-dialog-arrow-a, +.ui-popup-bottom .ui-dialog-arrow-a, +.ui-popup-bottom-right .ui-dialog-arrow-a { + top: -16px; + border-bottom:8px solid #7C7C7C; +} +.ui-popup-bottom-left .ui-dialog-arrow-b, +.ui-popup-bottom .ui-dialog-arrow-b, +.ui-popup-bottom-right .ui-dialog-arrow-b { + top: -15px; + border-bottom:8px solid #fff; +} +.ui-popup-bottom-left .ui-dialog-arrow-a, +.ui-popup-bottom-left .ui-dialog-arrow-b { + left: 15px; +} +.ui-popup-bottom .ui-dialog-arrow-a, +.ui-popup-bottom .ui-dialog-arrow-b { + margin-left: -8px; + left: 50%; +} +.ui-popup-bottom-right .ui-dialog-arrow-a, +.ui-popup-bottom-right .ui-dialog-arrow-b { + right: 15px; +} +.ui-popup-left-top .ui-dialog-arrow-a, +.ui-popup-left .ui-dialog-arrow-a, +.ui-popup-left-bottom .ui-dialog-arrow-a { + right: -16px; + border-left:8px solid #7C7C7C; +} +.ui-popup-left-top .ui-dialog-arrow-b, +.ui-popup-left .ui-dialog-arrow-b, +.ui-popup-left-bottom .ui-dialog-arrow-b { + right: -15px; + border-left:8px solid #fff; +} +.ui-popup-left-top .ui-dialog-arrow-a, +.ui-popup-left-top .ui-dialog-arrow-b { + top: 15px; +} +.ui-popup-left .ui-dialog-arrow-a, +.ui-popup-left .ui-dialog-arrow-b { + margin-top: -8px; + top: 50%; +} +.ui-popup-left-bottom .ui-dialog-arrow-a, +.ui-popup-left-bottom .ui-dialog-arrow-b { + bottom: 15px; +} +.ui-popup-right-top .ui-dialog-arrow-a, +.ui-popup-right .ui-dialog-arrow-a, +.ui-popup-right-bottom .ui-dialog-arrow-a { + left: -16px; + border-right:8px solid #7C7C7C; +} +.ui-popup-right-top .ui-dialog-arrow-b, +.ui-popup-right .ui-dialog-arrow-b, +.ui-popup-right-bottom .ui-dialog-arrow-b { + left: -15px; + border-right:8px solid #fff; +} +.ui-popup-right-top .ui-dialog-arrow-a, +.ui-popup-right-top .ui-dialog-arrow-b { + top: 15px; +} +.ui-popup-right .ui-dialog-arrow-a, +.ui-popup-right .ui-dialog-arrow-b { + margin-top: -8px; + top: 50%; +} +.ui-popup-right-bottom .ui-dialog-arrow-a, +.ui-popup-right-bottom .ui-dialog-arrow-b { + bottom: 15px; +} + + +@-webkit-keyframes ui-dialog-loading { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + } +} +@keyframes ui-dialog-loading { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +.ui-dialog-loading { + vertical-align: middle; + position: relative; + display: block; + *zoom: 1; + *display: inline; + overflow: hidden; + width: 32px; + height: 32px; + top: 50%; + margin: -16px auto 0 auto; + font-size: 0; + text-indent: -999em; + color: #666; +} +.ui-dialog-loading { + width: 100%\9; + text-indent: 0\9; + line-height: 32px\9; + text-align: center\9; + font-size: 12px\9; +} + +.ui-dialog-loading::after { + position: absolute; + content: ''; + width: 3px; + height: 3px; + margin: 14.5px 0 0 14.5px; + border-radius: 100%; + box-shadow: 0 -10px 0 1px #ccc, 10px 0px #ccc, 0 10px #ccc, -10px 0 #ccc, -7px -7px 0 0.5px #ccc, 7px -7px 0 1.5px #ccc, 7px 7px #ccc, -7px 7px #ccc; + -webkit-transform: rotate(360deg); + -webkit-animation: ui-dialog-loading 1.5s infinite linear; + transform: rotate(360deg); + animation: ui-dialog-loading 1.5s infinite linear; + display: none\9; +} diff --git a/infoport/static/images/date.png b/infoport/static/images/date.png new file mode 100644 index 0000000..2c1cac1 Binary files /dev/null and b/infoport/static/images/date.png differ diff --git a/infoport/static/images/dialog_icon_1.png b/infoport/static/images/dialog_icon_1.png new file mode 100644 index 0000000..fd9eb25 Binary files /dev/null and b/infoport/static/images/dialog_icon_1.png differ diff --git a/infoport/static/images/dialog_icon_2.png b/infoport/static/images/dialog_icon_2.png new file mode 100644 index 0000000..73d48ff Binary files /dev/null and b/infoport/static/images/dialog_icon_2.png differ diff --git a/infoport/static/images/dialog_icon_3.png b/infoport/static/images/dialog_icon_3.png new file mode 100644 index 0000000..e6c4984 Binary files /dev/null and b/infoport/static/images/dialog_icon_3.png differ diff --git a/infoport/static/images/dialog_icon_4.png b/infoport/static/images/dialog_icon_4.png new file mode 100644 index 0000000..c16b4e2 Binary files /dev/null and b/infoport/static/images/dialog_icon_4.png differ diff --git a/infoport/static/images/dialog_icon_5.png b/infoport/static/images/dialog_icon_5.png new file mode 100644 index 0000000..f6e64ae Binary files /dev/null and b/infoport/static/images/dialog_icon_5.png differ diff --git a/infoport/static/images/dialog_icon_close.png b/infoport/static/images/dialog_icon_close.png new file mode 100644 index 0000000..83c7fdf Binary files /dev/null and b/infoport/static/images/dialog_icon_close.png differ diff --git a/infoport/static/images/footer_filings.png b/infoport/static/images/footer_filings.png new file mode 100644 index 0000000..02313f7 Binary files /dev/null and b/infoport/static/images/footer_filings.png differ diff --git a/infoport/static/images/footer_icon_1.png b/infoport/static/images/footer_icon_1.png new file mode 100644 index 0000000..c562303 Binary files /dev/null and b/infoport/static/images/footer_icon_1.png differ diff --git a/infoport/static/images/map_icon.png b/infoport/static/images/map_icon.png new file mode 100644 index 0000000..a81899b Binary files /dev/null and b/infoport/static/images/map_icon.png differ diff --git a/infoport/static/images/nav_1.png b/infoport/static/images/nav_1.png new file mode 100644 index 0000000..c7586f4 Binary files /dev/null and b/infoport/static/images/nav_1.png differ diff --git a/infoport/static/images/nav_2.png b/infoport/static/images/nav_2.png new file mode 100644 index 0000000..9cf2b03 Binary files /dev/null and b/infoport/static/images/nav_2.png differ diff --git a/infoport/static/images/nav_3.png b/infoport/static/images/nav_3.png new file mode 100644 index 0000000..5cf34c2 Binary files /dev/null and b/infoport/static/images/nav_3.png differ diff --git a/infoport/static/images/nav_4.png b/infoport/static/images/nav_4.png new file mode 100644 index 0000000..9e72ce4 Binary files /dev/null and b/infoport/static/images/nav_4.png differ diff --git a/infoport/static/images/nav_5.png b/infoport/static/images/nav_5.png new file mode 100644 index 0000000..01e1be3 Binary files /dev/null and b/infoport/static/images/nav_5.png differ diff --git a/infoport/static/images/nav_6.png b/infoport/static/images/nav_6.png new file mode 100644 index 0000000..06c9b68 Binary files /dev/null and b/infoport/static/images/nav_6.png differ diff --git a/infoport/static/images/nav_7.png b/infoport/static/images/nav_7.png new file mode 100644 index 0000000..22a2cc4 Binary files /dev/null and b/infoport/static/images/nav_7.png differ diff --git a/infoport/static/images/nav_8.png b/infoport/static/images/nav_8.png new file mode 100644 index 0000000..57c04ce Binary files /dev/null and b/infoport/static/images/nav_8.png differ diff --git a/infoport/static/images/nav_bg.png b/infoport/static/images/nav_bg.png new file mode 100644 index 0000000..223d192 Binary files /dev/null and b/infoport/static/images/nav_bg.png differ diff --git a/infoport/static/images/new_icon_back.png b/infoport/static/images/new_icon_back.png new file mode 100644 index 0000000..6815310 Binary files /dev/null and b/infoport/static/images/new_icon_back.png differ diff --git a/infoport/static/images/news.png b/infoport/static/images/news.png new file mode 100644 index 0000000..78d33a1 Binary files /dev/null and b/infoport/static/images/news.png differ diff --git a/infoport/static/images/news_test.png b/infoport/static/images/news_test.png new file mode 100644 index 0000000..212ac37 Binary files /dev/null and b/infoport/static/images/news_test.png differ diff --git a/infoport/static/images/page_bg.jpg b/infoport/static/images/page_bg.jpg new file mode 100644 index 0000000..0e01b11 Binary files /dev/null and b/infoport/static/images/page_bg.jpg differ diff --git a/infoport/static/images/search_icon.png b/infoport/static/images/search_icon.png new file mode 100644 index 0000000..ab413f5 Binary files /dev/null and b/infoport/static/images/search_icon.png differ diff --git a/infoport/static/images/test.jpg b/infoport/static/images/test.jpg new file mode 100644 index 0000000..88de48a Binary files /dev/null and b/infoport/static/images/test.jpg differ diff --git a/infoport/static/images/title.png b/infoport/static/images/title.png new file mode 100644 index 0000000..0772dcf Binary files /dev/null and b/infoport/static/images/title.png differ diff --git a/infoport/static/js/api/index.js b/infoport/static/js/api/index.js new file mode 100644 index 0000000..3b1e2d2 --- /dev/null +++ b/infoport/static/js/api/index.js @@ -0,0 +1,97 @@ +/*-------------- +* 获取用户、登录、注册相关 +-----------------*/ +var captchaImage_get = '/captchaImage'; //图形验证码接口 +var login_post = '/login'; //用户登录接口 +var getInfo_get = '/getInfo' //获取用户信息 +/* +@purl /enforce/website/getTopDeptId +@param +*/ +var getTopDeptId = '/enforce/website/getTopDeptId' //查询当前系统最高级的deptId + +/* +@purl /open/house/web/list +@param + pageNum:当前记录起始索引(当前页码) + pageSize:每页显示记录数 + (分页方法默认需要传 pageNum 和 pageSize两个参数) +*/ +var newsList = '/open/house/web/list' //查询新闻列表 + +/* +@purl /open/house/web/get/ +*/ +var newsDetail = '/open/house/web/get/' //查询新闻详情 + +/* +@purl /open/asset/list +@param + deptId:所选部门id + useType: 2闲置 3出租 + operationType:1 + translate_dict:1 + pageNum:1 + pageSize:10 + orderByColumn:code + isAsc:asc + (分页方法默认需要传 pageNum 和 pageSize两个参数) +*/ +var assetList = '/open/asset/list' //查询资产列表 + +/* +@purl /open/asset/get +*/ +var assetGet = '/open/asset/get/' //查询资产详情 + +/* +@purl /system/attachment/query +*/ +var attachmentList = '/open/attachment/query' //附件查询 + +/* +@purl /system/dept/treeselect +*/ +var treeselect = '/open/dept/treeselect' //查询部门下拉树结构 + +/* +@purl /open/dept/get/ +*/ +var treeselectSecond = '/open/dept/get/' //查询部门下拉树结构 + +/* +@purl /open/resource/list +*/ +var resourceList = '/open/resource/list' //查询资源列表 + +/* +@purl /open/resource/list +*/ +var resourceGet = '/open/resource/get/' //查询资源详情 + +/* +@purl /open/house/zjdzdxx/list +*/ +var zjdzdxxList = '/open/house/zjdzdxx/list' //查询宅基地列表 + +/* +@purl /open/house/zjdzdxx/ +*/ +var zjdzdxxGet = '/open/house/zjdzdxx/' //查询宅基地详情 + +/* +@purl /open/house/policy/list +*/ +var webList = '/open/house/policy/list' //查询落款 + +/* +@purl /open/house/policy/get +*/ +var webGet = '/open/house/policy/get/' //查询落款 + +/* +@purl /system/dict/data/type/ + dictType +@param + dictType:project_type +*/ +var webDeptType = '/transaction/website/data/type/'//标的物类型查询接口 diff --git a/infoport/static/js/common/main.js b/infoport/static/js/common/main.js new file mode 100644 index 0000000..24d8422 --- /dev/null +++ b/infoport/static/js/common/main.js @@ -0,0 +1,94 @@ +requirejs.config({ + urlArgs: "ver=1.0_" + (new Date).getTime(), + baseUrl: '/infoport/static/js/', + paths: { + //第三方库的路径配置 + jquery: 'lib/jquery/jquery-1.9.1.min', //jquery + bootstrap: 'lib/bootstrap/js/bootstrap.min', //bootstrap + jqueryCookie: 'lib/jquery-cookie/jquery.cookie', //cookie插件 + template: 'lib/template/template', //模板引擎 + templaten: 'lib/template/template-native', //模板引擎-后端写法 + jqueryLazyload: 'lib/jQuery-plugins/jquery.lazyload.min', //图片延迟加载 + dialog: 'lib/dialog/dialog', //artDialog弹窗插件 + dialogConf: 'lib/dialog/dialog-config', + drag: 'lib/dialog/drag', + popup: 'lib/dialog/popup', + swiper: 'lib/swiper/swiper.min', //焦点图插件 + nprogress: 'lib/nprogress/nprogress', //页面加载loading组件 + echarts: 'lib/echarts/echarts.min', //echarts组件 + laydata:'lib/laydata/laydata', + paging:'lib/paging/page_common',//分页插件 + cupload:'lib/cupload/cupload',//上传图片插件 + dateTime:'lib/dateTime/dateTime.min',//时间选择器 + + //自己写的路径配置 + Tools: '/infoport/static/js/common/tools', + addressApi: '/infoport/static/js/api/index', //所有Ajax接口存放地 + user: 'api/user',//用户信息接口 + register:'api/register',//用户注册接口 + ajaxUploadImage:'lib/ajaxUpload/ajaxupload',//上传图片 + kindeditor:'lib/kindeditor/kindeditor-all', + zhCN:'lib/kindeditor/lang/zh-CN', + }, + shim: { + bootstrap: { + deps: ['jquery'] + }, + jqueryLazyload: { + deps: ['jquery'] + }, + dialog: { + deps: ['jquery', 'dialogConf', 'drag', 'popup'], + exports: 'dialog' + }, + swiper: { + deps: ['jquery'], + exports: 'swiper' + }, + nprogress: { + deps: ['jquery'], + exports: 'nprogress' + }, + paging: { + deps: ['jquery'], + exports: 'paging' + }, + dateTime: { + deps: ['jquery'], + exports: 'dateTime' + }, + ajaxUploadImage: { + deps: ['jquery'], + exports: 'ajaxUploadImage' + }, + } +}); + +//所有页面都需要的js,先行加载 +require(['jquery', 'addressApi']); + +require(["jquery", "nprogress"], function ($, nprogress) { + //ajax加载页面跳转 + $(document).ajaxStart(function () { + // $('.loading').show(); + nprogress.start(); + }).ajaxStop(function () { + // $('.loading').hide(); + nprogress.done(); + }); + //根据条件加载不同js文件 + var currentPage = $("#require-page").attr("current-page"); + var targetModule = $("#require-page").attr("target-module"); + if (targetModule) { + // 页面加载完毕后再执行相关业务代码比较稳妥 + $(function () { + require([targetModule], function (targetModule) { + //不要在这里写业务代码 + //全部统一调用init方法 + //也就是每个模块都暴露一个init方法用于事件监听,页面内容加载等 + targetModule.init(currentPage); + }); + }); + return; + } +}) diff --git a/infoport/static/js/common/require.js b/infoport/static/js/common/require.js new file mode 100644 index 0000000..78490f9 --- /dev/null +++ b/infoport/static/js/common/require.js @@ -0,0 +1,2145 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 2.3.6 Copyright jQuery Foundation and other contributors. + * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE + */ +//Not using strict: uneven strict support in browsers, #392, and causes +//problems with requirejs.exec()/transpiler plugins that may not be strict. +/*jslint regexp: true, nomen: true, sloppy: true */ +/*global window, navigator, document, importScripts, setTimeout, opera */ + +var requirejs, require, define; +(function (global, setTimeout) { + var req, s, head, baseElement, dataMain, src, + interactiveScript, currentlyAddingScript, mainScript, subPath, + version = '2.3.6', + commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg, + cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, + jsSuffixRegExp = /\.js$/, + currDirRegExp = /^\.\//, + op = Object.prototype, + ostring = op.toString, + hasOwn = op.hasOwnProperty, + isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document), + isWebWorker = !isBrowser && typeof importScripts !== 'undefined', + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is 'loading', 'loaded', execution, + // then 'complete'. The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? + /^complete$/ : /^(complete|loaded)$/, + defContextName = '_', + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', + contexts = {}, + cfg = {}, + globalDefQueue = [], + useInteractive = false; + + //Could match something like ')//comment', do not lose the prefix to comment. + function commentReplace(match, singlePrefix) { + return singlePrefix || ''; + } + + function isFunction(it) { + return ostring.call(it) === '[object Function]'; + } + + function isArray(it) { + return ostring.call(it) === '[object Array]'; + } + + /** + * Helper function for iterating over an array. If the func returns + * a true value, it will break out of the loop. + */ + function each(ary, func) { + if (ary) { + var i; + for (i = 0; i < ary.length; i += 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + /** + * Helper function for iterating over an array backwards. If the func + * returns a true value, it will break out of the loop. + */ + function eachReverse(ary, func) { + if (ary) { + var i; + for (i = ary.length - 1; i > -1; i -= 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + function hasProp(obj, prop) { + return hasOwn.call(obj, prop); + } + + function getOwn(obj, prop) { + return hasProp(obj, prop) && obj[prop]; + } + + /** + * Cycles over properties in an object and calls a function for each + * property value. If the function returns a truthy value, then the + * iteration is stopped. + */ + function eachProp(obj, func) { + var prop; + for (prop in obj) { + if (hasProp(obj, prop)) { + if (func(obj[prop], prop)) { + break; + } + } + } + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + */ + function mixin(target, source, force, deepStringMixin) { + if (source) { + eachProp(source, function (value, prop) { + if (force || !hasProp(target, prop)) { + if (deepStringMixin && typeof value === 'object' && value && + !isArray(value) && !isFunction(value) && + !(value instanceof RegExp)) { + + if (!target[prop]) { + target[prop] = {}; + } + mixin(target[prop], value, force, deepStringMixin); + } else { + target[prop] = value; + } + } + }); + } + return target; + } + + //Similar to Function.prototype.bind, but the 'this' object is specified + //first, since it is easier to read/figure out what 'this' will be. + function bind(obj, fn) { + return function () { + return fn.apply(obj, arguments); + }; + } + + function scripts() { + return document.getElementsByTagName('script'); + } + + function defaultOnError(err) { + throw err; + } + + //Allow getting a global that is expressed in + //dot notation, like 'a.b.c'. + function getGlobal(value) { + if (!value) { + return value; + } + var g = global; + each(value.split('.'), function (part) { + g = g[part]; + }); + return g; + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err, requireModules) { + var e = new Error(msg + '\nhttps://requirejs.org/docs/errors.html#' + id); + e.requireType = id; + e.requireModules = requireModules; + if (err) { + e.originalError = err; + } + return e; + } + + if (typeof define !== 'undefined') { + //If a define is already in play via another AMD loader, + //do not overwrite. + return; + } + + if (typeof requirejs !== 'undefined') { + if (isFunction(requirejs)) { + //Do not overwrite an existing requirejs instance. + return; + } + cfg = requirejs; + requirejs = undefined; + } + + //Allow for a require config object + if (typeof require !== 'undefined' && !isFunction(require)) { + //assume it is a config object. + cfg = require; + require = undefined; + } + + function newContext(contextName) { + var inCheckLoaded, Module, context, handlers, + checkLoadedTimeoutId, + config = { + //Defaults. Do not set a default for map + //config to speed up normalize(), which + //will run faster if there is no default. + waitSeconds: 7, + baseUrl: './', + paths: {}, + bundles: {}, + pkgs: {}, + shim: {}, + config: {} + }, + registry = {}, + //registry of just enabled modules, to speed + //cycle breaking code when lots of modules + //are registered, but not activated. + enabledRegistry = {}, + undefEvents = {}, + defQueue = [], + defined = {}, + urlFetched = {}, + bundlesMap = {}, + requireCounter = 1, + unnormalizedCounter = 1; + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part; + for (i = 0; i < ary.length; i++) { + part = ary[i]; + if (part === '.') { + ary.splice(i, 1); + i -= 1; + } else if (part === '..') { + // If at the start, or previous value is still .., + // keep them so that when converted to a path it may + // still work when converted to a path, even though + // as an ID it is less than ideal. In larger point + // releases, may be better to just kick out an error. + if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') { + continue; + } else if (i > 0) { + ary.splice(i - 1, 2); + i -= 2; + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @param {Boolean} applyMap apply the map config to the value. Should + * only be done if this normalization is for a dependency ID. + * @returns {String} normalized name + */ + function normalize(name, baseName, applyMap) { + var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, + foundMap, foundI, foundStarMap, starI, normalizedBaseParts, + baseParts = (baseName && baseName.split('/')), + map = config.map, + starMap = map && map['*']; + + //Adjust any relative paths. + if (name) { + name = name.split('/'); + lastIndex = name.length - 1; + + // If wanting node ID compatibility, strip .js from end + // of IDs. Have to do this here, and not in nameToUrl + // because node allows either .js or non .js to map + // to same file. + if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { + name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); + } + + // Starts with a '.' so need the baseName + if (name[0].charAt(0) === '.' && baseParts) { + //Convert baseName to array, and lop off the last part, + //so that . matches that 'directory' and not name of the baseName's + //module. For instance, baseName of 'one/two/three', maps to + //'one/two/three.js', but we want the directory, 'one/two' for + //this normalization. + normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); + name = normalizedBaseParts.concat(name); + } + + trimDots(name); + name = name.join('/'); + } + + //Apply map config if available. + if (applyMap && map && (baseParts || starMap)) { + nameParts = name.split('/'); + + outerLoop: for (i = nameParts.length; i > 0; i -= 1) { + nameSegment = nameParts.slice(0, i).join('/'); + + if (baseParts) { + //Find the longest baseName segment match in the config. + //So, do joins on the biggest to smallest lengths of baseParts. + for (j = baseParts.length; j > 0; j -= 1) { + mapValue = getOwn(map, baseParts.slice(0, j).join('/')); + + //baseName segment has config, find if it has one for + //this name. + if (mapValue) { + mapValue = getOwn(mapValue, nameSegment); + if (mapValue) { + //Match, update name to the new value. + foundMap = mapValue; + foundI = i; + break outerLoop; + } + } + } + } + + //Check for a star map match, but just hold on to it, + //if there is a shorter segment match later in a matching + //config, then favor over this star map. + if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { + foundStarMap = getOwn(starMap, nameSegment); + starI = i; + } + } + + if (!foundMap && foundStarMap) { + foundMap = foundStarMap; + foundI = starI; + } + + if (foundMap) { + nameParts.splice(0, foundI, foundMap); + name = nameParts.join('/'); + } + } + + // If the name points to a package's name, use + // the package main instead. + pkgMain = getOwn(config.pkgs, name); + + return pkgMain ? pkgMain : name; + } + + function removeScript(name) { + if (isBrowser) { + each(scripts(), function (scriptNode) { + if (scriptNode.getAttribute('data-requiremodule') === name && + scriptNode.getAttribute('data-requirecontext') === context.contextName) { + scriptNode.parentNode.removeChild(scriptNode); + return true; + } + }); + } + } + + function hasPathFallback(id) { + var pathConfig = getOwn(config.paths, id); + if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { + //Pop off the first array value, since it failed, and + //retry + pathConfig.shift(); + context.require.undef(id); + + //Custom require that does not do map translation, since + //ID is "absolute", already mapped/resolved. + context.makeRequire(null, { + skipMap: true + })([id]); + + return true; + } + } + + //Turns a plugin!resource to [plugin, resource] + //with the plugin being undefined if the name + //did not have a plugin prefix. + function splitPrefix(name) { + var prefix, + index = name ? name.indexOf('!') : -1; + if (index > -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + return [prefix, name]; + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * @param {Boolean} isNormalized: is the ID already normalized. + * This is true if this call is done for a define() module ID. + * @param {Boolean} applyMap: apply the map config to the ID. + * Should only be true if this map is for a dependency. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { + var url, pluginModule, suffix, nameParts, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + isDefine = true, + normalizedName = ''; + + //If no name, then it means it is a require call, generate an + //internal name. + if (!name) { + isDefine = false; + name = '_@r' + (requireCounter += 1); + } + + nameParts = splitPrefix(name); + prefix = nameParts[0]; + name = nameParts[1]; + + if (prefix) { + prefix = normalize(prefix, parentName, applyMap); + pluginModule = getOwn(defined, prefix); + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + if (isNormalized) { + normalizedName = name; + } else if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName, applyMap); + }); + } else { + // If nested plugin references, then do not try to + // normalize, as it will not normalize correctly. This + // places a restriction on resourceIds, and the longer + // term solution is not to normalize until plugins are + // loaded and all normalizations to allow for async + // loading of a loader plugin. But for now, fixes the + // common uses. Details in #1131 + normalizedName = name.indexOf('!') === -1 ? + normalize(name, parentName, applyMap) : + name; + } + } else { + //A regular module. + normalizedName = normalize(name, parentName, applyMap); + + //Normalized name may be a plugin ID due to map config + //application in normalize. The map config values must + //already be normalized, so do not need to redo that part. + nameParts = splitPrefix(normalizedName); + prefix = nameParts[0]; + normalizedName = nameParts[1]; + isNormalized = true; + + url = context.nameToUrl(normalizedName); + } + } + + //If the id is a plugin id that cannot be determined if it needs + //normalization, stamp it with a unique ID so two matching relative + //ids that may conflict can be separate. + suffix = prefix && !pluginModule && !isNormalized ? + '_unnormalized' + (unnormalizedCounter += 1) : + ''; + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + unnormalized: !!suffix, + url: url, + originalName: originalName, + isDefine: isDefine, + id: (prefix ? + prefix + '!' + normalizedName : + normalizedName) + suffix + }; + } + + function getModule(depMap) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (!mod) { + mod = registry[id] = new context.Module(depMap); + } + + return mod; + } + + function on(depMap, name, fn) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (hasProp(defined, id) && + (!mod || mod.defineEmitComplete)) { + if (name === 'defined') { + fn(defined[id]); + } + } else { + mod = getModule(depMap); + if (mod.error && name === 'error') { + fn(mod.error); + } else { + mod.on(name, fn); + } + } + } + + function onError(err, errback) { + var ids = err.requireModules, + notified = false; + + if (errback) { + errback(err); + } else { + each(ids, function (id) { + var mod = getOwn(registry, id); + if (mod) { + //Set error on module, so it skips timeout checks. + mod.error = err; + if (mod.events.error) { + notified = true; + mod.emit('error', err); + } + } + }); + + if (!notified) { + req.onError(err); + } + } + } + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + function takeGlobalQueue() { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + each(globalDefQueue, function(queueItem) { + var id = queueItem[0]; + if (typeof id === 'string') { + context.defQueueMap[id] = true; + } + defQueue.push(queueItem); + }); + globalDefQueue = []; + } + } + + handlers = { + 'require': function (mod) { + if (mod.require) { + return mod.require; + } else { + return (mod.require = context.makeRequire(mod.map)); + } + }, + 'exports': function (mod) { + mod.usingExports = true; + if (mod.map.isDefine) { + if (mod.exports) { + return (defined[mod.map.id] = mod.exports); + } else { + return (mod.exports = defined[mod.map.id] = {}); + } + } + }, + 'module': function (mod) { + if (mod.module) { + return mod.module; + } else { + return (mod.module = { + id: mod.map.id, + uri: mod.map.url, + config: function () { + return getOwn(config.config, mod.map.id) || {}; + }, + exports: mod.exports || (mod.exports = {}) + }); + } + } + }; + + function cleanRegistry(id) { + //Clean up machinery used for waiting modules. + delete registry[id]; + delete enabledRegistry[id]; + } + + function breakCycle(mod, traced, processed) { + var id = mod.map.id; + + if (mod.error) { + mod.emit('error', mod.error); + } else { + traced[id] = true; + each(mod.depMaps, function (depMap, i) { + var depId = depMap.id, + dep = getOwn(registry, depId); + + //Only force things that have not completed + //being defined, so still in the registry, + //and only if it has not been matched up + //in the module already. + if (dep && !mod.depMatched[i] && !processed[depId]) { + if (getOwn(traced, depId)) { + mod.defineDep(i, defined[depId]); + mod.check(); //pass false? + } else { + breakCycle(dep, traced, processed); + } + } + }); + processed[id] = true; + } + } + + function checkLoaded() { + var err, usingPathFallback, + waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), + noLoads = [], + reqCalls = [], + stillLoading = false, + needCycleCheck = true; + + //Do not bother if this call was a result of a cycle break. + if (inCheckLoaded) { + return; + } + + inCheckLoaded = true; + + //Figure out the state of all the modules. + eachProp(enabledRegistry, function (mod) { + var map = mod.map, + modId = map.id; + + //Skip things that are not enabled or in error state. + if (!mod.enabled) { + return; + } + + if (!map.isDefine) { + reqCalls.push(mod); + } + + if (!mod.error) { + //If the module should be executed, and it has not + //been inited and time is up, remember it. + if (!mod.inited && expired) { + if (hasPathFallback(modId)) { + usingPathFallback = true; + stillLoading = true; + } else { + noLoads.push(modId); + removeScript(modId); + } + } else if (!mod.inited && mod.fetched && map.isDefine) { + stillLoading = true; + if (!map.prefix) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + return (needCycleCheck = false); + } + } + } + }); + + if (expired && noLoads.length) { + //If wait time expired, throw error of unloaded modules. + err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); + err.contextName = context.contextName; + return onError(err); + } + + //Not expired, check for a cycle. + if (needCycleCheck) { + each(reqCalls, function (mod) { + breakCycle(mod, {}, {}); + }); + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if ((!expired || usingPathFallback) && stillLoading) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0; + checkLoaded(); + }, 50); + } + } + + inCheckLoaded = false; + } + + Module = function (map) { + this.events = getOwn(undefEvents, map.id) || {}; + this.map = map; + this.shim = getOwn(config.shim, map.id); + this.depExports = []; + this.depMaps = []; + this.depMatched = []; + this.pluginMaps = {}; + this.depCount = 0; + + /* this.exports this.factory + this.depMaps = [], + this.enabled, this.fetched + */ + }; + + Module.prototype = { + init: function (depMaps, factory, errback, options) { + options = options || {}; + + //Do not do more inits if already done. Can happen if there + //are multiple define calls for the same module. That is not + //a normal, common case, but it is also not unexpected. + if (this.inited) { + return; + } + + this.factory = factory; + + if (errback) { + //Register for errors on this module. + this.on('error', errback); + } else if (this.events.error) { + //If no errback already, but there are error listeners + //on this module, set up an errback to pass to the deps. + errback = bind(this, function (err) { + this.emit('error', err); + }); + } + + //Do a copy of the dependency array, so that + //source inputs are not modified. For example + //"shim" deps are passed in here directly, and + //doing a direct modification of the depMaps array + //would affect that config. + this.depMaps = depMaps && depMaps.slice(0); + + this.errback = errback; + + //Indicate this module has be initialized + this.inited = true; + + this.ignore = options.ignore; + + //Could have option to init this module in enabled mode, + //or could have been previously marked as enabled. However, + //the dependencies are not known until init is called. So + //if enabled previously, now trigger dependencies as enabled. + if (options.enabled || this.enabled) { + //Enable this module and dependencies. + //Will call this.check() + this.enable(); + } else { + this.check(); + } + }, + + defineDep: function (i, depExports) { + //Because of cycles, defined callback for a given + //export can be called more than once. + if (!this.depMatched[i]) { + this.depMatched[i] = true; + this.depCount -= 1; + this.depExports[i] = depExports; + } + }, + + fetch: function () { + if (this.fetched) { + return; + } + this.fetched = true; + + context.startTime = (new Date()).getTime(); + + var map = this.map; + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (this.shim) { + context.makeRequire(this.map, { + enableBuildCallback: true + })(this.shim.deps || [], bind(this, function () { + return map.prefix ? this.callPlugin() : this.load(); + })); + } else { + //Regular dependency. + return map.prefix ? this.callPlugin() : this.load(); + } + }, + + load: function () { + var url = this.map.url; + + //Regular dependency. + if (!urlFetched[url]) { + urlFetched[url] = true; + context.load(this.map.id, url); + } + }, + + /** + * Checks if the module is ready to define itself, and if so, + * define it. + */ + check: function () { + if (!this.enabled || this.enabling) { + return; + } + + var err, cjsModule, + id = this.map.id, + depExports = this.depExports, + exports = this.exports, + factory = this.factory; + + if (!this.inited) { + // Only fetch if not already in the defQueue. + if (!hasProp(context.defQueueMap, id)) { + this.fetch(); + } + } else if (this.error) { + this.emit('error', this.error); + } else if (!this.defining) { + //The factory could trigger another require call + //that would result in checking this module to + //define itself again. If already in the process + //of doing that, skip this work. + this.defining = true; + + if (this.depCount < 1 && !this.defined) { + if (isFunction(factory)) { + //If there is an error listener, favor passing + //to that instead of throwing an error. However, + //only do it for define()'d modules. require + //errbacks should not be called for failures in + //their callbacks (#699). However if a global + //onError is set, use that. + if ((this.events.error && this.map.isDefine) || + req.onError !== defaultOnError) { + try { + exports = context.execCb(id, factory, depExports, exports); + } catch (e) { + err = e; + } + } else { + exports = context.execCb(id, factory, depExports, exports); + } + + // Favor return value over exports. If node/cjs in play, + // then will not have a return value anyway. Favor + // module.exports assignment over exports object. + if (this.map.isDefine && exports === undefined) { + cjsModule = this.module; + if (cjsModule) { + exports = cjsModule.exports; + } else if (this.usingExports) { + //exports already set the defined value. + exports = this.exports; + } + } + + if (err) { + err.requireMap = this.map; + err.requireModules = this.map.isDefine ? [this.map.id] : null; + err.requireType = this.map.isDefine ? 'define' : 'require'; + return onError((this.error = err)); + } + + } else { + //Just a literal value + exports = factory; + } + + this.exports = exports; + + if (this.map.isDefine && !this.ignore) { + defined[id] = exports; + + if (req.onResourceLoad) { + var resLoadMaps = []; + each(this.depMaps, function (depMap) { + resLoadMaps.push(depMap.normalizedMap || depMap); + }); + req.onResourceLoad(context, this.map, resLoadMaps); + } + } + + //Clean up + cleanRegistry(id); + + this.defined = true; + } + + //Finished the define stage. Allow calling check again + //to allow define notifications below in the case of a + //cycle. + this.defining = false; + + if (this.defined && !this.defineEmitted) { + this.defineEmitted = true; + this.emit('defined', this.exports); + this.defineEmitComplete = true; + } + + } + }, + + callPlugin: function () { + var map = this.map, + id = map.id, + //Map already normalized the prefix. + pluginMap = makeModuleMap(map.prefix); + + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(pluginMap); + + on(pluginMap, 'defined', bind(this, function (plugin) { + var load, normalizedMap, normalizedMod, + bundleId = getOwn(bundlesMap, this.map.id), + name = this.map.name, + parentName = this.map.parentMap ? this.map.parentMap.name : null, + localRequire = context.makeRequire(map.parentMap, { + enableBuildCallback: true + }); + + //If current map is not normalized, wait for that + //normalized name to load instead of continuing. + if (this.map.unnormalized) { + //Normalize the ID if the plugin allows it. + if (plugin.normalize) { + name = plugin.normalize(name, function (name) { + return normalize(name, parentName, true); + }) || ''; + } + + //prefix and name should already be normalized, no need + //for applying map config again either. + normalizedMap = makeModuleMap(map.prefix + '!' + name, + this.map.parentMap, + true); + on(normalizedMap, + 'defined', bind(this, function (value) { + this.map.normalizedMap = normalizedMap; + this.init([], function () { return value; }, null, { + enabled: true, + ignore: true + }); + })); + + normalizedMod = getOwn(registry, normalizedMap.id); + if (normalizedMod) { + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(normalizedMap); + + if (this.events.error) { + normalizedMod.on('error', bind(this, function (err) { + this.emit('error', err); + })); + } + normalizedMod.enable(); + } + + return; + } + + //If a paths config, then just load that file instead to + //resolve the plugin, as it is built into that paths layer. + if (bundleId) { + this.map.url = context.nameToUrl(bundleId); + this.load(); + return; + } + + load = bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true + }); + }); + + load.error = bind(this, function (err) { + this.inited = true; + this.error = err; + err.requireModules = [id]; + + //Remove temp unnormalized modules for this module, + //since they will never be resolved otherwise now. + eachProp(registry, function (mod) { + if (mod.map.id.indexOf(id + '_unnormalized') === 0) { + cleanRegistry(mod.map.id); + } + }); + + onError(err); + }); + + //Allow plugins to load other code without having to know the + //context or how to 'complete' the load. + load.fromText = bind(this, function (text, textAlt) { + /*jslint evil: true */ + var moduleName = map.name, + moduleMap = makeModuleMap(moduleName), + hasInteractive = useInteractive; + + //As of 2.1.0, support just passing the text, to reinforce + //fromText only being called once per resource. Still + //support old style of passing moduleName but discard + //that moduleName in favor of the internal ref. + if (textAlt) { + text = textAlt; + } + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false; + } + + //Prime the system by creating a module instance for + //it. + getModule(moduleMap); + + //Transfer any config to this other module. + if (hasProp(config.config, id)) { + config.config[moduleName] = config.config[id]; + } + + try { + req.exec(text); + } catch (e) { + return onError(makeError('fromtexteval', + 'fromText eval for ' + id + + ' failed: ' + e, + e, + [id])); + } + + if (hasInteractive) { + useInteractive = true; + } + + //Mark this as a dependency for the plugin + //resource + this.depMaps.push(moduleMap); + + //Support anonymous modules. + context.completeLoad(moduleName); + + //Bind the value of that module to the value for this + //resource ID. + localRequire([moduleName], load); + }); + + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(map.name, localRequire, load, config); + })); + + context.enable(pluginMap, this); + this.pluginMaps[pluginMap.id] = pluginMap; + }, + + enable: function () { + enabledRegistry[this.map.id] = this; + this.enabled = true; + + //Set flag mentioning that the module is enabling, + //so that immediate calls to the defined callbacks + //for dependencies do not trigger inadvertent load + //with the depCount still being zero. + this.enabling = true; + + //Enable each dependency + each(this.depMaps, bind(this, function (depMap, i) { + var id, mod, handler; + + if (typeof depMap === 'string') { + //Dependency needs to be converted to a depMap + //and wired up to this module. + depMap = makeModuleMap(depMap, + (this.map.isDefine ? this.map : this.map.parentMap), + false, + !this.skipMap); + this.depMaps[i] = depMap; + + handler = getOwn(handlers, depMap.id); + + if (handler) { + this.depExports[i] = handler(this); + return; + } + + this.depCount += 1; + + on(depMap, 'defined', bind(this, function (depExports) { + if (this.undefed) { + return; + } + this.defineDep(i, depExports); + this.check(); + })); + + if (this.errback) { + on(depMap, 'error', bind(this, this.errback)); + } else if (this.events.error) { + // No direct errback on this module, but something + // else is listening for errors, so be sure to + // propagate the error correctly. + on(depMap, 'error', bind(this, function(err) { + this.emit('error', err); + })); + } + } + + id = depMap.id; + mod = registry[id]; + + //Skip special modules like 'require', 'exports', 'module' + //Also, don't call enable if it is already enabled, + //important in circular dependency cases. + if (!hasProp(handlers, id) && mod && !mod.enabled) { + context.enable(depMap, this); + } + })); + + //Enable each plugin that is used in + //a dependency + eachProp(this.pluginMaps, bind(this, function (pluginMap) { + var mod = getOwn(registry, pluginMap.id); + if (mod && !mod.enabled) { + context.enable(pluginMap, this); + } + })); + + this.enabling = false; + + this.check(); + }, + + on: function (name, cb) { + var cbs = this.events[name]; + if (!cbs) { + cbs = this.events[name] = []; + } + cbs.push(cb); + }, + + emit: function (name, evt) { + each(this.events[name], function (cb) { + cb(evt); + }); + if (name === 'error') { + //Now that the error handler was triggered, remove + //the listeners, since this broken Module instance + //can stay around for a while in the registry. + delete this.events[name]; + } + } + }; + + function callGetModule(args) { + //Skip modules already defined. + if (!hasProp(defined, args[0])) { + getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); + } + } + + function removeListener(node, func, name, ieName) { + //Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + if (ieName) { + node.detachEvent(ieName, func); + } + } else { + node.removeEventListener(name, func, false); + } + } + + /** + * Given an event from a script node, get the requirejs info from it, + * and then removes the event listeners on the node. + * @param {Event} evt + * @returns {Object} + */ + function getScriptData(evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement; + + //Remove the listeners once here. + removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); + removeListener(node, context.onScriptError, 'error'); + + return { + node: node, + id: node && node.getAttribute('data-requiremodule') + }; + } + + function intakeDefines() { + var args; + + //Any defined modules in the global queue, intake them now. + takeGlobalQueue(); + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + + args[args.length - 1])); + } else { + //args are id, deps, factory. Should be normalized by the + //define() function. + callGetModule(args); + } + } + context.defQueueMap = {}; + } + + context = { + config: config, + contextName: contextName, + registry: registry, + defined: defined, + urlFetched: urlFetched, + defQueue: defQueue, + defQueueMap: {}, + Module: Module, + makeModuleMap: makeModuleMap, + nextTick: req.nextTick, + onError: onError, + + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { + cfg.baseUrl += '/'; + } + } + + // Convert old style urlArgs string to a function. + if (typeof cfg.urlArgs === 'string') { + var urlArgs = cfg.urlArgs; + cfg.urlArgs = function(id, url) { + return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs; + }; + } + + //Save off the paths since they require special processing, + //they are additive. + var shim = config.shim, + objs = { + paths: true, + bundles: true, + config: true, + map: true + }; + + eachProp(cfg, function (value, prop) { + if (objs[prop]) { + if (!config[prop]) { + config[prop] = {}; + } + mixin(config[prop], value, true, true); + } else { + config[prop] = value; + } + }); + + //Reverse map the bundles + if (cfg.bundles) { + eachProp(cfg.bundles, function (value, prop) { + each(value, function (v) { + if (v !== prop) { + bundlesMap[v] = prop; + } + }); + }); + } + + //Merge shim + if (cfg.shim) { + eachProp(cfg.shim, function (value, id) { + //Normalize the structure + if (isArray(value)) { + value = { + deps: value + }; + } + if ((value.exports || value.init) && !value.exportsFn) { + value.exportsFn = context.makeShimExports(value); + } + shim[id] = value; + }); + config.shim = shim; + } + + //Adjust packages if necessary. + if (cfg.packages) { + each(cfg.packages, function (pkgObj) { + var location, name; + + pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj; + + name = pkgObj.name; + location = pkgObj.location; + if (location) { + config.paths[name] = pkgObj.location; + } + + //Save pointer to main module ID for pkg name. + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main') + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, ''); + }); + } + + //If there are any "waiting to execute" modules in the registry, + //update the maps for them, since their info, like URLs to load, + //may have changed. + eachProp(registry, function (mod, id) { + //If module already has init called, since it is too + //late to modify them, and ignore unnormalized ones + //since they are transient. + if (!mod.inited && !mod.map.unnormalized) { + mod.map = makeModuleMap(id, null, true); + } + }); + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback); + } + }, + + makeShimExports: function (value) { + function fn() { + var ret; + if (value.init) { + ret = value.init.apply(global, arguments); + } + return ret || (value.exports && getGlobal(value.exports)); + } + return fn; + }, + + makeRequire: function (relMap, options) { + options = options || {}; + + function localRequire(deps, callback, errback) { + var id, map, requireMod; + + if (options.enableBuildCallback && callback && isFunction(callback)) { + callback.__requireJsBuild = true; + } + + if (typeof deps === 'string') { + if (isFunction(callback)) { + //Invalid call + return onError(makeError('requireargs', 'Invalid require call'), errback); + } + + //If require|exports|module are requested, get the + //value for them from the special handlers. Caveat: + //this only works while module is being defined. + if (relMap && hasProp(handlers, deps)) { + return handlers[deps](registry[relMap.id]); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + if (req.get) { + return req.get(context, deps, relMap, localRequire); + } + + //Normalize module name, if it contains . or .. + map = makeModuleMap(deps, relMap, false, true); + id = map.id; + + if (!hasProp(defined, id)) { + return onError(makeError('notloaded', 'Module name "' + + id + + '" has not been loaded yet for context: ' + + contextName + + (relMap ? '' : '. Use require([])'))); + } + return defined[id]; + } + + //Grab defines waiting in the global queue. + intakeDefines(); + + //Mark all the dependencies as needing to be loaded. + context.nextTick(function () { + //Some defines could have been added since the + //require call, collect them. + intakeDefines(); + + requireMod = getModule(makeModuleMap(null, relMap)); + + //Store if map config should be applied to this require + //call for dependencies. + requireMod.skipMap = options.skipMap; + + requireMod.init(deps, callback, errback, { + enabled: true + }); + + checkLoaded(); + }); + + return localRequire; + } + + mixin(localRequire, { + isBrowser: isBrowser, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt) { + var ext, + index = moduleNamePlusExt.lastIndexOf('.'), + segment = moduleNamePlusExt.split('/')[0], + isRelative = segment === '.' || segment === '..'; + + //Have a file extension alias, and it is not the + //dots from a relative path. + if (index !== -1 && (!isRelative || index > 1)) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(normalize(moduleNamePlusExt, + relMap && relMap.id, true), ext, true); + }, + + defined: function (id) { + return hasProp(defined, makeModuleMap(id, relMap, false, true).id); + }, + + specified: function (id) { + id = makeModuleMap(id, relMap, false, true).id; + return hasProp(defined, id) || hasProp(registry, id); + } + }); + + //Only allow undef on top level require calls + if (!relMap) { + localRequire.undef = function (id) { + //Bind any waiting define() calls to this context, + //fix for #408 + takeGlobalQueue(); + + var map = makeModuleMap(id, relMap, true), + mod = getOwn(registry, id); + + mod.undefed = true; + removeScript(id); + + delete defined[id]; + delete urlFetched[map.url]; + delete undefEvents[id]; + + //Clean queued defines too. Go backwards + //in array so that the splices do not + //mess up the iteration. + eachReverse(defQueue, function(args, i) { + if (args[0] === id) { + defQueue.splice(i, 1); + } + }); + delete context.defQueueMap[id]; + + if (mod) { + //Hold on to listeners in case the + //module will be attempted to be reloaded + //using a different config. + if (mod.events.defined) { + undefEvents[id] = mod.events; + } + + cleanRegistry(id); + } + }; + } + + return localRequire; + }, + + /** + * Called to enable a module if it is still in the registry + * awaiting enablement. A second arg, parent, the parent module, + * is passed in for context, when this method is overridden by + * the optimizer. Not shown here to keep code compact. + */ + enable: function (depMap) { + var mod = getOwn(registry, depMap.id); + if (mod) { + getModule(depMap).enable(); + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var found, args, mod, + shim = getOwn(config.shim, moduleName) || {}, + shExports = shim.exports; + + takeGlobalQueue(); + + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + args[0] = moduleName; + //If already found an anonymous module and bound it + //to this name, then this is some other anon module + //waiting for its completeLoad to fire. + if (found) { + break; + } + found = true; + } else if (args[0] === moduleName) { + //Found matching define call for this script! + found = true; + } + + callGetModule(args); + } + context.defQueueMap = {}; + + //Do this after the cycle of callGetModule in case the result + //of those calls/init calls changes the registry. + mod = getOwn(registry, moduleName); + + if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { + if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { + if (hasPathFallback(moduleName)) { + return; + } else { + return onError(makeError('nodefine', + 'No define call for ' + moduleName, + null, + [moduleName])); + } + } else { + //A script that does not call define(), so just simulate + //the call for it. + callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); + } + } + + checkLoaded(); + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + * Note that it **does not** call normalize on the moduleName, + * it is assumed to have already been normalized. This is an + * internal API, not a public one. Use toUrl for the public API. + */ + nameToUrl: function (moduleName, ext, skipExt) { + var paths, syms, i, parentModule, url, + parentPath, bundleId, + pkgMain = getOwn(config.pkgs, moduleName); + + if (pkgMain) { + moduleName = pkgMain; + } + + bundleId = getOwn(bundlesMap, moduleName); + + if (bundleId) { + return context.nameToUrl(bundleId, ext, skipExt); + } + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) + //or ends with .js, then assume the user meant to use an url and not a module id. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext || ''); + } else { + //A module that needs to be converted to a path. + paths = config.paths; + + syms = moduleName.split('/'); + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i -= 1) { + parentModule = syms.slice(0, i).join('/'); + + parentPath = getOwn(paths, parentModule); + if (parentPath) { + //If an array, it means there are a few choices, + //Choose the one that is desired + if (isArray(parentPath)) { + parentPath = parentPath[0]; + } + syms.splice(0, i, parentPath); + break; + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join('/'); + url += (ext || (/^data\:|^blob\:|\?/.test(url) || skipExt ? '' : '.js')); + url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; + } + + return config.urlArgs && !/^blob\:/.test(url) ? + url + config.urlArgs(moduleName, url) : url; + }, + + //Delegates to req.load. Broken out as a separate function to + //allow overriding in the optimizer. + load: function (id, url) { + req.load(context, id, url); + }, + + /** + * Executes a module callback function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + execCb: function (name, callback, args, exports) { + return callback.apply(exports, args); + }, + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + */ + onScriptLoad: function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + if (evt.type === 'load' || + (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null; + + //Pull out the name of the module and the context. + var data = getScriptData(evt); + context.completeLoad(data.id); + } + }, + + /** + * Callback for script errors. + */ + onScriptError: function (evt) { + var data = getScriptData(evt); + if (!hasPathFallback(data.id)) { + var parents = []; + eachProp(registry, function(value, key) { + if (key.indexOf('_@r') !== 0) { + each(value.depMaps, function(depMap) { + if (depMap.id === data.id) { + parents.push(key); + return true; + } + }); + } + }); + return onError(makeError('scripterror', 'Script error for "' + data.id + + (parents.length ? + '", needed by: ' + parents.join(', ') : + '"'), evt, [data.id])); + } + } + }; + + context.require = context.makeRequire(); + return context; + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback, errback, optional) { + + //Find the right context, use default + var context, config, + contextName = defContextName; + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== 'string') { + // deps is a config object + config = deps; + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback; + callback = errback; + errback = optional; + } else { + deps = []; + } + } + + if (config && config.context) { + contextName = config.context; + } + + context = getOwn(contexts, contextName); + if (!context) { + context = contexts[contextName] = req.s.newContext(contextName); + } + + if (config) { + context.configure(config); + } + + return context.require(deps, callback, errback); + }; + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config); + }; + + /** + * Execute something after the current tick + * of the event loop. Override for other envs + * that have a better solution than setTimeout. + * @param {Function} fn function to execute later. + */ + req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { + setTimeout(fn, 4); + } : function (fn) { fn(); }; + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req; + } + + req.version = version; + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/; + req.isBrowser = isBrowser; + s = req.s = { + contexts: contexts, + newContext: newContext + }; + + //Create default context. + req({}); + + //Exports some context-sensitive methods on global require. + each([ + 'toUrl', + 'undef', + 'defined', + 'specified' + ], function (prop) { + //Reference from contexts instead of early binding to default context, + //so that during builds, the latest instance of the default context + //with its config gets used. + req[prop] = function () { + var ctx = contexts[defContextName]; + return ctx.require[prop].apply(ctx, arguments); + }; + }); + + if (isBrowser) { + head = s.head = document.getElementsByTagName('head')[0]; + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName('base')[0]; + if (baseElement) { + head = s.head = baseElement.parentNode; + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = defaultOnError; + + /** + * Creates the node for the load command. Only used in browser envs. + */ + req.createNode = function (config, moduleName, url) { + var node = config.xhtml ? + document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : + document.createElement('script'); + node.type = config.scriptType || 'text/javascript'; + node.charset = 'utf-8'; + node.async = true; + return node; + }; + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + var config = (context && context.config) || {}, + node; + if (isBrowser) { + //In the browser so use a script tag + node = req.createNode(config, moduleName, url); + + node.setAttribute('data-requirecontext', context.contextName); + node.setAttribute('data-requiremodule', moduleName); + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if (node.attachEvent && + //Check if node.attachEvent is artificially added by custom script or + //natively supported by browser + //read https://github.com/requirejs/requirejs/issues/187 + //if we can NOT find [native code] then it must NOT natively supported. + //in IE8, node.attachEvent does not have toString() + //Note the test for "[native code" with no closing brace, see: + //https://github.com/requirejs/requirejs/issues/273 + !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && + !isOpera) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in 'interactive' + //readyState at the time of the define call. + useInteractive = true; + + node.attachEvent('onreadystatechange', context.onScriptLoad); + //It would be great to add an error handler here to catch + //404s in IE9+. However, onreadystatechange will fire before + //the error handler, so that does not help. If addEventListener + //is used, then IE will fire error before load, but we cannot + //use that pathway given the connect.microsoft.com issue + //mentioned above about not doing the 'script execute, + //then fire the script load event listener before execute + //next script' that other browsers do. + //Best hope: IE10 fixes the issues, + //and then destroys all installs of IE 6-9. + //node.attachEvent('onerror', context.onScriptError); + } else { + node.addEventListener('load', context.onScriptLoad, false); + node.addEventListener('error', context.onScriptError, false); + } + node.src = url; + + //Calling onNodeCreated after all properties on the node have been + //set, but before it is placed in the DOM. + if (config.onNodeCreated) { + config.onNodeCreated(node, config, moduleName, url); + } + + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node; + if (baseElement) { + head.insertBefore(node, baseElement); + } else { + head.appendChild(node); + } + currentlyAddingScript = null; + + return node; + } else if (isWebWorker) { + try { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation is that a build has been done so + //that only one script needs to be loaded anyway. This may need + //to be reevaluated if other use cases become common. + + // Post a task to the event loop to work around a bug in WebKit + // where the worker gets garbage-collected after calling + // importScripts(): https://webkit.org/b/153317 + setTimeout(function() {}, 0); + importScripts(url); + + //Account for anonymous modules + context.completeLoad(moduleName); + } catch (e) { + context.onError(makeError('importscripts', + 'importScripts failed for ' + + moduleName + ' at ' + url, + e, + [moduleName])); + } + } + }; + + function getInteractiveScript() { + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript; + } + + eachReverse(scripts(), function (script) { + if (script.readyState === 'interactive') { + return (interactiveScript = script); + } + }); + return interactiveScript; + } + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser && !cfg.skipDataMain) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + eachReverse(scripts(), function (script) { + //Set the 'head' where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode; + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + dataMain = script.getAttribute('data-main'); + if (dataMain) { + //Preserve dataMain in case it is a path (i.e. contains '?') + mainScript = dataMain; + + //Set final baseUrl if there is not already an explicit one, + //but only do so if the data-main value is not a loader plugin + //module ID. + if (!cfg.baseUrl && mainScript.indexOf('!') === -1) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = mainScript.split('/'); + mainScript = src.pop(); + subPath = src.length ? src.join('/') + '/' : './'; + + cfg.baseUrl = subPath; + } + + //Strip off any trailing .js since mainScript is now + //like a module name. + mainScript = mainScript.replace(jsSuffixRegExp, ''); + + //If mainScript is still a path, fall back to dataMain + if (req.jsExtRegExp.test(mainScript)) { + mainScript = dataMain; + } + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; + + return true; + } + }); + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context; + + //Allow for anonymous modules + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps; + deps = name; + name = null; + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps; + deps = null; + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps && isFunction(callback)) { + deps = []; + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, commentReplace) + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep); + }); + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript(); + if (node) { + if (!name) { + name = node.getAttribute('data-requiremodule'); + } + context = contexts[node.getAttribute('data-requirecontext')]; + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + if (context) { + context.defQueue.push([name, deps, callback]); + context.defQueueMap[name] = true; + } else { + globalDefQueue.push([name, deps, callback]); + } + }; + + define.amd = { + jQuery: true + }; + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a better, environment-specific call. Only used for transpiling + * loader plugins, not for plain JS modules. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + /*jslint evil: true */ + return eval(text); + }; + + //Set up with config info. + req(cfg); +}(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout))); diff --git a/infoport/static/js/common/tools.js b/infoport/static/js/common/tools.js new file mode 100644 index 0000000..a63378e --- /dev/null +++ b/infoport/static/js/common/tools.js @@ -0,0 +1,481 @@ +var serverApi = ''; +var friendsLinksList = []; +var themeColor = ''; +var logo = ''; +define(['jquery', 'dialog'], function ($, dialog) { + // 工具类 + function Tool() { + this.version = "1.0.0"; + this.description = "这是一个工具类"; + } + var ajaxJsUrl = "/api"; + + $.extend(Tool.prototype, { + /** + * ajax post + * @param url (String) + * @param data (Json) 需要提交的数据 + * @param cb(Function) 回调函数 + * @param Bearer(Boolean) 是否需要Bearer,不需要传true + */ + doPost: function (url, data, cb, Bearer) { + var _this = this; + // data.deptId = 100 ; + // console.log(data) + var headAttribute = ''; + if (Bearer && Bearer == true || _this.getCookie('Admin-Token') == '') { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + } + } else { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + xhr.setRequestHeader('Authorization', 'Bearer ' + _this.getCookie('Admin-Token')) + } + } + $.ajax({ + url: ajaxJsUrl + url + '?=' + Math.random(), + type: 'POST', + data: JSON.stringify(data), + dataType: 'json', + contentType: "application/json", + beforeSend: headAttribute, + success: function (data) { + var code = data.code; + var msg = data.msg; + if (code === 401) { + _this.removeAllCookie(); + _this.initDialog('系统提示', '登录状态已过期,您可以继续留在该页面,或者重新登录', function () { + _this.skip('/view/login/login.html') + }, '重新登录', function () { }, "取消") + } else if (code === 500) { + _this.initError(msg) + cb(data); + } else if (code != 200) { + _this.initError(msg) + } else { + cb(data); + } + } + }); + }, + /** + * ajax post + * @param url (String) + * @param data (Json) 需要提交的数据 + * @param cb(Function) 回调函数 + * @param Bearer(Boolean) 是否需要Bearer,不需要传true + */ + doPostImg: function (url, data, cb, Bearer) { + var _this = this; + // data.deptId = 100 ; + // console.log(data) + var headAttribute = ''; + if (Bearer && Bearer == true || _this.getCookie('Admin-Token') == '') { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + } + } else { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + xhr.setRequestHeader('Authorization', 'Bearer ' + _this.getCookie('Admin-Token')) + } + } + $.ajax({ + url: ajaxJsUrl + url + '?=' + Math.random(), + type: 'POST', + data: JSON.stringify(data), + dataType: 'json', + traditional:true, + contentType: "application/json", + beforeSend: headAttribute, + success: function (data) { + var code = data.code; + var msg = data.msg; + if (code === 401) { + _this.removeAllCookie(); + _this.initDialog('系统提示', '登录状态已过期,您可以继续留在该页面,或者重新登录', function () { + _this.skip('/view/login/login.html') + }, '重新登录', function () { }, "取消") + } else if (code === 500) { + _this.initError(msg) + cb(data); + } else if (code != 200) { + _this.initError(msg) + } else { + cb(data); + } + } + }); + }, + /** + * ajax put + * @param url (String) + * @param data (Json) 需要提交的数据 + * @param cb(Function) 回调函数 + * @param Bearer(Boolean) 是否需要Bearer,不需要传true + */ + doPut: function (url, data, cb, Bearer) { + var _this = this; + var headAttribute = ''; + if (Bearer && Bearer == true || _this.getCookie('Admin-Token') == '') { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + } + } else { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + xhr.setRequestHeader('Authorization', 'Bearer ' + _this.getCookie('Admin-Token')) + } + } + $.ajax({ + url: ajaxJsUrl + url + '?=' + Math.random(), + type: 'put', + data: JSON.stringify(data), + dataType: 'json', + contentType: "application/json", + beforeSend: headAttribute, + success: function (data) { + var code = data.code; + var msg = data.msg; + if (code === 401) { + _this.removeAllCookie(); + _this.initDialog('系统提示', '登录状态已过期,您可以继续留在该页面,或者重新登录', function () { + _this.skip('/view/login/login.html') + }, '重新登录', function () { }, "取消") + } else if (code === 500) { + _this.initError(msg) + cb(data); + } else if (code != 200) { + _this.initError(msg) + } else { + cb(data); + } + } + }); + }, + /** + * ajax get + * @param url(String) + * @param data(Json) 需要提交的数据 + * @param cb(Function) 回调函数 + * @param noHead(Boolean) 是否需要Bearer,不需要传true + */ + doGet: function (uri, data, cb, Bearer) { + var _this = this; + // deptId=100& + var url = ajaxJsUrl + uri + '?'; + var headAttribute = '' + if (Bearer && Bearer == true || _this.getCookie('Admin-Token') == '') { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + } + } else { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + xhr.setRequestHeader('Authorization', 'Bearer ' + _this.getCookie('Admin-Token')) + } + } + if (data) { + url += $.map(data, function (n, i) { + if (i == data.length - 1) { + return i + '=' + n; + } else { + return i + '=' + n + '&'; + } + }).join(''); + } + + $.ajax({ + url: url, + type: 'GET', + beforeSend: headAttribute, + success: function (data) { + var code = data.code; + var msg = data.msg; + if (code === 401) { + _this.removeAllCookie(); + _this.initDialog('系统提示', '登录状态已过期,您可以继续留在该页面,或者重新登录', function () { + _this.skip('/view/login/login.html') + }, '重新登录', function () { }, "取消") + } else if (code === 500) { + _this.initError(msg) + } else if (code != 200) { + _this.initError(msg) + } else { + cb(data); + } + }, + error: function (data) { + console.log(data) + } + }); + }, + /** + * ajax delete + * @param url(String) + * @param data(Json) 需要提交的数据 + * @param cb(Function) 回调函数 + * @param noHead(Boolean) 是否需要Bearer,不需要传true + */ + doDelete: function (uri, data, cb, Bearer) { + var _this = this; + var url = ajaxJsUrl + uri + '?'; + var headAttribute = '' + if (Bearer && Bearer == true || _this.getCookie('Admin-Token') == '') { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + } + } else { + headAttribute = function (xhr) { + xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8'); + xhr.setRequestHeader('Authorization', 'Bearer ' + _this.getCookie('Admin-Token')) + } + } + if (data) { + url += $.map(data, function (n, i) { + if (i == data.length - 1) { + return i + '=' + n; + } else { + return i + '=' + n + '&'; + } + }).join(''); + } + + $.ajax({ + url: url, + type: 'delete', + beforeSend: headAttribute, + success: function (data) { + var code = data.code; + var msg = data.msg; + if (code === 401) { + _this.removeAllCookie(); + _this.initDialog('系统提示', '登录状态已过期,您可以继续留在该页面,或者重新登录', function () { + _this.skip('/view/login/login.html') + }, '重新登录', function () { }, "取消") + } else if (code === 500) { + _this.initError(msg) + } else if (code != 200) { + _this.initError(msg) + } else { + cb(data); + } + }, + error: function (data) { + console.log(data) + } + }); + }, + + /** + * 创建dialog + * @param id(String) 创建的dialog的Id 用于分辨唯一的dialog + * @param title (String) dialog的title + * @param content(String || HTMLElement) dialog的内容 + * @param ok (Function) 点击确定按钮的回调函数 + * @param cancel(Function) 点击取消按钮的回调函数 + * 可以通过showModal来实现modal显示 + */ + initDialog: function (title, content, ok, okValue, cancel, cancelValue, id) { + var initDialog = dialog({ + id: id ? id : '', + title: title, + content: content, + okValue: okValue ? okValue : '确定', + ok: ok, + cancelValue: cancelValue ? cancelValue : '取消', + cancel: cancel, + padding: 40, + top: '150px' + }); + initDialog.show(); + }, + /** + * 创建error dialog + * @param errContent + */ + initError: function (errContent) { + var error = dialog({ + content: errContent, + padding: 20 + }); + error.show(); + var time = setTimeout(function () { + error.remove(); + }, 1500); + }, + /** + * 创建dialog tips + * @param tips + * @param align + */ + initTips: function (tips, align, $target, times) { + var tips = dialog({ + content: tips, + padding: 20, + skin: 'min-dialog tips', + quickClose: true, + align: align + }); + tips.show($target); + if (times == undefined || times == 'undefined' || times == '' || times == 'null' || times == null) { + times = 2000 + } else { + times = times + } + setTimeout(function () { + tips.close().remove(); + }, times); + }, + /** + * setCookie 设置cookie + * @param cname 名称 + * @param cvalue 值 + * @param seconds 有效期 + */ + setCookie: function (cname, cvalue, seconds) { + var d = new Date(); + d.setTime(d.getTime() + (seconds * 1000)); + var expires = "expires=" + d.toGMTString(); + document.cookie = cname + "=" + cvalue + "; " + expires + ";path=/"; + }, + /** + * getCookie 获取cookie + * @param cname 名称 + */ + getCookie: function (cname) { + var name = cname + "="; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) == ' ') c = c.substring(1); + if (c.indexOf(name) != -1) return c.substring(name.length, c.length); + } + return ""; + }, + /** + * removeCookie 删除cookie + * @param cname 名称 + */ + removeCookie: function (cname) { + var exp = new Date(); + exp.setTime(exp.getTime() - 1); + document.cookie = cname + "=; expires=" + exp.toGMTString(); + }, + /** + * getParam 获取url参数 + * @param key 当前url链接 + */ + getParam: function (key) { + var json = {}, data; + $.each(location.search.substr(1).split("&"), function (i, n) { + data = n.split("="); + json[data[0]] = data[1]; + }); + return key != undefined ? json[key] : json; + }, + /** + * getParam 判断对象是否有内容 + * @param obj 传入对象 + */ + isEmptyObject: function (obj) { + for (var key in obj) { + return false; + } + return true; + }, + /** + * skip 页面跳转 + * @param url 跳转页面链接 + */ + skip: function (url) { + if (url != '') { + window.location = url + } + }, + /** + * getNowFormatDate 获取时间 + * @param + */ + getNowFormatDate: function () { + var date = new Date(); + var seperator1 = "-"; + var seperator2 = ":"; + var month = date.getMonth() + 1; + var day = date.getDate(); + var hours = date.getHours(); + var minutes = date.getMinutes(); + var seconds = date.getSeconds(); + if (month >= 1 && month <= 9) { + month = "0" + month; + } + if (day >= 0 && day <= 9) { + day = "0" + day; + } + if (hours >= 0 && hours <= 9) { + hours = "0" + hours; + } + if (minutes >= 0 && minutes <= 9) { + minutes = "0" + minutes; + } + if (seconds >= 0 && seconds <= 9) { + seconds = "0" + seconds; + } + var currentdate = date.getFullYear() + seperator1 + month + seperator1 + day + " " + hours + seperator2 + minutes + seperator2 + seconds; + console.log(currentdate) + return currentdate; + }, + /** + * getWebConfig 网站配置信息 + * @param + */ + getWebConfig: function () { + this.doGet(webConfig, {}, this.webConfigInformation, true) + }, + /** + * webConfigInformation 网站配置信息 + * @param + */ + webConfigInformation: function (data) { + if (data.code == 200) { + var content = data.data; + console.log(content) + // content[13].configValue = 'red'; + if (content[13].configValue == 'red'){ + themeColor = 'red'; + document.documentElement.style.setProperty('--color', '#e8041f'); + document.documentElement.style.setProperty('--icon', "url('../images/icon3_red.png')"); + document.documentElement.style.setProperty('--logo', "url('../images/logo_red.png')"); + logo = '../images/logo_red.png'; + } + if (content[13].configValue == 'green'){ + themeColor = 'green'; + document.documentElement.style.setProperty('--color', '#007b76'); + document.documentElement.style.setProperty('--icon', "url('../images/icon3.png')"); + document.documentElement.style.setProperty('--logo', "url('../images/logo.png')"); + logo = '../images/logo.png'; + } + $("#webConfigName").html(content[0].configValue); + $("#webConfigRecord").html(content[1].configValue + '' + content[2].configValue); + $("#webConfigAddress").html(content[0].configValue + '' + content[3].configValue); + serverApi = content[11].configValue; + + } + }, + /** + * removeAllCookie 清除所有Cookie + * @param + */ + removeAllCookie: function () { + var keys = document.cookie.match(/[^ =;]+(?==)/g) + if (keys) { + for (var i = keys.length; i--;) { + document.cookie = keys[i] + '=0;path=/;expires=' + new Date(0).toUTCString() // 清除当前域名下的,例如:m.ratingdog.cn + } + location.reload(); + } + }, + }); + return Tool; +}); diff --git a/infoport/static/js/lib/ajaxUpload/ajaxupload.js b/infoport/static/js/lib/ajaxUpload/ajaxupload.js new file mode 100644 index 0000000..c010a5e --- /dev/null +++ b/infoport/static/js/lib/ajaxUpload/ajaxupload.js @@ -0,0 +1,682 @@ +/** + * AJAX Upload ( http://valums.com/ajax-upload/ ) + * Copyright (c) Andrew Valums + * Licensed under the MIT license + */ +(function () { + /** + * Attaches event to a dom element. + * @param {Element} el + * @param type event name + * @param fn callback This refers to the passed element + */ + function addEvent(el, type, fn){ + if (el.addEventListener) { + el.addEventListener(type, fn, false); + } else if (el.attachEvent) { + el.attachEvent('on' + type, function(){ + fn.call(el); + }); + } else { + throw new Error('not supported or DOM not loaded'); + } + } + + /** + * Attaches resize event to a window, limiting + * number of event fired. Fires only when encounteres + * delay of 100 after series of events. + * + * Some browsers fire event multiple times when resizing + * http://www.quirksmode.org/dom/events/resize.html + * + * @param fn callback This refers to the passed element + */ + function addResizeEvent(fn){ + var timeout; + + addEvent(window, 'resize', function(){ + if (timeout){ + clearTimeout(timeout); + } + timeout = setTimeout(fn, 100); + }); + } + + // Needs more testing, will be rewriten for next version + // getOffset function copied from jQuery lib (http://jquery.com/) + if (document.documentElement.getBoundingClientRect){ + // Get Offset using getBoundingClientRect + // http://ejohn.org/blog/getboundingclientrect-is-awesome/ + var getOffset = function(el){ + var box = el.getBoundingClientRect(); + var doc = el.ownerDocument; + var body = doc.body; + var docElem = doc.documentElement; // for ie + var clientTop = docElem.clientTop || body.clientTop || 0; + var clientLeft = docElem.clientLeft || body.clientLeft || 0; + + // In Internet Explorer 7 getBoundingClientRect property is treated as physical, + // while others are logical. Make all logical, like in IE8. + var zoom = 1; + if (body.getBoundingClientRect) { + var bound = body.getBoundingClientRect(); + zoom = (bound.right - bound.left) / body.clientWidth; + } + + if (zoom > 1) { + clientTop = 0; + clientLeft = 0; + } + + var top = box.top / zoom + (window.pageYOffset || docElem && docElem.scrollTop / zoom || body.scrollTop / zoom) - clientTop, left = box.left / zoom + (window.pageXOffset || docElem && docElem.scrollLeft / zoom || body.scrollLeft / zoom) - clientLeft; + + return { + top: top, + left: left + }; + }; + } else { + // Get offset adding all offsets + var getOffset = function(el){ + var top = 0, left = 0; + do { + top += el.offsetTop || 0; + left += el.offsetLeft || 0; + el = el.offsetParent; + } while (el); + + return { + left: left, + top: top + }; + }; + } + + /** + * Returns left, top, right and bottom properties describing the border-box, + * in pixels, with the top-left relative to the body + * @param {Element} el + * @return {Object} Contains left, top, right,bottom + */ + function getBox(el){ + var left, right, top, bottom; + var offset = getOffset(el); + left = offset.left; + top = offset.top; + + right = left + el.offsetWidth; + bottom = top + el.offsetHeight; + + return { + left: left, + right: right, + top: top, + bottom: bottom + }; + } + + /** + * Helper that takes object literal + * and add all properties to element.style + * @param {Element} el + * @param {Object} styles + */ + function addStyles(el, styles){ + for (var name in styles) { + if (styles.hasOwnProperty(name)) { + el.style[name] = styles[name]; + } + } + } + + /** + * Function places an absolutely positioned + * element on top of the specified element + * copying position and dimentions. + * @param {Element} from + * @param {Element} to + */ + function copyLayout(from, to){ + var box = getBox(from); + + addStyles(to, { + position: 'absolute', + left : box.left + 'px', + top : box.top + 'px', + width : from.offsetWidth + 'px', + height : from.offsetHeight + 'px' + }); + } + + /** + * Creates and returns element from html chunk + * Uses innerHTML to create an element + */ + var toElement = (function(){ + var div = document.createElement('div'); + return function(html){ + div.innerHTML = html; + var el = div.firstChild; + return div.removeChild(el); + }; + })(); + + /** + * Function generates unique id + * @return unique id + */ + var getUID = (function(){ + var id = 0; + return function(){ + return 'ValumsAjaxUpload' + id++; + }; + })(); + + /** + * Get file name from path + * @param {String} file path to file + * @return filename + */ + function fileFromPath(file){ + return file.replace(/.*(\/|\\)/, ""); + } + + /** + * Get file extension lowercase + * @param {String} file name + * @return file extenstion + */ + function getExt(file){ + return (-1 !== file.indexOf('.')) ? file.replace(/.*[.]/, '') : ''; + } + + function hasClass(el, name){ + var re = new RegExp('\\b' + name + '\\b'); + return re.test(el.className); + } + function addClass(el, name){ + if ( ! hasClass(el, name)){ + el.className += ' ' + name; + } + } + function removeClass(el, name){ + var re = new RegExp('\\b' + name + '\\b'); + el.className = el.className.replace(re, ''); + } + + function removeNode(el){ + el.parentNode.removeChild(el); + } + + /** + * Easy styling and uploading + * @constructor + * @param button An element you want convert to + * upload button. Tested dimentions up to 500x500px + * @param {Object} options See defaults below. + */ + window.AjaxUpload = function(button, options){ + this._settings = { + // Location of the server-side upload script + action: 'upload.php', + // File upload name + name: 'userfile', + // Select & upload multiple files at once FF3.6+, Chrome 4+ + multiple: false, + // Additional data to send + data: {}, + // Submit file as soon as it's selected + autoSubmit: true, + // The type of data that you're expecting back from the server. + // html and xml are detected automatically. + // Only useful when you are using json data as a response. + // Set to "json" in that case. + responseType: false, + // Class applied to button when mouse is hovered + hoverClass: 'hover', + // Class applied to button when button is focused + focusClass: 'focus', + // Class applied to button when AU is disabled + disabledClass: 'disabled', + // When user selects a file, useful with autoSubmit disabled + // You can return false to cancel upload + onChange: function(file, extension){ + }, + // Callback to fire before file is uploaded + // You can return false to cancel upload + onSubmit: function(file, extension){ + }, + // Fired when file upload is completed + // WARNING! DO NOT USE "FALSE" STRING AS A RESPONSE! + onComplete: function(file, response){ + } + }; + + // Merge the users options with our defaults + for (var i in options) { + if (options.hasOwnProperty(i)){ + this._settings[i] = options[i]; + } + } + + // button isn't necessary a dom element + if (button.jquery){ + // jQuery object was passed + button = button[0]; + } else if (typeof button == "string") { + if (/^#.*/.test(button)){ + // If jQuery user passes #elementId don't break it + button = button.slice(1); + } + + button = document.getElementById(button); + } + + if ( ! button || button.nodeType !== 1){ + throw new Error("Please make sure that you're passing a valid element"); + } + + if ( button.nodeName.toUpperCase() == 'A'){ + // disable link + addEvent(button, 'click', function(e){ + if (e && e.preventDefault){ + e.preventDefault(); + } else if (window.event){ + window.event.returnValue = false; + } + }); + } + + // DOM element + this._button = button; + // DOM element + this._input = null; + // If disabled clicking on button won't do anything + this._disabled = false; + + // if the button was disabled before refresh if will remain + // disabled in FireFox, let's fix it + this.enable(); + + this._rerouteClicks(); + }; + + // assigning methods to our class + AjaxUpload.prototype = { + setData: function(data){ + this._settings.data = data; + }, + disable: function(){ + addClass(this._button, this._settings.disabledClass); + this._disabled = true; + + var nodeName = this._button.nodeName.toUpperCase(); + if (nodeName == 'INPUT' || nodeName == 'BUTTON'){ + this._button.setAttribute('disabled', 'disabled'); + } + + // hide input + if (this._input){ + if (this._input.parentNode) { + // We use visibility instead of display to fix problem with Safari 4 + // The problem is that the value of input doesn't change if it + // has display none when user selects a file + this._input.parentNode.style.visibility = 'hidden'; + } + } + }, + enable: function(){ + removeClass(this._button, this._settings.disabledClass); + this._button.removeAttribute('disabled'); + this._disabled = false; + + }, + /** + * Creates invisible file input + * that will hover above the button + *
+ */ + _createInput: function(){ + var self = this; + + var input = document.createElement("input"); + input.setAttribute('type', 'file'); + input.setAttribute('name', this._settings.name); + if(this._settings.multiple) input.setAttribute('multiple', 'multiple'); + + addStyles(input, { + 'position' : 'absolute', + // in Opera only 'browse' button + // is clickable and it is located at + // the right side of the input + 'right' : 0, + 'margin' : 0, + 'padding' : 0, + 'fontSize' : '480px', + // in Firefox if font-family is set to + // 'inherit' the input doesn't work + 'fontFamily' : 'sans-serif', + 'cursor' : 'pointer' + }); + + var div = document.createElement("div"); + addStyles(div, { + 'display' : 'block', + 'position' : 'absolute', + 'overflow' : 'hidden', + 'margin' : 0, + 'padding' : 0, + 'opacity' : 0, + // Make sure browse button is in the right side + // in Internet Explorer + 'direction' : 'ltr', + //Max zIndex supported by Opera 9.0-9.2 + 'zIndex': 2147483583 + }); + + // Make sure that element opacity exists. + // Otherwise use IE filter + if ( div.style.opacity !== "0") { + if (typeof(div.filters) == 'undefined'){ + throw new Error('Opacity not supported by the browser'); + } + div.style.filter = "alpha(opacity=0)"; + } + + addEvent(input, 'change', function(){ + + if ( ! input || input.value === ''){ + return; + } + + // Get filename from input, required + // as some browsers have path instead of it + var file = fileFromPath(input.value); + + if (false === self._settings.onChange.call(self, file, getExt(file))){ + self._clearInput(); + return; + } + + // Submit form when value is changed + if (self._settings.autoSubmit) { + self.submit(); + } + }); + + addEvent(input, 'mouseover', function(){ + addClass(self._button, self._settings.hoverClass); + }); + + addEvent(input, 'mouseout', function(){ + removeClass(self._button, self._settings.hoverClass); + removeClass(self._button, self._settings.focusClass); + + if (input.parentNode) { + // We use visibility instead of display to fix problem with Safari 4 + // The problem is that the value of input doesn't change if it + // has display none when user selects a file + input.parentNode.style.visibility = 'hidden'; + } + }); + + addEvent(input, 'focus', function(){ + addClass(self._button, self._settings.focusClass); + }); + + addEvent(input, 'blur', function(){ + removeClass(self._button, self._settings.focusClass); + }); + + div.appendChild(input); + document.body.appendChild(div); + + this._input = input; + }, + _clearInput : function(){ + if (!this._input){ + return; + } + + // this._input.value = ''; Doesn't work in IE6 + removeNode(this._input.parentNode); + this._input = null; + this._createInput(); + + removeClass(this._button, this._settings.hoverClass); + removeClass(this._button, this._settings.focusClass); + }, + /** + * Function makes sure that when user clicks upload button, + * the this._input is clicked instead + */ + _rerouteClicks: function(){ + var self = this; + + // IE will later display 'access denied' error + // if you use using self._input.click() + // other browsers just ignore click() + + addEvent(self._button, 'mouseover', function(){ + if (self._disabled){ + return; + } + + if ( ! self._input){ + self._createInput(); + } + + var div = self._input.parentNode; + copyLayout(self._button, div); + div.style.visibility = 'visible'; + + }); + + + // commented because we now hide input on mouseleave + /** + * When the window is resized the elements + * can be misaligned if button position depends + * on window size + */ + //addResizeEvent(function(){ + // if (self._input){ + // copyLayout(self._button, self._input.parentNode); + // } + //}); + + }, + /** + * Creates iframe with unique name + * @return {Element} iframe + */ + _createIframe: function(){ + // We can't use getTime, because it sometimes return + // same value in safari :( + var id = getUID(); + + // We can't use following code as the name attribute + // won't be properly registered in IE6, and new window + // on form submit will open + // var iframe = document.createElement('iframe'); + // iframe.setAttribute('name', id); + + var iframe = toElement('").css("width","100%"),c.textarea=K('').css("width","100%"),c.tabIndex=isNaN(parseInt(a.tabIndex,10))?c.srcElement.attr("tabindex"):parseInt(a.tabIndex,10),c.iframe.attr("tabindex",c.tabIndex),c.textarea.attr("tabindex",c.tabIndex),c.width&&c.setWidth(c.width),c.height&&c.setHeight(c.height),c.designMode?c.textarea.hide():c.iframe.hide(),h&&c.iframe.bind("load",function(){c.iframe.unbind("load"),_IE?b():setTimeout(b,0)}),c.div.append(c.iframe),c.div.append(c.textarea),c.srcElement.hide(),!h&&b()},setWidth:function(a){var b=this;return a=_addUnit(a),b.width=a,b.div.css("width",a),b},setHeight:function(a){var b=this;return a=_addUnit(a),b.height=a,b.div.css("height",a),b.iframe.css("height",a),(_IE&&8>_V||_QUIRKS)&&(a=_addUnit(_removeUnit(a)-2)),b.textarea.css("height",a),b},remove:function(){var a=this,b=a.doc;K(b.body).unbind(),K(b).unbind(),K(a.win).unbind(),a._mousedownHandler&&K(document).unbind("mousedown",a._mousedownHandler),_elementVal(a.srcElement,a.html()),a.srcElement.show(),a.iframe.unbind(),a.textarea.unbind(),KEdit.parent.remove.call(a)},html:function(a,b){var c=this,d=c.doc;if(c.designMode){var e=d.body;return a===undefined?(a=b?""+e.parentNode.innerHTML+"":e.innerHTML,c.beforeGetHtml&&(a=c.beforeGetHtml(a)),_GECKO&&"
"==a&&(a=""),a):(c.beforeSetHtml&&(a=c.beforeSetHtml(a)),_IE&&_V>=9&&(a=a.replace(/(<.*?checked=")checked(".*>)/gi,"$1$2")),K(e).html(a),c.afterSetHtml&&c.afterSetHtml(),c)}return a===undefined?c.textarea.val():(c.textarea.val(a),c)},design:function(a){var b,c=this;if(a===undefined?!c.designMode:a){if(!c.designMode){b=c.html(),c.designMode=!0,c.textarea.hide(),c.html(b);var d=c.iframe,e=_removeUnit(c.height);d.height(e-2),d.show(),setTimeout(function(){d.height(e)},0)}}else c.designMode&&(b=c.html(),c.designMode=!1,c.html(b),c.iframe.hide(),c.textarea.show());return c.focus()},focus:function(){var a=this;return a.designMode?a.win.focus():a.textarea[0].focus(),a},blur:function(){var a=this;if(_IE){var b=K('',a.div);a.div.append(b),b[0].focus(),b.remove()}else a.designMode?a.win.blur():a.textarea[0].blur();return a},afterChange:function(a){function b(b){setTimeout(function(){a(b)},1)}var c=this,d=c.doc,e=d.body;return K(d).keyup(function(b){b.ctrlKey||b.altKey||!_CHANGE_KEY_MAP[b.which]||a(b)}),K(d).mouseup(a).contextmenu(a),K(c.win).blur(a),K(e).bind("paste",b),K(e).bind("cut",b),c}}),K.EditClass=KEdit,K.edit=_edit,K.iframeDoc=_iframeDoc,_extend(KToolbar,KWidget,{init:function(a){function b(a){var b=K(a);return b.hasClass("ke-outline")?b:b.hasClass("ke-toolbar-icon")?b.parent():void 0}function c(a,c){var d=b(a.target);if(d){if(d.hasClass("ke-disabled"))return;if(d.hasClass("ke-selected"))return;d[c]("ke-on")}}var d=this;KToolbar.parent.init.call(d,a),d.disableMode=_undef(a.disableMode,!1),d.noDisableItemMap=_toMap(_undef(a.noDisableItems,[])),d._itemMap={},d.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",function(a){a.preventDefault()}).attr("unselectable","on"),d.div.mouseover(function(a){c(a,"addClass")}).mouseout(function(a){c(a,"removeClass")}).click(function(a){var c=b(a.target);if(c){if(c.hasClass("ke-disabled"))return;d.options.click.call(this,a,c.attr("data-name"))}})},get:function(a){return this._itemMap[a]?this._itemMap[a]:this._itemMap[a]=K("span.ke-icon-"+a,this.div).parent()},select:function(a){return _selectToolbar.call(this,a,function(a){a.addClass("ke-selected")}),self},unselect:function(a){return _selectToolbar.call(this,a,function(a){a.removeClass("ke-selected").removeClass("ke-on")}),self},enable:function(a){var b=this,c=a.get?a:b.get(a);return c&&(c.removeClass("ke-disabled"),c.opacity(1)),b},disable:function(a){var b=this,c=a.get?a:b.get(a);return c&&(c.removeClass("ke-selected").addClass("ke-disabled"),c.opacity(.5)),b},disableAll:function(a,b){var c=this,d=c.noDisableItemMap;return b&&(d=_toMap(b)),(a===undefined?!c.disableMode:a)?(K("span.ke-outline",c.div).each(function(){var a=K(this),b=a[0].getAttribute("data-name",2);d[b]||c.disable(a)}),c.disableMode=!0):(K("span.ke-outline",c.div).each(function(){var a=K(this),b=a[0].getAttribute("data-name",2);d[b]||c.enable(a)}),c.disableMode=!1),c}}),K.ToolbarClass=KToolbar,K.toolbar=_toolbar,_extend(KMenu,KWidget,{init:function(a){var b=this;a.z=a.z||811213,KMenu.parent.init.call(b,a),b.centerLineMode=_undef(a.centerLineMode,!0),b.div.addClass("ke-menu").bind("click,mousedown",function(a){a.stopPropagation()}).attr("unselectable","on")},addItem:function(a){var b=this;if("-"===a.title)return void b.div.append(K('
'));var c=K('
'),d=K('
'),e=K('
'),f=_addUnit(a.height),g=_undef(a.iconClass,"");b.div.append(c),f&&(c.css("height",f),e.css("line-height",f));var h;return b.centerLineMode&&(h=K('
'),f&&h.css("height",f)),c.mouseover(function(){K(this).addClass("ke-menu-item-on"),h&&h.addClass("ke-menu-item-center-on")}).mouseout(function(){K(this).removeClass("ke-menu-item-on"),h&&h.removeClass("ke-menu-item-center-on")}).click(function(b){a.click.call(K(this)),b.stopPropagation()}).append(d),h&&c.append(h),c.append(e),a.checked&&(g="ke-icon-checked"),""!==g&&d.html(''),e.html(a.title),b},remove:function(){var a=this;return a.options.beforeRemove&&a.options.beforeRemove.call(a),K(".ke-menu-item",a.div[0]).unbind(),KMenu.parent.remove.call(a),a}}),K.MenuClass=KMenu,K.menu=_menu,_extend(KColorPicker,KWidget,{init:function(a){var b=this;a.z=a.z||811213,KColorPicker.parent.init.call(b,a);var c=a.colors||[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]];b.selectedColor=(a.selectedColor||"").toLowerCase(),b._cells=[],b.div.addClass("ke-colorpicker").bind("click,mousedown",function(a){a.stopPropagation()}).attr("unselectable","on");var d=b.doc.createElement("table");b.div.append(d),d.className="ke-colorpicker-table",d.cellPadding=0,d.cellSpacing=0,d.border=0;var e=d.insertRow(0),f=e.insertCell(0);f.colSpan=c[0].length,b._addAttr(f,"","ke-colorpicker-cell-top");for(var g=0;g').css("background-color",b)):a.html(d.options.noColor),K(a).attr("unselectable","on"),d._cells.push(a)},remove:function(){var a=this;return _each(a._cells,function(){this.unbind()}),KColorPicker.parent.remove.call(a),a}}),K.ColorPickerClass=KColorPicker,K.colorpicker=_colorpicker,_extend(KUploadButton,{init:function(a){var b=this,c=K(a.button),d=a.fieldName||"file",e=a.url||"",f=c.val(),g=a.extraParams||{},h=c[0].className||"",i=a.target||"kindeditor_upload_iframe_"+(new Date).getTime();a.afterError=a.afterError||function(a){alert(a)};var j=[];for(var k in g)j.push('');var l=['
',a.target?"":'',a.form?'
':'
','',j.join(""),'',"",'',a.form?"
":"","
"].join(""),m=K(l,c.doc);c.hide(),c.before(m),b.div=m,b.button=c,b.iframe=a.target?K('iframe[name="'+i+'"]'):K("iframe",m),b.form=a.form?K(a.form):K("form",m),b.fileBox=K(".ke-upload-file",m);var n=a.width||K(".ke-button-common",m).width();K(".ke-upload-area",m).width(n),b.options=a},submit:function(){var a=this,b=a.iframe;return b.bind("load",function(){b.unbind();var c=document.createElement("form");a.fileBox.before(c),K(c).append(a.fileBox),c.reset(),K(c).remove(!0);var d,e=K.iframeDoc(b),f=e.getElementsByTagName("pre")[0],g="";g=f?f.innerHTML:e.body.innerHTML,g=_unescape(g),b[0].src="javascript:false";try{d=K.json(g)}catch(h){a.options.afterError.call(a,""+e.body.parentNode.innerHTML+"")}d&&a.options.afterUpload.call(a,d)}),a.form[0].submit(),a},remove:function(){var a=this;return a.fileBox&&a.fileBox.unbind(),a.iframe.remove(),a.div.remove(),a.button.show(),a}}),K.UploadButtonClass=KUploadButton,K.uploadbutton=_uploadbutton,_extend(KDialog,KWidget,{init:function(a){var b=this,c=_undef(a.shadowMode,!0);a.z=a.z||811213,a.shadowMode=!1,a.autoScroll=_undef(a.autoScroll,!0),KDialog.parent.init.call(b,a);var d=a.title,e=K(a.body,b.doc),f=a.previewBtn,g=a.yesBtn,h=a.noBtn,i=a.closeBtn,j=_undef(a.showMask,!0);b.div.addClass("ke-dialog").bind("click,mousedown",function(a){a.stopPropagation()});var k=K('
').appendTo(b.div);_IE&&7>_V?b.iframeMask=K('').appendTo(b.div):c&&K('
').appendTo(b.div);var l=K('
');k.append(l),l.html(d),b.closeIcon=K('').click(i.click),l.append(b.closeIcon),b.draggable({clickEl:l,beforeDrag:a.beforeDrag});var m=K('
');k.append(m),m.append(e);var n=K('');if((f||g||h)&&k.append(n),_each([{btn:f,name:"preview"},{btn:g,name:"yes"},{btn:h,name:"no"}],function(){if(this.btn){var a=_createButton(this.btn);a.addClass("ke-dialog-"+this.name),n.append(a)}}),b.height&&m.height(_removeUnit(b.height)-l.height()-n.height()),b.div.width(b.div.width()),b.div.height(b.div.height()),b.mask=null,j){var o=_docElement(b.doc),p=Math.max(o.scrollWidth,o.clientWidth),q=Math.max(o.scrollHeight,o.clientHeight);b.mask=_widget({x:0,y:0,z:b.z-1,cls:"ke-dialog-mask",width:p,height:q})}b.autoPos(b.div.width(),b.div.height()),b.footerDiv=n,b.bodyDiv=m,b.headerDiv=l,b.isLoading=!1},setMaskIndex:function(a){var b=this;b.mask.div.css("z-index",a)},showLoading:function(a){a=_undef(a,"");var b=this,c=b.bodyDiv;return b.loading=K('
'+a+"
").width(c.width()).height(c.height()).css("top",b.headerDiv.height()+"px"),c.css("visibility","hidden").after(b.loading),b.isLoading=!0,b},hideLoading:function(){return this.loading&&this.loading.remove(),this.bodyDiv.css("visibility","visible"),this.isLoading=!1,this},remove:function(){var a=this;return a.options.beforeRemove&&a.options.beforeRemove.call(a),a.mask&&a.mask.remove(),a.iframeMask&&a.iframeMask.remove(),a.closeIcon.unbind(),K("input",a.div).unbind(),K("button",a.div).unbind(),a.footerDiv.unbind(),a.bodyDiv.unbind(),a.headerDiv.unbind(),K("iframe",a.div).each(function(){K(this).remove()}),KDialog.parent.remove.call(a),a}}),K.DialogClass=KDialog,K.dialog=_dialog,K.tabs=_tabs,K.loadScript=_loadScript,K.loadStyle=_loadStyle,K.ajax=_ajax;var _plugins={},_language={};KEditor.prototype={lang:function(a){return _lang(a,this.langType)},loadPlugin:function(a,b){var c=this,d=this._pluginStatus;return d||(d=this._pluginStatus={}),_plugins[a]?_isFunction(_plugins[a])?(d[a]||(_plugins[a].call(c,KindEditor),d[a]="inited"),b&&b.call(c),c):(setTimeout(function(){c.loadPlugin(a,b)},100),c):(_plugins[a]="loading",_loadScript(c.pluginsPath+a+"/"+a+".js?ver="+encodeURIComponent(K.DEBUG?_TIME:_VERSION),function(){setTimeout(function(){_plugins[a]&&c.loadPlugin(a,b)},0)}),c)},handler:function(a,b){var c=this;return c._handlers[a]||(c._handlers[a]=[]),_isFunction(b)?(c._handlers[a].push(b),c):(_each(c._handlers[a],function(){b=this.call(c,b)}),b)},clickToolbar:function(a,b){var c=this,d="clickToolbar"+a;return b===undefined?c._handlers[d]?c.handler(d):(c.loadPlugin(a,function(){c.handler(d)}),c):c.handler(d,b)},updateState:function(){var a=this;return _each("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","),function(b,c){a.cmd.state(c)?a.toolbar.select(c):a.toolbar.unselect(c)}),a},addContextmenu:function(a){return this._contextmenus.push(a),this},afterCreate:function(a){return this.handler("afterCreate",a)},beforeRemove:function(a){return this.handler("beforeRemove",a)},beforeGetHtml:function(a){return this.handler("beforeGetHtml",a)},beforeSetHtml:function(a){return this.handler("beforeSetHtml",a)},afterSetHtml:function(a){return this.handler("afterSetHtml",a)},create:function(){function a(){return 0===i.height()?void setTimeout(a,100):void b.resize(d,e,!1)}var b=this,c=b.fullscreenMode;if(b.isCreated)return b;if(b.srcElement.data("kindeditor"))return b;b.srcElement.data("kindeditor","true"),_docElement().style.overflow=c?"hidden":"";var d=c?_docElement().clientWidth+"px":b.width,e=c?_docElement().clientHeight+"px":b.height;(_IE&&8>_V||_QUIRKS)&&(e=_addUnit(_removeUnit(e)+2));var f=b.container=K(b.layout);c?K(document.body).append(f):b.srcElement.before(f);var g=K(".toolbar",f),h=K(".edit",f),i=b.statusbar=K(".statusbar",f);f.removeClass("container").addClass("ke-container ke-container-"+b.themeType).css("width",d),c?(f.css({position:"absolute",left:0,top:0,"z-index":811211}),_GECKO||(b._scrollPos=_getScrollPos()),window.scrollTo(0,0),K(document.body).css({height:"1px",overflow:"hidden"}),K(document.body.parentNode).css("overflow","hidden"),b._fullscreenExecuted=!0):(b._fullscreenExecuted&&(K(document.body).css({height:"",overflow:""}),K(document.body.parentNode).css("overflow","")),b._scrollPos&&window.scrollTo(b._scrollPos.x,b._scrollPos.y));var j=[];K.each(b.items,function(a,c){"|"==c?j.push(''):"/"==c?j.push('
'):(j.push(''),j.push(''))});var k=b.toolbar=_toolbar({src:g,html:j.join(""),noDisableItems:b.noDisableItems,click:function(a,c){if(a.stop(),b.menu){var d=b.menu.name;if(b.hideMenu(),d===c)return}b.clickToolbar(c)}}),l=_removeUnit(e)-k.div.height(),m=b.edit=_edit({height:l>0&&_removeUnit(e)>b.minHeight?l:b.minHeight,src:h,srcElement:b.srcElement,designMode:b.designMode,themesPath:b.themesPath,bodyClass:b.bodyClass,cssPath:b.cssPath,cssData:b.cssData,beforeGetHtml:function(a){return a=b.beforeGetHtml(a),a=_removeBookmarkTag(_removeTempTag(a)),_formatHtml(a,b.filterMode?b.htmlTags:null,b.urlType,b.wellFormatMode,b.indentChar)},beforeSetHtml:function(a){return a=_formatHtml(a,b.filterMode?b.htmlTags:null,"",!1),b.beforeSetHtml(a)},afterSetHtml:function(){b.edit=m=this,b.afterSetHtml()},afterCreate:function(){if(b.edit=m=this,b.cmd=m.cmd,b._docMousedownFn=function(){b.menu&&b.hideMenu()},K(m.doc,document).mousedown(b._docMousedownFn),_bindContextmenuEvent.call(b),_bindNewlineEvent.call(b),_bindTabEvent.call(b),_bindFocusEvent.call(b),m.afterChange(function(){m.designMode&&(b.updateState(),b.addBookmark(),b.options.afterChange&&b.options.afterChange.call(b))}),m.textarea.keyup(function(a){a.ctrlKey||a.altKey||!_INPUT_KEY_MAP[a.which]||b.options.afterChange&&b.options.afterChange.call(b)}),b.readonlyMode&&b.readonly(),b.isCreated=!0,""===b.initContent&&(b.initContent=b.html()),b._undoStack.length>0){var a=b._undoStack.pop();a.start&&(b.html(a.html),m.cmd.range.moveToBookmark(a),b.select())}b.afterCreate(),b.options.afterCreate&&b.options.afterCreate.call(b)}});return i.removeClass("statusbar").addClass("ke-statusbar").append('').append(''),b._fullscreenResizeHandler&&(K(window).unbind("resize",b._fullscreenResizeHandler),b._fullscreenResizeHandler=null),a(),c?(b._fullscreenResizeHandler=function(){b.isCreated&&b.resize(_docElement().clientWidth,_docElement().clientHeight,!1)},K(window).bind("resize",b._fullscreenResizeHandler),k.select("fullscreen"),i.first().css("visibility","hidden"),i.last().css("visibility","hidden")):(_GECKO&&K(window).bind("scroll",function(){b._scrollPos=_getScrollPos()}),b.resizeType>0?_drag({moveEl:f,clickEl:i,moveFn:function(a,c,d,e,f,g){e+=g,b.resize(null,e)}}):i.first().css("visibility","hidden"),2===b.resizeType?_drag({moveEl:f,clickEl:i.last(),moveFn:function(a,c,d,e,f,g){d+=f,e+=g,b.resize(d,e)}}):i.last().css("visibility","hidden")),b},remove:function(){var a=this;return a.isCreated?(a.beforeRemove(),a.srcElement.data("kindeditor",""),a.menu&&a.hideMenu(),_each(a.dialogs,function(){a.hideDialog()}),K(document).unbind("mousedown",a._docMousedownFn),a.toolbar.remove(),a.edit.remove(),a.statusbar.last().unbind(),a.statusbar.unbind(),a.container.remove(),a.container=a.toolbar=a.edit=a.menu=null,a.dialogs=[],a.isCreated=!1,a):a},resize:function(a,b,c){var d=this;return c=_undef(c,!0),a&&(/%/.test(a)||(a=_removeUnit(a),a=a/gi,"").replace(/ /gi," ")):b.html(_escape(a))},isEmpty:function(){return""===_trim(this.text().replace(/\r\n|\n|\r/,""))},isDirty:function(){return _trim(this.initContent.replace(/\r\n|\n|\r|t/g,""))!==_trim(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var a=this.isCreated?this.cmd.range.html():"";return a=_removeBookmarkTag(_removeTempTag(a))},count:function(a){var b=this;return a=(a||"html").toLowerCase(),"html"===a?b.html().length:"text"===a?b.text().replace(/<(?:img|embed).*?>/gi,"K").replace(/\r\n|\n|\r/g,"").length:0},exec:function(a){a=a.toLowerCase();var b=this,c=b.cmd,d=_inArray(a,"selectall,copy,paste,print".split(","))<0;return d&&b.addBookmark(!1),c[a].apply(c,_toArray(arguments,1)),d&&(b.updateState(),b.addBookmark(!1),b.options.afterChange&&b.options.afterChange.call(b)),b},insertHtml:function(a,b){return this.isCreated?(a=this.beforeSetHtml(a),this.exec("inserthtml",a,b),this):this},appendHtml:function(a){if(this.html(this.html()+a),this.isCreated){var b=this.cmd;b.range.selectNodeContents(b.doc.body).collapse(!1),b.select()}return this},sync:function(){return _elementVal(this.srcElement,this.html()),this},focus:function(){return this.isCreated?this.edit.focus():this.srcElement[0].focus(),this},blur:function(){return this.isCreated?this.edit.blur():this.srcElement[0].blur(),this},addBookmark:function(a){a=_undef(a,!0);var b,c=this,d=c.edit,e=d.doc.body,f=_removeTempTag(e.innerHTML);if(a&&c._undoStack.length>0){var g=c._undoStack[c._undoStack.length-1];if(Math.abs(f.length-_removeBookmarkTag(g.html).length)0){var c=b.dialogs[0],d=b.dialogs[b.dialogs.length-1];c.setMaskIndex(d.z+2),a.z=d.z+3,a.showMask=!1}var e=_dialog(a);return b.dialogs.push(e),e},hideDialog:function(){var a=this;if(a.dialogs.length>0&&a.dialogs.pop().remove(),a.dialogs.length>0){var b=a.dialogs[0],c=a.dialogs[a.dialogs.length-1];b.setMaskIndex(c.z-1)}return a},errorDialog:function(a){var b=this,c=b.createDialog({width:750,title:b.lang("uploadError"),body:'
'}),d=K("iframe",c.div),e=K.iframeDoc(d);return e.open(),e.write(a),e.close(),K(e.body).css("background-color","#FFF"),d[0].contentWindow.focus(),b}},_instances=[],K.remove=function(a){_eachEditor(a,function(a){this.remove(),_instances.splice(a,1)})},K.sync=function(a){_eachEditor(a,function(){this.sync()})},K.html=function(a,b){_eachEditor(a,function(){this.html(b)})},K.insertHtml=function(a,b){_eachEditor(a,function(){this.insertHtml(b)})},K.appendHtml=function(a,b){_eachEditor(a,function(){this.appendHtml(b)})},_IE&&7>_V&&_nativeCommand(document,"BackgroundImageCache",!0),K.EditorClass=KEditor,K.editor=_editor,K.create=_create,K.instances=_instances,K.plugin=_plugin,K.lang=_lang,_plugin("core",function(a){var b=this,c={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};if(b.afterSetHtml(function(){b.options.afterChange&&b.options.afterChange.call(b)}),b.afterCreate(function(){if("form"==b.syncType){for(var c=a(b.srcElement),d=!1;c=c.parent();)if("form"==c.name){d=!0;break}if(d){c.bind("submit",function(){b.sync(),a(window).bind("unload",function(){b.edit.textarea.remove()})});var e=a('[type="reset"]',c);e.click(function(){b.html(b.initContent),b.cmd.selection()}),b.beforeRemove(function(){c.unbind(),e.unbind()})}}}),b.clickToolbar("source",function(){b.edit.designMode?(b.toolbar.disableAll(!0),b.edit.design(!1),b.toolbar.select("source")):(b.toolbar.disableAll(!1),b.edit.design(!0),b.toolbar.unselect("source"),_GECKO?setTimeout(function(){b.cmd.selection()},0):b.cmd.selection()),b.designMode=b.edit.designMode}),b.afterCreate(function(){b.designMode||b.toolbar.disableAll(!0).select("source")}),b.clickToolbar("fullscreen",function(){b.fullscreen()}),b.fullscreenShortcut){var d=!1;b.afterCreate(function(){if(a(b.edit.doc,b.edit.textarea).keyup(function(a){27==a.which&&setTimeout(function(){b.fullscreen()},0)}),d){if(_IE&&!b.designMode)return;b.focus()}d||(d=!0)})}_each("undo,redo".split(","),function(a,d){c[d]&&b.afterCreate(function(){_ctrl(this.edit.doc,c[d],function(){b.clickToolbar(d)})}),b.clickToolbar(d,function(){b[d]()})}),b.clickToolbar("formatblock",function(){var a=b.lang("formatblock.formatBlock"),c={h1:28,h2:24,h3:18,H4:14,p:12},d=b.cmd.val("formatblock"),e=b.createMenu({name:"formatblock",width:"en"==b.langType?200:150});_each(a,function(a,f){var g="font-size:"+c[a]+"px;";"h"===a.charAt(0)&&(g+="font-weight:bold;"),e.addItem({title:''+f+"",height:c[a]+12,checked:d===a||d===f,click:function(){b.select().exec("formatblock","<"+a+">").hideMenu()}})})}),b.clickToolbar("fontname",function(){var a=b.cmd.val("fontname"),c=b.createMenu({name:"fontname",width:150});_each(b.lang("fontname.fontName"),function(d,e){c.addItem({title:''+e+"",checked:a===d.toLowerCase()||a===e.toLowerCase(),click:function(){b.exec("fontname",d).hideMenu()}})})}),b.clickToolbar("fontsize",function(){var a=b.cmd.val("fontsize"),c=b.createMenu({name:"fontsize",width:150});_each(b.fontSizeTable,function(d,e){c.addItem({title:''+e+"",height:_removeUnit(e)+12,checked:a===e,click:function(){b.exec("fontsize",e).hideMenu()}})})}),_each("forecolor,hilitecolor".split(","),function(a,c){b.clickToolbar(c,function(){b.createMenu({name:c,selectedColor:b.cmd.val(c)||"default",colors:b.colorTable,click:function(a){b.exec(c,a).hideMenu()}})})}),_each("cut,copy,paste".split(","),function(a,c){b.clickToolbar(c,function(){b.focus();try{b.exec(c,null)}catch(a){alert(b.lang(c+"Error"))}})}),b.clickToolbar("about",function(){var a='
KindEditor '+_VERSION+'
Copyright © kindsoft.net All rights reserved.
';b.createDialog({name:"about",width:350,title:b.lang("about"),body:a})}),b.plugin.getSelectedLink=function(){return b.cmd.commonAncestor("a")},b.plugin.getSelectedImage=function(){return _getImageFromRange(b.edit.cmd.range,function(a){return!/^ke-\w+$/i.test(a[0].className)})},b.plugin.getSelectedFlash=function(){return _getImageFromRange(b.edit.cmd.range,function(a){return"ke-flash"==a[0].className})},b.plugin.getSelectedMedia=function(){return _getImageFromRange(b.edit.cmd.range,function(a){return"ke-media"==a[0].className||"ke-rm"==a[0].className})},b.plugin.getSelectedAnchor=function(){return _getImageFromRange(b.edit.cmd.range,function(a){return"ke-anchor"==a[0].className})},_each("link,image,flash,media,anchor".split(","),function(a,c){var d=c.charAt(0).toUpperCase()+c.substr(1);_each("edit,delete".split(","),function(a,e){b.addContextmenu({title:b.lang(e+d),click:function(){b.loadPlugin(c,function(){b.plugin[c][e](),b.hideMenu()})},cond:b.plugin["getSelected"+d],width:150,iconClass:"edit"==e?"ke-icon-"+c:undefined}) +}),b.addContextmenu({title:"-"})}),b.plugin.getSelectedTable=function(){return b.cmd.commonAncestor("table")},b.plugin.getSelectedRow=function(){return b.cmd.commonAncestor("tr")},b.plugin.getSelectedCell=function(){return b.cmd.commonAncestor("td")},_each("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,insert,delete".split(","),function(a,c){var d=_inArray(c,["prop","delete"])<0?b.plugin.getSelectedCell:b.plugin.getSelectedTable;b.addContextmenu({title:b.lang("table"+c),click:function(){b.loadPlugin("table",function(){b.plugin.table[c](),b.hideMenu()})},cond:d,width:170,iconClass:"ke-icon-table"+c})}),b.addContextmenu({title:"-"}),_each("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","),function(a,d){c[d]&&b.afterCreate(function(){_ctrl(this.edit.doc,c[d],function(){b.cmd.selection(),b.clickToolbar(d)})}),b.clickToolbar(d,function(){b.focus().exec(d,null)})}),b.afterCreate(function(){function c(){d.range.moveToBookmark(e),d.select(),_WEBKIT&&(a("div."+h,f).each(function(){a(this).after("
").remove(!0)}),a("span.Apple-style-span",f).remove(!0),a("span.Apple-tab-span",f).remove(!0),a("span[style]",f).each(function(){"nowrap"==a(this).css("white-space")&&a(this).remove(!0)}),a("meta",f).remove());var c=f[0].innerHTML;f.remove(),""!==c&&(_WEBKIT&&(c=c.replace(/(
)\1/gi,"$1")),2===b.pasteType&&(c=c.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/gi,""),/schemas-microsoft-com|worddocument|mso-\w+/i.test(c)?c=_clearMsWord(c,b.filterMode?b.htmlTags:a.options.htmlTags):(c=_formatHtml(c,b.filterMode?b.htmlTags:null),c=b.beforeSetHtml(c))),1===b.pasteType&&(c=c.replace(/ /gi," "),c=c.replace(/\n\s*\n/g,"\n"),c=c.replace(/]*>/gi,"\n"),c=c.replace(/<\/p>]*>/gi,"\n"),c=c.replace(/<[^>]+>/g,""),c=c.replace(/ {2}/g,"  "),"p"==b.newlineTag?/\n/.test(c)&&(c=c.replace(/^/,"

").replace(/$/,"

").replace(/\n/g,"

")):c=c.replace(/\n/g,"
$&")),b.insertHtml(c,!0))}var d,e,f,g=b.edit.doc,h="__kindeditor_paste__",i=!1;a(g.body).bind("paste",function(j){if(0===b.pasteType)return void j.stop();if(!i){if(i=!0,a("div."+h,g).remove(),d=b.cmd.selection(),e=d.range.createBookmark(),f=a('

',g).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:a(e.start).pos().y+"px","white-space":"nowrap"}),a(g.body).append(f),_IE){var k=d.range.get(!0);k.moveToElementText(f[0]),k.select(),k.execCommand("paste"),j.preventDefault()}else d.range.selectNodeContents(f[0]),d.select(),f[0].tabIndex=-1,f[0].focus();setTimeout(function(){c(),i=!1},0)}})}),b.beforeGetHtml(function(a){return _IE&&8>=_V&&(a=a.replace(/]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(a,b){return unescape(b)}),a=a.replace(/(]*)?>)/gi,function(a,b,c){return/\s+type="[^"]+"/i.test(a)?a:b+' type="text"'+c})),a.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/gi,function(a,b,c,d){return b+_unescape(c).replace(/\s+/g," ")+d}).replace(/]*class="?ke-(flash|rm|media)"?[^>]*>/gi,function(a){var b=_getAttrList(a),c=_getCssList(b.style||""),d=_mediaAttrs(b["data-ke-tag"]),e=_undef(c.width,""),f=_undef(c.height,"");return/px/i.test(e)&&(e=_removeUnit(e)),/px/i.test(f)&&(f=_removeUnit(f)),d.width=_undef(b.width,e),d.height=_undef(b.height,f),_mediaEmbed(d)}).replace(/]*class="?ke-anchor"?[^>]*>/gi,function(a){var b=_getAttrList(a);return''}).replace(/]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(a,b,c){return""+unescape(c)+""}).replace(/]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(a,b,c){return""+unescape(c)+""}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/gi,function(a,b,c){return a=a.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(a,b,d){return b+_unescape(c)+d}),a=a.replace(/\s+data-ke-src="[^"]*"/i,"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/gi,function(a,b,c){return b+c})}),b.beforeSetHtml(function(a){return _IE&&8>=_V&&(a=a.replace(/]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/gi,function(a){var b=_getAttrList(a),c=_getCssList(b.style||"");return"none"==c.display?'
':a})),a.replace(/]*type="([^"]+)"[^>]*>(?:<\/embed>)?/gi,function(a){var c=_getAttrList(a);return c.src=_undef(c.src,""),c.width=_undef(c.width,0),c.height=_undef(c.height,0),_mediaImg(b.themesPath+"common/blank.gif",c)}).replace(/]*name="([^"]+)"[^>]*>(?:<\/a>)?/gi,function(a){var c=_getAttrList(a);return c.href!==undefined?a:''}).replace(/]*)>([\s\S]*?)<\/script>/gi,function(a,b,c){return'
'+escape(c)+"
"}).replace(/]*)>([\s\S]*?)<\/noscript>/gi,function(a,b,c){return'
'+escape(c)+"
"}).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/gi,function(a,b,c,d,e){return a.match(/\sdata-ke-src="[^"]*"/i)?a:a=b+c+'="'+d+'" data-ke-src="'+_escape(d)+'"'+e}).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/gi,function(a,b,c){return b+"data-ke-"+c}).replace(/]*\s+border="0"[^>]*>/gi,function(a){return a.indexOf("ke-zeroborder")>=0?a:_addClassToTag(a,"ke-zeroborder")})})})}}(window),KindEditor.lang({source:"HTML代码",preview:"预览",undo:"后退(Ctrl+Z)",redo:"前进(Ctrl+Y)",cut:"剪切(Ctrl+X)",copy:"复制(Ctrl+C)",paste:"粘贴(Ctrl+V)",plainpaste:"粘贴为无格式文本",wordpaste:"从Word粘贴",selectall:"全选(Ctrl+A)",justifyleft:"左对齐",justifycenter:"居中",justifyright:"右对齐",justifyfull:"两端对齐",insertorderedlist:"编号",insertunorderedlist:"项目符号",indent:"增加缩进",outdent:"减少缩进",subscript:"下标",superscript:"上标",formatblock:"段落",fontname:"字体",fontsize:"文字大小",forecolor:"文字颜色",hilitecolor:"文字背景",bold:"粗体(Ctrl+B)",italic:"斜体(Ctrl+I)",underline:"下划线(Ctrl+U)",strikethrough:"删除线",removeformat:"删除格式",image:"图片",multiimage:"批量图片上传",flash:"Flash",media:"视音频",table:"表格",tablecell:"单元格",hr:"插入横线",emoticons:"插入表情",link:"超级链接",unlink:"取消超级链接",fullscreen:"全屏显示",about:"关于",print:"打印(Ctrl+P)",filemanager:"文件空间",code:"插入程序代码",map:"Google地图",baidumap:"百度地图",lineheight:"行距",clearhtml:"清理HTML代码",pagebreak:"插入分页符",quickformat:"一键排版",insertfile:"插入文件",template:"插入模板",anchor:"锚点",yes:"确定",no:"取消",close:"关闭",editImage:"图片属性",deleteImage:"删除图片",editFlash:"Flash属性",deleteFlash:"删除Flash",editMedia:"视音频属性",deleteMedia:"删除视音频",editLink:"超级链接属性",deleteLink:"取消超级链接",editAnchor:"锚点属性",deleteAnchor:"删除锚点",tableprop:"表格属性",tablecellprop:"单元格属性",tableinsert:"插入表格",tabledelete:"删除表格",tablecolinsertleft:"左侧插入列",tablecolinsertright:"右侧插入列",tablerowinsertabove:"上方插入行",tablerowinsertbelow:"下方插入行",tablerowmerge:"向下合并单元格",tablecolmerge:"向右合并单元格",tablerowsplit:"拆分行",tablecolsplit:"拆分列",tablecoldelete:"删除列",tablerowdelete:"删除行",noColor:"无颜色",pleaseSelectFile:"请选择文件。",invalidImg:"请输入有效的URL地址。\n只允许jpg,gif,bmp,png格式。",invalidMedia:"请输入有效的URL地址。\n只允许swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。",invalidWidth:"宽度必须为数字。",invalidHeight:"高度必须为数字。",invalidBorder:"边框必须为数字。",invalidUrl:"请输入有效的URL地址。",invalidRows:"行数为必选项,只允许输入大于0的数字。",invalidCols:"列数为必选项,只允许输入大于0的数字。",invalidPadding:"边距必须为数字。",invalidSpacing:"间距必须为数字。",invalidJson:"服务器发生故障。",uploadSuccess:"上传成功。",cutError:"您的浏览器安全设置不允许使用剪切操作,请使用快捷键(Ctrl+X)来完成。",copyError:"您的浏览器安全设置不允许使用复制操作,请使用快捷键(Ctrl+C)来完成。",pasteError:"您的浏览器安全设置不允许使用粘贴操作,请使用快捷键(Ctrl+V)来完成。",ajaxLoading:"加载中,请稍候 ...",uploadLoading:"上传中,请稍候 ...",uploadError:"上传错误","plainpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","wordpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","code.pleaseInput":"请输入程序代码。","link.url":"URL","link.linkType":"打开类型","link.newWindow":"新窗口","link.selfWindow":"当前窗口","flash.url":"URL","flash.width":"宽度","flash.height":"高度","flash.upload":"上传","flash.viewServer":"文件空间","media.url":"URL","media.width":"宽度","media.height":"高度","media.autostart":"自动播放","media.upload":"上传","media.viewServer":"文件空间","image.remoteImage":"网络图片","image.localImage":"本地上传","image.remoteUrl":"图片地址","image.localUrl":"上传文件","image.size":"图片大小","image.width":"宽","image.height":"高","image.resetSize":"重置大小","image.align":"对齐方式","image.defaultAlign":"默认方式","image.leftAlign":"左对齐","image.rightAlign":"右对齐","image.imgTitle":"图片说明","image.upload":"浏览...","image.viewServer":"图片空间","multiimage.uploadDesc":"允许用户同时上传<%=uploadLimit%>张图片,单张图片容量不超过<%=sizeLimit%>","multiimage.startUpload":"开始上传","multiimage.clearAll":"全部清空","multiimage.insertAll":"全部插入","multiimage.queueLimitExceeded":"文件数量超过限制。","multiimage.fileExceedsSizeLimit":"文件大小超过限制。","multiimage.zeroByteFile":"无法上传空文件。","multiimage.invalidFiletype":"文件类型不正确。","multiimage.unknownError":"发生异常,无法上传。","multiimage.pending":"等待上传","multiimage.uploadError":"上传失败","filemanager.emptyFolder":"空文件夹","filemanager.moveup":"移到上一级文件夹","filemanager.viewType":"显示方式:","filemanager.viewImage":"缩略图","filemanager.listImage":"详细信息","filemanager.orderType":"排序方式:","filemanager.fileName":"名称","filemanager.fileSize":"大小","filemanager.fileType":"类型","insertfile.url":"URL","insertfile.title":"文件说明","insertfile.upload":"上传","insertfile.viewServer":"文件空间","table.cells":"单元格数","table.rows":"行数","table.cols":"列数","table.size":"大小","table.width":"宽度","table.height":"高度","table.percent":"%","table.px":"px","table.space":"边距间距","table.padding":"边距","table.spacing":"间距","table.align":"对齐方式","table.textAlign":"水平对齐","table.verticalAlign":"垂直对齐","table.alignDefault":"默认","table.alignLeft":"左对齐","table.alignCenter":"居中","table.alignRight":"右对齐","table.alignTop":"顶部","table.alignMiddle":"中部","table.alignBottom":"底部","table.alignBaseline":"基线","table.border":"边框","table.borderWidth":"边框","table.borderColor":"颜色","table.backgroundColor":"背景颜色","map.address":"地址: ","map.search":"搜索","baidumap.address":"地址: ","baidumap.search":"搜索","baidumap.insertDynamicMap":"插入动态地图","anchor.name":"锚点名称","formatblock.formatBlock":{h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",p:"正 文"},"fontname.fontName":{SimSun:"宋体",NSimSun:"新宋体",FangSong_GB2312:"仿宋_GB2312",KaiTi_GB2312:"楷体_GB2312",SimHei:"黑体","Microsoft YaHei":"微软雅黑",Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",Verdana:"Verdana"},"lineheight.lineHeight":[{1:"单倍行距"},{1.5:"1.5倍行距"},{2:"2倍行距"},{2.5:"2.5倍行距"},{3:"3倍行距"}],"template.selectTemplate":"可选模板","template.replaceContent":"替换当前内容","template.fileList":{"1.html":"图片和文字","2.html":"表格","3.html":"项目编号"}},"zh-CN"),KindEditor.options.langType="zh-CN",KindEditor.plugin("anchor",function(a){var b=this,c="anchor",d=b.lang(c+".");b.plugin.anchor={edit:function(){var e=['
','
','",'',"
","
"].join(""),f=b.createDialog({name:c,width:300,title:b.lang(c),body:e,yesBtn:{name:b.lang("yes"),click:function(){b.insertHtml('').hideDialog().focus()}}}),g=f.div,h=a('input[name="name"]',g),i=b.plugin.getSelectedAnchor();i&&h.val(unescape(i.attr("data-ke-name"))),h[0].focus(),h[0].select()},"delete":function(){b.plugin.getSelectedAnchor().remove()}},b.clickToolbar(c,b.plugin.anchor.edit)}),KindEditor.plugin("autoheight",function(a){function b(){var a=e.edit,b=a.doc.body;a.iframe[0].scroll="no",b.style.overflowY="hidden"}function c(){var b=e.edit,c=b.doc.body;b.iframe.height(f),e.resize(null,Math.max((a.IE?c.scrollHeight:c.offsetHeight)+76,f))}function d(){f=a.removeUnit(e.height),e.edit.afterChange(c),b(),c()}var e=this;if(e.autoHeightMode){var f;e.isCreated?d():e.afterCreate(d)}}),KindEditor.plugin("baidumap",function(a){var b=this,c="baidumap",d=b.lang(c+"."),e=a.undef(b.mapWidth,558),f=a.undef(b.mapHeight,360);b.clickToolbar(c,function(){function g(){h=p[0].contentWindow,i=a.iframeDoc(p)}var h,i,j=['
','
','
',d.address+' ','','',"","
",'
',' ","
",'
',"
",'
',"
"].join(""),k=b.createDialog({name:c,width:e+42,title:b.lang(c),body:j,yesBtn:{name:b.lang("yes"),click:function(){var a=h.map,c=a.getCenter(),d=c.lng+","+c.lat,g=a.getZoom(),i=[o[0].checked?b.pluginsPath+"baidumap/index.html":"http://api.map.baidu.com/staticimage","?center="+encodeURIComponent(d),"&zoom="+encodeURIComponent(g),"&width="+e,"&height="+f,"&markers="+encodeURIComponent(d),"&markerStyles="+encodeURIComponent("l,A")].join("");o[0].checked?b.insertHtml(''):b.exec("insertimage",i),b.hideDialog().focus()}},beforeRemove:function(){n.remove(),i&&i.write(""),p.remove()}}),l=k.div,m=a('[name="address"]',l),n=a('[name="searchBtn"]',l),o=a('[name="insertDynamicMap"]',k.div),p=a('');p.bind("load",function(){p.unbind("load"),a.IE?g():setTimeout(g,0)}),a(".ke-map",l).replaceWith(p),n.click(function(){h.search(m.val())})})}),KindEditor.plugin("map",function(a){var b=this,c="map",d=b.lang(c+".");b.clickToolbar(c,function(){function e(){f=m[0].contentWindow,g=a.iframeDoc(m)}var f,g,h=['
','
',d.address+' ','','',"","
",'
',"
"].join(""),i=b.createDialog({name:c,width:600,title:b.lang(c),body:h,yesBtn:{name:b.lang("yes"),click:function(){var a=(f.geocoder,f.map),c=a.getCenter().lat()+","+a.getCenter().lng(),d=a.getZoom(),e=a.getMapTypeId(),g="http://maps.googleapis.com/maps/api/staticmap";g+="?center="+encodeURIComponent(c),g+="&zoom="+encodeURIComponent(d),g+="&size=558x360",g+="&maptype="+encodeURIComponent(e),g+="&markers="+encodeURIComponent(c),g+="&language="+b.langType,g+="&sensor=false",b.exec("insertimage",g).hideDialog().focus()}},beforeRemove:function(){l.remove(),g&&g.write(""),m.remove()}}),j=i.div,k=a('[name="address"]',j),l=a('[name="searchBtn"]',j),m=(["",'',"",'',"","",'','
',""].join("\n"),a(''));m.bind("load",function(){m.unbind("load"),a.IE?e():setTimeout(e,0)}),a(".ke-map",j).replaceWith(m),l.click(function(){f.search(k.val())})})}),KindEditor.plugin("clearhtml",function(a){var b=this,c="clearhtml";b.clickToolbar(c,function(){b.focus();var c=b.html();c=c.replace(/(]*>)([\s\S]*?)(<\/script>)/gi,""),c=c.replace(/(]*>)([\s\S]*?)(<\/style>)/gi,""),c=a.formatHtml(c,{a:["href","target"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["src","width","height","border","alt","title",".width",".height"],table:["border"],"td,th":["rowspan","colspan"],"div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":[]}),b.html(c),b.cmd.selection(!0),b.addBookmark()})}),KindEditor.plugin("code",function(a){var b=this,c="code";b.clickToolbar(c,function(){var d=b.lang(c+"."),e=['
','
','","
",'',"
"].join(""),f=b.createDialog({name:c,width:450,title:b.lang(c),body:e,yesBtn:{name:b.lang("yes"),click:function(){var c=a(".ke-code-type",f.div).val(),e=g.val(),h=""===c?"":" lang-"+c,i='
\n'+a.escape(e)+"
";return""===a.trim(e)?(alert(d.pleaseInput),void g[0].focus()):void b.insertHtml(i).hideDialog().focus()}}}),g=a("textarea",f.div);g[0].focus()})}),KindEditor.plugin("emoticons",function(a){var b=this,c="emoticons",d=b.emoticonsPath||b.pluginsPath+"emoticons/images/",e=void 0===b.allowPreviewEmoticons?!0:b.allowPreviewEmoticons,f=1;b.clickToolbar(c,function(){function g(c,e,f){c.mouseover(v?function(){e>r?(v.css("left",0),v.css("right","")):(v.css("left",""),v.css("right",0)),w.attr("src",d+f+".gif"),a(this).addClass("ke-on")}:function(){a(this).addClass("ke-on")}),c.mouseout(function(){a(this).removeClass("ke-on")}),c.click(function(a){b.insertHtml('').hideMenu().focus(),a.stop()})}function h(b,c){var e=document.createElement("table");c.append(e),v&&(a(e).mouseover(function(){v.show("block")}),a(e).mouseout(function(){v.hide()}),t.push(a(e))),e.className="ke-table",e.cellPadding=0,e.cellSpacing=0,e.border=0;for(var f=(b-1)*p+o,h=0;l>h;h++)for(var i=e.insertRow(h),j=0;m>j;j++){var k=a(i.insertCell(j));k.addClass("ke-cell"),g(k,j,f);var n=a('').css("background-position","-"+24*f+"px 0px").css("background-image","url("+d+"static.gif)");k.append(n),t.push(k),f++}return e}function i(){a.each(t,function(){this.unbind()})}function j(a,b){a.click(function(a){i(),y.parentNode.removeChild(y),x.remove(),y=h(b,s),k(b),f=b,a.stop()})}function k(b){x=a('
'),s.append(x);for(var c=1;q>=c;c++){if(b!==c){var d=a('
['+c+"]");j(d,c),x.append(d),t.push(d)}else x.append(a("@["+c+"]"));x.append(a("@ "))}}var l=5,m=9,n=135,o=0,p=l*m,q=Math.ceil(n/p),r=Math.floor(m/2),s=a('
'),t=[],u=b.createMenu({name:c,beforeRemove:function(){i()}});u.div.append(s);var v,w;e&&(v=a('
').css("right",0),w=a(''),s.append(v),v.append(w));var x,y=h(f,s);k(f)})}),KindEditor.plugin("filemanager",function(a){function b(a,b,c){return a+" ("+Math.ceil(b/1024)+"KB, "+c+")"}function c(a,c){c.is_dir?a.attr("title",c.filename):a.attr("title",b(c.filename,c.filesize,c.datetime))}var d=this,e="filemanager",f=a.undef(d.fileManagerJson,d.basePath+"php/file_manager_json.php"),g=d.pluginsPath+e+"/images/",h=d.lang(e+".");d.plugin.filemanagerDialog=function(b){function i(b,c,e){var g="path="+b+"&order="+c+"&dir="+p;t.showLoading(d.lang("ajaxLoading")),a.ajax(a.addParam(f,g+"&"+(new Date).getTime()),function(a){t.hideLoading(),e(a)})}function j(b,c,d,e){var f=a.formatUrl(c.current_url+d.filename,"absolute"),g=encodeURIComponent(c.current_dir_path+d.filename+"/");b.click(d.is_dir?function(){i(g,y.val(),e)}:d.is_photo?function(){r.call(this,f,d.filename)}:function(){r.call(this,f,d.filename)}),z.push(b)}function k(b,c){function d(){"VIEW"==x.val()?i(b.current_dir_path,y.val(),m):i(b.current_dir_path,y.val(),l)}a.each(z,function(){this.unbind()}),w.unbind(),x.unbind(),y.unbind(),b.current_dir_path&&w.click(function(){i(b.moveup_dir_path,y.val(),c)}),x.change(d),y.change(d),v.html("")}function l(b){k(b,l);var c=document.createElement("table");c.className="ke-table",c.cellPadding=0,c.cellSpacing=0,c.border=0,v.append(c);for(var d=b.file_list,e=0,f=d.length;f>e;e++){var i=d[e],m=a(c.insertRow(e));m.mouseover(function(){a(this).addClass("ke-on")}).mouseout(function(){a(this).removeClass("ke-on")});var n=g+(i.is_dir?"folder-16.gif":"file-16.gif"),o=a(''+i.filename+''),p=a(m[0].insertCell(0)).addClass("ke-cell ke-name").append(o).append(document.createTextNode(" "+i.filename));!i.is_dir||i.has_file?(m.css("cursor","pointer"),p.attr("title",i.filename),j(p,b,i,l)):p.attr("title",h.emptyFolder),a(m[0].insertCell(1)).addClass("ke-cell ke-size").html(i.is_dir?"-":Math.ceil(i.filesize/1024)+"KB"),a(m[0].insertCell(2)).addClass("ke-cell ke-datetime").html(i.datetime)}}function m(b){k(b,m);for(var d=b.file_list,e=0,f=d.length;f>e;e++){var i=d[e],l=a('
');v.append(l);var n=a('
').mouseover(function(){a(this).addClass("ke-on")}).mouseout(function(){a(this).removeClass("ke-on")});l.append(n);var o=b.current_url+i.filename,p=i.is_dir?g+"folder-64.gif":i.is_photo?o:g+"file-64.gif",q=a(''+i.filename+'');!i.is_dir||i.has_file?(n.css("cursor","pointer"),c(n,i),j(n,b,i,m)):n.attr("title",h.emptyFolder),n.append(q),l.append('
'+i.filename+"
")}}var n=a.undef(b.width,650),o=a.undef(b.height,510),p=a.undef(b.dirName,""),q=a.undef(b.viewType,"VIEW").toUpperCase(),r=b.clickFn,s=['
','
','
',' ',''+h.moveup+"","
",'
',h.viewType+' ",h.orderType+' ","
",'
',"
",'
',"
"].join(""),t=d.createDialog({name:e,width:n,height:o,title:d.lang(e),body:s}),u=t.div,v=a(".ke-plugin-filemanager-body",u),w=(a('[name="moveupImg"]',u),a('[name="moveupLink"]',u)),x=(a('[name="viewServer"]',u),a('[name="viewType"]',u)),y=a('[name="orderType"]',u),z=[];return x.val(q),i("",y.val(),"VIEW"==q?m:l),t}}),KindEditor.plugin("flash",function(a){var b=this,c="flash",d=b.lang(c+"."),e=a.undef(b.allowFlashUpload,!0),f=a.undef(b.allowFileManager,!1),g=a.undef(b.formatUploadUrl,!0),h=a.undef(b.extraFileUploadParams,{}),i=a.undef(b.filePostName,"imgFile"),j=a.undef(b.uploadJson,b.basePath+"php/upload_json.php");b.plugin.flash={edit:function(){var k=['
','
','",'  ','  ','','',"","
",'
','",' ',"
",'
','",' ',"
","
"].join(""),l=b.createDialog({name:c,width:450,title:b.lang(c),body:k,yesBtn:{name:b.lang("yes"),click:function(){var c=a.trim(n.val()),d=p.val(),e=q.val();if("http://"==c||a.invalidUrl(c))return alert(b.lang("invalidUrl")),void n[0].focus();if(!/^\d*$/.test(d))return alert(b.lang("invalidWidth")),void p[0].focus();if(!/^\d*$/.test(e))return alert(b.lang("invalidHeight")),void q[0].focus();var f=a.mediaImg(b.themesPath+"common/blank.gif",{src:c,type:a.mediaType(".swf"),width:d,height:e,quality:"high"});b.insertHtml(f).hideDialog().focus()}}}),m=l.div,n=a('[name="url"]',m),o=a('[name="viewServer"]',m),p=a('[name="width"]',m),q=a('[name="height"]',m);if(n.val("http://"),e){var r=a.uploadbutton({button:a(".ke-upload-button",m)[0],fieldName:i,extraParams:h,url:a.addParam(j,"dir=flash"),afterUpload:function(d){if(l.hideLoading(),0===d.error){var e=d.url;g&&(e=a.formatUrl(e,"absolute")),n.val(e),b.afterUpload&&b.afterUpload.call(b,e,d,c),alert(b.lang("uploadSuccess"))}else alert(d.message)},afterError:function(a){l.hideLoading(),b.errorDialog(a)}});r.fileBox.change(function(){l.showLoading(b.lang("uploadLoading")),r.submit()})}else a(".ke-upload-button",m).hide();f?o.click(function(){b.loadPlugin("filemanager",function(){b.plugin.filemanagerDialog({viewType:"LIST",dirName:"flash",clickFn:function(c){b.dialogs.length>1&&(a('[name="url"]',m).val(c),b.afterSelectFile&&b.afterSelectFile.call(b,c),b.hideDialog())}})})}):o.hide();var s=b.plugin.getSelectedFlash();if(s){var t=a.mediaAttrs(s.attr("data-ke-tag"));n.val(t.src),p.val(a.removeUnit(s.css("width"))||t.width||0),q.val(a.removeUnit(s.css("height"))||t.height||0)}n[0].focus(),n[0].select()},"delete":function(){b.plugin.getSelectedFlash().remove(),b.addBookmark()}},b.clickToolbar(c,b.plugin.flash.edit)}),KindEditor.plugin("image",function(a){var b=this,c="image",d=a.undef(b.allowImageUpload,!0),e=a.undef(b.allowImageRemote,!0),f=a.undef(b.formatUploadUrl,!0),g=a.undef(b.allowFileManager,!1),h=a.undef(b.uploadJson,b.basePath+"php/upload_json.php"),i=a.undef(b.imageTabIndex,0),j=b.pluginsPath+"image/images/",k=a.undef(b.extraFileUploadParams,{}),l=a.undef(b.filePostName,"imgFile"),m=a.undef(b.fillDescAfterUploadImage,!1),n=b.lang(c+".");b.plugin.imageDialog=function(d){function e(a,b){D.val(a),E.val(b),J=a,K=b}var i=(d.imageUrl,a.undef(d.imageWidth,""),a.undef(d.imageHeight,""),a.undef(d.imageTitle,""),a.undef(d.imageAlign,""),a.undef(d.showRemote,!0)),o=a.undef(d.showLocal,!0),p=a.undef(d.tabIndex,0),q=d.clickFn,r="kindeditor_upload_iframe_"+(new Date).getTime(),s=[];for(var t in k)s.push('');var u,v=['
','
','",'","
"].join(""),w=o||g?450:400,x=o&&i?300:250,y=b.createDialog({name:c,width:w,height:x,title:b.lang(c),body:v,yesBtn:{name:b.lang("yes"),click:function(){if(!y.isLoading){if(o&&i&&u&&1===u.selectedIndex||!i)return""==I.fileBox.val()?void alert(b.lang("pleaseSelectFile")):(y.showLoading(b.lang("uploadLoading")),I.submit(),void B.val(""));var c=a.trim(A.val()),d=D.val(),e=E.val(),f=G.val(),g="";return H.each(function(){return this.checked?(g=this.value,!1):void 0}),"http://"==c||a.invalidUrl(c)?(alert(b.lang("invalidUrl")),void A[0].focus()):/^\d*$/.test(d)?/^\d*$/.test(e)?void q.call(b,c,f,d,e,0,g):(alert(b.lang("invalidHeight")),void E[0].focus()):(alert(b.lang("invalidWidth")),void D[0].focus())}}},beforeRemove:function(){C.unbind(),D.unbind(),E.unbind(),F.unbind()}}),z=y.div,A=a('[name="url"]',z),B=a('[name="localUrl"]',z),C=a('[name="viewServer"]',z),D=a('.tab1 [name="width"]',z),E=a('.tab1 [name="height"]',z),F=a(".ke-refresh-btn",z),G=a('.tab1 [name="title"]',z),H=a('.tab1 [name="align"]',z);i&&o?(u=a.tabs({src:a(".tabs",z),afterSelect:function(){}}),u.add({title:n.remoteImage,panel:a(".tab1",z)}),u.add({title:n.localImage,panel:a(".tab2",z)}),u.select(p)):i?a(".tab1",z).show():o&&a(".tab2",z).show(); +var I=a.uploadbutton({button:a(".ke-upload-button",z)[0],fieldName:l,form:a(".ke-form",z),target:r,width:60,afterUpload:function(d){if(y.hideLoading(),0===d.error){var e=d.url;f&&(e=a.formatUrl(e,"absolute")),b.afterUpload&&b.afterUpload.call(b,e,d,c),m?(a(".ke-dialog-row #remoteUrl",z).val(e),a(".ke-tabs-li",z)[0].click(),a(".ke-refresh-btn",z).click()):q.call(b,e,d.title,d.width,d.height,d.border,d.align)}else alert(d.message)},afterError:function(a){y.hideLoading(),b.errorDialog(a)}});I.fileBox.change(function(){B.val(I.fileBox.val())}),g?C.click(function(){b.loadPlugin("filemanager",function(){b.plugin.filemanagerDialog({viewType:"VIEW",dirName:"image",clickFn:function(c){b.dialogs.length>1&&(a('[name="url"]',z).val(c),b.afterSelectFile&&b.afterSelectFile.call(b,c),b.hideDialog())}})})}):C.hide();var J=0,K=0;return F.click(function(){var b=a('',document).css({position:"absolute",visibility:"hidden",top:0,left:"-1000px"});b.bind("load",function(){e(b.width(),b.height()),b.remove()}),a(document.body).append(b)}),D.change(function(){J>0&&E.val(Math.round(K/J*parseInt(this.value,10)))}),E.change(function(){K>0&&D.val(Math.round(J/K*parseInt(this.value,10)))}),A.val(d.imageUrl),e(d.imageWidth,d.imageHeight),G.val(d.imageTitle),H.each(function(){return this.value===d.imageAlign?(this.checked=!0,!1):void 0}),i&&0===p&&(A[0].focus(),A[0].select()),y},b.plugin.image={edit:function(){var a=b.plugin.getSelectedImage();b.plugin.imageDialog({imageUrl:a?a.attr("data-ke-src"):"http://",imageWidth:a?a.width():"",imageHeight:a?a.height():"",imageTitle:a?a.attr("title"):"",imageAlign:a?a.attr("align"):"",showRemote:e,showLocal:d,tabIndex:a?0:i,clickFn:function(c,d,e,f,g,h){a?(a.attr("src",c),a.attr("data-ke-src",c),a.attr("width",e),a.attr("height",f),a.attr("title",d),a.attr("align",h),a.attr("alt",d)):b.exec("insertimage",c,d,e,f,g,h),setTimeout(function(){b.hideDialog().focus()},0)}})},"delete":function(){var a=b.plugin.getSelectedImage();"a"==a.parent().name&&(a=a.parent()),a.remove(),b.addBookmark()}},b.clickToolbar(c,b.plugin.image.edit)}),KindEditor.plugin("insertfile",function(a){var b=this,c="insertfile",d=a.undef(b.allowFileUpload,!0),e=a.undef(b.allowFileManager,!1),f=a.undef(b.formatUploadUrl,!0),g=a.undef(b.uploadJson,b.basePath+"php/upload_json.php"),h=a.undef(b.extraFileUploadParams,{}),i=a.undef(b.filePostName,"imgFile"),j=b.lang(c+".");b.plugin.fileDialog=function(k){var l=a.undef(k.fileUrl,"http://"),m=a.undef(k.fileTitle,""),n=k.clickFn,o=['
','
','",'  ','  ','','',"","
",'
','",'
',"
","",""].join(""),p=b.createDialog({name:c,width:450,title:b.lang(c),body:o,yesBtn:{name:b.lang("yes"),click:function(){var c=a.trim(r.val()),d=t.val();return"http://"==c||a.invalidUrl(c)?(alert(b.lang("invalidUrl")),void r[0].focus()):(""===a.trim(d)&&(d=c),void n.call(b,c,d))}}}),q=p.div,r=a('[name="url"]',q),s=a('[name="viewServer"]',q),t=a('[name="title"]',q);if(d){var u=a.uploadbutton({button:a(".ke-upload-button",q)[0],fieldName:i,url:a.addParam(g,"dir=file"),extraParams:h,afterUpload:function(d){if(p.hideLoading(),0===d.error){var e=d.url;f&&(e=a.formatUrl(e,"absolute")),r.val(e),b.afterUpload&&b.afterUpload.call(b,e,d,c),alert(b.lang("uploadSuccess"))}else alert(d.message)},afterError:function(a){p.hideLoading(),b.errorDialog(a)}});u.fileBox.change(function(){p.showLoading(b.lang("uploadLoading")),u.submit()})}else a(".ke-upload-button",q).hide();e?s.click(function(){b.loadPlugin("filemanager",function(){b.plugin.filemanagerDialog({viewType:"LIST",dirName:"file",clickFn:function(c){b.dialogs.length>1&&(a('[name="url"]',q).val(c),b.afterSelectFile&&b.afterSelectFile.call(b,c),b.hideDialog())}})})}):s.hide(),r.val(l),t.val(m),r[0].focus(),r[0].select()},b.clickToolbar(c,function(){b.plugin.fileDialog({clickFn:function(a,c){var d=''+c+"";b.insertHtml(d).hideDialog().focus()}})})}),KindEditor.plugin("lineheight",function(a){var b=this,c="lineheight",d=b.lang(c+".");b.clickToolbar(c,function(){var e="",f=b.cmd.commonNode({"*":".line-height"});f&&(e=f.css("line-height"));var g=b.createMenu({name:c,width:150});a.each(d.lineHeight,function(c,d){a.each(d,function(a,c){g.addItem({title:c,checked:e===a,click:function(){b.cmd.toggle('',{span:".line-height="+a}),b.updateState(),b.addBookmark(),b.hideMenu()}})})})})}),KindEditor.plugin("link",function(a){var b=this,c="link";b.plugin.link={edit:function(){var d=b.lang(c+"."),e='
',f=b.createDialog({name:c,width:450,title:b.lang(c),body:e,yesBtn:{name:b.lang("yes"),click:function(){var c=a.trim(h.val());return"http://"==c||a.invalidUrl(c)?(alert(b.lang("invalidUrl")),void h[0].focus()):void b.exec("createlink",c,i.val()).hideDialog().focus()}}}),g=f.div,h=a('input[name="url"]',g),i=a('select[name="type"]',g);h.val("http://"),i[0].options[0]=new Option(d.newWindow,"_blank"),i[0].options[1]=new Option(d.selfWindow,""),b.cmd.selection();var j=b.plugin.getSelectedLink();j&&(b.cmd.range.selectNode(j[0]),b.cmd.select(),h.val(j.attr("data-ke-src")),i.val(j.attr("target"))),h[0].focus(),h[0].select()},"delete":function(){b.exec("unlink",null)}},b.clickToolbar(c,b.plugin.link.edit)}),KindEditor.plugin("media",function(a){var b=this,c="media",d=b.lang(c+"."),e=a.undef(b.allowMediaUpload,!0),f=a.undef(b.allowFileManager,!1),g=a.undef(b.formatUploadUrl,!0),h=a.undef(b.extraFileUploadParams,{}),i=a.undef(b.filePostName,"imgFile"),j=a.undef(b.uploadJson,b.basePath+"php/upload_json.php");b.plugin.media={edit:function(){var k=['
','
','",'  ','  ','','',"","
",'
','",'',"
",'
','",'',"
",'
','",' ',"
","
"].join(""),l=b.createDialog({name:c,width:450,height:230,title:b.lang(c),body:k,yesBtn:{name:b.lang("yes"),click:function(){var c=a.trim(n.val()),d=p.val(),e=q.val();if("http://"==c||a.invalidUrl(c))return alert(b.lang("invalidUrl")),void n[0].focus();if(!/^\d*$/.test(d))return alert(b.lang("invalidWidth")),void p[0].focus();if(!/^\d*$/.test(e))return alert(b.lang("invalidHeight")),void q[0].focus();var f=a.mediaImg(b.themesPath+"common/blank.gif",{src:c,type:a.mediaType(c),width:d,height:e,autostart:r[0].checked?"true":"false",loop:"true"});b.insertHtml(f).hideDialog().focus()}}}),m=l.div,n=a('[name="url"]',m),o=a('[name="viewServer"]',m),p=a('[name="width"]',m),q=a('[name="height"]',m),r=a('[name="autostart"]',m);if(n.val("http://"),e){var s=a.uploadbutton({button:a(".ke-upload-button",m)[0],fieldName:i,extraParams:h,url:a.addParam(j,"dir=media"),afterUpload:function(d){if(l.hideLoading(),0===d.error){var e=d.url;g&&(e=a.formatUrl(e,"absolute")),n.val(e),b.afterUpload&&b.afterUpload.call(b,e,d,c),alert(b.lang("uploadSuccess"))}else alert(d.message)},afterError:function(a){l.hideLoading(),b.errorDialog(a)}});s.fileBox.change(function(){l.showLoading(b.lang("uploadLoading")),s.submit()})}else a(".ke-upload-button",m).hide();f?o.click(function(){b.loadPlugin("filemanager",function(){b.plugin.filemanagerDialog({viewType:"LIST",dirName:"media",clickFn:function(c){b.dialogs.length>1&&(a('[name="url"]',m).val(c),b.afterSelectFile&&b.afterSelectFile.call(b,c),b.hideDialog())}})})}):o.hide();var t=b.plugin.getSelectedMedia();if(t){var u=a.mediaAttrs(t.attr("data-ke-tag"));n.val(u.src),p.val(a.removeUnit(t.css("width"))||u.width||0),q.val(a.removeUnit(t.css("height"))||u.height||0),r[0].checked="true"===u.autostart}n[0].focus(),n[0].select()},"delete":function(){b.plugin.getSelectedMedia().remove(),b.addBookmark()}},b.clickToolbar(c,b.plugin.media.edit)}),function(a){function b(a){this.init(a)}a.extend(b,{init:function(b){function c(b,c){a(".ke-status > div",b).hide(),a(".ke-message",b).addClass("ke-error").show().html(a.escape(c))}var d=this;b.afterError=b.afterError||function(a){alert(a)},d.options=b,d.progressbars={},d.div=a(b.container).html(['
','
','
','',"
",'
'+b.uploadDesc+"
",'','',"","
",'
',"
"].join("")),d.bodyDiv=a(".ke-swfupload-body",d.div);var e={debug:!1,upload_url:b.uploadUrl,flash_url:b.flashUrl,file_post_name:b.filePostName,button_placeholder:a(".ke-swfupload-button > input",d.div)[0],button_image_url:b.buttonImageUrl,button_width:b.buttonWidth,button_height:b.buttonHeight,button_cursor:SWFUpload.CURSOR.HAND,file_types:b.fileTypes,file_types_description:b.fileTypesDesc,file_upload_limit:b.fileUploadLimit,file_size_limit:b.fileSizeLimit,post_params:b.postParams,file_queued_handler:function(a){a.url=d.options.fileIconUrl,d.appendFile(a)},file_queue_error_handler:function(c,d){var e="";switch(d){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:e=b.queueLimitExceeded;break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:e=b.fileExceedsSizeLimit;break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:e=b.zeroByteFile;break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:e=b.invalidFiletype;break;default:e=b.unknownError}a.DEBUG&&alert(e)},upload_start_handler:function(b){var c=this,d=a('div[data-id="'+b.id+'"]',c.bodyDiv);a(".ke-status > div",d).hide(),a(".ke-progressbar",d).show()},upload_progress_handler:function(a,b,c){var e=Math.round(100*b/c),f=d.progressbars[a.id];f.bar.css("width",Math.round(80*e/100)+"px"),f.percent.html(e+"%")},upload_error_handler:function(b){if(b&&b.filestatus==SWFUpload.FILE_STATUS.ERROR){var e=a('div[data-id="'+b.id+'"]',d.bodyDiv).eq(0);c(e,d.options.errorMessage)}},upload_success_handler:function(b,e){var f=a('div[data-id="'+b.id+'"]',d.bodyDiv).eq(0),g={};try{g=a.json(e)}catch(h){d.options.afterError.call(this,""+e+"")}return 0!==g.error?void c(f,a.DEBUG?g.message:d.options.errorMessage):(b.url=g.url,a(".ke-img",f).attr("src",b.url).attr("data-status",b.filestatus).data("data",g),void a(".ke-status > div",f).hide())}};d.swfu=new SWFUpload(e),a(".ke-swfupload-startupload input",d.div).click(function(){d.swfu.startUpload()})},getUrlList:function(){var b=[];return a(".ke-img",self.bodyDiv).each(function(){var c=a(this),d=c.attr("data-status");d==SWFUpload.FILE_STATUS.COMPLETE&&b.push(c.data("data"))}),b},removeFile:function(b){var c=this;c.swfu.cancelUpload(b);var d=a('div[data-id="'+b+'"]',c.bodyDiv);a(".ke-photo",d).unbind(),a(".ke-delete",d).unbind(),d.remove()},removeFiles:function(){var b=this;a(".ke-item",b.bodyDiv).each(function(){b.removeFile(a(this).attr("data-id"))})},appendFile:function(b){var c=this,d=a('
');c.bodyDiv.append(d);var e=a('
').mouseover(function(){a(this).addClass("ke-on")}).mouseout(function(){a(this).removeClass("ke-on")});d.append(e);var f=a(''+b.name+'');e.append(f),a('').appendTo(e).click(function(){c.removeFile(b.id)});var g=a('
').appendTo(e);a(['
','
','
0%
'].join("")).hide().appendTo(g),a('
'+c.options.pendingMessage+"
").appendTo(g),d.append('
'+b.name+"
"),c.progressbars[b.id]={bar:a(".ke-progressbar-bar-inner",e),percent:a(".ke-progressbar-percent",e)}},remove:function(){this.removeFiles(),this.swfu.destroy(),this.div.html("")}}),a.swfupload=function(a,c){return new b(a,c)}}(KindEditor),KindEditor.plugin("multiimage",function(a){var b=this,c="multiimage",d=(a.undef(b.formatUploadUrl,!0),a.undef(b.uploadJson,b.basePath+"php/upload_json.php")),e=b.pluginsPath+"multiimage/images/",f=a.undef(b.imageSizeLimit,"1MB"),g=(a.undef(b.imageFileTypes,"*.jpg;*.gif;*.png"),a.undef(b.imageUploadLimit,20)),h=a.undef(b.filePostName,"imgFile"),i=b.lang(c+".");b.plugin.multiImageDialog=function(j){var k=j.clickFn,l=a.tmpl(i.uploadDesc,{uploadLimit:g,sizeLimit:f}),m=['
','
',"
","
"].join(""),n=b.createDialog({name:c,width:650,height:510,title:b.lang(c),body:m,previewBtn:{name:i.insertAll,click:function(){k.call(b,p.getUrlList())}},yesBtn:{name:i.clearAll,click:function(){p.removeFiles()}},beforeRemove:function(){(!a.IE||a.V<=8)&&p.remove()}}),o=n.div,p=a.swfupload({container:a(".swfupload",o),buttonImageUrl:e+("zh-CN"==b.langType?"select-files-zh-CN.png":"select-files-en.png"),buttonWidth:"zh-CN"==b.langType?72:88,buttonHeight:23,fileIconUrl:e+"image.png",uploadDesc:l,startButtonValue:i.startUpload,uploadUrl:a.addParam(d,"dir=image"),flashUrl:e+"swfupload.swf",filePostName:h,fileTypes:"*.jpg;*.jpeg;*.gif;*.png;*.bmp",fileTypesDesc:"Image Files",fileUploadLimit:g,fileSizeLimit:f,postParams:a.undef(b.extraFileUploadParams,{}),queueLimitExceeded:i.queueLimitExceeded,fileExceedsSizeLimit:i.fileExceedsSizeLimit,zeroByteFile:i.zeroByteFile,invalidFiletype:i.invalidFiletype,unknownError:i.unknownError,pendingMessage:i.pending,errorMessage:i.uploadError,afterError:function(a){b.errorDialog(a)}});return n},b.clickToolbar(c,function(){b.plugin.multiImageDialog({clickFn:function(c){0!==c.length&&(a.each(c,function(a,c){b.afterUpload&&b.afterUpload.call(b,c.url,c,"multiimage"),b.exec("insertimage",c.url,c.title,c.width,c.height,c.border,c.align)}),setTimeout(function(){b.hideDialog().focus()},0))}})})}),function(){window.SWFUpload=function(a){this.initSWFUpload(a)},SWFUpload.prototype.initSWFUpload=function(a){try{this.customSettings={},this.settings=a,this.eventQueue=[],this.movieName="KindEditor_SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(),this.loadFlash(),this.displayDebugInfo()}catch(b){throw delete SWFUpload.instances[this.movieName],b}},SWFUpload.instances={},SWFUpload.movieCount=0,SWFUpload.version="2.2.0 2009-03-25",SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130},SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290},SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5},SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120},SWFUpload.CURSOR={ARROW:-1,HAND:-2},SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"},SWFUpload.completeURL=function(a){if("string"!=typeof a||a.match(/^https?:\/\//i)||a.match(/^\//))return a;var b=(window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),window.location.pathname.lastIndexOf("/"));return path=0>=b?"/":window.location.pathname.substr(0,b)+"/",path+a},SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(a,b){this.settings[a]=void 0==this.settings[a]?b:this.settings[a]},this.ensureDefault("upload_url",""),this.ensureDefault("preserve_relative_urls",!1),this.ensureDefault("file_post_name","Filedata"),this.ensureDefault("post_params",{}),this.ensureDefault("use_query_string",!1),this.ensureDefault("requeue_on_error",!1),this.ensureDefault("http_success",[]),this.ensureDefault("assume_success_timeout",0),this.ensureDefault("file_types","*.*"),this.ensureDefault("file_types_description","All Files"),this.ensureDefault("file_size_limit",0),this.ensureDefault("file_upload_limit",0),this.ensureDefault("file_queue_limit",0),this.ensureDefault("flash_url","swfupload.swf"),this.ensureDefault("prevent_swf_caching",!0),this.ensureDefault("button_image_url",""),this.ensureDefault("button_width",1),this.ensureDefault("button_height",1),this.ensureDefault("button_text",""),this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;"),this.ensureDefault("button_text_top_padding",0),this.ensureDefault("button_text_left_padding",0),this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES),this.ensureDefault("button_disabled",!1),this.ensureDefault("button_placeholder_id",""),this.ensureDefault("button_placeholder",null),this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW),this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW),this.ensureDefault("debug",!1),this.settings.debug_enabled=this.settings.debug,this.settings.return_upload_start_handler=this.returnUploadStart,this.ensureDefault("swfupload_loaded_handler",null),this.ensureDefault("file_dialog_start_handler",null),this.ensureDefault("file_queued_handler",null),this.ensureDefault("file_queue_error_handler",null),this.ensureDefault("file_dialog_complete_handler",null),this.ensureDefault("upload_start_handler",null),this.ensureDefault("upload_progress_handler",null),this.ensureDefault("upload_error_handler",null),this.ensureDefault("upload_success_handler",null),this.ensureDefault("upload_complete_handler",null),this.ensureDefault("debug_handler",this.debugMessage),this.ensureDefault("custom_settings",{}),this.customSettings=this.settings.custom_settings,this.settings.prevent_swf_caching&&(this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+(new Date).getTime()),this.settings.preserve_relative_urls||(this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url),this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)),delete this.ensureDefault},SWFUpload.prototype.loadFlash=function(){var a,b;if(null!==document.getElementById(this.movieName))throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";if(a=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder,void 0==a)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;b=document.createElement("div"),b.innerHTML=this.getFlashHTML(),a.parentNode.replaceChild(b.firstChild,a),void 0==window[this.movieName]&&(window[this.movieName]=this.getMovieElement())},SWFUpload.prototype.getFlashHTML=function(){var a="";return KindEditor.IE&&KindEditor.V>8&&(a=' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'),['','','','','','','',""].join("")},SWFUpload.prototype.getFlashVars=function(){var a=this.buildParamString(),b=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&uploadURL=",encodeURIComponent(this.settings.upload_url),"&useQueryString=",encodeURIComponent(this.settings.use_query_string),"&requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&httpSuccess=",encodeURIComponent(b),"&assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&params=",encodeURIComponent(a),"&filePostName=",encodeURIComponent(this.settings.file_post_name),"&fileTypes=",encodeURIComponent(this.settings.file_types),"&fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&buttonWidth=",encodeURIComponent(this.settings.button_width),"&buttonHeight=",encodeURIComponent(this.settings.button_height),"&buttonText=",encodeURIComponent(this.settings.button_text),"&buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&buttonAction=",encodeURIComponent(this.settings.button_action),"&buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")},SWFUpload.prototype.getMovieElement=function(){if(void 0==this.movieElement&&(this.movieElement=document.getElementById(this.movieName)),null===this.movieElement)throw"Could not find Flash element";return this.movieElement},SWFUpload.prototype.buildParamString=function(){var a=this.settings.post_params,b=[];if("object"==typeof a)for(var c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c.toString())+"="+encodeURIComponent(a[c].toString()));return b.join("&")},SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,!1);var a=null;if(a=this.getMovieElement(),a&&"unknown"==typeof a.CallFunction){for(var b in a)try{"function"==typeof a[b]&&(a[b]=null)}catch(c){}try{a.parentNode.removeChild(a)}catch(d){}}return window[this.movieName]=null,SWFUpload.instances[this.movieName]=null,delete SWFUpload.instances[this.movieName],this.movieElement=null,this.settings=null,this.customSettings=null,this.eventQueue=null,this.movieName=null,!0}catch(e){return!1}},SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n"," ","upload_url: ",this.settings.upload_url,"\n"," ","flash_url: ",this.settings.flash_url,"\n"," ","use_query_string: ",this.settings.use_query_string.toString(),"\n"," ","requeue_on_error: ",this.settings.requeue_on_error.toString(),"\n"," ","http_success: ",this.settings.http_success.join(", "),"\n"," ","assume_success_timeout: ",this.settings.assume_success_timeout,"\n"," ","file_post_name: ",this.settings.file_post_name,"\n"," ","post_params: ",this.settings.post_params.toString(),"\n"," ","file_types: ",this.settings.file_types,"\n"," ","file_types_description: ",this.settings.file_types_description,"\n"," ","file_size_limit: ",this.settings.file_size_limit,"\n"," ","file_upload_limit: ",this.settings.file_upload_limit,"\n"," ","file_queue_limit: ",this.settings.file_queue_limit,"\n"," ","debug: ",this.settings.debug.toString(),"\n"," ","prevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n"," ","button_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n"," ","button_placeholder: ",this.settings.button_placeholder?"Set":"Not Set","\n"," ","button_image_url: ",this.settings.button_image_url.toString(),"\n"," ","button_width: ",this.settings.button_width.toString(),"\n"," ","button_height: ",this.settings.button_height.toString(),"\n"," ","button_text: ",this.settings.button_text.toString(),"\n"," ","button_text_style: ",this.settings.button_text_style.toString(),"\n"," ","button_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n"," ","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n"," ","button_action: ",this.settings.button_action.toString(),"\n"," ","button_disabled: ",this.settings.button_disabled.toString(),"\n"," ","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n"," ","swfupload_loaded_handler assigned: ",("function"==typeof this.settings.swfupload_loaded_handler).toString(),"\n"," ","file_dialog_start_handler assigned: ",("function"==typeof this.settings.file_dialog_start_handler).toString(),"\n"," ","file_queued_handler assigned: ",("function"==typeof this.settings.file_queued_handler).toString(),"\n"," ","file_queue_error_handler assigned: ",("function"==typeof this.settings.file_queue_error_handler).toString(),"\n"," ","upload_start_handler assigned: ",("function"==typeof this.settings.upload_start_handler).toString(),"\n"," ","upload_progress_handler assigned: ",("function"==typeof this.settings.upload_progress_handler).toString(),"\n"," ","upload_error_handler assigned: ",("function"==typeof this.settings.upload_error_handler).toString(),"\n"," ","upload_success_handler assigned: ",("function"==typeof this.settings.upload_success_handler).toString(),"\n"," ","upload_complete_handler assigned: ",("function"==typeof this.settings.upload_complete_handler).toString(),"\n"," ","debug_handler assigned: ",("function"==typeof this.settings.debug_handler).toString(),"\n"].join(""))},SWFUpload.prototype.addSetting=function(a,b,c){return this.settings[a]=void 0==b?c:b},SWFUpload.prototype.getSetting=function(a){return void 0!=this.settings[a]?this.settings[a]:""},SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement(),returnValue,returnString;try{returnString=movieElement.CallFunction(''+__flash__argumentsToXML(argumentArray,0)+""),returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}return void 0!=returnValue&&"object"==typeof returnValue.post&&(returnValue=this.unescapeFilePostParams(returnValue)),returnValue},SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")},SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")},SWFUpload.prototype.startUpload=function(a){this.callFlash("StartUpload",[a])},SWFUpload.prototype.cancelUpload=function(a,b){b!==!1&&(b=!0),this.callFlash("CancelUpload",[a,b])},SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")},SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")},SWFUpload.prototype.setStats=function(a){this.callFlash("SetStats",[a])},SWFUpload.prototype.getFile=function(a){return"number"==typeof a?this.callFlash("GetFileByIndex",[a]):this.callFlash("GetFile",[a])},SWFUpload.prototype.addFileParam=function(a,b,c){return this.callFlash("AddFileParam",[a,b,c])},SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash("RemoveFileParam",[a,b])},SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString(),this.callFlash("SetUploadURL",[a])},SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a,this.callFlash("SetPostParams",[a])},SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b,this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.removePostParam=function(a){delete this.settings.post_params[a],this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a,this.settings.file_types_description=b,this.callFlash("SetFileTypes",[a,b])},SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a,this.callFlash("SetFileSizeLimit",[a])},SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a,this.callFlash("SetFileUploadLimit",[a])},SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a,this.callFlash("SetFileQueueLimit",[a])},SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a,this.callFlash("SetFilePostName",[a])},SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a,this.callFlash("SetUseQueryString",[a])},SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_error=a,this.callFlash("SetRequeueOnError",[a])},SWFUpload.prototype.setHTTPSuccess=function(a){"string"==typeof a&&(a=a.replace(" ","").split(",")),this.settings.http_success=a,this.callFlash("SetHTTPSuccess",[a])},SWFUpload.prototype.setAssumeSuccessTimeout=function(a){this.settings.assume_success_timeout=a,this.callFlash("SetAssumeSuccessTimeout",[a])},SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a,this.callFlash("SetDebugEnabled",[a])},SWFUpload.prototype.setButtonImageURL=function(a){void 0==a&&(a=""),this.settings.button_image_url=a,this.callFlash("SetButtonImageURL",[a])},SWFUpload.prototype.setButtonDimensions=function(a,b){this.settings.button_width=a,this.settings.button_height=b;var c=this.getMovieElement();void 0!=c&&(c.style.width=a+"px",c.style.height=b+"px"),this.callFlash("SetButtonDimensions",[a,b])},SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a,this.callFlash("SetButtonText",[a])},SWFUpload.prototype.setButtonTextPadding=function(a,b){this.settings.button_text_top_padding=b,this.settings.button_text_left_padding=a,this.callFlash("SetButtonTextPadding",[a,b])},SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a,this.callFlash("SetButtonTextStyle",[a])},SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a,this.callFlash("SetButtonDisabled",[a])},SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a,this.callFlash("SetButtonAction",[a])},SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a,this.callFlash("SetButtonCursor",[a])},SWFUpload.prototype.queueEvent=function(a,b){void 0==b?b=[]:b instanceof Array||(b=[b]);var c=this;if("function"==typeof this.settings[a])this.eventQueue.push(function(){this.settings[a].apply(this,b) +}),setTimeout(function(){c.executeNextEvent()},0);else if(null!==this.settings[a])throw"Event handler "+a+" is unknown or is not a function"},SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;"function"==typeof a&&a.apply(this)},SWFUpload.prototype.unescapeFilePostParams=function(a){var b,c=/[$]([0-9a-f]{4})/i,d={};if(void 0!=a){for(var e in a.post)if(a.post.hasOwnProperty(e)){b=e;for(var f;null!==(f=c.exec(b));)b=b.replace(f[0],String.fromCharCode(parseInt("0x"+f[1],16)));d[b]=a.post[e]}a.post=d}return a},SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(a){return!1}},SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();return a?(this.cleanUp(a),void this.queueEvent("swfupload_loaded_handler")):void this.debug("Flash called back ready but the flash movie can't be found.")},SWFUpload.prototype.cleanUp=function(a){try{if(this.movieElement&&"unknown"==typeof a.CallFunction){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var b in a)try{"function"==typeof a[b]&&(a[b]=null)}catch(c){}}}catch(d){}window.__flash__removeCallback=function(a,b){try{a&&(a[b]=null)}catch(c){}}},SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")},SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a),this.queueEvent("file_queued_handler",a)},SWFUpload.prototype.fileQueueError=function(a,b,c){a=this.unescapeFilePostParams(a),this.queueEvent("file_queue_error_handler",[a,b,c])},SWFUpload.prototype.fileDialogComplete=function(a,b,c){this.queueEvent("file_dialog_complete_handler",[a,b,c])},SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a),this.queueEvent("return_upload_start_handler",a)},SWFUpload.prototype.returnUploadStart=function(a){var b;if("function"==typeof this.settings.upload_start_handler)a=this.unescapeFilePostParams(a),b=this.settings.upload_start_handler.call(this,a);else if(void 0!=this.settings.upload_start_handler)throw"upload_start_handler must be a function";void 0===b&&(b=!0),b=!!b,this.callFlash("ReturnUploadStart",[b])},SWFUpload.prototype.uploadProgress=function(a,b,c){a=this.unescapeFilePostParams(a),this.queueEvent("upload_progress_handler",[a,b,c])},SWFUpload.prototype.uploadError=function(a,b,c){a=this.unescapeFilePostParams(a),this.queueEvent("upload_error_handler",[a,b,c])},SWFUpload.prototype.uploadSuccess=function(a,b,c){a=this.unescapeFilePostParams(a),this.queueEvent("upload_success_handler",[a,b,c])},SWFUpload.prototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a),this.queueEvent("upload_complete_handler",a)},SWFUpload.prototype.debug=function(a){this.queueEvent("debug_handler",a)},SWFUpload.prototype.debugMessage=function(a){if(this.settings.debug){var b,c=[];if("object"==typeof a&&"string"==typeof a.name&&"string"==typeof a.message){for(var d in a)a.hasOwnProperty(d)&&c.push(d+": "+a[d]);b=c.join("\n")||"",c=b.split("\n"),b="EXCEPTION: "+c.join("\nEXCEPTION: "),SWFUpload.Console.writeLine(b)}else SWFUpload.Console.writeLine(a)}},SWFUpload.Console={},SWFUpload.Console.writeLine=function(a){var b,c;try{b=document.getElementById("SWFUpload_Console"),b||(c=document.createElement("form"),document.getElementsByTagName("body")[0].appendChild(c),b=document.createElement("textarea"),b.id="SWFUpload_Console",b.style.fontFamily="monospace",b.setAttribute("wrap","off"),b.wrap="off",b.style.overflow="auto",b.style.width="700px",b.style.height="350px",b.style.margin="5px",c.appendChild(b)),b.value+=a+"\n",b.scrollTop=b.scrollHeight-b.clientHeight}catch(d){alert("Exception: "+d.name+" Message: "+d.message)}}}(),function(){"function"==typeof SWFUpload&&(SWFUpload.queue={},SWFUpload.prototype.initSettings=function(a){return function(){"function"==typeof a&&a.call(this),this.queueSettings={},this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0,this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler,this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler,this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler,this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler,this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}}(SWFUpload.prototype.initSettings),SWFUpload.prototype.startUpload=function(a){this.queueSettings.queue_cancelled_flag=!1,this.callFlash("StartUpload",[a])},SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=!0,this.stopUpload();for(var a=this.getStats();a.files_queued>0;)this.cancelUpload(),a=this.getStats()},SWFUpload.queue.uploadStartHandler=function(a){var b;return"function"==typeof this.queueSettings.user_upload_start_handler&&(b=this.queueSettings.user_upload_start_handler.call(this,a)),b=b===!1?!1:!0,this.queueSettings.queue_cancelled_flag=!b,b},SWFUpload.queue.uploadCompleteHandler=function(a){var b,c=this.queueSettings.user_upload_complete_handler;if(a.filestatus===SWFUpload.FILE_STATUS.COMPLETE&&this.queueSettings.queue_upload_count++,b="function"==typeof c?c.call(this,a)===!1?!1:!0:a.filestatus===SWFUpload.FILE_STATUS.QUEUED?!1:!0){var d=this.getStats();d.files_queued>0&&this.queueSettings.queue_cancelled_flag===!1?this.startUpload():this.queueSettings.queue_cancelled_flag===!1?(this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]),this.queueSettings.queue_upload_count=0):(this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0)}})}(),KindEditor.plugin("pagebreak",function(a){var b=this,c="pagebreak",d=a.undef(b.pagebreakHtml,'
');b.clickToolbar(c,function(){var c=b.cmd,e=c.range;b.focus();var f="br"==b.newlineTag||a.WEBKIT?"":'';if(b.insertHtml(d+f),""!==f){var g=a("#__kindeditor_tail_tag__",b.edit.doc);e.selectNodeContents(g[0]),g.removeAttr("id"),c.select()}})}),KindEditor.plugin("plainpaste",function(a){var b=this,c="plainpaste";b.clickToolbar(c,function(){var d=b.lang(c+"."),e='
'+d.comment+'
',f=b.createDialog({name:c,width:450,title:b.lang(c),body:e,yesBtn:{name:b.lang("yes"),click:function(){var c=g.val();c=a.escape(c),c=c.replace(/ {2}/g,"  "),c="p"==b.newlineTag?c.replace(/^/,"

").replace(/$/,"

").replace(/\n/g,"

"):c.replace(/\n/g,"
$&"),b.insertHtml(c).hideDialog().focus()}}}),g=a("textarea",f.div);g[0].focus()})}),KindEditor.plugin("preview",function(a){var b=this,c="preview";b.clickToolbar(c,function(){var d=(b.lang(c+"."),'

'),e=b.createDialog({name:c,width:750,title:b.lang(c),body:d}),f=a("iframe",e.div),g=a.iframeDoc(f);g.open(),g.write(b.fullHtml()),g.close(),a(g.body).css("background-color","#FFF"),f[0].contentWindow.focus()})}),KindEditor.plugin("quickformat",function(a){function b(a){for(var b=a.first();b&&b.first();)b=b.first();return b}var c=this,d="quickformat",e=a.toMap("blockquote,center,div,h1,h2,h3,h4,h5,h6,p");c.clickToolbar(d,function(){c.focus();for(var d,f=c.edit.doc,g=c.cmd.range,h=a(f.body).first(),i=[],j=[],k=g.createBookmark(!0);h;){d=h.next();var l=b(h);l&&"img"==l.name||(e[h.name]?(h.html(h.html().replace(/^(\s| | )+/gi,"")),h.css("text-indent","2em")):j.push(h),(!d||e[d.name]||e[h.name]&&!e[d.name])&&(j.length>0&&i.push(j),j=[])),h=d}a.each(i,function(b,c){var d=a('

',f);c[0].before(d),a.each(c,function(a,b){d.append(b)})}),g.moveToBookmark(k),c.addBookmark()})}),KindEditor.plugin("table",function(a){function b(a,b){b=b.toUpperCase(),a.css("background-color",b),a.css("color","#000000"===b?"#FFFFFF":"#000000"),a.html(b)}function c(c,d){function f(){a.each(i,function(){this.remove()}),i=[],a(document).unbind("click,mousedown",f),c.unbind("click,mousedown",f)}d.bind("click,mousedown",function(a){a.stopPropagation()}),d.click(function(){f();var d=a(this),g=d.pos(),h=a.colorpicker({x:g.x,y:g.y+d.height(),z:811214,selectedColor:a(this).html(),colors:e.colorTable,noColor:e.lang("noColor"),shadowMode:e.shadowMode,click:function(a){b(d,a),f()}});i.push(h),a(document).bind("click,mousedown",f),c.bind("click,mousedown",f)})}function d(a,b,c){for(var d=0,e=0,f=b.cells.length;f>e&&b.cells[e]!=c;e++)d+=b.cells[e].rowSpan-1;return c.cellIndex-d}var e=this,f="table",g=e.lang(f+"."),h="ke-zeroborder",i=[];e.plugin.table={prop:function(d){var i=['
','
','",g.rows+'   ',g.cols+' ',"
",'
','",g.width+'   ','   ",g.height+'   ','","
",'
','",g.padding+'   ',g.spacing+' ',"
",'
','",'","
",'
','",g.borderWidth+'   ',g.borderColor+' ',"
",'
','",'',"
","
"].join(""),j=e.cmd.range.createBookmark(),k=e.createDialog({name:f,width:500,title:e.lang(f),body:i,beforeRemove:function(){w.unbind()},yesBtn:{name:e.lang("yes"),click:function(){var b=m.val(),c=n.val(),d=o.val(),f=p.val(),g=q.val(),i=r.val(),k=s.val(),l=t.val(),y=u.val(),z=v.val(),A=a(w[0]).html()||"",B=a(w[1]).html()||"";if(0==b||!/^\d+$/.test(b))return alert(e.lang("invalidRows")),void m[0].focus();if(0==c||!/^\d+$/.test(c))return alert(e.lang("invalidRows")),void n[0].focus();if(!/^\d*$/.test(d))return alert(e.lang("invalidWidth")),void o[0].focus();if(!/^\d*$/.test(f))return alert(e.lang("invalidHeight")),void p[0].focus();if(!/^\d*$/.test(k))return alert(e.lang("invalidPadding")),void s[0].focus();if(!/^\d*$/.test(l))return alert(e.lang("invalidSpacing")),void t[0].focus();if(!/^\d*$/.test(z))return alert(e.lang("invalidBorder")),void v[0].focus();if(x)return""!==d?x.width(d+g):x.css("width",""),void 0!==x[0].width&&x.removeAttr("width"),""!==f?x.height(f+i):x.css("height",""),void 0!==x[0].height&&x.removeAttr("height"),x.css("background-color",B),void 0!==x[0].bgColor&&x.removeAttr("bgColor"),""!==k?x[0].cellPadding=k:x.removeAttr("cellPadding"),""!==l?x[0].cellSpacing=l:x.removeAttr("cellSpacing"),""!==y?x[0].align=y:x.removeAttr("align"),""!==z?x.attr("border",z):x.removeAttr("border"),""===z||"0"===z?x.addClass(h):x.removeClass(h),""!==A?x.attr("borderColor",A):x.removeAttr("borderColor"),e.hideDialog().focus(),e.cmd.range.moveToBookmark(j),e.cmd.select(),void e.addBookmark();var C="";""!==d&&(C+="width:"+d+g+";"),""!==f&&(C+="height:"+f+i+";"),""!==B&&(C+="background-color:"+B+";");var D="E;E++){D+="";for(var F=0;c>F;F++)D+=""+(a.IE?" ":"
")+"";D+=""}D+="",a.IE||(D+="
"),e.insertHtml(D),e.select().hideDialog().focus(),e.addBookmark()}}}),l=k.div,m=a('[name="rows"]',l).val(3),n=a('[name="cols"]',l).val(2),o=a('[name="width"]',l).val(100),p=a('[name="height"]',l),q=a('[name="widthType"]',l),r=a('[name="heightType"]',l),s=a('[name="padding"]',l).val(2),t=a('[name="spacing"]',l).val(0),u=a('[name="align"]',l),v=a('[name="border"]',l).val(1),w=a(".ke-input-color",l);c(l,w.eq(0)),c(l,w.eq(1)),b(w.eq(0),"#000000"),b(w.eq(1),""),m[0].focus(),m[0].select();var x;if(!d&&(x=e.plugin.getSelectedTable())){m.val(x[0].rows.length),n.val(x[0].rows.length>0?x[0].rows[0].cells.length:0),m.attr("disabled",!0),n.attr("disabled",!0);var y,z=x[0].style.width||x[0].width,A=x[0].style.height||x[0].height;void 0!==z&&(y=/^(\d+)((?:px|%)*)$/.exec(z))?(o.val(y[1]),q.val(y[2])):o.val(""),void 0!==A&&(y=/^(\d+)((?:px|%)*)$/.exec(A))&&(p.val(y[1]),r.val(y[2])),s.val(x[0].cellPadding||""),t.val(x[0].cellSpacing||""),u.val(x[0].align||""),v.val(void 0===x[0].border?"":x[0].border),b(w.eq(0),a.toHex(x.attr("borderColor")||"")),b(w.eq(1),a.toHex(x[0].style.backgroundColor||x[0].bgColor||"")),o[0].focus(),o[0].select()}},cellprop:function(){var d=['
','
','",g.width+'   ','   ",g.height+'   ','","
",'
','",g.textAlign+' ",g.verticalAlign+' ","
",'
','",g.borderWidth+'   ',g.borderColor+' ',"
",'
','",'',"
","
"].join(""),h=e.cmd.range.createBookmark(),i=e.createDialog({name:f,width:500,title:e.lang("tablecell"),body:d,beforeRemove:function(){t.unbind()},yesBtn:{name:e.lang("yes"),click:function(){var b=k.val(),c=l.val(),d=m.val(),f=n.val(),g=(o.val(),p.val(),q.val()),i=r.val(),j=s.val(),u=a(t[0]).html()||"",w=a(t[1]).html()||"";return/^\d*$/.test(b)?/^\d*$/.test(c)?/^\d*$/.test(j)?(v.css({width:""!==b?b+d:"",height:""!==c?c+f:"","background-color":w,"text-align":g,"vertical-align":i,"border-width":j,"border-style":""!==j?"solid":"","border-color":u}),e.hideDialog().focus(),e.cmd.range.moveToBookmark(h),e.cmd.select(),void e.addBookmark()):(alert(e.lang("invalidBorder")),void s[0].focus()):(alert(e.lang("invalidHeight")),void l[0].focus()):(alert(e.lang("invalidWidth")),void k[0].focus())}}}),j=i.div,k=a('[name="width"]',j).val(100),l=a('[name="height"]',j),m=a('[name="widthType"]',j),n=a('[name="heightType"]',j),o=a('[name="padding"]',j).val(2),p=a('[name="spacing"]',j).val(0),q=a('[name="textAlign"]',j),r=a('[name="verticalAlign"]',j),s=a('[name="border"]',j).val(1),t=a(".ke-input-color",j);c(j,t.eq(0)),c(j,t.eq(1)),b(t.eq(0),"#000000"),b(t.eq(1),""),k[0].focus(),k[0].select();var u,v=e.plugin.getSelectedCell(),w=v[0].style.width||v[0].width||"",x=v[0].style.height||v[0].height||"";(u=/^(\d+)((?:px|%)*)$/.exec(w))?(k.val(u[1]),m.val(u[2])):k.val(""),(u=/^(\d+)((?:px|%)*)$/.exec(x))&&(l.val(u[1]),n.val(u[2])),q.val(v[0].style.textAlign||""),r.val(v[0].style.verticalAlign||"");var y=v[0].style.borderWidth||"";y&&(y=parseInt(y)),s.val(y),b(t.eq(0),a.toHex(v[0].style.borderColor||"")),b(t.eq(1),a.toHex(v[0].style.backgroundColor||"")),k[0].focus(),k[0].select()},insert:function(){this.prop(!0)},"delete":function(){var a=e.plugin.getSelectedTable();e.cmd.range.setStartBefore(a[0]).collapse(!0),e.cmd.select(),a.remove(),e.addBookmark()},colinsert:function(b){var c=e.plugin.getSelectedTable()[0],f=e.plugin.getSelectedRow()[0],g=e.plugin.getSelectedCell()[0],h=g.cellIndex+b;h+=c.rows[0].cells.length-f.cells.length;for(var i=0,j=c.rows.length;j>i;i++){var k=c.rows[i],l=k.insertCell(h);l.innerHTML=a.IE?"":"
",h=d(c,k,l)}e.cmd.range.selectNodeContents(g).collapse(!0),e.cmd.select(),e.addBookmark()},colinsertleft:function(){this.colinsert(0)},colinsertright:function(){this.colinsert(1)},rowinsert:function(b){var c=e.plugin.getSelectedTable()[0],d=e.plugin.getSelectedRow()[0],f=e.plugin.getSelectedCell()[0],g=d.rowIndex;1===b&&(g=d.rowIndex+(f.rowSpan-1)+b);for(var h=c.insertRow(g),i=0,j=d.cells.length;j>i;i++){d.cells[i].rowSpan>1&&(j-=d.cells[i].rowSpan-1);var k=h.insertCell(i);1===b&&d.cells[i].colSpan>1&&(k.colSpan=d.cells[i].colSpan),k.innerHTML=a.IE?"":"
"}for(var l=g;l>=0;l--){var m=c.rows[l].cells;if(m.length>i){for(var n=f.cellIndex;n>=0;n--)m[n].rowSpan>1&&(m[n].rowSpan+=1);break}}e.cmd.range.selectNodeContents(f).collapse(!0),e.cmd.select(),e.addBookmark()},rowinsertabove:function(){this.rowinsert(0)},rowinsertbelow:function(){this.rowinsert(1)},rowmerge:function(){var a=e.plugin.getSelectedTable()[0],b=e.plugin.getSelectedRow()[0],c=e.plugin.getSelectedCell()[0],d=b.rowIndex,f=d+c.rowSpan,g=a.rows[f];if(!(a.rows.length<=f)){var h=c.cellIndex;if(!(g.cells.length<=h)){var i=g.cells[h];c.colSpan===i.colSpan&&(c.rowSpan+=i.rowSpan,g.deleteCell(h),e.cmd.range.selectNodeContents(c).collapse(!0),e.cmd.select(),e.addBookmark())}}},colmerge:function(){var a=(e.plugin.getSelectedTable()[0],e.plugin.getSelectedRow()[0]),b=e.plugin.getSelectedCell()[0],c=(a.rowIndex,b.cellIndex),d=c+1;if(!(a.cells.length<=d)){var f=a.cells[d];b.rowSpan===f.rowSpan&&(b.colSpan+=f.colSpan,a.deleteCell(d),e.cmd.range.selectNodeContents(b).collapse(!0),e.cmd.select(),e.addBookmark())}},rowsplit:function(){var b=e.plugin.getSelectedTable()[0],c=e.plugin.getSelectedRow()[0],f=e.plugin.getSelectedCell()[0],g=c.rowIndex;if(1!==f.rowSpan){for(var h=d(b,c,f),i=1,j=f.rowSpan;j>i;i++){var k=b.rows[g+i],l=k.insertCell(h);f.colSpan>1&&(l.colSpan=f.colSpan),l.innerHTML=a.IE?"":"
",h=d(b,k,l)}a(f).removeAttr("rowSpan"),e.cmd.range.selectNodeContents(f).collapse(!0),e.cmd.select(),e.addBookmark()}},colsplit:function(){var b=(e.plugin.getSelectedTable()[0],e.plugin.getSelectedRow()[0]),c=e.plugin.getSelectedCell()[0],d=c.cellIndex;if(1!==c.colSpan){for(var f=1,g=c.colSpan;g>f;f++){var h=b.insertCell(d+f);c.rowSpan>1&&(h.rowSpan=c.rowSpan),h.innerHTML=a.IE?"":"
"}a(c).removeAttr("colSpan"),e.cmd.range.selectNodeContents(c).collapse(!0),e.cmd.select(),e.addBookmark()}},coldelete:function(){for(var b=e.plugin.getSelectedTable()[0],c=e.plugin.getSelectedRow()[0],d=e.plugin.getSelectedCell()[0],f=d.cellIndex,g=0,h=b.rows.length;h>g;g++){var i=b.rows[g],j=i.cells[f];j.colSpan>1?(j.colSpan-=1,1===j.colSpan&&a(j).removeAttr("colSpan")):i.deleteCell(f),j.rowSpan>1&&(g+=j.rowSpan-1)}0===c.cells.length?(e.cmd.range.setStartBefore(b).collapse(!0),e.cmd.select(),a(b).remove()):e.cmd.selection(!0),e.addBookmark()},rowdelete:function(){for(var b=e.plugin.getSelectedTable()[0],c=e.plugin.getSelectedRow()[0],d=e.plugin.getSelectedCell()[0],f=c.rowIndex,g=d.rowSpan-1;g>=0;g--)b.deleteRow(f+g);0===b.rows.length?(e.cmd.range.setStartBefore(b).collapse(!0),e.cmd.select(),a(b).remove()):e.cmd.selection(!0),e.addBookmark()}},e.clickToolbar(f,e.plugin.table.prop)}),KindEditor.plugin("template",function(a){function b(b){return e+b+"?ver="+encodeURIComponent(a.DEBUG?a.TIME:a.VERSION)}var c=this,d="template",e=(c.lang(d+"."),c.pluginsPath+d+"/html/");c.clickToolbar(d,function(){var e=c.lang(d+"."),f=['
','
','
',e.selectTemplate+"
",'
',' ","
",'
',"
",'',"
"].join("");var g=c.createDialog({name:d,width:500,title:c.lang(d),body:html,yesBtn:{name:c.lang("yes"),click:function(){var b=a.iframeDoc(j);c[i[0].checked?"html":"insertHtml"](b.body.innerHTML).hideDialog().focus()}}}),h=a("select",g.div),i=a('[name="replaceFlag"]',g.div),j=a("iframe",g.div);i[0].checked=!0,j.attr("src",b(h.val())),h.change(function(){j.attr("src",b(this.value))})})}),KindEditor.plugin("wordpaste",function(a){var b=this,c="wordpaste";b.clickToolbar(c,function(){var d=b.lang(c+"."),e='
'+d.comment+'
',f=b.createDialog({name:c,width:450,title:b.lang(c),body:e,yesBtn:{name:b.lang("yes"),click:function(){var c=i.body.innerHTML;c=a.clearMsWord(c,b.filterMode?b.htmlTags:a.options.htmlTags),b.insertHtml(c).hideDialog().focus()}}}),g=f.div,h=a("iframe",g),i=a.iframeDoc(h);a.IE||(i.designMode="on"),i.open(),i.write("WordPaste"),i.write(''),a.IE||i.write("
"),i.write(""),i.close(),a.IE&&(i.body.contentEditable="true"),h[0].contentWindow.focus()})}),KindEditor.plugin("fixtoolbar",function(a){function b(){var b=a(".ke-toolbar"),c=b.pos().y;a(window).bind("scroll",function(){"fixed"==b.css("position")?document.body.scrollTop-c<0&&(b.css("position","static"),b.css("top","auto")):b.pos().y-document.body.scrollTop<0&&(b.css("position","fixed"),b.css("top",0))})}var c=this;c.fixToolBar&&(c.isCreated?b():c.afterCreate(b))}); \ No newline at end of file diff --git a/infoport/static/js/lib/kindeditor/kindeditor-all.js b/infoport/static/js/lib/kindeditor/kindeditor-all.js new file mode 100644 index 0000000..17e29b0 --- /dev/null +++ b/infoport/static/js/lib/kindeditor/kindeditor-all.js @@ -0,0 +1,9901 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2016 kindsoft.net +* +* @author Roddy +* @website http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +* @version 4.1.11 (2016-03-31) +*******************************************************************************/ +(function (window, undefined) { + if (window.KindEditor) { + return; + } + + +if (!window.console) { + window.console = {}; +} +if (!console.log) { + console.log = function () {}; +} +var _VERSION = '4.1.11 (2016-03-31)', + _ua = navigator.userAgent.toLowerCase(), + _IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1, + _NEWIE = _ua.indexOf('msie') == -1 && _ua.indexOf('trident') > -1, + _GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1, + _WEBKIT = _ua.indexOf('applewebkit') > -1, + _OPERA = _ua.indexOf('opera') > -1, + _MOBILE = _ua.indexOf('mobile') > -1, + _IOS = /ipad|iphone|ipod/.test(_ua), + _QUIRKS = document.compatMode != 'CSS1Compat', + _IERANGE = !window.getSelection, + _matches = /(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(_ua), + _V = _matches ? _matches[1] : '0', + _TIME = new Date().getTime(); +function _isArray(val) { + if (!val) { + return false; + } + return Object.prototype.toString.call(val) === '[object Array]'; +} +function _isFunction(val) { + if (!val) { + return false; + } + return Object.prototype.toString.call(val) === '[object Function]'; +} +function _inArray(val, arr) { + for (var i = 0, len = arr.length; i < len; i++) { + if (val === arr[i]) { + return i; + } + } + return -1; +} +function _each(obj, fn) { + if (_isArray(obj)) { + for (var i = 0, len = obj.length; i < len; i++) { + if (fn.call(obj[i], i, obj[i]) === false) { + break; + } + } + } else { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + if (fn.call(obj[key], key, obj[key]) === false) { + break; + } + } + } + } +} +function _trim(str) { + return str.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, ''); +} +function _inString(val, str, delimiter) { + delimiter = delimiter === undefined ? ',' : delimiter; + return (delimiter + str + delimiter).indexOf(delimiter + val + delimiter) >= 0; +} +function _addUnit(val, unit) { + unit = unit || 'px'; + return val && /^-?\d+(?:\.\d+)?$/.test(val) ? val + unit : val; +} +function _removeUnit(val) { + var match; + return val && (match = /(\d+)/.exec(val)) ? parseInt(match[1], 10) : 0; +} +function _escape(val) { + return val.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); +} +function _unescape(val) { + return val.replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/&/g, '&'); +} +function _toCamel(str) { + var arr = str.split('-'); + str = ''; + _each(arr, function(key, val) { + str += (key > 0) ? val.charAt(0).toUpperCase() + val.substr(1) : val; + }); + return str; +} +function _toHex(val) { + function hex(d) { + var s = parseInt(d, 10).toString(16).toUpperCase(); + return s.length > 1 ? s : '0' + s; + } + return val.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig, + function($0, $1, $2, $3) { + return '#' + hex($1) + hex($2) + hex($3); + } + ); +} +function _toMap(val, delimiter) { + delimiter = delimiter === undefined ? ',' : delimiter; + var map = {}, arr = _isArray(val) ? val : val.split(delimiter), match; + _each(arr, function(key, val) { + if ((match = /^(\d+)\.\.(\d+)$/.exec(val))) { + for (var i = parseInt(match[1], 10); i <= parseInt(match[2], 10); i++) { + map[i.toString()] = true; + } + } else { + map[val] = true; + } + }); + return map; +} +function _toArray(obj, offset) { + return Array.prototype.slice.call(obj, offset || 0); +} +function _undef(val, defaultVal) { + return val === undefined ? defaultVal : val; +} +function _invalidUrl(url) { + return !url || /[<>"]/.test(url); +} +function _addParam(url, param) { + return url.indexOf('?') >= 0 ? url + '&' + param : url + '?' + param; +} +function _extend(child, parent, proto) { + if (!proto) { + proto = parent; + parent = null; + } + var childProto; + if (parent) { + var fn = function () {}; + fn.prototype = parent.prototype; + childProto = new fn(); + _each(proto, function(key, val) { + childProto[key] = val; + }); + } else { + childProto = proto; + } + childProto.constructor = child; + child.prototype = childProto; + child.parent = parent ? parent.prototype : null; +} + + +function _json(text) { + var match; + if ((match = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))) { + text = match[0]; + } + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + if (/^[\],:{}\s]*$/. + test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). + replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). + replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + return eval('(' + text + ')'); + } + throw 'JSON parse error'; +} +var _round = Math.round; +var K = { + DEBUG : false, + VERSION : _VERSION, + IE : _IE, + GECKO : _GECKO, + WEBKIT : _WEBKIT, + OPERA : _OPERA, + V : _V, + TIME : _TIME, + each : _each, + isArray : _isArray, + isFunction : _isFunction, + inArray : _inArray, + inString : _inString, + trim : _trim, + addUnit : _addUnit, + removeUnit : _removeUnit, + escape : _escape, + unescape : _unescape, + toCamel : _toCamel, + toHex : _toHex, + toMap : _toMap, + toArray : _toArray, + undef : _undef, + invalidUrl : _invalidUrl, + addParam : _addParam, + extend : _extend, + json : _json +}; +var _INLINE_TAG_MAP = _toMap('a,abbr,acronym,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,img,input,ins,kbd,label,map,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'), + _BLOCK_TAG_MAP = _toMap('address,applet,blockquote,body,center,dd,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,head,hr,html,iframe,ins,isindex,li,map,menu,meta,noframes,noscript,object,ol,p,pre,script,style,table,tbody,td,tfoot,th,thead,title,tr,ul'), + _SINGLE_TAG_MAP = _toMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed'), + _STYLE_TAG_MAP = _toMap('b,basefont,big,del,em,font,i,s,small,span,strike,strong,sub,sup,u'), + _CONTROL_TAG_MAP = _toMap('img,table,input,textarea,button'), + _PRE_TAG_MAP = _toMap('pre,style,script'), + _NOSPLIT_TAG_MAP = _toMap('html,head,body,td,tr,table,ol,ul,li'), + _AUTOCLOSE_TAG_MAP = _toMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'), + _FILL_ATTR_MAP = _toMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'), + _VALUE_TAG_MAP = _toMap('input,button,textarea,select'); + + +function _getBasePath() { + var els = document.getElementsByTagName('script'), src; + for (var i = 0, len = els.length; i < len; i++) { + src = els[i].src || ''; + if (/kindeditor[\w\-\.]*\.js/.test(src)) { + return src.substring(0, src.lastIndexOf('/') + 1); + } + } + return ''; +} +K.basePath = _getBasePath(); +K.options = { + designMode : true, + fullscreenMode : false, + filterMode : true, + wellFormatMode : true, + shadowMode : true, + loadStyleMode : true, + basePath : K.basePath, + themesPath : K.basePath + 'themes/', + langPath : K.basePath + 'lang/', + pluginsPath : K.basePath + 'plugins/', + themeType : 'default', + langType : 'zh-CN', + urlType : '', + newlineTag : 'p', + resizeType : 2, + syncType : 'form', + pasteType : 2, + dialogAlignType : 'page', + useContextmenu : true, + fullscreenShortcut : false, + bodyClass : 'ke-content', + indentChar : '\t', + cssPath : '', + cssData : '', + minWidth : 650, + minHeight : 100, + minChangeSize : 50, + zIndex : 811213, + items : [ + 'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste', + 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', + 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', + 'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/', + 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', + 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage', + 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', + 'anchor', 'link', 'unlink', '|', 'about' + ], + noDisableItems : ['source', 'fullscreen'], + colorTable : [ + ['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'], + ['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'], + ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'], + ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000'] + ], + fontSizeTable : ['9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px'], + htmlTags : { + font : ['id', 'class', 'color', 'size', 'face', '.background-color'], + span : [ + 'id', 'class', '.color', '.background-color', '.font-size', '.font-family', '.background', + '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height' + ], + div : [ + 'id', 'class', 'align', '.border', '.margin', '.padding', '.text-align', '.color', + '.background-color', '.font-size', '.font-family', '.font-weight', '.background', + '.font-style', '.text-decoration', '.vertical-align', '.margin-left' + ], + table: [ + 'id', 'class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor', + '.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color', + '.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background', + '.width', '.height', '.border-collapse' + ], + 'td,th': [ + 'id', 'class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor', + '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight', + '.font-style', '.text-decoration', '.vertical-align', '.background', '.border' + ], + a : ['id', 'class', 'href', 'target', 'name'], + embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess', 'wmode'], + img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'], + 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [ + 'id', 'class', 'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background', + '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left' + ], + pre : ['id', 'class'], + hr : ['id', 'class', '.page-break-after'], + 'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : ['id', 'class'], + iframe : ['id', 'class', 'src', 'frameborder', 'width', 'height', '.width', '.height'] + }, + layout : '
' +}; + + +var _useCapture = false; + + +var _INPUT_KEY_MAP = _toMap('8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222'); + +var _CURSORMOVE_KEY_MAP = _toMap('33..40'); + +var _CHANGE_KEY_MAP = {}; +_each(_INPUT_KEY_MAP, function(key, val) { + _CHANGE_KEY_MAP[key] = val; +}); +_each(_CURSORMOVE_KEY_MAP, function(key, val) { + _CHANGE_KEY_MAP[key] = val; +}); + + +function _bindEvent(el, type, fn) { + if (el.addEventListener){ + el.addEventListener(type, fn, _useCapture); + } else if (el.attachEvent){ + el.attachEvent('on' + type, fn); + } +} + +function _unbindEvent(el, type, fn) { + if (el.removeEventListener){ + el.removeEventListener(type, fn, _useCapture); + } else if (el.detachEvent){ + el.detachEvent('on' + type, fn); + } +} +var _EVENT_PROPS = ('altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,' + + 'data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,' + + 'pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which').split(','); + + +function KEvent(el, event) { + this.init(el, event); +} +_extend(KEvent, { + init : function(el, event) { + var self = this, doc = el.ownerDocument || el.document || el; + self.event = event; + _each(_EVENT_PROPS, function(key, val) { + self[val] = event[val]; + }); + if (!self.target) { + self.target = self.srcElement || doc; + } + if (self.target.nodeType === 3) { + self.target = self.target.parentNode; + } + if (!self.relatedTarget && self.fromElement) { + self.relatedTarget = self.fromElement === self.target ? self.toElement : self.fromElement; + } + if (self.pageX == null && self.clientX != null) { + var d = doc.documentElement, body = doc.body; + self.pageX = self.clientX + (d && d.scrollLeft || body && body.scrollLeft || 0) - (d && d.clientLeft || body && body.clientLeft || 0); + self.pageY = self.clientY + (d && d.scrollTop || body && body.scrollTop || 0) - (d && d.clientTop || body && body.clientTop || 0); + } + if (!self.which && ((self.charCode || self.charCode === 0) ? self.charCode : self.keyCode)) { + self.which = self.charCode || self.keyCode; + } + if (!self.metaKey && self.ctrlKey) { + self.metaKey = self.ctrlKey; + } + if (!self.which && self.button !== undefined) { + self.which = (self.button & 1 ? 1 : (self.button & 2 ? 3 : (self.button & 4 ? 2 : 0))); + } + switch (self.which) { + case 186 : + self.which = 59; + break; + case 187 : + case 107 : + case 43 : + self.which = 61; + break; + case 189 : + case 45 : + self.which = 109; + break; + case 42 : + self.which = 106; + break; + case 47 : + self.which = 111; + break; + case 78 : + self.which = 110; + break; + } + if (self.which >= 96 && self.which <= 105) { + self.which -= 48; + } + }, + preventDefault : function() { + var ev = this.event; + if (ev.preventDefault) { + ev.preventDefault(); + } else { + ev.returnValue = false; + } + }, + stopPropagation : function() { + var ev = this.event; + if (ev.stopPropagation) { + ev.stopPropagation(); + } else { + ev.cancelBubble = true; + } + }, + stop : function() { + this.preventDefault(); + this.stopPropagation(); + } +}); +var _eventExpendo = 'kindeditor_' + _TIME, _eventId = 0, _eventData = {}; +function _getId(el) { + return el[_eventExpendo] || null; +} +function _setId(el) { + el[_eventExpendo] = ++_eventId; + return _eventId; +} +function _removeId(el) { + try { + delete el[_eventExpendo]; + } catch(e) { + if (el.removeAttribute) { + el.removeAttribute(_eventExpendo); + } + } +} +function _bind(el, type, fn) { + if (type.indexOf(',') >= 0) { + _each(type.split(','), function() { + _bind(el, this, fn); + }); + return; + } + var id = _getId(el); + if (!id) { + id = _setId(el); + } + if (_eventData[id] === undefined) { + _eventData[id] = {}; + } + var events = _eventData[id][type]; + if (events && events.length > 0) { + _unbindEvent(el, type, events[0]); + } else { + _eventData[id][type] = []; + _eventData[id].el = el; + } + events = _eventData[id][type]; + if (events.length === 0) { + events[0] = function(e) { + var kevent = e ? new KEvent(el, e) : undefined; + _each(events, function(i, event) { + if (i > 0 && event) { + event.call(el, kevent); + } + }); + }; + } + if (_inArray(fn, events) < 0) { + events.push(fn); + } + _bindEvent(el, type, events[0]); +} +function _unbind(el, type, fn) { + if (type && type.indexOf(',') >= 0) { + _each(type.split(','), function() { + _unbind(el, this, fn); + }); + return; + } + var id = _getId(el); + if (!id) { + return; + } + if (type === undefined) { + if (id in _eventData) { + _each(_eventData[id], function(key, events) { + if (key != 'el' && events.length > 0) { + _unbindEvent(el, key, events[0]); + } + }); + delete _eventData[id]; + _removeId(el); + } + return; + } + if (!_eventData[id]) { + return; + } + var events = _eventData[id][type]; + if (events && events.length > 0) { + if (fn === undefined) { + _unbindEvent(el, type, events[0]); + delete _eventData[id][type]; + } else { + _each(events, function(i, event) { + if (i > 0 && event === fn) { + events.splice(i, 1); + } + }); + if (events.length == 1) { + _unbindEvent(el, type, events[0]); + delete _eventData[id][type]; + } + } + var count = 0; + _each(_eventData[id], function() { + count++; + }); + if (count < 2) { + delete _eventData[id]; + _removeId(el); + } + } +} +function _fire(el, type) { + if (type.indexOf(',') >= 0) { + _each(type.split(','), function() { + _fire(el, this); + }); + return; + } + var id = _getId(el); + if (!id) { + return; + } + var events = _eventData[id][type]; + if (_eventData[id] && events && events.length > 0) { + events[0](); + } +} +function _ctrl(el, key, fn) { + var self = this; + key = /^\d{2,}$/.test(key) ? key : key.toUpperCase().charCodeAt(0); + _bind(el, 'keydown', function(e) { + if (e.ctrlKey && e.which == key && !e.shiftKey && !e.altKey) { + fn.call(el); + e.stop(); + } + }); +} +var _readyFinished = false; +function _ready(fn) { + console.log(fn) + if (_readyFinished) { + fn(KindEditor); + return; + } + var loaded = false; + function readyFunc() { + if (!loaded) { + loaded = true; + fn(KindEditor); + _readyFinished = true; + } + } + function ieReadyFunc() { + if (!loaded) { + try { + document.documentElement.doScroll('left'); + } catch(e) { + setTimeout(ieReadyFunc, 100); + return; + } + readyFunc(); + } + } + function ieReadyStateFunc() { + if (document.readyState === 'complete') { + readyFunc(); + } + } + if (document.addEventListener) { + _bind(document, 'DOMContentLoaded', readyFunc); + } else if (document.attachEvent) { + _bind(document, 'readystatechange', ieReadyStateFunc); + var toplevel = false; + try { + toplevel = window.frameElement == null; + } catch(e) {} + if (document.documentElement.doScroll && toplevel) { + ieReadyFunc(); + } + } + _bind(window, 'load', readyFunc); +} +if (window.attachEvent) { + window.attachEvent('onunload', function() { + _each(_eventData, function(key, events) { + if (events.el) { + _unbind(events.el); + } + }); + }); +} +K.ctrl = _ctrl; +K.ready = _ready; + +function _getCssList(css) { + var list = {}, + reg = /\s*([\w\-]+)\s*:([^;]*)(;|$)/g, + match; + while ((match = reg.exec(css))) { + var key = _trim(match[1].toLowerCase()), + val = _trim(_toHex(match[2])); + list[key] = val; + } + return list; +} +function _getAttrList(tag) { + var list = {}, + reg = /\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g, + match; + while ((match = reg.exec(tag))) { + var key = (match[1] || match[2] || match[4] || match[6]).toLowerCase(), + val = (match[2] ? match[3] : (match[4] ? match[5] : match[7])) || ''; + list[key] = val; + } + return list; +} +function _addClassToTag(tag, className) { + if (/\s+class\s*=/.test(tag)) { + tag = tag.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/, function($0, $1, $2, $3) { + if ((' ' + $2 + ' ').indexOf(' ' + className + ' ') < 0) { + return $2 === '' ? $1 + className + $3 : $1 + $2 + ' ' + className + $3; + } else { + return $0; + } + }); + } else { + tag = tag.substr(0, tag.length - 1) + ' class="' + className + '">'; + } + return tag; +} +function _formatCss(css) { + var str = ''; + _each(_getCssList(css), function(key, val) { + str += key + ':' + val + ';'; + }); + return str; +} +function _formatUrl(url, mode, host, pathname) { + mode = _undef(mode, '').toLowerCase(); + if (url.substr(0, 5) != 'data:') { + url = url.replace(/([^:])\/\//g, '$1/'); + } + if (_inArray(mode, ['absolute', 'relative', 'domain']) < 0) { + return url; + } + host = host || location.protocol + '//' + location.host; + if (pathname === undefined) { + var m = location.pathname.match(/^(\/.*)\//); + pathname = m ? m[1] : ''; + } + var match; + if ((match = /^(\w+:\/\/[^\/]*)/.exec(url))) { + if (match[1] !== host) { + return url; + } + } else if (/^\w+:/.test(url)) { + return url; + } + function getRealPath(path) { + var parts = path.split('/'), paths = []; + for (var i = 0, len = parts.length; i < len; i++) { + var part = parts[i]; + if (part == '..') { + if (paths.length > 0) { + paths.pop(); + } + } else if (part !== '' && part != '.') { + paths.push(part); + } + } + return '/' + paths.join('/'); + } + if (/^\//.test(url)) { + url = host + getRealPath(url.substr(1)); + } else if (!/^\w+:\/\//.test(url)) { + url = host + getRealPath(pathname + '/' + url); + } + function getRelativePath(path, depth) { + if (url.substr(0, path.length) === path) { + var arr = []; + for (var i = 0; i < depth; i++) { + arr.push('..'); + } + var prefix = '.'; + if (arr.length > 0) { + prefix += '/' + arr.join('/'); + } + if (pathname == '/') { + prefix += '/'; + } + return prefix + url.substr(path.length); + } else { + if ((match = /^(.*)\//.exec(path))) { + return getRelativePath(match[1], ++depth); + } + } + } + if (mode === 'relative') { + url = getRelativePath(host + pathname, 0).substr(2); + } else if (mode === 'absolute') { + if (url.substr(0, host.length) === host) { + url = url.substr(host.length); + } + } + return url; +} +function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) { + if (html == null) { + html = ''; + } + urlType = urlType || ''; + wellFormatted = _undef(wellFormatted, false); + indentChar = _undef(indentChar, '\t'); + var fontSizeList = 'xx-small,x-small,small,medium,large,x-large,xx-large'.split(','); + html = html.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig, function($0, $1, $2, $3) { + return $1 + $2.replace(/<(?:br|br\s[^>]*)>/ig, '\n') + $3; + }); + html = html.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig, '

'); + html = html.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig, '$1
$2'); + html = html.replace(/\u200B/g, ''); + html = html.replace(/\u00A9/g, '©'); + html = html.replace(/\u00AE/g, '®'); + html = html.replace(/\u2003/g, ' '); + html = html.replace(/\u3000/g, ' '); + html = html.replace(/<[^>]+/g, function($0) { + return $0.replace(/\s+/g, ' '); + }); + var htmlTagMap = {}; + if (htmlTags) { + _each(htmlTags, function(key, val) { + var arr = key.split(','); + for (var i = 0, len = arr.length; i < len; i++) { + htmlTagMap[arr[i]] = _toMap(val); + } + }); + if (!htmlTagMap.script) { + html = html.replace(/(<(?:script|script\s[^>]*)>)([\s\S]*?)(<\/script>)/ig, ''); + } + if (!htmlTagMap.style) { + html = html.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig, ''); + } + } + var re = /(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g; + var tagStack = []; + html = html.replace(re, function($0, $1, $2, $3, $4, $5, $6) { + var full = $0, + startNewline = $1 || '', + startSlash = $2 || '', + tagName = $3.toLowerCase(), + attr = $4 || '', + endSlash = $5 ? ' ' + $5 : '', + endNewline = $6 || ''; + if (htmlTags && !htmlTagMap[tagName]) { + return ''; + } + if (endSlash === '' && _SINGLE_TAG_MAP[tagName]) { + endSlash = ' /'; + } + if (_INLINE_TAG_MAP[tagName]) { + if (startNewline) { + startNewline = ' '; + } + if (endNewline) { + endNewline = ' '; + } + } + if (_PRE_TAG_MAP[tagName]) { + if (startSlash) { + endNewline = '\n'; + } else { + startNewline = '\n'; + } + } + if (wellFormatted && tagName == 'br') { + endNewline = '\n'; + } + if (_BLOCK_TAG_MAP[tagName] && !_PRE_TAG_MAP[tagName]) { + if (wellFormatted) { + if (startSlash && tagStack.length > 0 && tagStack[tagStack.length - 1] === tagName) { + tagStack.pop(); + } else { + tagStack.push(tagName); + } + startNewline = '\n'; + endNewline = '\n'; + for (var i = 0, len = startSlash ? tagStack.length : tagStack.length - 1; i < len; i++) { + startNewline += indentChar; + if (!startSlash) { + endNewline += indentChar; + } + } + if (endSlash) { + tagStack.pop(); + } else if (!startSlash) { + endNewline += indentChar; + } + } else { + startNewline = endNewline = ''; + } + } + if (attr !== '') { + var attrMap = _getAttrList(full); + if (tagName === 'font') { + var fontStyleMap = {}, fontStyle = ''; + _each(attrMap, function(key, val) { + if (key === 'color') { + fontStyleMap.color = val; + delete attrMap[key]; + } + if (key === 'size') { + fontStyleMap['font-size'] = fontSizeList[parseInt(val, 10) - 1] || ''; + delete attrMap[key]; + } + if (key === 'face') { + fontStyleMap['font-family'] = val; + delete attrMap[key]; + } + if (key === 'style') { + fontStyle = val; + } + }); + if (fontStyle && !/;$/.test(fontStyle)) { + fontStyle += ';'; + } + _each(fontStyleMap, function(key, val) { + if (val === '') { + return; + } + if (/\s/.test(val)) { + val = "'" + val + "'"; + } + fontStyle += key + ':' + val + ';'; + }); + attrMap.style = fontStyle; + } + _each(attrMap, function(key, val) { + if (_FILL_ATTR_MAP[key]) { + attrMap[key] = key; + } + if (_inArray(key, ['src', 'href']) >= 0) { + attrMap[key] = _formatUrl(val, urlType); + } + if (htmlTags && key !== 'style' && !htmlTagMap[tagName]['*'] && !htmlTagMap[tagName][key] || + tagName === 'body' && key === 'contenteditable' || + /^kindeditor_\d+$/.test(key)) { + delete attrMap[key]; + } + if (key === 'style' && val !== '') { + var styleMap = _getCssList(val); + _each(styleMap, function(k, v) { + if (htmlTags && !htmlTagMap[tagName].style && !htmlTagMap[tagName]['.' + k]) { + delete styleMap[k]; + } + }); + var style = ''; + _each(styleMap, function(k, v) { + style += k + ':' + v + ';'; + }); + attrMap.style = style; + } + }); + attr = ''; + _each(attrMap, function(key, val) { + if (key === 'style' && val === '') { + return; + } + val = val.replace(/"/g, '"'); + attr += ' ' + key + '="' + val + '"'; + }); + } + if (tagName === 'font') { + tagName = 'span'; + } + return startNewline + '<' + startSlash + tagName + attr + endSlash + '>' + endNewline; + }); + html = html.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig, function($0, $1, $2, $3) { + return $1 + $2.replace(/\n/g, '\n') + $3; + }); + html = html.replace(/\n\s*\n/g, '\n'); + html = html.replace(/\n/g, '\n'); + return _trim(html); +} + +function _clearMsWord(html, htmlTags) { + html = html.replace(//ig, '') + .replace(//ig, '') + .replace(/]*>[\s\S]*?<\/style>/ig, '') + .replace(/]*>[\s\S]*?<\/script>/ig, '') + .replace(/]+>[\s\S]*?<\/w:[^>]+>/ig, '') + .replace(/]+>[\s\S]*?<\/o:[^>]+>/ig, '') + .replace(/[\s\S]*?<\/xml>/ig, '') + .replace(/<(?:table|td)[^>]*>/ig, function(full) { + return full.replace(/border-bottom:([#\w\s]+)/ig, 'border:$1'); + }); + return _formatHtml(html, htmlTags); +} + +function _mediaType(src) { + if (/\.(rm|rmvb)(\?|$)/i.test(src)) { + return 'audio/x-pn-realaudio-plugin'; + } + if (/\.(swf|flv)(\?|$)/i.test(src)) { + return 'application/x-shockwave-flash'; + } + return 'video/x-ms-asf-plugin'; +} + +function _mediaClass(type) { + if (/realaudio/i.test(type)) { + return 'ke-rm'; + } + if (/flash/i.test(type)) { + return 'ke-flash'; + } + return 'ke-media'; +} +function _mediaAttrs(srcTag) { + return _getAttrList(unescape(srcTag)); +} +function _mediaEmbed(attrs) { + var html = ' 0) { + style += 'width:' + width + 'px;'; + } + if (/\D/.test(height)) { + style += 'height:' + height + ';'; + } else if (height > 0) { + style += 'height:' + height + 'px;'; + } + var html = ''; + return html; +} + + + + +function _tmpl(str, data) { + var fn = new Function("obj", + "var p=[],print=function(){p.push.apply(p,arguments);};" + + "with(obj){p.push('" + + str.replace(/[\r\t\n]/g, " ") + .split("<%").join("\t") + .replace(/((^|%>)[^\t]*)'/g, "$1\r") + .replace(/\t=(.*?)%>/g, "',$1,'") + .split("\t").join("');") + .split("%>").join("p.push('") + .split("\r").join("\\'") + "');}return p.join('');"); + return data ? fn(data) : fn; +} +K.formatUrl = _formatUrl; +K.formatHtml = _formatHtml; +K.getCssList = _getCssList; +K.getAttrList = _getAttrList; +K.mediaType = _mediaType; +K.mediaAttrs = _mediaAttrs; +K.mediaEmbed = _mediaEmbed; +K.mediaImg = _mediaImg; +K.clearMsWord = _clearMsWord; +K.tmpl = _tmpl; + + +function _contains(nodeA, nodeB) { + if (nodeA.nodeType == 9 && nodeB.nodeType != 9) { + return true; + } + while ((nodeB = nodeB.parentNode)) { + if (nodeB == nodeA) { + return true; + } + } + return false; +} +var _getSetAttrDiv = document.createElement('div'); +_getSetAttrDiv.setAttribute('className', 't'); +var _GET_SET_ATTRIBUTE = _getSetAttrDiv.className !== 't'; +function _getAttr(el, key) { + key = key.toLowerCase(); + var val = null; + if (!_GET_SET_ATTRIBUTE && el.nodeName.toLowerCase() != 'script') { + var div = el.ownerDocument.createElement('div'); + div.appendChild(el.cloneNode(false)); + var list = _getAttrList(_unescape(div.innerHTML)); + if (key in list) { + val = list[key]; + } + } else { + try { + val = el.getAttribute(key, 2); + } catch(e) { + val = el.getAttribute(key, 1); + } + } + if (key === 'style' && val !== null) { + val = _formatCss(val); + } + return val; +} +function _queryAll(expr, root) { + var exprList = expr.split(','); + if (exprList.length > 1) { + var mergedResults = []; + _each(exprList, function() { + _each(_queryAll(this, root), function() { + if (_inArray(this, mergedResults) < 0) { + mergedResults.push(this); + } + }); + }); + return mergedResults; + } + root = root || document; + function escape(str) { + if (typeof str != 'string') { + return str; + } + return str.replace(/([^\w\-])/g, '\\$1'); + } + function stripslashes(str) { + return str.replace(/\\/g, ''); + } + function cmpTag(tagA, tagB) { + return tagA === '*' || tagA.toLowerCase() === escape(tagB.toLowerCase()); + } + function byId(id, tag, root) { + var arr = [], + doc = root.ownerDocument || root, + el = doc.getElementById(stripslashes(id)); + if (el) { + if (cmpTag(tag, el.nodeName) && _contains(root, el)) { + arr.push(el); + } + } + return arr; + } + function byClass(className, tag, root) { + var doc = root.ownerDocument || root, arr = [], els, i, len, el; + if (root.getElementsByClassName) { + els = root.getElementsByClassName(stripslashes(className)); + for (i = 0, len = els.length; i < len; i++) { + el = els[i]; + if (cmpTag(tag, el.nodeName)) { + arr.push(el); + } + } + } else if (doc.querySelectorAll) { + els = doc.querySelectorAll((root.nodeName !== '#document' ? root.nodeName + ' ' : '') + tag + '.' + className); + for (i = 0, len = els.length; i < len; i++) { + el = els[i]; + if (_contains(root, el)) { + arr.push(el); + } + } + } else { + els = root.getElementsByTagName(tag); + className = ' ' + className + ' '; + for (i = 0, len = els.length; i < len; i++) { + el = els[i]; + if (el.nodeType == 1) { + var cls = el.className; + if (cls && (' ' + cls + ' ').indexOf(className) > -1) { + arr.push(el); + } + } + } + } + return arr; + } + function byName(name, tag, root) { + var arr = [], doc = root.ownerDocument || root, + els = doc.getElementsByName(stripslashes(name)), el; + for (var i = 0, len = els.length; i < len; i++) { + el = els[i]; + if (cmpTag(tag, el.nodeName) && _contains(root, el)) { + if (el.getAttribute('name') !== null) { + arr.push(el); + } + } + } + return arr; + } + function byAttr(key, val, tag, root) { + var arr = [], els = root.getElementsByTagName(tag), el; + for (var i = 0, len = els.length; i < len; i++) { + el = els[i]; + if (el.nodeType == 1) { + if (val === null) { + if (_getAttr(el, key) !== null) { + arr.push(el); + } + } else { + if (val === escape(_getAttr(el, key))) { + arr.push(el); + } + } + } + } + return arr; + } + function select(expr, root) { + var arr = [], matches; + matches = /^((?:\\.|[^.#\s\[<>])+)/.exec(expr); + var tag = matches ? matches[1] : '*'; + if ((matches = /#((?:[\w\-]|\\.)+)$/.exec(expr))) { + arr = byId(matches[1], tag, root); + } else if ((matches = /\.((?:[\w\-]|\\.)+)$/.exec(expr))) { + arr = byClass(matches[1], tag, root); + } else if ((matches = /\[((?:[\w\-]|\\.)+)\]/.exec(expr))) { + arr = byAttr(matches[1].toLowerCase(), null, tag, root); + } else if ((matches = /\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(expr))) { + var key = matches[1].toLowerCase(), val = matches[2]; + if (key === 'id') { + arr = byId(val, tag, root); + } else if (key === 'class') { + arr = byClass(val, tag, root); + } else if (key === 'name') { + arr = byName(val, tag, root); + } else { + arr = byAttr(key, val, tag, root); + } + } else { + var els = root.getElementsByTagName(tag), el; + for (var i = 0, len = els.length; i < len; i++) { + el = els[i]; + if (el.nodeType == 1) { + arr.push(el); + } + } + } + return arr; + } + var parts = [], arr, re = /((?:\\.|[^\s>])+|[\s>])/g; + while ((arr = re.exec(expr))) { + if (arr[1] !== ' ') { + parts.push(arr[1]); + } + } + var results = []; + if (parts.length == 1) { + return select(parts[0], root); + } + var isChild = false, part, els, subResults, val, v, i, j, k, length, len, l; + for (i = 0, lenth = parts.length; i < lenth; i++) { + part = parts[i]; + if (part === '>') { + isChild = true; + continue; + } + if (i > 0) { + els = []; + for (j = 0, len = results.length; j < len; j++) { + val = results[j]; + subResults = select(part, val); + for (k = 0, l = subResults.length; k < l; k++) { + v = subResults[k]; + if (isChild) { + if (val === v.parentNode) { + els.push(v); + } + } else { + els.push(v); + } + } + } + results = els; + } else { + results = select(part, root); + } + if (results.length === 0) { + return []; + } + } + return results; +} +function _query(expr, root) { + var arr = _queryAll(expr, root); + return arr.length > 0 ? arr[0] : null; +} +K.query = _query; +K.queryAll = _queryAll; + + +function _get(val) { + return K(val)[0]; +} +function _getDoc(node) { + if (!node) { + return document; + } + return node.ownerDocument || node.document || node; +} +function _getWin(node) { + if (!node) { + return window; + } + var doc = _getDoc(node); + return doc.parentWindow || doc.defaultView; +} +function _setHtml(el, html) { + if (el.nodeType != 1) { + return; + } + var doc = _getDoc(el); + try { + el.innerHTML = '' + html; + var temp = doc.getElementById('__kindeditor_temp_tag__'); + temp.parentNode.removeChild(temp); + } catch(e) { + K(el).empty(); + K('@' + html, doc).each(function() { + el.appendChild(this); + }); + } +} +function _hasClass(el, cls) { + return _inString(cls, el.className, ' '); +} +function _setAttr(el, key, val) { + if (_IE && _V < 8 && key.toLowerCase() == 'class') { + key = 'className'; + } + el.setAttribute(key, '' + val); +} +function _removeAttr(el, key) { + if (_IE && _V < 8 && key.toLowerCase() == 'class') { + key = 'className'; + } + _setAttr(el, key, ''); + el.removeAttribute(key); +} +function _getNodeName(node) { + if (!node || !node.nodeName) { + return ''; + } + return node.nodeName.toLowerCase(); +} +function _computedCss(el, key) { + var self = this, win = _getWin(el), camelKey = _toCamel(key), val = ''; + if (win.getComputedStyle) { + var style = win.getComputedStyle(el, null); + val = style[camelKey] || style.getPropertyValue(key) || el.style[camelKey]; + } else if (el.currentStyle) { + val = el.currentStyle[camelKey] || el.style[camelKey]; + } + return val; +} +function _hasVal(node) { + return !!_VALUE_TAG_MAP[_getNodeName(node)]; +} +function _docElement(doc) { + doc = doc || document; + return _QUIRKS ? doc.body : doc.documentElement; +} +function _docHeight(doc) { + var el = _docElement(doc); + return Math.max(el.scrollHeight, el.clientHeight); +} +function _docWidth(doc) { + var el = _docElement(doc); + return Math.max(el.scrollWidth, el.clientWidth); +} +function _getScrollPos(doc) { + doc = doc || document; + var x, y; + if (_IE || _NEWIE || _OPERA) { + x = _docElement(doc).scrollLeft; + y = _docElement(doc).scrollTop; + } else { + x = _getWin(doc).scrollX; + y = _getWin(doc).scrollY; + } + return {x : x, y : y}; +} + + +function KNode(node) { + this.init(node); +} +_extend(KNode, { + init : function(node) { + var self = this; + node = _isArray(node) ? node : [node]; + var length = 0; + for (var i = 0, len = node.length; i < len; i++) { + if (node[i]) { + self[i] = node[i].constructor === KNode ? node[i][0] : node[i]; + length++; + } + } + self.length = length; + self.doc = _getDoc(self[0]); + self.name = _getNodeName(self[0]); + self.type = self.length > 0 ? self[0].nodeType : null; + self.win = _getWin(self[0]); + }, + each : function(fn) { + var self = this; + for (var i = 0; i < self.length; i++) { + if (fn.call(self[i], i, self[i]) === false) { + return self; + } + } + return self; + }, + bind : function(type, fn) { + this.each(function() { + _bind(this, type, fn); + }); + return this; + }, + unbind : function(type, fn) { + this.each(function() { + _unbind(this, type, fn); + }); + return this; + }, + fire : function(type) { + if (this.length < 1) { + return this; + } + _fire(this[0], type); + return this; + }, + hasAttr : function(key) { + if (this.length < 1) { + return false; + } + return !!_getAttr(this[0], key); + }, + attr : function(key, val) { + var self = this; + if (key === undefined) { + return _getAttrList(self.outer()); + } + if (typeof key === 'object') { + _each(key, function(k, v) { + self.attr(k, v); + }); + return self; + } + if (val === undefined) { + val = self.length < 1 ? null : _getAttr(self[0], key); + return val === null ? '' : val; + } + self.each(function() { + _setAttr(this, key, val); + }); + return self; + }, + removeAttr : function(key) { + this.each(function() { + _removeAttr(this, key); + }); + return this; + }, + get : function(i) { + if (this.length < 1) { + return null; + } + return this[i || 0]; + }, + eq : function(i) { + if (this.length < 1) { + return null; + } + return this[i] ? new KNode(this[i]) : null; + }, + hasClass : function(cls) { + if (this.length < 1) { + return false; + } + return _hasClass(this[0], cls); + }, + addClass : function(cls) { + this.each(function() { + if (!_hasClass(this, cls)) { + this.className = _trim(this.className + ' ' + cls); + } + }); + return this; + }, + removeClass : function(cls) { + this.each(function() { + if (_hasClass(this, cls)) { + this.className = _trim(this.className.replace(new RegExp('(^|\\s)' + cls + '(\\s|$)'), ' ')); + } + }); + return this; + }, + html : function(val) { + var self = this; + if (val === undefined) { + if (self.length < 1 || self.type != 1) { + return ''; + } + return _formatHtml(self[0].innerHTML); + } + self.each(function() { + _setHtml(this, val); + }); + return self; + }, + text : function() { + var self = this; + if (self.length < 1) { + return ''; + } + return _IE ? self[0].innerText : self[0].textContent; + }, + hasVal : function() { + if (this.length < 1) { + return false; + } + return _hasVal(this[0]); + }, + val : function(val) { + var self = this; + if (val === undefined) { + if (self.length < 1) { + return ''; + } + return self.hasVal() ? self[0].value : self.attr('value'); + } else { + self.each(function() { + if (_hasVal(this)) { + this.value = val; + } else { + _setAttr(this, 'value' , val); + } + }); + return self; + } + }, + css : function(key, val) { + var self = this; + if (key === undefined) { + return _getCssList(self.attr('style')); + } + if (typeof key === 'object') { + _each(key, function(k, v) { + self.css(k, v); + }); + return self; + } + if (val === undefined) { + if (self.length < 1) { + return ''; + } + return self[0].style[_toCamel(key)] || _computedCss(self[0], key) || ''; + } + self.each(function() { + this.style[_toCamel(key)] = val; + }); + return self; + }, + width : function(val) { + var self = this; + if (val === undefined) { + if (self.length < 1) { + return 0; + } + return self[0].offsetWidth; + } + return self.css('width', _addUnit(val)); + }, + height : function(val) { + var self = this; + if (val === undefined) { + if (self.length < 1) { + return 0; + } + return self[0].offsetHeight; + } + return self.css('height', _addUnit(val)); + }, + opacity : function(val) { + this.each(function() { + if (this.style.opacity === undefined) { + this.style.filter = val == 1 ? '' : 'alpha(opacity=' + (val * 100) + ')'; + } else { + this.style.opacity = val == 1 ? '' : val; + } + }); + return this; + }, + data : function(key, val) { + var self = this; + key = 'kindeditor_data_' + key; + if (val === undefined) { + if (self.length < 1) { + return null; + } + return self[0][key]; + } + this.each(function() { + this[key] = val; + }); + return self; + }, + pos : function() { + var self = this, node = self[0], x = 0, y = 0; + if (node) { + if (node.getBoundingClientRect) { + var box = node.getBoundingClientRect(), + pos = _getScrollPos(self.doc); + x = box.left + pos.x; + y = box.top + pos.y; + } else { + while (node) { + x += node.offsetLeft; + y += node.offsetTop; + node = node.offsetParent; + } + } + } + return {x : _round(x), y : _round(y)}; + }, + clone : function(bool) { + if (this.length < 1) { + return new KNode([]); + } + return new KNode(this[0].cloneNode(bool)); + }, + append : function(expr) { + this.each(function() { + if (this.appendChild) { + this.appendChild(_get(expr)); + } + }); + return this; + }, + appendTo : function(expr) { + this.each(function() { + _get(expr).appendChild(this); + }); + return this; + }, + before : function(expr) { + this.each(function() { + this.parentNode.insertBefore(_get(expr), this); + }); + return this; + }, + after : function(expr) { + this.each(function() { + if (this.nextSibling) { + this.parentNode.insertBefore(_get(expr), this.nextSibling); + } else { + this.parentNode.appendChild(_get(expr)); + } + }); + return this; + }, + replaceWith : function(expr) { + var nodes = []; + this.each(function(i, node) { + _unbind(node); + var newNode = _get(expr); + node.parentNode.replaceChild(newNode, node); + nodes.push(newNode); + }); + return K(nodes); + }, + empty : function() { + var self = this; + self.each(function(i, node) { + var child = node.firstChild; + while (child) { + if (!node.parentNode) { + return; + } + var next = child.nextSibling; + child.parentNode.removeChild(child); + child = next; + } + }); + return self; + }, + remove : function(keepChilds) { + var self = this; + self.each(function(i, node) { + if (!node.parentNode) { + return; + } + _unbind(node); + if (keepChilds) { + var child = node.firstChild; + while (child) { + var next = child.nextSibling; + node.parentNode.insertBefore(child, node); + child = next; + } + } + node.parentNode.removeChild(node); + delete self[i]; + }); + self.length = 0; + return self; + }, + show : function(val) { + var self = this; + if (val === undefined) { + val = self._originDisplay || ''; + } + if (self.css('display') != 'none') { + return self; + } + return self.css('display', val); + }, + hide : function() { + var self = this; + if (self.length < 1) { + return self; + } + self._originDisplay = self[0].style.display; + return self.css('display', 'none'); + }, + outer : function() { + var self = this; + if (self.length < 1) { + return ''; + } + var div = self.doc.createElement('div'), html; + div.appendChild(self[0].cloneNode(true)); + html = _formatHtml(div.innerHTML); + div = null; + return html; + }, + isSingle : function() { + return !!_SINGLE_TAG_MAP[this.name]; + }, + isInline : function() { + return !!_INLINE_TAG_MAP[this.name]; + }, + isBlock : function() { + return !!_BLOCK_TAG_MAP[this.name]; + }, + isStyle : function() { + return !!_STYLE_TAG_MAP[this.name]; + }, + isControl : function() { + return !!_CONTROL_TAG_MAP[this.name]; + }, + contains : function(otherNode) { + if (this.length < 1) { + return false; + } + return _contains(this[0], _get(otherNode)); + }, + parent : function() { + if (this.length < 1) { + return null; + } + var node = this[0].parentNode; + return node ? new KNode(node) : null; + }, + children : function() { + if (this.length < 1) { + return new KNode([]); + } + var list = [], child = this[0].firstChild; + while (child) { + if (child.nodeType != 3 || _trim(child.nodeValue) !== '') { + list.push(child); + } + child = child.nextSibling; + } + return new KNode(list); + }, + first : function() { + var list = this.children(); + return list.length > 0 ? list.eq(0) : null; + }, + last : function() { + var list = this.children(); + return list.length > 0 ? list.eq(list.length - 1) : null; + }, + index : function() { + if (this.length < 1) { + return -1; + } + var i = -1, sibling = this[0]; + while (sibling) { + i++; + sibling = sibling.previousSibling; + } + return i; + }, + prev : function() { + if (this.length < 1) { + return null; + } + var node = this[0].previousSibling; + return node ? new KNode(node) : null; + }, + next : function() { + if (this.length < 1) { + return null; + } + var node = this[0].nextSibling; + return node ? new KNode(node) : null; + }, + scan : function(fn, order) { + if (this.length < 1) { + return; + } + order = (order === undefined) ? true : order; + function walk(node) { + var n = order ? node.firstChild : node.lastChild; + while (n) { + var next = order ? n.nextSibling : n.previousSibling; + if (fn(n) === false) { + return false; + } + if (walk(n) === false) { + return false; + } + n = next; + } + } + walk(this[0]); + return this; + } +}); +_each(('blur,focus,focusin,focusout,load,resize,scroll,unload,click,dblclick,' + + 'mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,' + + 'change,select,submit,keydown,keypress,keyup,error,contextmenu').split(','), function(i, type) { + KNode.prototype[type] = function(fn) { + return fn ? this.bind(type, fn) : this.fire(type); + }; +}); +var _K = K; +K = function(expr, root) { + if (expr === undefined || expr === null) { + return; + } + function newNode(node) { + if (!node[0]) { + node = []; + } + return new KNode(node); + } + if (typeof expr === 'string') { + if (root) { + root = _get(root); + } + var length = expr.length; + if (expr.charAt(0) === '@') { + expr = expr.substr(1); + } + if (expr.length !== length || /<.+>/.test(expr)) { + var doc = root ? root.ownerDocument || root : document, + div = doc.createElement('div'), list = []; + div.innerHTML = '' + expr; + for (var i = 0, len = div.childNodes.length; i < len; i++) { + var child = div.childNodes[i]; + if (child.id == '__kindeditor_temp_tag__') { + continue; + } + list.push(child); + } + return newNode(list); + } + return newNode(_queryAll(expr, root)); + } + if (expr && expr.constructor === KNode) { + return expr; + } + if (expr.toArray) { + expr = expr.toArray(); + } + if (_isArray(expr)) { + return newNode(expr); + } + return newNode(_toArray(arguments)); +}; +_each(_K, function(key, val) { + K[key] = val; +}); +K.NodeClass = KNode; +window.KindEditor = K; + + +var _START_TO_START = 0, + _START_TO_END = 1, + _END_TO_END = 2, + _END_TO_START = 3, + _BOOKMARK_ID = 0; +function _updateCollapsed(range) { + range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset); + return range; +} +function _copyAndDelete(range, isCopy, isDelete) { + var doc = range.doc, nodeList = []; + function splitTextNode(node, startOffset, endOffset) { + var length = node.nodeValue.length, centerNode; + if (isCopy) { + var cloneNode = node.cloneNode(true); + if (startOffset > 0) { + centerNode = cloneNode.splitText(startOffset); + } else { + centerNode = cloneNode; + } + if (endOffset < length) { + centerNode.splitText(endOffset - startOffset); + } + } + if (isDelete) { + var center = node; + if (startOffset > 0) { + center = node.splitText(startOffset); + range.setStart(node, startOffset); + } + if (endOffset < length) { + var right = center.splitText(endOffset - startOffset); + range.setEnd(right, 0); + } + nodeList.push(center); + } + return centerNode; + } + function removeNodes() { + if (isDelete) { + range.up().collapse(true); + } + for (var i = 0, len = nodeList.length; i < len; i++) { + var node = nodeList[i]; + if (node.parentNode) { + node.parentNode.removeChild(node); + } + } + } + var copyRange = range.cloneRange().down(); + var start = -1, incStart = -1, incEnd = -1, end = -1, + ancestor = range.commonAncestor(), frag = doc.createDocumentFragment(); + if (ancestor.nodeType == 3) { + var textNode = splitTextNode(ancestor, range.startOffset, range.endOffset); + if (isCopy) { + frag.appendChild(textNode); + } + removeNodes(); + return isCopy ? frag : range; + } + function extractNodes(parent, frag) { + var node = parent.firstChild, nextNode; + while (node) { + var testRange = new KRange(doc).selectNode(node); + start = testRange.compareBoundaryPoints(_START_TO_END, range); + if (start >= 0 && incStart <= 0) { + incStart = testRange.compareBoundaryPoints(_START_TO_START, range); + } + if (incStart >= 0 && incEnd <= 0) { + incEnd = testRange.compareBoundaryPoints(_END_TO_END, range); + } + if (incEnd >= 0 && end <= 0) { + end = testRange.compareBoundaryPoints(_END_TO_START, range); + } + if (end >= 0) { + return false; + } + nextNode = node.nextSibling; + if (start > 0) { + if (node.nodeType == 1) { + if (incStart >= 0 && incEnd <= 0) { + if (isCopy) { + frag.appendChild(node.cloneNode(true)); + } + if (isDelete) { + nodeList.push(node); + } + } else { + var childFlag; + if (isCopy) { + childFlag = node.cloneNode(false); + frag.appendChild(childFlag); + } + if (extractNodes(node, childFlag) === false) { + return false; + } + } + } else if (node.nodeType == 3) { + var textNode; + if (node == copyRange.startContainer) { + textNode = splitTextNode(node, copyRange.startOffset, node.nodeValue.length); + } else if (node == copyRange.endContainer) { + textNode = splitTextNode(node, 0, copyRange.endOffset); + } else { + textNode = splitTextNode(node, 0, node.nodeValue.length); + } + if (isCopy) { + try { + frag.appendChild(textNode); + } catch(e) {} + } + } + } + node = nextNode; + } + } + extractNodes(ancestor, frag); + if (isDelete) { + range.up().collapse(true); + } + for (var i = 0, len = nodeList.length; i < len; i++) { + var node = nodeList[i]; + if (node.parentNode) { + node.parentNode.removeChild(node); + } + } + return isCopy ? frag : range; +} + +function _moveToElementText(range, el) { + var node = el; + while (node) { + var knode = K(node); + if (knode.name == 'marquee' || knode.name == 'select') { + return; + } + node = node.parentNode; + } + try { + range.moveToElementText(el); + } catch(e) {} +} + +function _getStartEnd(rng, isStart) { + var doc = rng.parentElement().ownerDocument, + pointRange = rng.duplicate(); + pointRange.collapse(isStart); + var parent = pointRange.parentElement(), + nodes = parent.childNodes; + if (nodes.length === 0) { + return {node: parent.parentNode, offset: K(parent).index()}; + } + var startNode = doc, startPos = 0, cmp = -1; + var testRange = rng.duplicate(); + _moveToElementText(testRange, parent); + for (var i = 0, len = nodes.length; i < len; i++) { + var node = nodes[i]; + cmp = testRange.compareEndPoints('StartToStart', pointRange); + if (cmp === 0) { + return {node: node.parentNode, offset: i}; + } + if (node.nodeType == 1) { + var nodeRange = rng.duplicate(), dummy, knode = K(node), newNode = node; + if (knode.isControl()) { + dummy = doc.createElement('span'); + knode.after(dummy); + newNode = dummy; + startPos += knode.text().replace(/\r\n|\n|\r/g, '').length; + } + _moveToElementText(nodeRange, newNode); + testRange.setEndPoint('StartToEnd', nodeRange); + if (cmp > 0) { + startPos += nodeRange.text.replace(/\r\n|\n|\r/g, '').length; + } else { + startPos = 0; + } + if (dummy) { + K(dummy).remove(); + } + } else if (node.nodeType == 3) { + testRange.moveStart('character', node.nodeValue.length); + startPos += node.nodeValue.length; + } + if (cmp < 0) { + startNode = node; + } + } + if (cmp < 0 && startNode.nodeType == 1) { + return {node: parent, offset: K(parent.lastChild).index() + 1}; + } + if (cmp > 0) { + while (startNode.nextSibling && startNode.nodeType == 1) { + startNode = startNode.nextSibling; + } + } + testRange = rng.duplicate(); + _moveToElementText(testRange, parent); + testRange.setEndPoint('StartToEnd', pointRange); + startPos -= testRange.text.replace(/\r\n|\n|\r/g, '').length; + if (cmp > 0 && startNode.nodeType == 3) { + var prevNode = startNode.previousSibling; + while (prevNode && prevNode.nodeType == 3) { + startPos -= prevNode.nodeValue.length; + prevNode = prevNode.previousSibling; + } + } + return {node: startNode, offset: startPos}; +} + +function _getEndRange(node, offset) { + var doc = node.ownerDocument || node, + range = doc.body.createTextRange(); + if (doc == node) { + range.collapse(true); + return range; + } + if (node.nodeType == 1 && node.childNodes.length > 0) { + var children = node.childNodes, isStart, child; + if (offset === 0) { + child = children[0]; + isStart = true; + } else { + child = children[offset - 1]; + isStart = false; + } + if (!child) { + return range; + } + if (K(child).name === 'head') { + if (offset === 1) { + isStart = true; + } + if (offset === 2) { + isStart = false; + } + range.collapse(isStart); + return range; + } + if (child.nodeType == 1) { + var kchild = K(child), span; + if (kchild.isControl()) { + span = doc.createElement('span'); + if (isStart) { + kchild.before(span); + } else { + kchild.after(span); + } + child = span; + } + _moveToElementText(range, child); + range.collapse(isStart); + if (span) { + K(span).remove(); + } + return range; + } + node = child; + offset = isStart ? 0 : child.nodeValue.length; + } + var dummy = doc.createElement('span'); + K(node).before(dummy); + _moveToElementText(range, dummy); + range.moveStart('character', offset); + K(dummy).remove(); + return range; +} + +function _toRange(rng) { + var doc, range; + function tr2td(start) { + if (K(start.node).name == 'tr') { + start.node = start.node.cells[start.offset]; + start.offset = 0; + } + } + if (_IERANGE) { + if (rng.item) { + doc = _getDoc(rng.item(0)); + range = new KRange(doc); + range.selectNode(rng.item(0)); + return range; + } + doc = rng.parentElement().ownerDocument; + var start = _getStartEnd(rng, true), + end = _getStartEnd(rng, false); + tr2td(start); + tr2td(end); + range = new KRange(doc); + range.setStart(start.node, start.offset); + range.setEnd(end.node, end.offset); + return range; + } + var startContainer = rng.startContainer; + doc = startContainer.ownerDocument || startContainer; + range = new KRange(doc); + range.setStart(startContainer, rng.startOffset); + range.setEnd(rng.endContainer, rng.endOffset); + return range; +} + + +function KRange(doc) { + this.init(doc); +} +_extend(KRange, { + init : function(doc) { + var self = this; + self.startContainer = doc; + self.startOffset = 0; + self.endContainer = doc; + self.endOffset = 0; + self.collapsed = true; + self.doc = doc; + }, + commonAncestor : function() { + function getParents(node) { + var parents = []; + while (node) { + parents.push(node); + node = node.parentNode; + } + return parents; + } + var parentsA = getParents(this.startContainer), + parentsB = getParents(this.endContainer), + i = 0, lenA = parentsA.length, lenB = parentsB.length, parentA, parentB; + while (++i) { + parentA = parentsA[lenA - i]; + parentB = parentsB[lenB - i]; + if (!parentA || !parentB || parentA !== parentB) { + break; + } + } + return parentsA[lenA - i + 1]; + }, + setStart : function(node, offset) { + var self = this, doc = self.doc; + self.startContainer = node; + self.startOffset = offset; + if (self.endContainer === doc) { + self.endContainer = node; + self.endOffset = offset; + } + return _updateCollapsed(this); + }, + setEnd : function(node, offset) { + var self = this, doc = self.doc; + self.endContainer = node; + self.endOffset = offset; + if (self.startContainer === doc) { + self.startContainer = node; + self.startOffset = offset; + } + return _updateCollapsed(this); + }, + setStartBefore : function(node) { + return this.setStart(node.parentNode || this.doc, K(node).index()); + }, + setStartAfter : function(node) { + return this.setStart(node.parentNode || this.doc, K(node).index() + 1); + }, + setEndBefore : function(node) { + return this.setEnd(node.parentNode || this.doc, K(node).index()); + }, + setEndAfter : function(node) { + return this.setEnd(node.parentNode || this.doc, K(node).index() + 1); + }, + selectNode : function(node) { + return this.setStartBefore(node).setEndAfter(node); + }, + selectNodeContents : function(node) { + var knode = K(node); + if (knode.type == 3 || knode.isSingle()) { + return this.selectNode(node); + } + var children = knode.children(); + if (children.length > 0) { + return this.setStartBefore(children[0]).setEndAfter(children[children.length - 1]); + } + return this.setStart(node, 0).setEnd(node, 0); + }, + collapse : function(toStart) { + if (toStart) { + return this.setEnd(this.startContainer, this.startOffset); + } + return this.setStart(this.endContainer, this.endOffset); + }, + compareBoundaryPoints : function(how, range) { + var rangeA = this.get(), rangeB = range.get(); + if (_IERANGE) { + var arr = {}; + arr[_START_TO_START] = 'StartToStart'; + arr[_START_TO_END] = 'EndToStart'; + arr[_END_TO_END] = 'EndToEnd'; + arr[_END_TO_START] = 'StartToEnd'; + var cmp = rangeA.compareEndPoints(arr[how], rangeB); + if (cmp !== 0) { + return cmp; + } + var nodeA, nodeB, nodeC, posA, posB; + if (how === _START_TO_START || how === _END_TO_START) { + nodeA = this.startContainer; + posA = this.startOffset; + } + if (how === _START_TO_END || how === _END_TO_END) { + nodeA = this.endContainer; + posA = this.endOffset; + } + if (how === _START_TO_START || how === _START_TO_END) { + nodeB = range.startContainer; + posB = range.startOffset; + } + if (how === _END_TO_END || how === _END_TO_START) { + nodeB = range.endContainer; + posB = range.endOffset; + } + if (nodeA === nodeB) { + var diff = posA - posB; + return diff > 0 ? 1 : (diff < 0 ? -1 : 0); + } + nodeC = nodeB; + while (nodeC && nodeC.parentNode !== nodeA) { + nodeC = nodeC.parentNode; + } + if (nodeC) { + return K(nodeC).index() >= posA ? -1 : 1; + } + nodeC = nodeA; + while (nodeC && nodeC.parentNode !== nodeB) { + nodeC = nodeC.parentNode; + } + if (nodeC) { + return K(nodeC).index() >= posB ? 1 : -1; + } + nodeC = K(nodeB).next(); + if (nodeC && nodeC.contains(nodeA)) { + return 1; + } + nodeC = K(nodeA).next(); + if (nodeC && nodeC.contains(nodeB)) { + return -1; + } + } else { + return rangeA.compareBoundaryPoints(how, rangeB); + } + }, + cloneRange : function() { + return new KRange(this.doc).setStart(this.startContainer, this.startOffset).setEnd(this.endContainer, this.endOffset); + }, + toString : function() { + var rng = this.get(), str = _IERANGE ? rng.text : rng.toString(); + return str.replace(/\r\n|\n|\r/g, ''); + }, + cloneContents : function() { + return _copyAndDelete(this, true, false); + }, + deleteContents : function() { + return _copyAndDelete(this, false, true); + }, + extractContents : function() { + return _copyAndDelete(this, true, true); + }, + insertNode : function(node) { + var self = this, + sc = self.startContainer, so = self.startOffset, + ec = self.endContainer, eo = self.endOffset, + firstChild, lastChild, c, nodeCount = 1; + if (node.nodeName.toLowerCase() === '#document-fragment') { + firstChild = node.firstChild; + lastChild = node.lastChild; + nodeCount = node.childNodes.length; + } + if (sc.nodeType == 1) { + c = sc.childNodes[so]; + if (c) { + sc.insertBefore(node, c); + if (sc === ec) { + eo += nodeCount; + } + } else { + sc.appendChild(node); + } + } else if (sc.nodeType == 3) { + if (so === 0) { + sc.parentNode.insertBefore(node, sc); + if (sc.parentNode === ec) { + eo += nodeCount; + } + } else if (so >= sc.nodeValue.length) { + if (sc.nextSibling) { + sc.parentNode.insertBefore(node, sc.nextSibling); + } else { + sc.parentNode.appendChild(node); + } + } else { + if (so > 0) { + c = sc.splitText(so); + } else { + c = sc; + } + sc.parentNode.insertBefore(node, c); + if (sc === ec) { + ec = c; + eo -= so; + } + } + } + if (firstChild) { + self.setStartBefore(firstChild).setEndAfter(lastChild); + } else { + self.selectNode(node); + } + if (self.compareBoundaryPoints(_END_TO_END, self.cloneRange().setEnd(ec, eo)) >= 1) { + return self; + } + return self.setEnd(ec, eo); + }, + surroundContents : function(node) { + node.appendChild(this.extractContents()); + return this.insertNode(node).selectNode(node); + }, + isControl : function() { + var self = this, + sc = self.startContainer, so = self.startOffset, + ec = self.endContainer, eo = self.endOffset, rng; + return sc.nodeType == 1 && sc === ec && so + 1 === eo && K(sc.childNodes[so]).isControl(); + }, + get : function(hasControlRange) { + var self = this, doc = self.doc, node, rng; + if (!_IERANGE) { + rng = doc.createRange(); + try { + rng.setStart(self.startContainer, self.startOffset); + rng.setEnd(self.endContainer, self.endOffset); + } catch (e) {} + return rng; + } + if (hasControlRange && self.isControl()) { + rng = doc.body.createControlRange(); + rng.addElement(self.startContainer.childNodes[self.startOffset]); + return rng; + } + var range = self.cloneRange().down(); + rng = doc.body.createTextRange(); + rng.setEndPoint('StartToStart', _getEndRange(range.startContainer, range.startOffset)); + rng.setEndPoint('EndToStart', _getEndRange(range.endContainer, range.endOffset)); + return rng; + }, + html : function() { + return K(this.cloneContents()).outer(); + }, + down : function() { + var self = this; + function downPos(node, pos, isStart) { + if (node.nodeType != 1) { + return; + } + var children = K(node).children(); + if (children.length === 0) { + return; + } + var left, right, child, offset; + if (pos > 0) { + left = children.eq(pos - 1); + } + if (pos < children.length) { + right = children.eq(pos); + } + if (left && left.type == 3) { + child = left[0]; + offset = child.nodeValue.length; + } + if (right && right.type == 3) { + child = right[0]; + offset = 0; + } + if (!child) { + return; + } + if (isStart) { + self.setStart(child, offset); + } else { + self.setEnd(child, offset); + } + } + downPos(self.startContainer, self.startOffset, true); + downPos(self.endContainer, self.endOffset, false); + return self; + }, + up : function() { + var self = this; + function upPos(node, pos, isStart) { + if (node.nodeType != 3) { + return; + } + if (pos === 0) { + if (isStart) { + self.setStartBefore(node); + } else { + self.setEndBefore(node); + } + } else if (pos == node.nodeValue.length) { + if (isStart) { + self.setStartAfter(node); + } else { + self.setEndAfter(node); + } + } + } + upPos(self.startContainer, self.startOffset, true); + upPos(self.endContainer, self.endOffset, false); + return self; + }, + enlarge : function(toBlock) { + var self = this; + self.up(); + function enlargePos(node, pos, isStart) { + var knode = K(node), parent; + if (knode.type == 3 || _NOSPLIT_TAG_MAP[knode.name] || !toBlock && knode.isBlock()) { + return; + } + if (pos === 0) { + while (!knode.prev()) { + parent = knode.parent(); + if (!parent || _NOSPLIT_TAG_MAP[parent.name] || !toBlock && parent.isBlock()) { + break; + } + knode = parent; + } + if (isStart) { + self.setStartBefore(knode[0]); + } else { + self.setEndBefore(knode[0]); + } + } else if (pos == knode.children().length) { + while (!knode.next()) { + parent = knode.parent(); + if (!parent || _NOSPLIT_TAG_MAP[parent.name] || !toBlock && parent.isBlock()) { + break; + } + knode = parent; + } + if (isStart) { + self.setStartAfter(knode[0]); + } else { + self.setEndAfter(knode[0]); + } + } + } + enlargePos(self.startContainer, self.startOffset, true); + enlargePos(self.endContainer, self.endOffset, false); + return self; + }, + shrink : function() { + var self = this, child, collapsed = self.collapsed; + while (self.startContainer.nodeType == 1 && (child = self.startContainer.childNodes[self.startOffset]) && child.nodeType == 1 && !K(child).isSingle()) { + self.setStart(child, 0); + } + if (collapsed) { + return self.collapse(collapsed); + } + while (self.endContainer.nodeType == 1 && self.endOffset > 0 && (child = self.endContainer.childNodes[self.endOffset - 1]) && child.nodeType == 1 && !K(child).isSingle()) { + self.setEnd(child, child.childNodes.length); + } + return self; + }, + createBookmark : function(serialize) { + var self = this, doc = self.doc, endNode, + startNode = K('', doc)[0]; + startNode.id = '__kindeditor_bookmark_start_' + (_BOOKMARK_ID++) + '__'; + if (!self.collapsed) { + endNode = startNode.cloneNode(true); + endNode.id = '__kindeditor_bookmark_end_' + (_BOOKMARK_ID++) + '__'; + } + if (endNode) { + self.cloneRange().collapse(false).insertNode(endNode).setEndBefore(endNode); + } + self.insertNode(startNode).setStartAfter(startNode); + return { + start : serialize ? '#' + startNode.id : startNode, + end : endNode ? (serialize ? '#' + endNode.id : endNode) : null + }; + }, + moveToBookmark : function(bookmark) { + var self = this, doc = self.doc, + start = K(bookmark.start, doc), end = bookmark.end ? K(bookmark.end, doc) : null; + if (!start || start.length < 1) { + return self; + } + self.setStartBefore(start[0]); + start.remove(); + if (end && end.length > 0) { + self.setEndBefore(end[0]); + end.remove(); + } else { + self.collapse(true); + } + return self; + }, + dump : function() { + console.log('--------------------'); + console.log(this.startContainer.nodeType == 3 ? this.startContainer.nodeValue : this.startContainer, this.startOffset); + console.log(this.endContainer.nodeType == 3 ? this.endContainer.nodeValue : this.endContainer, this.endOffset); + } +}); +function _range(mixed) { + if (!mixed.nodeName) { + return mixed.constructor === KRange ? mixed : _toRange(mixed); + } + return new KRange(mixed); +} +K.RangeClass = KRange; +K.range = _range; +K.START_TO_START = _START_TO_START; +K.START_TO_END = _START_TO_END; +K.END_TO_END = _END_TO_END; +K.END_TO_START = _END_TO_START; + + + +function _nativeCommand(doc, key, val) { + try { + doc.execCommand(key, false, val); + } catch(e) {} +} + +function _nativeCommandValue(doc, key) { + var val = ''; + try { + val = doc.queryCommandValue(key); + } catch (e) {} + if (typeof val !== 'string') { + val = ''; + } + return val; +} + +function _getSel(doc) { + var win = _getWin(doc); + return _IERANGE ? doc.selection : win.getSelection(); +} + +function _getRng(doc) { + var sel = _getSel(doc), rng; + try { + if (sel.rangeCount > 0) { + rng = sel.getRangeAt(0); + } else { + rng = sel.createRange(); + } + } catch(e) {} + if (_IERANGE && (!rng || (!rng.item && rng.parentElement().ownerDocument !== doc))) { + return null; + } + return rng; +} + +function _singleKeyMap(map) { + var newMap = {}, arr, v; + _each(map, function(key, val) { + arr = key.split(','); + for (var i = 0, len = arr.length; i < len; i++) { + v = arr[i]; + newMap[v] = val; + } + }); + return newMap; +} + +function _hasAttrOrCss(knode, map) { + return _hasAttrOrCssByKey(knode, map, '*') || _hasAttrOrCssByKey(knode, map); +} +function _hasAttrOrCssByKey(knode, map, mapKey) { + mapKey = mapKey || knode.name; + if (knode.type !== 1) { + return false; + } + var newMap = _singleKeyMap(map); + if (!newMap[mapKey]) { + return false; + } + var arr = newMap[mapKey].split(','); + for (var i = 0, len = arr.length; i < len; i++) { + var key = arr[i]; + if (key === '*') { + return true; + } + var match = /^(\.?)([^=]+)(?:=([^=]*))?$/.exec(key); + var method = match[1] ? 'css' : 'attr'; + key = match[2]; + var val = match[3] || ''; + if (val === '' && knode[method](key) !== '') { + return true; + } + if (val !== '' && knode[method](key) === val) { + return true; + } + } + return false; +} + +function _removeAttrOrCss(knode, map) { + if (knode.type != 1) { + return; + } + _removeAttrOrCssByKey(knode, map, '*'); + _removeAttrOrCssByKey(knode, map); +} +function _removeAttrOrCssByKey(knode, map, mapKey) { + mapKey = mapKey || knode.name; + if (knode.type !== 1) { + return; + } + var newMap = _singleKeyMap(map); + if (!newMap[mapKey]) { + return; + } + var arr = newMap[mapKey].split(','), allFlag = false; + for (var i = 0, len = arr.length; i < len; i++) { + var key = arr[i]; + if (key === '*') { + allFlag = true; + break; + } + var match = /^(\.?)([^=]+)(?:=([^=]*))?$/.exec(key); + key = match[2]; + if (match[1]) { + key = _toCamel(key); + if (knode[0].style[key]) { + knode[0].style[key] = ''; + } + } else { + knode.removeAttr(key); + } + } + if (allFlag) { + knode.remove(true); + } +} + +function _getInnerNode(knode) { + var inner = knode; + while (inner.first()) { + inner = inner.first(); + } + return inner; +} + +function _isEmptyNode(knode) { + if (knode.type != 1 || knode.isSingle()) { + return false; + } + return knode.html().replace(/<[^>]+>/g, '') === ''; +} + + + + +function _mergeWrapper(a, b) { + a = a.clone(true); + var lastA = _getInnerNode(a), childA = a, merged = false; + while (b) { + while (childA) { + if (childA.name === b.name) { + _mergeAttrs(childA, b.attr(), b.css()); + merged = true; + } + childA = childA.first(); + } + if (!merged) { + lastA.append(b.clone(false)); + } + merged = false; + b = b.first(); + } + return a; +} + +function _wrapNode(knode, wrapper) { + wrapper = wrapper.clone(true); + if (knode.type == 3) { + _getInnerNode(wrapper).append(knode.clone(false)); + knode.replaceWith(wrapper); + return wrapper; + } + var nodeWrapper = knode, child; + while ((child = knode.first()) && child.children().length == 1) { + knode = child; + } + child = knode.first(); + var frag = knode.doc.createDocumentFragment(); + while (child) { + frag.appendChild(child[0]); + child = child.next(); + } + wrapper = _mergeWrapper(nodeWrapper, wrapper); + if (frag.firstChild) { + _getInnerNode(wrapper).append(frag); + } + nodeWrapper.replaceWith(wrapper); + return wrapper; +} + +function _mergeAttrs(knode, attrs, styles) { + _each(attrs, function(key, val) { + if (key !== 'style') { + knode.attr(key, val); + } + }); + _each(styles, function(key, val) { + knode.css(key, val); + }); +} + +function _inPreElement(knode) { + while (knode && knode.name != 'body') { + if (_PRE_TAG_MAP[knode.name] || knode.name == 'div' && knode.hasClass('ke-script')) { + return true; + } + knode = knode.parent(); + } + return false; +} + +function KCmd(range) { + this.init(range); +} +_extend(KCmd, { + init : function(range) { + var self = this, doc = range.doc; + self.doc = doc; + self.win = _getWin(doc); + self.sel = _getSel(doc); + self.range = range; + }, + selection : function(forceReset) { + var self = this, doc = self.doc, rng = _getRng(doc); + self.sel = _getSel(doc); + if (rng) { + self.range = _range(rng); + if (K(self.range.startContainer).name == 'html') { + self.range.selectNodeContents(doc.body).collapse(false); + } + return self; + } + if (forceReset) { + self.range.selectNodeContents(doc.body).collapse(false); + } + return self; + }, + select : function(hasDummy) { + hasDummy = _undef(hasDummy, true); + var self = this, sel = self.sel, range = self.range.cloneRange().shrink(), + sc = range.startContainer, so = range.startOffset, + ec = range.endContainer, eo = range.endOffset, + doc = _getDoc(sc), win = self.win, rng, hasU200b = false; + if (hasDummy && sc.nodeType == 1 && range.collapsed) { + if (_IERANGE) { + var dummy = K(' ', doc); + range.insertNode(dummy[0]); + rng = doc.body.createTextRange(); + try { + rng.moveToElementText(dummy[0]); + } catch(ex) {} + rng.collapse(false); + rng.select(); + dummy.remove(); + win.focus(); + return self; + } + if (_WEBKIT) { + var children = sc.childNodes; + if (K(sc).isInline() || so > 0 && K(children[so - 1]).isInline() || children[so] && K(children[so]).isInline()) { + range.insertNode(doc.createTextNode('\u200B')); + hasU200b = true; + } + } + } + if (_IERANGE) { + try { + rng = range.get(true); + rng.select(); + } catch(e) {} + } else { + if (hasU200b) { + range.collapse(false); + } + rng = range.get(true); + sel.removeAllRanges(); + sel.addRange(rng); + if (doc !== document) { + var pos = K(rng.endContainer).pos(); + win.scrollTo(pos.x, pos.y); + } + } + win.focus(); + return self; + }, + wrap : function(val) { + var self = this, doc = self.doc, range = self.range, wrapper; + wrapper = K(val, doc); + if (range.collapsed) { + range.shrink(); + range.insertNode(wrapper[0]).selectNodeContents(wrapper[0]); + return self; + } + if (wrapper.isBlock()) { + var copyWrapper = wrapper.clone(true), child = copyWrapper; + while (child.first()) { + child = child.first(); + } + child.append(range.extractContents()); + range.insertNode(copyWrapper[0]).selectNode(copyWrapper[0]); + return self; + } + range.enlarge(); + var bookmark = range.createBookmark(), ancestor = range.commonAncestor(), isStart = false; + K(ancestor).scan(function(node) { + if (!isStart && node == bookmark.start) { + isStart = true; + return; + } + if (isStart) { + if (node == bookmark.end) { + return false; + } + var knode = K(node); + if (_inPreElement(knode)) { + return; + } + if (knode.type == 3 && _trim(node.nodeValue).length > 0) { + var parent; + while ((parent = knode.parent()) && parent.isStyle() && parent.children().length == 1) { + knode = parent; + } + _wrapNode(knode, wrapper); + } + } + }); + range.moveToBookmark(bookmark); + return self; + }, + split : function(isStart, map) { + var range = this.range, doc = range.doc; + var tempRange = range.cloneRange().collapse(isStart); + var node = tempRange.startContainer, pos = tempRange.startOffset, + parent = node.nodeType == 3 ? node.parentNode : node, + needSplit = false, knode; + while (parent && parent.parentNode) { + knode = K(parent); + if (map) { + if (!knode.isStyle()) { + break; + } + if (!_hasAttrOrCss(knode, map)) { + break; + } + } else { + if (_NOSPLIT_TAG_MAP[knode.name]) { + break; + } + } + needSplit = true; + parent = parent.parentNode; + } + if (needSplit) { + var dummy = doc.createElement('span'); + range.cloneRange().collapse(!isStart).insertNode(dummy); + if (isStart) { + tempRange.setStartBefore(parent.firstChild).setEnd(node, pos); + } else { + tempRange.setStart(node, pos).setEndAfter(parent.lastChild); + } + var frag = tempRange.extractContents(), + first = frag.firstChild, last = frag.lastChild; + if (isStart) { + tempRange.insertNode(frag); + range.setStartAfter(last).setEndBefore(dummy); + } else { + parent.appendChild(frag); + range.setStartBefore(dummy).setEndBefore(first); + } + var dummyParent = dummy.parentNode; + if (dummyParent == range.endContainer) { + var prev = K(dummy).prev(), next = K(dummy).next(); + if (prev && next && prev.type == 3 && next.type == 3) { + range.setEnd(prev[0], prev[0].nodeValue.length); + } else if (!isStart) { + range.setEnd(range.endContainer, range.endOffset - 1); + } + } + dummyParent.removeChild(dummy); + } + return this; + }, + remove : function(map) { + var self = this, doc = self.doc, range = self.range; + range.enlarge(); + if (range.startOffset === 0) { + var ksc = K(range.startContainer), parent; + while ((parent = ksc.parent()) && parent.isStyle() && parent.children().length == 1) { + ksc = parent; + } + range.setStart(ksc[0], 0); + ksc = K(range.startContainer); + if (ksc.isBlock()) { + _removeAttrOrCss(ksc, map); + } + var kscp = ksc.parent(); + if (kscp && kscp.isBlock()) { + _removeAttrOrCss(kscp, map); + } + } + var sc, so; + if (range.collapsed) { + self.split(true, map); + sc = range.startContainer; + so = range.startOffset; + if (so > 0) { + var sb = K(sc.childNodes[so - 1]); + if (sb && _isEmptyNode(sb)) { + sb.remove(); + range.setStart(sc, so - 1); + } + } + var sa = K(sc.childNodes[so]); + if (sa && _isEmptyNode(sa)) { + sa.remove(); + } + if (_isEmptyNode(sc)) { + range.startBefore(sc); + sc.remove(); + } + range.collapse(true); + return self; + } + self.split(true, map); + self.split(false, map); + var startDummy = doc.createElement('span'), endDummy = doc.createElement('span'); + range.cloneRange().collapse(false).insertNode(endDummy); + range.cloneRange().collapse(true).insertNode(startDummy); + var nodeList = [], cmpStart = false; + K(range.commonAncestor()).scan(function(node) { + if (!cmpStart && node == startDummy) { + cmpStart = true; + return; + } + if (node == endDummy) { + return false; + } + if (cmpStart) { + nodeList.push(node); + } + }); + K(startDummy).remove(); + K(endDummy).remove(); + sc = range.startContainer; + so = range.startOffset; + var ec = range.endContainer, eo = range.endOffset; + if (so > 0) { + var startBefore = K(sc.childNodes[so - 1]); + if (startBefore && _isEmptyNode(startBefore)) { + startBefore.remove(); + range.setStart(sc, so - 1); + if (sc == ec) { + range.setEnd(ec, eo - 1); + } + } + var startAfter = K(sc.childNodes[so]); + if (startAfter && _isEmptyNode(startAfter)) { + startAfter.remove(); + if (sc == ec) { + range.setEnd(ec, eo - 1); + } + } + } + var endAfter = K(ec.childNodes[range.endOffset]); + if (endAfter && _isEmptyNode(endAfter)) { + endAfter.remove(); + } + var bookmark = range.createBookmark(true); + _each(nodeList, function(i, node) { + _removeAttrOrCss(K(node), map); + }); + range.moveToBookmark(bookmark); + return self; + }, + commonNode : function(map) { + var range = this.range; + var ec = range.endContainer, eo = range.endOffset, + node = (ec.nodeType == 3 || eo === 0) ? ec : ec.childNodes[eo - 1]; + function find(node) { + var child = node, parent = node; + while (parent) { + if (_hasAttrOrCss(K(parent), map)) { + return K(parent); + } + parent = parent.parentNode; + } + while (child && (child = child.lastChild)) { + if (_hasAttrOrCss(K(child), map)) { + return K(child); + } + } + return null; + } + var cNode = find(node); + if (cNode) { + return cNode; + } + if (node.nodeType == 1 || (ec.nodeType == 3 && eo === 0)) { + var prev = K(node).prev(); + if (prev) { + return find(prev); + } + } + return null; + }, + commonAncestor : function(tagName) { + var range = this.range, + sc = range.startContainer, so = range.startOffset, + ec = range.endContainer, eo = range.endOffset, + startNode = (sc.nodeType == 3 || so === 0) ? sc : sc.childNodes[so - 1], + endNode = (ec.nodeType == 3 || eo === 0) ? ec : ec.childNodes[eo - 1]; + function find(node) { + while (node) { + if (node.nodeType == 1) { + if (node.tagName.toLowerCase() === tagName) { + return node; + } + } + node = node.parentNode; + } + return null; + } + var start = find(startNode), end = find(endNode); + if (start && end && start === end) { + return K(start); + } + return null; + }, + state : function(key) { + var self = this, doc = self.doc, bool = false; + try { + bool = doc.queryCommandState(key); + } catch (e) {} + return bool; + }, + val : function(key) { + var self = this, doc = self.doc, range = self.range; + function lc(val) { + return val.toLowerCase(); + } + key = lc(key); + var val = '', knode; + if (key === 'fontfamily' || key === 'fontname') { + val = _nativeCommandValue(doc, 'fontname'); + val = val.replace(/['"]/g, ''); + return lc(val); + } + if (key === 'formatblock') { + val = _nativeCommandValue(doc, key); + if (val === '') { + knode = self.commonNode({'h1,h2,h3,h4,h5,h6,p,div,pre,address' : '*'}); + if (knode) { + val = knode.name; + } + } + if (val === 'Normal') { + val = 'p'; + } + return lc(val); + } + if (key === 'fontsize') { + knode = self.commonNode({'*' : '.font-size'}); + if (knode) { + val = knode.css('font-size'); + } + return lc(val); + } + if (key === 'forecolor') { + knode = self.commonNode({'*' : '.color'}); + if (knode) { + val = knode.css('color'); + } + val = _toHex(val); + if (val === '') { + val = 'default'; + } + return lc(val); + } + if (key === 'hilitecolor') { + knode = self.commonNode({'*' : '.background-color'}); + if (knode) { + val = knode.css('background-color'); + } + val = _toHex(val); + if (val === '') { + val = 'default'; + } + return lc(val); + } + return val; + }, + toggle : function(wrapper, map) { + var self = this; + if (self.commonNode(map)) { + self.remove(map); + } else { + self.wrap(wrapper); + } + return self.select(); + }, + bold : function() { + return this.toggle('', { + span : '.font-weight=bold', + strong : '*', + b : '*' + }); + }, + italic : function() { + return this.toggle('', { + span : '.font-style=italic', + em : '*', + i : '*' + }); + }, + underline : function() { + return this.toggle('', { + span : '.text-decoration=underline', + u : '*' + }); + }, + strikethrough : function() { + return this.toggle('', { + span : '.text-decoration=line-through', + s : '*' + }); + }, + forecolor : function(val) { + return this.wrap('').select(); + }, + hilitecolor : function(val) { + return this.wrap('').select(); + }, + fontsize : function(val) { + return this.wrap('').select(); + }, + fontname : function(val) { + return this.fontfamily(val); + }, + fontfamily : function(val) { + return this.wrap('').select(); + }, + removeformat : function() { + var map = { + '*' : '.font-weight,.font-style,.text-decoration,.color,.background-color,.font-size,.font-family,.text-indent' + }, + tags = _STYLE_TAG_MAP; + _each(tags, function(key, val) { + map[key] = '*'; + }); + this.remove(map); + return this.select(); + }, + inserthtml : function(val, quickMode) { + var self = this, range = self.range; + if (val === '') { + return self; + } + function pasteHtml(range, val) { + val = '' + val; + var rng = range.get(); + if (rng.item) { + rng.item(0).outerHTML = val; + } else { + rng.pasteHTML(val); + } + var temp = range.doc.getElementById('__kindeditor_temp_tag__'); + temp.parentNode.removeChild(temp); + var newRange = _toRange(rng); + range.setEnd(newRange.endContainer, newRange.endOffset); + range.collapse(false); + self.select(false); + } + function insertHtml(range, val) { + var doc = range.doc, + frag = doc.createDocumentFragment(); + K('@' + val, doc).each(function() { + frag.appendChild(this); + }); + range.deleteContents(); + range.insertNode(frag); + range.collapse(false); + self.select(false); + } + if (_IERANGE && quickMode) { + try { + pasteHtml(range, val); + } catch(e) { + insertHtml(range, val); + } + return self; + } + insertHtml(range, val); + return self; + }, + hr : function() { + return this.inserthtml('
'); + }, + print : function() { + this.win.print(); + return this; + }, + insertimage : function(url, title, width, height, border, align) { + title = _undef(title, ''); + border = _undef(border, 0); + var html = ''; + return self.inserthtml(html); + } + if (range.isControl()) { + var node = K(range.startContainer.childNodes[range.startOffset]); + html += '>'; + node.after(K(html, doc)); + node.next().append(node); + range.selectNode(node[0]); + return self.select(); + } + function setAttr(node, url, type) { + K(node).attr('href', url).attr('data-ke-src', url); + if (type) { + K(node).attr('target', type); + } else { + K(node).removeAttr('target'); + } + } + var sc = range.startContainer, so = range.startOffset, + ec = range.endContainer, eo = range.endOffset; + if (sc.nodeType == 1 && sc === ec && so + 1 === eo) { + var child = sc.childNodes[so]; + if (child.nodeName.toLowerCase() == 'a') { + setAttr(child, url, type); + return self; + } + } + _nativeCommand(doc, 'createlink', '__kindeditor_temp_url__'); + K('a[href="__kindeditor_temp_url__"]', doc).each(function() { + setAttr(this, url, type); + }); + return self; + }, + unlink : function() { + var self = this, doc = self.doc, range = self.range; + self.select(); + if (range.collapsed) { + var a = self.commonNode({ a : '*' }); + if (a) { + range.selectNode(a.get()); + self.select(); + } + _nativeCommand(doc, 'unlink', null); + if (_WEBKIT && K(range.startContainer).name === 'img') { + var parent = K(range.startContainer).parent(); + if (parent.name === 'a') { + parent.remove(true); + } + } + } else { + _nativeCommand(doc, 'unlink', null); + } + return self; + } +}); +_each(('formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,' + + 'insertunorderedlist,indent,outdent,subscript,superscript').split(','), function(i, name) { + KCmd.prototype[name] = function(val) { + var self = this; + self.select(); + _nativeCommand(self.doc, name, val); + if (_IERANGE && _inArray(name, 'justifyleft,justifycenter,justifyright,justifyfull'.split(',')) >= 0) { + self.selection(); + } + if (!_IERANGE || _inArray(name, 'formatblock,selectall,insertorderedlist,insertunorderedlist'.split(',')) >= 0) { + self.selection(); + } + return self; + }; +}); +_each('cut,copy,paste'.split(','), function(i, name) { + KCmd.prototype[name] = function() { + var self = this; + if (!self.doc.queryCommandSupported(name)) { + throw 'not supported'; + } + self.select(); + _nativeCommand(self.doc, name, null); + return self; + }; +}); +function _cmd(mixed) { + if (mixed.nodeName) { + var doc = _getDoc(mixed); + mixed = _range(doc).selectNodeContents(doc.body).collapse(false); + } + return new KCmd(mixed); +} +K.CmdClass = KCmd; +K.cmd = _cmd; + + +function _drag(options) { + var moveEl = options.moveEl, + moveFn = options.moveFn, + clickEl = options.clickEl || moveEl, + beforeDrag = options.beforeDrag, + iframeFix = options.iframeFix === undefined ? true : options.iframeFix; + var docs = [document]; + if (iframeFix) { + K('iframe').each(function() { + var src = _formatUrl(this.src || '', 'absolute'); + if (/^https?:\/\//.test(src)) { + return; + } + var doc; + try { + doc = _iframeDoc(this); + } catch(e) {} + if (doc) { + var pos = K(this).pos(); + K(doc).data('pos-x', pos.x); + K(doc).data('pos-y', pos.y); + docs.push(doc); + } + }); + } + clickEl.mousedown(function(e) { + if(e.button !== 0 && e.button !== 1) { + return; + } + e.stopPropagation(); + var self = clickEl.get(), + x = _removeUnit(moveEl.css('left')), + y = _removeUnit(moveEl.css('top')), + width = moveEl.width(), + height = moveEl.height(), + pageX = e.pageX, + pageY = e.pageY; + if (beforeDrag) { + beforeDrag(); + } + function moveListener(e) { + e.preventDefault(); + var kdoc = K(_getDoc(e.target)); + var diffX = _round((kdoc.data('pos-x') || 0) + e.pageX - pageX); + var diffY = _round((kdoc.data('pos-y') || 0) + e.pageY - pageY); + moveFn.call(clickEl, x, y, width, height, diffX, diffY); + } + function selectListener(e) { + e.preventDefault(); + } + function upListener(e) { + e.preventDefault(); + K(docs).unbind('mousemove', moveListener) + .unbind('mouseup', upListener) + .unbind('selectstart', selectListener); + if (self.releaseCapture) { + self.releaseCapture(); + } + } + K(docs).mousemove(moveListener) + .mouseup(upListener) + .bind('selectstart', selectListener); + if (self.setCapture) { + self.setCapture(); + } + }); +} + + +function KWidget(options) { + this.init(options); +} +_extend(KWidget, { + init : function(options) { + var self = this; + self.name = options.name || ''; + self.doc = options.doc || document; + self.win = _getWin(self.doc); + self.x = _addUnit(options.x); + self.y = _addUnit(options.y); + self.z = options.z; + self.width = _addUnit(options.width); + self.height = _addUnit(options.height); + self.div = K('
'); + self.options = options; + self._alignEl = options.alignEl; + if (self.width) { + self.div.css('width', self.width); + } + if (self.height) { + self.div.css('height', self.height); + } + if (self.z) { + self.div.css({ + position : 'absolute', + left : self.x, + top : self.y, + 'z-index' : self.z + }); + } + if (self.z && (self.x === undefined || self.y === undefined)) { + self.autoPos(self.width, self.height); + } + if (options.cls) { + self.div.addClass(options.cls); + } + if (options.shadowMode) { + self.div.addClass('ke-shadow'); + } + if (options.css) { + self.div.css(options.css); + } + if (options.src) { + K(options.src).replaceWith(self.div); + } else { + K(self.doc.body).append(self.div); + } + if (options.html) { + self.div.html(options.html); + } + if (options.autoScroll) { + if (_IE && _V < 7 || _QUIRKS) { + var scrollPos = _getScrollPos(); + K(self.win).bind('scroll', function(e) { + var pos = _getScrollPos(), + diffX = pos.x - scrollPos.x, + diffY = pos.y - scrollPos.y; + self.pos(_removeUnit(self.x) + diffX, _removeUnit(self.y) + diffY, false); + }); + } else { + self.div.css('position', 'fixed'); + } + } + }, + pos : function(x, y, updateProp) { + var self = this; + updateProp = _undef(updateProp, true); + if (x !== null) { + x = x < 0 ? 0 : _addUnit(x); + self.div.css('left', x); + if (updateProp) { + self.x = x; + } + } + if (y !== null) { + y = y < 0 ? 0 : _addUnit(y); + self.div.css('top', y); + if (updateProp) { + self.y = y; + } + } + return self; + }, + autoPos : function(width, height) { + var self = this, + w = _removeUnit(width) || 0, + h = _removeUnit(height) || 0, + scrollPos = _getScrollPos(); + if (self._alignEl) { + var knode = K(self._alignEl), + pos = knode.pos(), + diffX = _round(knode[0].clientWidth / 2 - w / 2), + diffY = _round(knode[0].clientHeight / 2 - h / 2); + x = diffX < 0 ? pos.x : pos.x + diffX; + y = diffY < 0 ? pos.y : pos.y + diffY; + } else { + var docEl = _docElement(self.doc); + x = _round(scrollPos.x + (docEl.clientWidth - w) / 2); + y = _round(scrollPos.y + (docEl.clientHeight - h) / 2); + } + if (!(_IE && _V < 7 || _QUIRKS)) { + x -= scrollPos.x; + y -= scrollPos.y; + } + return self.pos(x, y); + }, + remove : function() { + var self = this; + if (_IE && _V < 7 || _QUIRKS) { + K(self.win).unbind('scroll'); + } + self.div.remove(); + _each(self, function(i) { + self[i] = null; + }); + return this; + }, + show : function() { + this.div.show(); + return this; + }, + hide : function() { + this.div.hide(); + return this; + }, + draggable : function(options) { + var self = this; + options = options || {}; + options.moveEl = self.div; + options.moveFn = function(x, y, width, height, diffX, diffY) { + if ((x = x + diffX) < 0) { + x = 0; + } + if ((y = y + diffY) < 0) { + y = 0; + } + self.pos(x, y); + }; + _drag(options); + return self; + } +}); +function _widget(options) { + return new KWidget(options); +} +K.WidgetClass = KWidget; +K.widget = _widget; + + +function _iframeDoc(iframe) { + iframe = _get(iframe); + return iframe.contentDocument || iframe.contentWindow.document; +} +var html, _direction = ''; +if ((html = document.getElementsByTagName('html'))) { + _direction = html[0].dir; +} +function _getInitHtml(themesPath, bodyClass, cssPath, cssData) { + var arr = [ + (_direction === '' ? '' : ''), + '', + '' + ]; + if (!_isArray(cssPath)) { + cssPath = [cssPath]; + } + _each(cssPath, function(i, path) { + if (path) { + arr.push(''); + } + }); + if (cssData) { + arr.push(''); + } + arr.push(''); + return arr.join('\n'); +} +function _elementVal(knode, val) { + if (knode.hasVal()) { + if (val === undefined) { + var html = knode.val(); + html = html.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig, ''); + return html; + } + return knode.val(val); + } + return knode.html(val); +} + + +function KEdit(options) { + this.init(options); +} +_extend(KEdit, KWidget, { + init : function(options) { + var self = this; + KEdit.parent.init.call(self, options); + self.srcElement = K(options.srcElement); + self.div.addClass('ke-edit'); + self.designMode = _undef(options.designMode, true); + self.beforeGetHtml = options.beforeGetHtml; + self.beforeSetHtml = options.beforeSetHtml; + self.afterSetHtml = options.afterSetHtml; + var themesPath = _undef(options.themesPath, ''), + bodyClass = options.bodyClass, + cssPath = options.cssPath, + cssData = options.cssData, + isDocumentDomain = location.protocol != 'res:' && location.host.replace(/:\d+/, '') !== document.domain, + srcScript = ('document.open();' + + (isDocumentDomain ? 'document.domain="' + document.domain + '";' : '') + + 'document.close();'), + iframeSrc = _IE ? ' src="javascript:void(function(){' + encodeURIComponent(srcScript) + '}())"' : ''; + self.iframe = K('').css('width', '100%'); + self.textarea = K('').css('width', '100%'); + self.tabIndex = isNaN(parseInt(options.tabIndex, 10)) ? self.srcElement.attr('tabindex') : parseInt(options.tabIndex, 10); + self.iframe.attr('tabindex', self.tabIndex); + self.textarea.attr('tabindex', self.tabIndex); + if (self.width) { + self.setWidth(self.width); + } + if (self.height) { + self.setHeight(self.height); + } + if (self.designMode) { + self.textarea.hide(); + } else { + self.iframe.hide(); + } + function ready() { + var doc = _iframeDoc(self.iframe); + doc.open(); + if (isDocumentDomain) { + doc.domain = document.domain; + } + doc.write(_getInitHtml(themesPath, bodyClass, cssPath, cssData)); + doc.close(); + self.win = self.iframe[0].contentWindow; + self.doc = doc; + var cmd = _cmd(doc); + self.afterChange(function(e) { + cmd.selection(); + }); + if (_WEBKIT) { + K(doc).click(function(e) { + if (K(e.target).name === 'img') { + cmd.selection(true); + cmd.range.selectNode(e.target); + cmd.select(); + } + }); + } + if (_IE) { + self._mousedownHandler = function() { + var newRange = cmd.range.cloneRange(); + newRange.shrink(); + if (newRange.isControl()) { + self.blur(); + } + }; + K(document).mousedown(self._mousedownHandler); + K(doc).keydown(function(e) { + if (e.which == 8) { + cmd.selection(); + var rng = cmd.range; + if (rng.isControl()) { + rng.collapse(true); + K(rng.startContainer.childNodes[rng.startOffset]).remove(); + e.preventDefault(); + } + } + }); + } + self.cmd = cmd; + self.html(_elementVal(self.srcElement)); + if (_IE) { + doc.body.disabled = true; + doc.body.contentEditable = true; + doc.body.removeAttribute('disabled'); + } else { + doc.designMode = 'on'; + } + if (options.afterCreate) { + options.afterCreate.call(self); + } + } + if (isDocumentDomain) { + self.iframe.bind('load', function(e) { + self.iframe.unbind('load'); + if (_IE) { + ready(); + } else { + setTimeout(ready, 0); + } + }); + } + self.div.append(self.iframe); + self.div.append(self.textarea); + self.srcElement.hide(); + !isDocumentDomain && ready(); + }, + setWidth : function(val) { + var self = this; + val = _addUnit(val); + self.width = val; + self.div.css('width', val); + return self; + }, + setHeight : function(val) { + var self = this; + val = _addUnit(val); + self.height = val; + self.div.css('height', val); + self.iframe.css('height', val); + if ((_IE && _V < 8) || _QUIRKS) { + val = _addUnit(_removeUnit(val) - 2); + } + self.textarea.css('height', val); + return self; + }, + remove : function() { + var self = this, doc = self.doc; + K(doc.body).unbind(); + K(doc).unbind(); + K(self.win).unbind(); + if (self._mousedownHandler) { + K(document).unbind('mousedown', self._mousedownHandler); + } + _elementVal(self.srcElement, self.html()); + self.srcElement.show(); + self.iframe.unbind(); + self.textarea.unbind(); + KEdit.parent.remove.call(self); + }, + html : function(val, isFull) { + var self = this, doc = self.doc; + if (self.designMode) { + var body = doc.body; + if (val === undefined) { + if (isFull) { + val = '' + body.parentNode.innerHTML + ''; + } else { + val = body.innerHTML; + } + if (self.beforeGetHtml) { + val = self.beforeGetHtml(val); + } + if (_GECKO && val == '
') { + val = ''; + } + return val; + } + if (self.beforeSetHtml) { + val = self.beforeSetHtml(val); + } + if (_IE && _V >= 9) { + val = val.replace(/(<.*?checked=")checked(".*>)/ig, '$1$2'); + } + K(body).html(val); + if (self.afterSetHtml) { + self.afterSetHtml(); + } + return self; + } + if (val === undefined) { + return self.textarea.val(); + } + self.textarea.val(val); + return self; + }, + design : function(bool) { + var self = this, val; + if (bool === undefined ? !self.designMode : bool) { + if (!self.designMode) { + val = self.html(); + self.designMode = true; + self.textarea.hide(); + self.html(val); + var iframe = self.iframe; + var height = _removeUnit(self.height); + iframe.height(height - 2); + iframe.show(); + setTimeout(function() { + iframe.height(height); + }, 0); + } + } else { + if (self.designMode) { + val = self.html(); + self.designMode = false; + self.html(val); + self.iframe.hide(); + self.textarea.show(); + } + } + return self.focus(); + }, + focus : function() { + var self = this; + self.designMode ? self.win.focus() : self.textarea[0].focus(); + return self; + }, + blur : function() { + var self = this; + if (_IE) { + var input = K('', self.div); + self.div.append(input); + input[0].focus(); + input.remove(); + } else { + self.designMode ? self.win.blur() : self.textarea[0].blur(); + } + return self; + }, + afterChange : function(fn) { + var self = this, doc = self.doc, body = doc.body; + K(doc).keyup(function(e) { + if (!e.ctrlKey && !e.altKey && _CHANGE_KEY_MAP[e.which]) { + fn(e); + } + }); + K(doc).mouseup(fn).contextmenu(fn); + K(self.win).blur(fn); + function timeoutHandler(e) { + setTimeout(function() { + fn(e); + }, 1); + } + K(body).bind('paste', timeoutHandler); + K(body).bind('cut', timeoutHandler); + return self; + } +}); +function _edit(options) { + return new KEdit(options); +} +K.EditClass = KEdit; +K.edit = _edit; +K.iframeDoc = _iframeDoc; + + +function _selectToolbar(name, fn) { + var self = this, + knode = self.get(name); + if (knode) { + if (knode.hasClass('ke-disabled')) { + return; + } + fn(knode); + } +} + + +function KToolbar(options) { + this.init(options); +} +_extend(KToolbar, KWidget, { + init : function(options) { + var self = this; + KToolbar.parent.init.call(self, options); + self.disableMode = _undef(options.disableMode, false); + self.noDisableItemMap = _toMap(_undef(options.noDisableItems, [])); + self._itemMap = {}; + self.div.addClass('ke-toolbar').bind('contextmenu,mousedown,mousemove', function(e) { + e.preventDefault(); + }).attr('unselectable', 'on'); + function find(target) { + var knode = K(target); + if (knode.hasClass('ke-outline')) { + return knode; + } + if (knode.hasClass('ke-toolbar-icon')) { + return knode.parent(); + } + } + function hover(e, method) { + var knode = find(e.target); + if (knode) { + if (knode.hasClass('ke-disabled')) { + return; + } + if (knode.hasClass('ke-selected')) { + return; + } + knode[method]('ke-on'); + } + } + self.div.mouseover(function(e) { + hover(e, 'addClass'); + }) + .mouseout(function(e) { + hover(e, 'removeClass'); + }) + .click(function(e) { + var knode = find(e.target); + if (knode) { + if (knode.hasClass('ke-disabled')) { + return; + } + self.options.click.call(this, e, knode.attr('data-name')); + } + }); + }, + get : function(name) { + if (this._itemMap[name]) { + return this._itemMap[name]; + } + return (this._itemMap[name] = K('span.ke-icon-' + name, this.div).parent()); + }, + select : function(name) { + _selectToolbar.call(this, name, function(knode) { + knode.addClass('ke-selected'); + }); + return self; + }, + unselect : function(name) { + _selectToolbar.call(this, name, function(knode) { + knode.removeClass('ke-selected').removeClass('ke-on'); + }); + return self; + }, + enable : function(name) { + var self = this, + knode = name.get ? name : self.get(name); + if (knode) { + knode.removeClass('ke-disabled'); + knode.opacity(1); + } + return self; + }, + disable : function(name) { + var self = this, + knode = name.get ? name : self.get(name); + if (knode) { + knode.removeClass('ke-selected').addClass('ke-disabled'); + knode.opacity(0.5); + } + return self; + }, + disableAll : function(bool, noDisableItems) { + var self = this, map = self.noDisableItemMap, item; + if (noDisableItems) { + map = _toMap(noDisableItems); + } + if (bool === undefined ? !self.disableMode : bool) { + K('span.ke-outline', self.div).each(function() { + var knode = K(this), + name = knode[0].getAttribute('data-name', 2); + if (!map[name]) { + self.disable(knode); + } + }); + self.disableMode = true; + } else { + K('span.ke-outline', self.div).each(function() { + var knode = K(this), + name = knode[0].getAttribute('data-name', 2); + if (!map[name]) { + self.enable(knode); + } + }); + self.disableMode = false; + } + return self; + } +}); +function _toolbar(options) { + return new KToolbar(options); +} +K.ToolbarClass = KToolbar; +K.toolbar = _toolbar; + + + +function KMenu(options) { + this.init(options); +} +_extend(KMenu, KWidget, { + init : function(options) { + var self = this; + options.z = options.z || 811213; + KMenu.parent.init.call(self, options); + self.centerLineMode = _undef(options.centerLineMode, true); + self.div.addClass('ke-menu').bind('click,mousedown', function(e){ + e.stopPropagation(); + }).attr('unselectable', 'on'); + }, + addItem : function(item) { + var self = this; + if (item.title === '-') { + self.div.append(K('
')); + return; + } + var itemDiv = K('
'), + leftDiv = K('
'), + rightDiv = K('
'), + height = _addUnit(item.height), + iconClass = _undef(item.iconClass, ''); + self.div.append(itemDiv); + if (height) { + itemDiv.css('height', height); + rightDiv.css('line-height', height); + } + var centerDiv; + if (self.centerLineMode) { + centerDiv = K('
'); + if (height) { + centerDiv.css('height', height); + } + } + itemDiv.mouseover(function(e) { + K(this).addClass('ke-menu-item-on'); + if (centerDiv) { + centerDiv.addClass('ke-menu-item-center-on'); + } + }) + .mouseout(function(e) { + K(this).removeClass('ke-menu-item-on'); + if (centerDiv) { + centerDiv.removeClass('ke-menu-item-center-on'); + } + }) + .click(function(e) { + item.click.call(K(this)); + e.stopPropagation(); + }) + .append(leftDiv); + if (centerDiv) { + itemDiv.append(centerDiv); + } + itemDiv.append(rightDiv); + if (item.checked) { + iconClass = 'ke-icon-checked'; + } + if (iconClass !== '') { + leftDiv.html(''); + } + rightDiv.html(item.title); + return self; + }, + remove : function() { + var self = this; + if (self.options.beforeRemove) { + self.options.beforeRemove.call(self); + } + K('.ke-menu-item', self.div[0]).unbind(); + KMenu.parent.remove.call(self); + return self; + } +}); +function _menu(options) { + return new KMenu(options); +} +K.MenuClass = KMenu; +K.menu = _menu; + + + +function KColorPicker(options) { + this.init(options); +} +_extend(KColorPicker, KWidget, { + init : function(options) { + var self = this; + options.z = options.z || 811213; + KColorPicker.parent.init.call(self, options); + var colors = options.colors || [ + ['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'], + ['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'], + ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'], + ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000'] + ]; + self.selectedColor = (options.selectedColor || '').toLowerCase(); + self._cells = []; + self.div.addClass('ke-colorpicker').bind('click,mousedown', function(e){ + e.stopPropagation(); + }).attr('unselectable', 'on'); + var table = self.doc.createElement('table'); + self.div.append(table); + table.className = 'ke-colorpicker-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + var row = table.insertRow(0), cell = row.insertCell(0); + cell.colSpan = colors[0].length; + self._addAttr(cell, '', 'ke-colorpicker-cell-top'); + for (var i = 0; i < colors.length; i++) { + row = table.insertRow(i + 1); + for (var j = 0; j < colors[i].length; j++) { + cell = row.insertCell(j); + self._addAttr(cell, colors[i][j], 'ke-colorpicker-cell'); + } + } + }, + _addAttr : function(cell, color, cls) { + var self = this; + cell = K(cell).addClass(cls); + if (self.selectedColor === color.toLowerCase()) { + cell.addClass('ke-colorpicker-cell-selected'); + } + cell.attr('title', color || self.options.noColor); + cell.mouseover(function(e) { + K(this).addClass('ke-colorpicker-cell-on'); + }); + cell.mouseout(function(e) { + K(this).removeClass('ke-colorpicker-cell-on'); + }); + cell.click(function(e) { + e.stop(); + self.options.click.call(K(this), color); + }); + if (color) { + cell.append(K('
').css('background-color', color)); + } else { + cell.html(self.options.noColor); + } + K(cell).attr('unselectable', 'on'); + self._cells.push(cell); + }, + remove : function() { + var self = this; + _each(self._cells, function() { + this.unbind(); + }); + KColorPicker.parent.remove.call(self); + return self; + } +}); +function _colorpicker(options) { + return new KColorPicker(options); +} +K.ColorPickerClass = KColorPicker; +K.colorpicker = _colorpicker; + + +function KUploadButton(options) { + this.init(options); +} +_extend(KUploadButton, { + init : function(options) { + var self = this, + button = K(options.button), + fieldName = options.fieldName || 'file', + url = options.url || '', + title = button.val(), + extraParams = options.extraParams || {}, + cls = button[0].className || '', + target = options.target || 'kindeditor_upload_iframe_' + new Date().getTime(); + options.afterError = options.afterError || function(str) { + alert(str); + }; + var hiddenElements = []; + for(var k in extraParams){ + hiddenElements.push(''); + } + var html = [ + '
', + (options.target ? '' : ''), + (options.form ? '
' : '
'), + '', + hiddenElements.join(''), + '', + '', + '', + (options.form ? '
' : ''), + '
'].join(''); + var div = K(html, button.doc); + button.hide(); + button.before(div); + self.div = div; + self.button = button; + self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div); + self.form = options.form ? K(options.form) : K('form', div); + self.fileBox = K('.ke-upload-file', div); + var width = options.width || K('.ke-button-common', div).width(); + K('.ke-upload-area', div).width(width); + self.options = options; + }, + submit : function() { + var self = this, + iframe = self.iframe; + iframe.bind('load', function() { + iframe.unbind(); + var tempForm = document.createElement('form'); + self.fileBox.before(tempForm); + K(tempForm).append(self.fileBox); + tempForm.reset(); + K(tempForm).remove(true); + var doc = K.iframeDoc(iframe), + pre = doc.getElementsByTagName('pre')[0], + str = '', data; + if (pre) { + str = pre.innerHTML; + } else { + str = doc.body.innerHTML; + } + str = _unescape(str); + iframe[0].src = 'javascript:false'; + try { + data = K.json(str); + } catch (e) { + self.options.afterError.call(self, '' + doc.body.parentNode.innerHTML + ''); + } + if (data) { + self.options.afterUpload.call(self, data); + } + }); + self.form[0].submit(); + return self; + }, + remove : function() { + var self = this; + if (self.fileBox) { + self.fileBox.unbind(); + } + self.iframe.remove(); + self.div.remove(); + self.button.show(); + return self; + } +}); +function _uploadbutton(options) { + return new KUploadButton(options); +} +K.UploadButtonClass = KUploadButton; +K.uploadbutton = _uploadbutton; + + +function _createButton(arg) { + arg = arg || {}; + var name = arg.name || '', + span = K(''), + btn = K(''); + if (arg.click) { + btn.click(arg.click); + } + span.append(btn); + return span; +} + + +function KDialog(options) { + this.init(options); +} +_extend(KDialog, KWidget, { + init : function(options) { + var self = this; + var shadowMode = _undef(options.shadowMode, true); + options.z = options.z || 811213; + options.shadowMode = false; + options.autoScroll = _undef(options.autoScroll, true); + KDialog.parent.init.call(self, options); + var title = options.title, + body = K(options.body, self.doc), + previewBtn = options.previewBtn, + yesBtn = options.yesBtn, + noBtn = options.noBtn, + closeBtn = options.closeBtn, + showMask = _undef(options.showMask, true); + self.div.addClass('ke-dialog').bind('click,mousedown', function(e){ + e.stopPropagation(); + }); + var contentDiv = K('
').appendTo(self.div); + if (_IE && _V < 7) { + self.iframeMask = K('').appendTo(self.div); + } else if (shadowMode) { + K('
').appendTo(self.div); + } + var headerDiv = K('
'); + contentDiv.append(headerDiv); + headerDiv.html(title); + self.closeIcon = K('').click(closeBtn.click); + headerDiv.append(self.closeIcon); + self.draggable({ + clickEl : headerDiv, + beforeDrag : options.beforeDrag + }); + var bodyDiv = K('
'); + contentDiv.append(bodyDiv); + bodyDiv.append(body); + var footerDiv = K(''); + if (previewBtn || yesBtn || noBtn) { + contentDiv.append(footerDiv); + } + _each([ + { btn : previewBtn, name : 'preview' }, + { btn : yesBtn, name : 'yes' }, + { btn : noBtn, name : 'no' } + ], function() { + if (this.btn) { + var button = _createButton(this.btn); + button.addClass('ke-dialog-' + this.name); + footerDiv.append(button); + } + }); + if (self.height) { + bodyDiv.height(_removeUnit(self.height) - headerDiv.height() - footerDiv.height()); + } + self.div.width(self.div.width()); + self.div.height(self.div.height()); + self.mask = null; + if (showMask) { + var docEl = _docElement(self.doc), + docWidth = Math.max(docEl.scrollWidth, docEl.clientWidth), + docHeight = Math.max(docEl.scrollHeight, docEl.clientHeight); + self.mask = _widget({ + x : 0, + y : 0, + z : self.z - 1, + cls : 'ke-dialog-mask', + width : docWidth, + height : docHeight + }); + } + self.autoPos(self.div.width(), self.div.height()); + self.footerDiv = footerDiv; + self.bodyDiv = bodyDiv; + self.headerDiv = headerDiv; + self.isLoading = false; + }, + setMaskIndex : function(z) { + var self = this; + self.mask.div.css('z-index', z); + }, + showLoading : function(msg) { + msg = _undef(msg, ''); + var self = this, body = self.bodyDiv; + self.loading = K('
' + msg + '
') + .width(body.width()).height(body.height()) + .css('top', self.headerDiv.height() + 'px'); + body.css('visibility', 'hidden').after(self.loading); + self.isLoading = true; + return self; + }, + hideLoading : function() { + this.loading && this.loading.remove(); + this.bodyDiv.css('visibility', 'visible'); + this.isLoading = false; + return this; + }, + remove : function() { + var self = this; + if (self.options.beforeRemove) { + self.options.beforeRemove.call(self); + } + self.mask && self.mask.remove(); + self.iframeMask && self.iframeMask.remove(); + self.closeIcon.unbind(); + K('input', self.div).unbind(); + K('button', self.div).unbind(); + self.footerDiv.unbind(); + self.bodyDiv.unbind(); + self.headerDiv.unbind(); + K('iframe', self.div).each(function() { + K(this).remove(); + }); + KDialog.parent.remove.call(self); + return self; + } +}); +function _dialog(options) { + return new KDialog(options); +} +K.DialogClass = KDialog; +K.dialog = _dialog; + + +function _tabs(options) { + var self = _widget(options), + remove = self.remove, + afterSelect = options.afterSelect, + div = self.div, + liList = []; + div.addClass('ke-tabs') + .bind('contextmenu,mousedown,mousemove', function(e) { + e.preventDefault(); + }); + var ul = K('
    '); + div.append(ul); + self.add = function(tab) { + var li = K('
  • ' + tab.title + '
  • '); + li.data('tab', tab); + liList.push(li); + ul.append(li); + }; + self.selectedIndex = 0; + self.select = function(index) { + self.selectedIndex = index; + _each(liList, function(i, li) { + li.unbind(); + if (i === index) { + li.addClass('ke-tabs-li-selected'); + K(li.data('tab').panel).show(''); + } else { + li.removeClass('ke-tabs-li-selected').removeClass('ke-tabs-li-on') + .mouseover(function() { + K(this).addClass('ke-tabs-li-on'); + }) + .mouseout(function() { + K(this).removeClass('ke-tabs-li-on'); + }) + .click(function() { + self.select(i); + }); + K(li.data('tab').panel).hide(); + } + }); + if (afterSelect) { + afterSelect.call(self, index); + } + }; + self.remove = function() { + _each(liList, function() { + this.remove(); + }); + ul.remove(); + remove.call(self); + }; + return self; +} +K.tabs = _tabs; + + +function _loadScript(url, fn) { + var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement), + script = document.createElement('script'); + head.appendChild(script); + script.src = url; + script.charset = 'utf-8'; + script.onload = script.onreadystatechange = function() { + if (!this.readyState || this.readyState === 'loaded') { + if (fn) { + fn(); + } + script.onload = script.onreadystatechange = null; + head.removeChild(script); + } + }; +} + + +function _chopQuery(url) { + var index = url.indexOf('?'); + return index > 0 ? url.substr(0, index) : url; +} +function _loadStyle(url) { + var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement), + link = document.createElement('link'), + absoluteUrl = _chopQuery(_formatUrl(url, 'absolute')); + var links = K('link[rel="stylesheet"]', head); + for (var i = 0, len = links.length; i < len; i++) { + if (_chopQuery(_formatUrl(links[i].href, 'absolute')) === absoluteUrl) { + return; + } + } + head.appendChild(link); + link.href = url; + link.rel = 'stylesheet'; +} +function _ajax(url, fn, method, param, dataType) { + method = method || 'GET'; + dataType = dataType || 'json'; + var xhr = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); + xhr.open(method, url, true); + xhr.onreadystatechange = function () { + if (xhr.readyState == 4 && xhr.status == 200) { + if (fn) { + var data = _trim(xhr.responseText); + if (dataType == 'json') { + data = _json(data); + } + fn(data); + } + } + }; + if (method == 'POST') { + var params = []; + _each(param, function(key, val) { + params.push(encodeURIComponent(key) + '=' + encodeURIComponent(val)); + }); + try { + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + } catch (e) {} + xhr.send(params.join('&')); + } else { + xhr.send(null); + } +} +K.loadScript = _loadScript; +K.loadStyle = _loadStyle; +K.ajax = _ajax; + + +var _plugins = {}; +function _plugin(name, fn) { + if (name === undefined) { + return _plugins; + } + if (!fn) { + return _plugins[name]; + } + _plugins[name] = fn; +} +var _language = {}; +function _parseLangKey(key) { + var match, ns = 'core'; + if ((match = /^(\w+)\.(\w+)$/.exec(key))) { + ns = match[1]; + key = match[2]; + } + return { ns : ns, key : key }; +} +function _lang(mixed, langType) { + langType = langType === undefined ? K.options.langType : langType; + if (typeof mixed === 'string') { + if (!_language[langType]) { + return 'no language'; + } + var pos = mixed.length - 1; + if (mixed.substr(pos) === '.') { + return _language[langType][mixed.substr(0, pos)]; + } + var obj = _parseLangKey(mixed); + return _language[langType][obj.ns][obj.key]; + } + _each(mixed, function(key, val) { + var obj = _parseLangKey(key); + if (!_language[langType]) { + _language[langType] = {}; + } + if (!_language[langType][obj.ns]) { + _language[langType][obj.ns] = {}; + } + _language[langType][obj.ns][obj.key] = val; + }); +} + + +function _getImageFromRange(range, fn) { + if (range.collapsed) { + return; + } + range = range.cloneRange().up(); + var sc = range.startContainer, so = range.startOffset; + if (!_WEBKIT && !range.isControl()) { + return; + } + var img = K(sc.childNodes[so]); + if (!img || img.name != 'img') { + return; + } + if (fn(img)) { + return img; + } +} +function _bindContextmenuEvent() { + var self = this, doc = self.edit.doc; + K(doc).contextmenu(function(e) { + if (self.menu) { + self.hideMenu(); + } + if (!self.useContextmenu) { + e.preventDefault(); + return; + } + if (self._contextmenus.length === 0) { + return; + } + var maxWidth = 0, items = []; + _each(self._contextmenus, function() { + if (this.title == '-') { + items.push(this); + return; + } + if (this.cond && this.cond()) { + items.push(this); + if (this.width && this.width > maxWidth) { + maxWidth = this.width; + } + } + }); + while (items.length > 0 && items[0].title == '-') { + items.shift(); + } + while (items.length > 0 && items[items.length - 1].title == '-') { + items.pop(); + } + var prevItem = null; + _each(items, function(i) { + if (this.title == '-' && prevItem.title == '-') { + delete items[i]; + } + prevItem = this; + }); + if (items.length > 0) { + e.preventDefault(); + var pos = K(self.edit.iframe).pos(), + menu = _menu({ + x : pos.x + e.clientX, + y : pos.y + e.clientY, + width : maxWidth, + css : { visibility: 'hidden' }, + shadowMode : self.shadowMode + }); + _each(items, function() { + if (this.title) { + menu.addItem(this); + } + }); + var docEl = _docElement(menu.doc), + menuHeight = menu.div.height(); + if (e.clientY + menuHeight >= docEl.clientHeight - 100) { + menu.pos(menu.x, _removeUnit(menu.y) - menuHeight); + } + menu.div.css('visibility', 'visible'); + self.menu = menu; + } + }); +} +function _bindNewlineEvent() { + var self = this, doc = self.edit.doc, newlineTag = self.newlineTag; + if (_IE && newlineTag !== 'br') { + return; + } + if (_GECKO && _V < 3 && newlineTag !== 'p') { + return; + } + if (_OPERA && _V < 9) { + return; + } + var brSkipTagMap = _toMap('h1,h2,h3,h4,h5,h6,pre,li'), + pSkipTagMap = _toMap('p,h1,h2,h3,h4,h5,h6,pre,li,blockquote'); + function getAncestorTagName(range) { + var ancestor = K(range.commonAncestor()); + while (ancestor) { + if (ancestor.type == 1 && !ancestor.isStyle()) { + break; + } + ancestor = ancestor.parent(); + } + return ancestor.name; + } + K(doc).keydown(function(e) { + if (e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { + return; + } + self.cmd.selection(); + var tagName = getAncestorTagName(self.cmd.range); + if (tagName == 'marquee' || tagName == 'select') { + return; + } + if (newlineTag === 'br' && !brSkipTagMap[tagName]) { + e.preventDefault(); + self.insertHtml('
    ' + (_IE && _V < 9 ? '' : '\u200B')); + return; + } + if (!pSkipTagMap[tagName]) { + _nativeCommand(doc, 'formatblock', '

    '); + } + }); + K(doc).keyup(function(e) { + if (e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { + return; + } + if (newlineTag == 'br') { + return; + } + if (_GECKO) { + var root = self.cmd.commonAncestor('p'); + var a = self.cmd.commonAncestor('a'); + if (a && a.text() == '') { + a.remove(true); + self.cmd.range.selectNodeContents(root[0]).collapse(true); + self.cmd.select(); + } + return; + } + self.cmd.selection(); + var tagName = getAncestorTagName(self.cmd.range); + if (tagName == 'marquee' || tagName == 'select') { + return; + } + if (!pSkipTagMap[tagName]) { + _nativeCommand(doc, 'formatblock', '

    '); + } + var div = self.cmd.commonAncestor('div'); + if (div) { + var p = K('

    '), + child = div[0].firstChild; + while (child) { + var next = child.nextSibling; + p.append(child); + child = next; + } + div.before(p); + div.remove(); + self.cmd.range.selectNodeContents(p[0]); + self.cmd.select(); + } + }); +} +function _bindTabEvent() { + var self = this, doc = self.edit.doc; + K(doc).keydown(function(e) { + if (e.which == 9) { + e.preventDefault(); + if (self.afterTab) { + self.afterTab.call(self, e); + return; + } + var cmd = self.cmd, range = cmd.range; + range.shrink(); + if (range.collapsed && range.startContainer.nodeType == 1) { + range.insertNode(K('@ ', doc)[0]); + cmd.select(); + } + self.insertHtml('    '); + } + }); +} +function _bindFocusEvent() { + var self = this; + K(self.edit.textarea[0], self.edit.win).focus(function(e) { + if (self.afterFocus) { + self.afterFocus.call(self, e); + } + }).blur(function(e) { + if (self.afterBlur) { + self.afterBlur.call(self, e); + } + }); +} +function _removeBookmarkTag(html) { + return _trim(html.replace(/]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig, '')); +} +function _removeTempTag(html) { + return html.replace(/]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/ig, ''); +} +function _addBookmarkToStack(stack, bookmark) { + if (stack.length === 0) { + stack.push(bookmark); + return; + } + var prev = stack[stack.length - 1]; + if (_removeBookmarkTag(bookmark.html) !== _removeBookmarkTag(prev.html)) { + stack.push(bookmark); + } +} + + + +function _undoToRedo(fromStack, toStack) { + var self = this, edit = self.edit, + body = edit.doc.body, + range, bookmark; + if (fromStack.length === 0) { + return self; + } + if (edit.designMode) { + range = self.cmd.range; + bookmark = range.createBookmark(true); + bookmark.html = body.innerHTML; + } else { + bookmark = { + html : body.innerHTML + }; + } + _addBookmarkToStack(toStack, bookmark); + var prev = fromStack.pop(); + if (_removeBookmarkTag(bookmark.html) === _removeBookmarkTag(prev.html) && fromStack.length > 0) { + prev = fromStack.pop(); + } + if (edit.designMode) { + edit.html(prev.html); + if (prev.start) { + range.moveToBookmark(prev); + self.select(); + } + } else { + K(body).html(_removeBookmarkTag(prev.html)); + } + return self; +} +function KEditor(options) { + var self = this; + self.options = {}; + function setOption(key, val) { + if (KEditor.prototype[key] === undefined) { + self[key] = val; + } + self.options[key] = val; + } + _each(options, function(key, val) { + setOption(key, options[key]); + }); + _each(K.options, function(key, val) { + if (self[key] === undefined) { + setOption(key, val); + } + }); + var se = K(self.srcElement || '', + ''].join(''), + dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var type = K('.ke-code-type', dialog.div).val(), + code = textarea.val(), + cls = type === '' ? '' : ' lang-' + type, + html = '
    \n' + K.escape(code) + '
    '; + if (K.trim(code) === '') { + alert(lang.pleaseInput); + textarea[0].focus(); + return; + } + self.insertHtml(html).hideDialog().focus(); + } + } + }), + textarea = K('textarea', dialog.div); + textarea[0].focus(); + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('emoticons', function(K) { + var self = this, name = 'emoticons', + path = (self.emoticonsPath || self.pluginsPath + 'emoticons/images/'), + allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons, + currentPageNum = 1; + self.clickToolbar(name, function() { + var rows = 5, cols = 9, total = 135, startNum = 0, + cells = rows * cols, pages = Math.ceil(total / cells), + colsHalf = Math.floor(cols / 2), + wrapperDiv = K('
    '), + elements = [], + menu = self.createMenu({ + name : name, + beforeRemove : function() { + removeEvent(); + } + }); + menu.div.append(wrapperDiv); + var previewDiv, previewImg; + if (allowPreview) { + previewDiv = K('
    ').css('right', 0); + previewImg = K(''); + wrapperDiv.append(previewDiv); + previewDiv.append(previewImg); + } + function bindCellEvent(cell, j, num) { + if (previewDiv) { + cell.mouseover(function() { + if (j > colsHalf) { + previewDiv.css('left', 0); + previewDiv.css('right', ''); + } else { + previewDiv.css('left', ''); + previewDiv.css('right', 0); + } + previewImg.attr('src', path + num + '.gif'); + K(this).addClass('ke-on'); + }); + } else { + cell.mouseover(function() { + K(this).addClass('ke-on'); + }); + } + cell.mouseout(function() { + K(this).removeClass('ke-on'); + }); + cell.click(function(e) { + self.insertHtml('').hideMenu().focus(); + e.stop(); + }); + } + function createEmoticonsTable(pageNum, parentDiv) { + var table = document.createElement('table'); + parentDiv.append(table); + if (previewDiv) { + K(table).mouseover(function() { + previewDiv.show('block'); + }); + K(table).mouseout(function() { + previewDiv.hide(); + }); + elements.push(K(table)); + } + table.className = 'ke-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + var num = (pageNum - 1) * cells + startNum; + for (var i = 0; i < rows; i++) { + var row = table.insertRow(i); + for (var j = 0; j < cols; j++) { + var cell = K(row.insertCell(j)); + cell.addClass('ke-cell'); + bindCellEvent(cell, j, num); + var span = K('') + .css('background-position', '-' + (24 * num) + 'px 0px') + .css('background-image', 'url(' + path + 'static.gif)'); + cell.append(span); + elements.push(cell); + num++; + } + } + return table; + } + var table = createEmoticonsTable(currentPageNum, wrapperDiv); + function removeEvent() { + K.each(elements, function() { + this.unbind(); + }); + } + var pageDiv; + function bindPageEvent(el, pageNum) { + el.click(function(e) { + removeEvent(); + table.parentNode.removeChild(table); + pageDiv.remove(); + table = createEmoticonsTable(pageNum, wrapperDiv); + createPageTable(pageNum); + currentPageNum = pageNum; + e.stop(); + }); + } + function createPageTable(currentPageNum) { + pageDiv = K('
    '); + wrapperDiv.append(pageDiv); + for (var pageNum = 1; pageNum <= pages; pageNum++) { + if (currentPageNum !== pageNum) { + var a = K('[' + pageNum + ']'); + bindPageEvent(a, pageNum); + pageDiv.append(a); + elements.push(a); + } else { + pageDiv.append(K('@[' + pageNum + ']')); + } + pageDiv.append(K('@ ')); + } + } + createPageTable(currentPageNum); + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('filemanager', function(K) { + var self = this, name = 'filemanager', + fileManagerJson = K.undef(self.fileManagerJson, self.basePath + 'php/file_manager_json.php'), + imgPath = self.pluginsPath + name + '/images/', + lang = self.lang(name + '.'); + function makeFileTitle(filename, filesize, datetime) { + return filename + ' (' + Math.ceil(filesize / 1024) + 'KB, ' + datetime + ')'; + } + function bindTitle(el, data) { + if (data.is_dir) { + el.attr('title', data.filename); + } else { + el.attr('title', makeFileTitle(data.filename, data.filesize, data.datetime)); + } + } + self.plugin.filemanagerDialog = function(options) { + var width = K.undef(options.width, 650), + height = K.undef(options.height, 510), + dirName = K.undef(options.dirName, ''), + viewType = K.undef(options.viewType, 'VIEW').toUpperCase(), + clickFn = options.clickFn; + var html = [ + '
    ', + '
    ', + '
    ', + ' ', + '' + lang.moveup + '', + '
    ', + '
    ', + lang.viewType + ' ', + lang.orderType + ' ', + '
    ', + '
    ', + '
    ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : width, + height : height, + title : self.lang(name), + body : html + }), + div = dialog.div, + bodyDiv = K('.ke-plugin-filemanager-body', div), + moveupImg = K('[name="moveupImg"]', div), + moveupLink = K('[name="moveupLink"]', div), + viewServerBtn = K('[name="viewServer"]', div), + viewTypeBox = K('[name="viewType"]', div), + orderTypeBox = K('[name="orderType"]', div); + function reloadPage(path, order, func) { + var param = 'path=' + path + '&order=' + order + '&dir=' + dirName; + dialog.showLoading(self.lang('ajaxLoading')); + K.ajax(K.addParam(fileManagerJson, param + '&' + new Date().getTime()), function(data) { + dialog.hideLoading(); + func(data); + }); + } + var elList = []; + function bindEvent(el, result, data, createFunc) { + var fileUrl = K.formatUrl(result.current_url + data.filename, 'absolute'), + dirPath = encodeURIComponent(result.current_dir_path + data.filename + '/'); + if (data.is_dir) { + el.click(function(e) { + reloadPage(dirPath, orderTypeBox.val(), createFunc); + }); + } else if (data.is_photo) { + el.click(function(e) { + clickFn.call(this, fileUrl, data.filename); + }); + } else { + el.click(function(e) { + clickFn.call(this, fileUrl, data.filename); + }); + } + elList.push(el); + } + function createCommon(result, createFunc) { + K.each(elList, function() { + this.unbind(); + }); + moveupLink.unbind(); + viewTypeBox.unbind(); + orderTypeBox.unbind(); + if (result.current_dir_path) { + moveupLink.click(function(e) { + reloadPage(result.moveup_dir_path, orderTypeBox.val(), createFunc); + }); + } + function changeFunc() { + if (viewTypeBox.val() == 'VIEW') { + reloadPage(result.current_dir_path, orderTypeBox.val(), createView); + } else { + reloadPage(result.current_dir_path, orderTypeBox.val(), createList); + } + } + viewTypeBox.change(changeFunc); + orderTypeBox.change(changeFunc); + bodyDiv.html(''); + } + function createList(result) { + createCommon(result, createList); + var table = document.createElement('table'); + table.className = 'ke-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + bodyDiv.append(table); + var fileList = result.file_list; + for (var i = 0, len = fileList.length; i < len; i++) { + var data = fileList[i], row = K(table.insertRow(i)); + row.mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + var iconUrl = imgPath + (data.is_dir ? 'folder-16.gif' : 'file-16.gif'), + img = K('' + data.filename + ''), + cell0 = K(row[0].insertCell(0)).addClass('ke-cell ke-name').append(img).append(document.createTextNode(' ' + data.filename)); + if (!data.is_dir || data.has_file) { + row.css('cursor', 'pointer'); + cell0.attr('title', data.filename); + bindEvent(cell0, result, data, createList); + } else { + cell0.attr('title', lang.emptyFolder); + } + K(row[0].insertCell(1)).addClass('ke-cell ke-size').html(data.is_dir ? '-' : Math.ceil(data.filesize / 1024) + 'KB'); + K(row[0].insertCell(2)).addClass('ke-cell ke-datetime').html(data.datetime); + } + } + function createView(result) { + createCommon(result, createView); + var fileList = result.file_list; + for (var i = 0, len = fileList.length; i < len; i++) { + var data = fileList[i], + div = K('
    '); + bodyDiv.append(div); + var photoDiv = K('
    ') + .mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + div.append(photoDiv); + var fileUrl = result.current_url + data.filename, + iconUrl = data.is_dir ? imgPath + 'folder-64.gif' : (data.is_photo ? fileUrl : imgPath + 'file-64.gif'); + var img = K('' + data.filename + ''); + if (!data.is_dir || data.has_file) { + photoDiv.css('cursor', 'pointer'); + bindTitle(photoDiv, data); + bindEvent(photoDiv, result, data, createView); + } else { + photoDiv.attr('title', lang.emptyFolder); + } + photoDiv.append(img); + div.append('
    ' + data.filename + '
    '); + } + } + viewTypeBox.val(viewType); + reloadPage('', orderTypeBox.val(), viewType == 'VIEW' ? createView : createList); + return dialog; + } +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('flash', function(K) { + var self = this, name = 'flash', lang = self.lang(name + '.'), + allowFlashUpload = K.undef(self.allowFlashUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'); + self.plugin.flash = { + edit : function() { + var html = [ + '
    ', + '
    ', + '', + '  ', + '  ', + '', + '', + '', + '
    ', + '
    ', + '', + ' ', + '
    ', + '
    ', + '', + ' ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(); + if (url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + var html = K.mediaImg(self.themesPath + 'common/blank.gif', { + src : url, + type : K.mediaType('.swf'), + width : width, + height : height, + quality : 'high' + }); + self.insertHtml(html).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('[name="width"]', div), + heightBox = K('[name="height"]', div); + urlBox.val('http://'); + if (allowFlashUpload) { + var uploadbutton = K.uploadbutton({ + button : K('.ke-upload-button', div)[0], + fieldName : filePostName, + extraParams : extraParams, + url : K.addParam(uploadJson, 'dir=flash'), + afterUpload : function(data) { + dialog.hideLoading(); + if (data.error === 0) { + var url = data.url; + if (formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if (self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError : function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + if (allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType : 'LIST', + dirName : 'flash', + clickFn : function(url, title) { + if (self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if (self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + var img = self.plugin.getSelectedFlash(); + if (img) { + var attrs = K.mediaAttrs(img.attr('data-ke-tag')); + urlBox.val(attrs.src); + widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0); + heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete' : function() { + self.plugin.getSelectedFlash().remove(); + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.flash.edit); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('image', function(K) { + var self = this, name = 'image', + allowImageUpload = K.undef(self.allowImageUpload, true), + allowImageRemote = K.undef(self.allowImageRemote, true), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + allowFileManager = K.undef(self.allowFileManager, false), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + imageTabIndex = K.undef(self.imageTabIndex, 0), + imgPath = self.pluginsPath + 'image/images/', + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + fillDescAfterUploadImage = K.undef(self.fillDescAfterUploadImage, false), + lang = self.lang(name + '.'); + self.plugin.imageDialog = function(options) { + var imageUrl = options.imageUrl, + imageWidth = K.undef(options.imageWidth, ''), + imageHeight = K.undef(options.imageHeight, ''), + imageTitle = K.undef(options.imageTitle, ''), + imageAlign = K.undef(options.imageAlign, ''), + showRemote = K.undef(options.showRemote, true), + showLocal = K.undef(options.showLocal, true), + tabIndex = K.undef(options.tabIndex, 0), + clickFn = options.clickFn; + var target = 'kindeditor_upload_iframe_' + new Date().getTime(); + var hiddenElements = []; + for(var k in extraParams){ + hiddenElements.push(''); + } + var html = [ + '
    ', + '
    ', + '', + '', + '
    ' + ].join(''); + var dialogWidth = showLocal || allowFileManager ? 450 : 400, + dialogHeight = showLocal && showRemote ? 300 : 250; + var dialog = self.createDialog({ + name : name, + width : dialogWidth, + height : dialogHeight, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + if (dialog.isLoading) { + return; + } + if (showLocal && showRemote && tabs && tabs.selectedIndex === 1 || !showRemote) { + if (uploadbutton.fileBox.val() == '') { + alert(self.lang('pleaseSelectFile')); + return; + } + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + localUrlBox.val(''); + return; + } + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(), + title = titleBox.val(), + align = ''; + alignBox.each(function() { + if (this.checked) { + align = this.value; + return false; + } + }); + if (url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + clickFn.call(self, url, title, width, height, 0, align); + } + }, + beforeRemove : function() { + viewServerBtn.unbind(); + widthBox.unbind(); + heightBox.unbind(); + refreshBtn.unbind(); + } + }), + div = dialog.div; + var urlBox = K('[name="url"]', div), + localUrlBox = K('[name="localUrl"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('.tab1 [name="width"]', div), + heightBox = K('.tab1 [name="height"]', div), + refreshBtn = K('.ke-refresh-btn', div), + titleBox = K('.tab1 [name="title"]', div), + alignBox = K('.tab1 [name="align"]', div); + var tabs; + if (showRemote && showLocal) { + tabs = K.tabs({ + src : K('.tabs', div), + afterSelect : function(i) {} + }); + tabs.add({ + title : lang.remoteImage, + panel : K('.tab1', div) + }); + tabs.add({ + title : lang.localImage, + panel : K('.tab2', div) + }); + tabs.select(tabIndex); + } else if (showRemote) { + K('.tab1', div).show(); + } else if (showLocal) { + K('.tab2', div).show(); + } + var uploadbutton = K.uploadbutton({ + button : K('.ke-upload-button', div)[0], + fieldName : filePostName, + form : K('.ke-form', div), + target : target, + width: 60, + afterUpload : function(data) { + dialog.hideLoading(); + if (data.error === 0) { + var url = data.url; + if (formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + if (self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + if (!fillDescAfterUploadImage) { + clickFn.call(self, url, data.title, data.width, data.height, data.border, data.align); + } else { + K(".ke-dialog-row #remoteUrl", div).val(url); + K(".ke-tabs-li", div)[0].click(); + K(".ke-refresh-btn", div).click(); + } + } else { + alert(data.message); + } + }, + afterError : function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + localUrlBox.val(uploadbutton.fileBox.val()); + }); + if (allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType : 'VIEW', + dirName : 'image', + clickFn : function(url, title) { + if (self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if (self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + var originalWidth = 0, originalHeight = 0; + function setSize(width, height) { + widthBox.val(width); + heightBox.val(height); + originalWidth = width; + originalHeight = height; + } + refreshBtn.click(function(e) { + var tempImg = K('', document).css({ + position : 'absolute', + visibility : 'hidden', + top : 0, + left : '-1000px' + }); + tempImg.bind('load', function() { + setSize(tempImg.width(), tempImg.height()); + tempImg.remove(); + }); + K(document.body).append(tempImg); + }); + widthBox.change(function(e) { + if (originalWidth > 0) { + heightBox.val(Math.round(originalHeight / originalWidth * parseInt(this.value, 10))); + } + }); + heightBox.change(function(e) { + if (originalHeight > 0) { + widthBox.val(Math.round(originalWidth / originalHeight * parseInt(this.value, 10))); + } + }); + urlBox.val(options.imageUrl); + setSize(options.imageWidth, options.imageHeight); + titleBox.val(options.imageTitle); + alignBox.each(function() { + if (this.value === options.imageAlign) { + this.checked = true; + return false; + } + }); + if (showRemote && tabIndex === 0) { + urlBox[0].focus(); + urlBox[0].select(); + } + return dialog; + }; + self.plugin.image = { + edit : function() { + var img = self.plugin.getSelectedImage(); + self.plugin.imageDialog({ + imageUrl : img ? img.attr('data-ke-src') : 'http://', + imageWidth : img ? img.width() : '', + imageHeight : img ? img.height() : '', + imageTitle : img ? img.attr('title') : '', + imageAlign : img ? img.attr('align') : '', + showRemote : allowImageRemote, + showLocal : allowImageUpload, + tabIndex: img ? 0 : imageTabIndex, + clickFn : function(url, title, width, height, border, align) { + if (img) { + img.attr('src', url); + img.attr('data-ke-src', url); + img.attr('width', width); + img.attr('height', height); + img.attr('title', title); + img.attr('align', align); + img.attr('alt', title); + } else { + self.exec('insertimage', url, title, width, height, border, align); + } + setTimeout(function() { + self.hideDialog().focus(); + }, 0); + } + }); + }, + 'delete' : function() { + var target = self.plugin.getSelectedImage(); + if (target.parent().name == 'a') { + target = target.parent(); + } + target.remove(); + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.image.edit); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('insertfile', function(K) { + var self = this, name = 'insertfile', + allowFileUpload = K.undef(self.allowFileUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + lang = self.lang(name + '.'); + self.plugin.fileDialog = function(options) { + var fileUrl = K.undef(options.fileUrl, 'http://'), + fileTitle = K.undef(options.fileTitle, ''), + clickFn = options.clickFn; + var html = [ + '
    ', + '
    ', + '', + '  ', + '  ', + '', + '', + '', + '
    ', + '
    ', + '', + '
    ', + '
    ', + '', + '' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var url = K.trim(urlBox.val()), + title = titleBox.val(); + if (url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if (K.trim(title) === '') { + title = url; + } + clickFn.call(self, url, title); + } + } + }), + div = dialog.div; + var urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + titleBox = K('[name="title"]', div); + if (allowFileUpload) { + var uploadbutton = K.uploadbutton({ + button : K('.ke-upload-button', div)[0], + fieldName : filePostName, + url : K.addParam(uploadJson, 'dir=file'), + extraParams : extraParams, + afterUpload : function(data) { + dialog.hideLoading(); + if (data.error === 0) { + var url = data.url; + if (formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if (self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError : function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + if (allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType : 'LIST', + dirName : 'file', + clickFn : function(url, title) { + if (self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if (self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + urlBox.val(fileUrl); + titleBox.val(fileTitle); + urlBox[0].focus(); + urlBox[0].select(); + }; + self.clickToolbar(name, function() { + self.plugin.fileDialog({ + clickFn : function(url, title) { + var html = '' + title + ''; + self.insertHtml(html).hideDialog().focus(); + } + }); + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('lineheight', function(K) { + var self = this, name = 'lineheight', lang = self.lang(name + '.'); + self.clickToolbar(name, function() { + var curVal = '', commonNode = self.cmd.commonNode({'*' : '.line-height'}); + if (commonNode) { + curVal = commonNode.css('line-height'); + } + var menu = self.createMenu({ + name : name, + width : 150 + }); + K.each(lang.lineHeight, function(i, row) { + K.each(row, function(key, val) { + menu.addItem({ + title : val, + checked : curVal === key, + click : function() { + self.cmd.toggle('', { + span : '.line-height=' + key + }); + self.updateState(); + self.addBookmark(); + self.hideMenu(); + } + }); + }); + }); + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('link', function(K) { + var self = this, name = 'link'; + self.plugin.link = { + edit : function() { + var lang = self.lang(name + '.'), + html = '
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '' + + '' + + '
    ' + + '
    ', + dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var url = K.trim(urlBox.val()); + if (url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + self.exec('createlink', url, typeBox.val()).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('input[name="url"]', div), + typeBox = K('select[name="type"]', div); + urlBox.val('http://'); + typeBox[0].options[0] = new Option(lang.newWindow, '_blank'); + typeBox[0].options[1] = new Option(lang.selfWindow, ''); + self.cmd.selection(); + var a = self.plugin.getSelectedLink(); + if (a) { + self.cmd.range.selectNode(a[0]); + self.cmd.select(); + urlBox.val(a.attr('data-ke-src')); + typeBox.val(a.attr('target')); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete' : function() { + self.exec('unlink', null); + } + }; + self.clickToolbar(name, self.plugin.link.edit); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('media', function(K) { + var self = this, name = 'media', lang = self.lang(name + '.'), + allowMediaUpload = K.undef(self.allowMediaUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'); + self.plugin.media = { + edit : function() { + var html = [ + '
    ', + '
    ', + '', + '  ', + '  ', + '', + '', + '', + '
    ', + '
    ', + '', + '', + '
    ', + '
    ', + '', + '', + '
    ', + '
    ', + '', + ' ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 450, + height : 230, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(); + if (url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + var html = K.mediaImg(self.themesPath + 'common/blank.gif', { + src : url, + type : K.mediaType(url), + width : width, + height : height, + autostart : autostartBox[0].checked ? 'true' : 'false', + loop : 'true' + }); + self.insertHtml(html).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('[name="width"]', div), + heightBox = K('[name="height"]', div), + autostartBox = K('[name="autostart"]', div); + urlBox.val('http://'); + if (allowMediaUpload) { + var uploadbutton = K.uploadbutton({ + button : K('.ke-upload-button', div)[0], + fieldName : filePostName, + extraParams : extraParams, + url : K.addParam(uploadJson, 'dir=media'), + afterUpload : function(data) { + dialog.hideLoading(); + if (data.error === 0) { + var url = data.url; + if (formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if (self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError : function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + if (allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType : 'LIST', + dirName : 'media', + clickFn : function(url, title) { + if (self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if (self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + var img = self.plugin.getSelectedMedia(); + if (img) { + var attrs = K.mediaAttrs(img.attr('data-ke-tag')); + urlBox.val(attrs.src); + widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0); + heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0); + autostartBox[0].checked = (attrs.autostart === 'true'); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete' : function() { + self.plugin.getSelectedMedia().remove(); + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.media.edit); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +(function(K) { +function KSWFUpload(options) { + this.init(options); +} +K.extend(KSWFUpload, { + init : function(options) { + var self = this; + options.afterError = options.afterError || function(str) { + alert(str); + }; + self.options = options; + self.progressbars = {}; + self.div = K(options.container).html([ + '
    ', + '
    ', + '
    ', + '', + '
    ', + '
    ' + options.uploadDesc + '
    ', + '', + '', + '', + '
    ', + '
    ', + '
    ' + ].join('')); + self.bodyDiv = K('.ke-swfupload-body', self.div); + function showError(itemDiv, msg) { + K('.ke-status > div', itemDiv).hide(); + K('.ke-message', itemDiv).addClass('ke-error').show().html(K.escape(msg)); + } + var settings = { + debug : false, + upload_url : options.uploadUrl, + flash_url : options.flashUrl, + file_post_name : options.filePostName, + button_placeholder : K('.ke-swfupload-button > input', self.div)[0], + button_image_url: options.buttonImageUrl, + button_width: options.buttonWidth, + button_height: options.buttonHeight, + button_cursor : SWFUpload.CURSOR.HAND, + file_types : options.fileTypes, + file_types_description : options.fileTypesDesc, + file_upload_limit : options.fileUploadLimit, + file_size_limit : options.fileSizeLimit, + post_params : options.postParams, + file_queued_handler : function(file) { + file.url = self.options.fileIconUrl; + self.appendFile(file); + }, + file_queue_error_handler : function(file, errorCode, message) { + var errorName = ''; + switch (errorCode) { + case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED: + errorName = options.queueLimitExceeded; + break; + case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: + errorName = options.fileExceedsSizeLimit; + break; + case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: + errorName = options.zeroByteFile; + break; + case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: + errorName = options.invalidFiletype; + break; + default: + errorName = options.unknownError; + break; + } + K.DEBUG && alert(errorName); + }, + upload_start_handler : function(file) { + var self = this; + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv); + K('.ke-status > div', itemDiv).hide(); + K('.ke-progressbar', itemDiv).show(); + }, + upload_progress_handler : function(file, bytesLoaded, bytesTotal) { + var percent = Math.round(bytesLoaded * 100 / bytesTotal); + var progressbar = self.progressbars[file.id]; + progressbar.bar.css('width', Math.round(percent * 80 / 100) + 'px'); + progressbar.percent.html(percent + '%'); + }, + upload_error_handler : function(file, errorCode, message) { + if (file && file.filestatus == SWFUpload.FILE_STATUS.ERROR) { + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv).eq(0); + showError(itemDiv, self.options.errorMessage); + } + }, + upload_success_handler : function(file, serverData) { + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv).eq(0); + var data = {}; + try { + data = K.json(serverData); + } catch (e) { + self.options.afterError.call(this, '' + serverData + ''); + } + if (data.error !== 0) { + showError(itemDiv, K.DEBUG ? data.message : self.options.errorMessage); + return; + } + file.url = data.url; + K('.ke-img', itemDiv).attr('src', file.url).attr('data-status', file.filestatus).data('data', data); + K('.ke-status > div', itemDiv).hide(); + } + }; + self.swfu = new SWFUpload(settings); + K('.ke-swfupload-startupload input', self.div).click(function() { + self.swfu.startUpload(); + }); + }, + getUrlList : function() { + var list = []; + K('.ke-img', self.bodyDiv).each(function() { + var img = K(this); + var status = img.attr('data-status'); + if (status == SWFUpload.FILE_STATUS.COMPLETE) { + list.push(img.data('data')); + } + }); + return list; + }, + removeFile : function(fileId) { + var self = this; + self.swfu.cancelUpload(fileId); + var itemDiv = K('div[data-id="' + fileId + '"]', self.bodyDiv); + K('.ke-photo', itemDiv).unbind(); + K('.ke-delete', itemDiv).unbind(); + itemDiv.remove(); + }, + removeFiles : function() { + var self = this; + K('.ke-item', self.bodyDiv).each(function() { + self.removeFile(K(this).attr('data-id')); + }); + }, + appendFile : function(file) { + var self = this; + var itemDiv = K('
    '); + self.bodyDiv.append(itemDiv); + var photoDiv = K('
    ') + .mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + itemDiv.append(photoDiv); + var img = K('' + file.name + ''); + photoDiv.append(img); + K('').appendTo(photoDiv).click(function() { + self.removeFile(file.id); + }); + var statusDiv = K('
    ').appendTo(photoDiv); + K(['
    ', + '
    ', + '
    0%
    '].join('')).hide().appendTo(statusDiv); + K('
    ' + self.options.pendingMessage + '
    ').appendTo(statusDiv); + itemDiv.append('
    ' + file.name + '
    '); + self.progressbars[file.id] = { + bar : K('.ke-progressbar-bar-inner', photoDiv), + percent : K('.ke-progressbar-percent', photoDiv) + }; + }, + remove : function() { + this.removeFiles(); + this.swfu.destroy(); + this.div.html(''); + } +}); +K.swfupload = function(element, options) { + return new KSWFUpload(element, options); +}; +})(KindEditor); +KindEditor.plugin('multiimage', function(K) { + var self = this, name = 'multiimage', + formatUploadUrl = K.undef(self.formatUploadUrl, true), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + imgPath = self.pluginsPath + 'multiimage/images/', + imageSizeLimit = K.undef(self.imageSizeLimit, '1MB'), + imageFileTypes = K.undef(self.imageFileTypes, '*.jpg;*.gif;*.png'), + imageUploadLimit = K.undef(self.imageUploadLimit, 20), + filePostName = K.undef(self.filePostName, 'imgFile'), + lang = self.lang(name + '.'); + self.plugin.multiImageDialog = function(options) { + var clickFn = options.clickFn, + uploadDesc = K.tmpl(lang.uploadDesc, {uploadLimit : imageUploadLimit, sizeLimit : imageSizeLimit}); + var html = [ + '
    ', + '
    ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 650, + height : 510, + title : self.lang(name), + body : html, + previewBtn : { + name : lang.insertAll, + click : function(e) { + clickFn.call(self, swfupload.getUrlList()); + } + }, + yesBtn : { + name : lang.clearAll, + click : function(e) { + swfupload.removeFiles(); + } + }, + beforeRemove : function() { + if (!K.IE || K.V <= 8) { + swfupload.remove(); + } + } + }), + div = dialog.div; + var swfupload = K.swfupload({ + container : K('.swfupload', div), + buttonImageUrl : imgPath + (self.langType == 'zh-CN' ? 'select-files-zh-CN.png' : 'select-files-en.png'), + buttonWidth : self.langType == 'zh-CN' ? 72 : 88, + buttonHeight : 23, + fileIconUrl : imgPath + 'image.png', + uploadDesc : uploadDesc, + startButtonValue : lang.startUpload, + uploadUrl : K.addParam(uploadJson, 'dir=image'), + flashUrl : imgPath + 'swfupload.swf', + filePostName : filePostName, + fileTypes : '*.jpg;*.jpeg;*.gif;*.png;*.bmp', + fileTypesDesc : 'Image Files', + fileUploadLimit : imageUploadLimit, + fileSizeLimit : imageSizeLimit, + postParams : K.undef(self.extraFileUploadParams, {}), + queueLimitExceeded : lang.queueLimitExceeded, + fileExceedsSizeLimit : lang.fileExceedsSizeLimit, + zeroByteFile : lang.zeroByteFile, + invalidFiletype : lang.invalidFiletype, + unknownError : lang.unknownError, + pendingMessage : lang.pending, + errorMessage : lang.uploadError, + afterError : function(html) { + self.errorDialog(html); + } + }); + return dialog; + }; + self.clickToolbar(name, function() { + self.plugin.multiImageDialog({ + clickFn : function (urlList) { + if (urlList.length === 0) { + return; + } + K.each(urlList, function(i, data) { + if (self.afterUpload) { + self.afterUpload.call(self, data.url, data, 'multiimage'); + } + self.exec('insertimage', data.url, data.title, data.width, data.height, data.border, data.align); + }); + setTimeout(function() { + self.hideDialog().focus(); + }, 0); + } + }); + }); +}); +/* ******************* */ +/* Constructor & Init */ +/* ******************* */ +(function() { +window.SWFUpload = function (settings) { + this.initSWFUpload(settings); +}; +SWFUpload.prototype.initSWFUpload = function (settings) { + try { + this.customSettings = {}; + this.settings = settings; + this.eventQueue = []; + this.movieName = "KindEditor_SWFUpload_" + SWFUpload.movieCount++; + this.movieElement = null; + SWFUpload.instances[this.movieName] = this; + this.initSettings(); + this.loadFlash(); + this.displayDebugInfo(); + } catch (ex) { + delete SWFUpload.instances[this.movieName]; + throw ex; + } +}; +/* *************** */ +/* Static Members */ +/* *************** */ +SWFUpload.instances = {}; +SWFUpload.movieCount = 0; +SWFUpload.version = "2.2.0 2009-03-25"; +SWFUpload.QUEUE_ERROR = { + QUEUE_LIMIT_EXCEEDED : -100, + FILE_EXCEEDS_SIZE_LIMIT : -110, + ZERO_BYTE_FILE : -120, + INVALID_FILETYPE : -130 +}; +SWFUpload.UPLOAD_ERROR = { + HTTP_ERROR : -200, + MISSING_UPLOAD_URL : -210, + IO_ERROR : -220, + SECURITY_ERROR : -230, + UPLOAD_LIMIT_EXCEEDED : -240, + UPLOAD_FAILED : -250, + SPECIFIED_FILE_ID_NOT_FOUND : -260, + FILE_VALIDATION_FAILED : -270, + FILE_CANCELLED : -280, + UPLOAD_STOPPED : -290 +}; +SWFUpload.FILE_STATUS = { + QUEUED : -1, + IN_PROGRESS : -2, + ERROR : -3, + COMPLETE : -4, + CANCELLED : -5 +}; +SWFUpload.BUTTON_ACTION = { + SELECT_FILE : -100, + SELECT_FILES : -110, + START_UPLOAD : -120 +}; +SWFUpload.CURSOR = { + ARROW : -1, + HAND : -2 +}; +SWFUpload.WINDOW_MODE = { + WINDOW : "window", + TRANSPARENT : "transparent", + OPAQUE : "opaque" +}; +SWFUpload.completeURL = function(url) { + if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) { + return url; + } + var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : ""); + var indexSlash = window.location.pathname.lastIndexOf("/"); + if (indexSlash <= 0) { + path = "/"; + } else { + path = window.location.pathname.substr(0, indexSlash) + "/"; + } + return /*currentURL +*/ path + url; +}; +/* ******************** */ +/* Instance Members */ +/* ******************** */ +SWFUpload.prototype.initSettings = function () { + this.ensureDefault = function (settingName, defaultValue) { + this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName]; + }; + this.ensureDefault("upload_url", ""); + this.ensureDefault("preserve_relative_urls", false); + this.ensureDefault("file_post_name", "Filedata"); + this.ensureDefault("post_params", {}); + this.ensureDefault("use_query_string", false); + this.ensureDefault("requeue_on_error", false); + this.ensureDefault("http_success", []); + this.ensureDefault("assume_success_timeout", 0); + this.ensureDefault("file_types", "*.*"); + this.ensureDefault("file_types_description", "All Files"); + this.ensureDefault("file_size_limit", 0); + this.ensureDefault("file_upload_limit", 0); + this.ensureDefault("file_queue_limit", 0); + this.ensureDefault("flash_url", "swfupload.swf"); + this.ensureDefault("prevent_swf_caching", true); + this.ensureDefault("button_image_url", ""); + this.ensureDefault("button_width", 1); + this.ensureDefault("button_height", 1); + this.ensureDefault("button_text", ""); + this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;"); + this.ensureDefault("button_text_top_padding", 0); + this.ensureDefault("button_text_left_padding", 0); + this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES); + this.ensureDefault("button_disabled", false); + this.ensureDefault("button_placeholder_id", ""); + this.ensureDefault("button_placeholder", null); + this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW); + this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW); + this.ensureDefault("debug", false); + this.settings.debug_enabled = this.settings.debug; + this.settings.return_upload_start_handler = this.returnUploadStart; + this.ensureDefault("swfupload_loaded_handler", null); + this.ensureDefault("file_dialog_start_handler", null); + this.ensureDefault("file_queued_handler", null); + this.ensureDefault("file_queue_error_handler", null); + this.ensureDefault("file_dialog_complete_handler", null); + this.ensureDefault("upload_start_handler", null); + this.ensureDefault("upload_progress_handler", null); + this.ensureDefault("upload_error_handler", null); + this.ensureDefault("upload_success_handler", null); + this.ensureDefault("upload_complete_handler", null); + this.ensureDefault("debug_handler", this.debugMessage); + this.ensureDefault("custom_settings", {}); + this.customSettings = this.settings.custom_settings; + if (!!this.settings.prevent_swf_caching) { + this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime(); + } + if (!this.settings.preserve_relative_urls) { + this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url); + this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url); + } + delete this.ensureDefault; +}; +SWFUpload.prototype.loadFlash = function () { + var targetElement, tempParent; + if (document.getElementById(this.movieName) !== null) { + throw "ID " + this.movieName + " is already in use. The Flash Object could not be added"; + } + targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder; + if (targetElement == undefined) { + throw "Could not find the placeholder element: " + this.settings.button_placeholder_id; + } + tempParent = document.createElement("div"); + tempParent.innerHTML = this.getFlashHTML(); + targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement); + if (window[this.movieName] == undefined) { + window[this.movieName] = this.getMovieElement(); + } +}; +SWFUpload.prototype.getFlashHTML = function () { + var classid = ''; + if (KindEditor.IE && KindEditor.V > 8) { + classid = ' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'; + } + return ['', + '', + '', + '', + '', + '', + '', + ''].join(""); +}; +SWFUpload.prototype.getFlashVars = function () { + var paramString = this.buildParamString(); + var httpSuccessString = this.settings.http_success.join(","); + return ["movieName=", encodeURIComponent(this.movieName), + "&uploadURL=", encodeURIComponent(this.settings.upload_url), + "&useQueryString=", encodeURIComponent(this.settings.use_query_string), + "&requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), + "&httpSuccess=", encodeURIComponent(httpSuccessString), + "&assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout), + "&params=", encodeURIComponent(paramString), + "&filePostName=", encodeURIComponent(this.settings.file_post_name), + "&fileTypes=", encodeURIComponent(this.settings.file_types), + "&fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), + "&fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), + "&fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), + "&fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), + "&debugEnabled=", encodeURIComponent(this.settings.debug_enabled), + "&buttonImageURL=", encodeURIComponent(this.settings.button_image_url), + "&buttonWidth=", encodeURIComponent(this.settings.button_width), + "&buttonHeight=", encodeURIComponent(this.settings.button_height), + "&buttonText=", encodeURIComponent(this.settings.button_text), + "&buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding), + "&buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding), + "&buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), + "&buttonAction=", encodeURIComponent(this.settings.button_action), + "&buttonDisabled=", encodeURIComponent(this.settings.button_disabled), + "&buttonCursor=", encodeURIComponent(this.settings.button_cursor) + ].join(""); +}; +SWFUpload.prototype.getMovieElement = function () { + if (this.movieElement == undefined) { + this.movieElement = document.getElementById(this.movieName); + } + if (this.movieElement === null) { + throw "Could not find Flash element"; + } + return this.movieElement; +}; +SWFUpload.prototype.buildParamString = function () { + var postParams = this.settings.post_params; + var paramStringPairs = []; + if (typeof(postParams) === "object") { + for (var name in postParams) { + if (postParams.hasOwnProperty(name)) { + paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString())); + } + } + } + return paramStringPairs.join("&"); +}; +SWFUpload.prototype.destroy = function () { + try { + this.cancelUpload(null, false); + var movieElement = null; + movieElement = this.getMovieElement(); + if (movieElement && typeof(movieElement.CallFunction) === "unknown") { + for (var i in movieElement) { + try { + if (typeof(movieElement[i]) === "function") { + movieElement[i] = null; + } + } catch (ex1) {} + } + try { + movieElement.parentNode.removeChild(movieElement); + } catch (ex) {} + } + window[this.movieName] = null; + SWFUpload.instances[this.movieName] = null; + delete SWFUpload.instances[this.movieName]; + this.movieElement = null; + this.settings = null; + this.customSettings = null; + this.eventQueue = null; + this.movieName = null; + return true; + } catch (ex2) { + return false; + } +}; +SWFUpload.prototype.displayDebugInfo = function () { + this.debug( + [ + "---SWFUpload Instance Info---\n", + "Version: ", SWFUpload.version, "\n", + "Movie Name: ", this.movieName, "\n", + "Settings:\n", + "\t", "upload_url: ", this.settings.upload_url, "\n", + "\t", "flash_url: ", this.settings.flash_url, "\n", + "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n", + "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n", + "\t", "http_success: ", this.settings.http_success.join(", "), "\n", + "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n", + "\t", "file_post_name: ", this.settings.file_post_name, "\n", + "\t", "post_params: ", this.settings.post_params.toString(), "\n", + "\t", "file_types: ", this.settings.file_types, "\n", + "\t", "file_types_description: ", this.settings.file_types_description, "\n", + "\t", "file_size_limit: ", this.settings.file_size_limit, "\n", + "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n", + "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n", + "\t", "debug: ", this.settings.debug.toString(), "\n", + "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n", + "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n", + "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n", + "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n", + "\t", "button_width: ", this.settings.button_width.toString(), "\n", + "\t", "button_height: ", this.settings.button_height.toString(), "\n", + "\t", "button_text: ", this.settings.button_text.toString(), "\n", + "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n", + "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n", + "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n", + "\t", "button_action: ", this.settings.button_action.toString(), "\n", + "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n", + "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n", + "Event Handlers:\n", + "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n", + "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n", + "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n", + "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n", + "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n", + "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n", + "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n", + "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n", + "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n", + "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n" + ].join("") + ); +}; +/* Note: addSetting and getSetting are no longer used by SWFUpload but are included + the maintain v2 API compatibility +*/ +SWFUpload.prototype.addSetting = function (name, value, default_value) { + if (value == undefined) { + return (this.settings[name] = default_value); + } else { + return (this.settings[name] = value); + } +}; +SWFUpload.prototype.getSetting = function (name) { + if (this.settings[name] != undefined) { + return this.settings[name]; + } + return ""; +}; +SWFUpload.prototype.callFlash = function (functionName, argumentArray) { + argumentArray = argumentArray || []; + var movieElement = this.getMovieElement(); + var returnValue, returnString; + try { + returnString = movieElement.CallFunction('' + __flash__argumentsToXML(argumentArray, 0) + ''); + returnValue = eval(returnString); + } catch (ex) { + throw "Call to " + functionName + " failed"; + } + if (returnValue != undefined && typeof returnValue.post === "object") { + returnValue = this.unescapeFilePostParams(returnValue); + } + return returnValue; +}; +/* ***************************** + -- Flash control methods -- + Your UI should use these + to operate SWFUpload + ***************************** */ +SWFUpload.prototype.selectFile = function () { + this.callFlash("SelectFile"); +}; +SWFUpload.prototype.selectFiles = function () { + this.callFlash("SelectFiles"); +}; +SWFUpload.prototype.startUpload = function (fileID) { + this.callFlash("StartUpload", [fileID]); +}; +SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) { + if (triggerErrorEvent !== false) { + triggerErrorEvent = true; + } + this.callFlash("CancelUpload", [fileID, triggerErrorEvent]); +}; +SWFUpload.prototype.stopUpload = function () { + this.callFlash("StopUpload"); +}; +/* ************************ + * Settings methods + * These methods change the SWFUpload settings. + * SWFUpload settings should not be changed directly on the settings object + * since many of the settings need to be passed to Flash in order to take + * effect. + * *********************** */ +SWFUpload.prototype.getStats = function () { + return this.callFlash("GetStats"); +}; +SWFUpload.prototype.setStats = function (statsObject) { + this.callFlash("SetStats", [statsObject]); +}; +SWFUpload.prototype.getFile = function (fileID) { + if (typeof(fileID) === "number") { + return this.callFlash("GetFileByIndex", [fileID]); + } else { + return this.callFlash("GetFile", [fileID]); + } +}; +SWFUpload.prototype.addFileParam = function (fileID, name, value) { + return this.callFlash("AddFileParam", [fileID, name, value]); +}; +SWFUpload.prototype.removeFileParam = function (fileID, name) { + this.callFlash("RemoveFileParam", [fileID, name]); +}; +SWFUpload.prototype.setUploadURL = function (url) { + this.settings.upload_url = url.toString(); + this.callFlash("SetUploadURL", [url]); +}; +SWFUpload.prototype.setPostParams = function (paramsObject) { + this.settings.post_params = paramsObject; + this.callFlash("SetPostParams", [paramsObject]); +}; +SWFUpload.prototype.addPostParam = function (name, value) { + this.settings.post_params[name] = value; + this.callFlash("SetPostParams", [this.settings.post_params]); +}; +SWFUpload.prototype.removePostParam = function (name) { + delete this.settings.post_params[name]; + this.callFlash("SetPostParams", [this.settings.post_params]); +}; +SWFUpload.prototype.setFileTypes = function (types, description) { + this.settings.file_types = types; + this.settings.file_types_description = description; + this.callFlash("SetFileTypes", [types, description]); +}; +SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) { + this.settings.file_size_limit = fileSizeLimit; + this.callFlash("SetFileSizeLimit", [fileSizeLimit]); +}; +SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) { + this.settings.file_upload_limit = fileUploadLimit; + this.callFlash("SetFileUploadLimit", [fileUploadLimit]); +}; +SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) { + this.settings.file_queue_limit = fileQueueLimit; + this.callFlash("SetFileQueueLimit", [fileQueueLimit]); +}; +SWFUpload.prototype.setFilePostName = function (filePostName) { + this.settings.file_post_name = filePostName; + this.callFlash("SetFilePostName", [filePostName]); +}; +SWFUpload.prototype.setUseQueryString = function (useQueryString) { + this.settings.use_query_string = useQueryString; + this.callFlash("SetUseQueryString", [useQueryString]); +}; +SWFUpload.prototype.setRequeueOnError = function (requeueOnError) { + this.settings.requeue_on_error = requeueOnError; + this.callFlash("SetRequeueOnError", [requeueOnError]); +}; +SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) { + if (typeof http_status_codes === "string") { + http_status_codes = http_status_codes.replace(" ", "").split(","); + } + this.settings.http_success = http_status_codes; + this.callFlash("SetHTTPSuccess", [http_status_codes]); +}; +SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) { + this.settings.assume_success_timeout = timeout_seconds; + this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]); +}; +SWFUpload.prototype.setDebugEnabled = function (debugEnabled) { + this.settings.debug_enabled = debugEnabled; + this.callFlash("SetDebugEnabled", [debugEnabled]); +}; +SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) { + if (buttonImageURL == undefined) { + buttonImageURL = ""; + } + this.settings.button_image_url = buttonImageURL; + this.callFlash("SetButtonImageURL", [buttonImageURL]); +}; +SWFUpload.prototype.setButtonDimensions = function (width, height) { + this.settings.button_width = width; + this.settings.button_height = height; + var movie = this.getMovieElement(); + if (movie != undefined) { + movie.style.width = width + "px"; + movie.style.height = height + "px"; + } + this.callFlash("SetButtonDimensions", [width, height]); +}; +SWFUpload.prototype.setButtonText = function (html) { + this.settings.button_text = html; + this.callFlash("SetButtonText", [html]); +}; +SWFUpload.prototype.setButtonTextPadding = function (left, top) { + this.settings.button_text_top_padding = top; + this.settings.button_text_left_padding = left; + this.callFlash("SetButtonTextPadding", [left, top]); +}; +SWFUpload.prototype.setButtonTextStyle = function (css) { + this.settings.button_text_style = css; + this.callFlash("SetButtonTextStyle", [css]); +}; +SWFUpload.prototype.setButtonDisabled = function (isDisabled) { + this.settings.button_disabled = isDisabled; + this.callFlash("SetButtonDisabled", [isDisabled]); +}; +SWFUpload.prototype.setButtonAction = function (buttonAction) { + this.settings.button_action = buttonAction; + this.callFlash("SetButtonAction", [buttonAction]); +}; +SWFUpload.prototype.setButtonCursor = function (cursor) { + this.settings.button_cursor = cursor; + this.callFlash("SetButtonCursor", [cursor]); +}; +/* ******************************* + Flash Event Interfaces + These functions are used by Flash to trigger the various + events. + All these functions a Private. + Because the ExternalInterface library is buggy the event calls + are added to a queue and the queue then executed by a setTimeout. + This ensures that events are executed in a determinate order and that + the ExternalInterface bugs are avoided. +******************************* */ +SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) { + if (argumentArray == undefined) { + argumentArray = []; + } else if (!(argumentArray instanceof Array)) { + argumentArray = [argumentArray]; + } + var self = this; + if (typeof this.settings[handlerName] === "function") { + this.eventQueue.push(function () { + this.settings[handlerName].apply(this, argumentArray); + }); + setTimeout(function () { + self.executeNextEvent(); + }, 0); + } else if (this.settings[handlerName] !== null) { + throw "Event handler " + handlerName + " is unknown or is not a function"; + } +}; +SWFUpload.prototype.executeNextEvent = function () { + var f = this.eventQueue ? this.eventQueue.shift() : null; + if (typeof(f) === "function") { + f.apply(this); + } +}; +SWFUpload.prototype.unescapeFilePostParams = function (file) { + var reg = /[$]([0-9a-f]{4})/i; + var unescapedPost = {}; + var uk; + if (file != undefined) { + for (var k in file.post) { + if (file.post.hasOwnProperty(k)) { + uk = k; + var match; + while ((match = reg.exec(uk)) !== null) { + uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16))); + } + unescapedPost[uk] = file.post[k]; + } + } + file.post = unescapedPost; + } + return file; +}; +SWFUpload.prototype.testExternalInterface = function () { + try { + return this.callFlash("TestExternalInterface"); + } catch (ex) { + return false; + } +}; +SWFUpload.prototype.flashReady = function () { + var movieElement = this.getMovieElement(); + if (!movieElement) { + this.debug("Flash called back ready but the flash movie can't be found."); + return; + } + this.cleanUp(movieElement); + this.queueEvent("swfupload_loaded_handler"); +}; +SWFUpload.prototype.cleanUp = function (movieElement) { + try { + if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { + this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)"); + for (var key in movieElement) { + try { + if (typeof(movieElement[key]) === "function") { + movieElement[key] = null; + } + } catch (ex) { + } + } + } + } catch (ex1) { + } + window["__flash__removeCallback"] = function (instance, name) { + try { + if (instance) { + instance[name] = null; + } + } catch (flashEx) { + } + }; +}; +/* This is a chance to do something before the browse window opens */ +SWFUpload.prototype.fileDialogStart = function () { + this.queueEvent("file_dialog_start_handler"); +}; +/* Called when a file is successfully added to the queue. */ +SWFUpload.prototype.fileQueued = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queued_handler", file); +}; +/* Handle errors that occur when an attempt to queue a file fails. */ +SWFUpload.prototype.fileQueueError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queue_error_handler", [file, errorCode, message]); +}; +/* Called after the file dialog has closed and the selected files have been queued. + You could call startUpload here if you want the queued files to begin uploading immediately. */ +SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) { + this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]); +}; +SWFUpload.prototype.uploadStart = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("return_upload_start_handler", file); +}; +SWFUpload.prototype.returnUploadStart = function (file) { + var returnValue; + if (typeof this.settings.upload_start_handler === "function") { + file = this.unescapeFilePostParams(file); + returnValue = this.settings.upload_start_handler.call(this, file); + } else if (this.settings.upload_start_handler != undefined) { + throw "upload_start_handler must be a function"; + } + if (returnValue === undefined) { + returnValue = true; + } + returnValue = !!returnValue; + this.callFlash("ReturnUploadStart", [returnValue]); +}; +SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]); +}; +SWFUpload.prototype.uploadError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_error_handler", [file, errorCode, message]); +}; +SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_success_handler", [file, serverData, responseReceived]); +}; +SWFUpload.prototype.uploadComplete = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_complete_handler", file); +}; +/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the + internal debug console. You can override this event and have messages written where you want. */ +SWFUpload.prototype.debug = function (message) { + this.queueEvent("debug_handler", message); +}; +/* ********************************** + Debug Console + The debug console is a self contained, in page location + for debug message to be sent. The Debug Console adds + itself to the body if necessary. + The console is automatically scrolled as messages appear. + If you are using your own debug handler or when you deploy to production and + have debug disabled you can remove these functions to reduce the file size + and complexity. +********************************** */ +SWFUpload.prototype.debugMessage = function (message) { + if (this.settings.debug) { + var exceptionMessage, exceptionValues = []; + if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") { + for (var key in message) { + if (message.hasOwnProperty(key)) { + exceptionValues.push(key + ": " + message[key]); + } + } + exceptionMessage = exceptionValues.join("\n") || ""; + exceptionValues = exceptionMessage.split("\n"); + exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: "); + SWFUpload.Console.writeLine(exceptionMessage); + } else { + SWFUpload.Console.writeLine(message); + } + } +}; +SWFUpload.Console = {}; +SWFUpload.Console.writeLine = function (message) { + var console, documentForm; + try { + console = document.getElementById("SWFUpload_Console"); + if (!console) { + documentForm = document.createElement("form"); + document.getElementsByTagName("body")[0].appendChild(documentForm); + console = document.createElement("textarea"); + console.id = "SWFUpload_Console"; + console.style.fontFamily = "monospace"; + console.setAttribute("wrap", "off"); + console.wrap = "off"; + console.style.overflow = "auto"; + console.style.width = "700px"; + console.style.height = "350px"; + console.style.margin = "5px"; + documentForm.appendChild(console); + } + console.value += message + "\n"; + console.scrollTop = console.scrollHeight - console.clientHeight; + } catch (ex) { + alert("Exception: " + ex.name + " Message: " + ex.message); + } +}; +})(); +(function() { +/* + Queue Plug-in + Features: + *Adds a cancelQueue() method for cancelling the entire queue. + *All queued files are uploaded when startUpload() is called. + *If false is returned from uploadComplete then the queue upload is stopped. + If false is not returned (strict comparison) then the queue upload is continued. + *Adds a QueueComplete event that is fired when all the queued files have finished uploading. + Set the event handler with the queue_complete_handler setting. + */ +if (typeof(SWFUpload) === "function") { + SWFUpload.queue = {}; + SWFUpload.prototype.initSettings = (function (oldInitSettings) { + return function () { + if (typeof(oldInitSettings) === "function") { + oldInitSettings.call(this); + } + this.queueSettings = {}; + this.queueSettings.queue_cancelled_flag = false; + this.queueSettings.queue_upload_count = 0; + this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler; + this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler; + this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler; + this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler; + this.settings.queue_complete_handler = this.settings.queue_complete_handler || null; + }; + })(SWFUpload.prototype.initSettings); + SWFUpload.prototype.startUpload = function (fileID) { + this.queueSettings.queue_cancelled_flag = false; + this.callFlash("StartUpload", [fileID]); + }; + SWFUpload.prototype.cancelQueue = function () { + this.queueSettings.queue_cancelled_flag = true; + this.stopUpload(); + var stats = this.getStats(); + while (stats.files_queued > 0) { + this.cancelUpload(); + stats = this.getStats(); + } + }; + SWFUpload.queue.uploadStartHandler = function (file) { + var returnValue; + if (typeof(this.queueSettings.user_upload_start_handler) === "function") { + returnValue = this.queueSettings.user_upload_start_handler.call(this, file); + } + returnValue = (returnValue === false) ? false : true; + this.queueSettings.queue_cancelled_flag = !returnValue; + return returnValue; + }; + SWFUpload.queue.uploadCompleteHandler = function (file) { + var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler; + var continueUpload; + if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) { + this.queueSettings.queue_upload_count++; + } + if (typeof(user_upload_complete_handler) === "function") { + continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true; + } else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) { + continueUpload = false; + } else { + continueUpload = true; + } + if (continueUpload) { + var stats = this.getStats(); + if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) { + this.startUpload(); + } else if (this.queueSettings.queue_cancelled_flag === false) { + this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]); + this.queueSettings.queue_upload_count = 0; + } else { + this.queueSettings.queue_cancelled_flag = false; + this.queueSettings.queue_upload_count = 0; + } + } + }; +} +})(); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('pagebreak', function(K) { + var self = this; + var name = 'pagebreak'; + var pagebreakHtml = K.undef(self.pagebreakHtml, '
    '); + self.clickToolbar(name, function() { + var cmd = self.cmd, range = cmd.range; + self.focus(); + var tail = self.newlineTag == 'br' || K.WEBKIT ? '' : ''; + self.insertHtml(pagebreakHtml + tail); + if (tail !== '') { + var p = K('#__kindeditor_tail_tag__', self.edit.doc); + range.selectNodeContents(p[0]); + p.removeAttr('id'); + cmd.select(); + } + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('plainpaste', function(K) { + var self = this, name = 'plainpaste'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '
    ' + + '
    ' + lang.comment + '
    ' + + '' + + '
    ', + dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var html = textarea.val(); + html = K.escape(html); + html = html.replace(/ {2}/g, '  '); + if (self.newlineTag == 'p') { + html = html.replace(/^/, '

    ').replace(/$/, '

    ').replace(/\n/g, '

    '); + } else { + html = html.replace(/\n/g, '
    $&'); + } + self.insertHtml(html).hideDialog().focus(); + } + } + }), + textarea = K('textarea', dialog.div); + textarea[0].focus(); + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('preview', function(K) { + var self = this, name = 'preview', undefined; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '

    ' + + '' + + '
    ', + dialog = self.createDialog({ + name : name, + width : 750, + title : self.lang(name), + body : html + }), + iframe = K('iframe', dialog.div), + doc = K.iframeDoc(iframe); + doc.open(); + doc.write(self.fullHtml()); + doc.close(); + K(doc.body).css('background-color', '#FFF'); + iframe[0].contentWindow.focus(); + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('quickformat', function(K) { + var self = this, name = 'quickformat', + blockMap = K.toMap('blockquote,center,div,h1,h2,h3,h4,h5,h6,p'); + function getFirstChild(knode) { + var child = knode.first(); + while (child && child.first()) { + child = child.first(); + } + return child; + } + self.clickToolbar(name, function() { + self.focus(); + var doc = self.edit.doc, + range = self.cmd.range, + child = K(doc.body).first(), next, + nodeList = [], subList = [], + bookmark = range.createBookmark(true); + while(child) { + next = child.next(); + var firstChild = getFirstChild(child); + if (!firstChild || firstChild.name != 'img') { + if (blockMap[child.name]) { + child.html(child.html().replace(/^(\s| | )+/ig, '')); + child.css('text-indent', '2em'); + } else { + subList.push(child); + } + if (!next || (blockMap[next.name] || blockMap[child.name] && !blockMap[next.name])) { + if (subList.length > 0) { + nodeList.push(subList); + } + subList = []; + } + } + child = next; + } + K.each(nodeList, function(i, subList) { + var wrapper = K('

    ', doc); + subList[0].before(wrapper); + K.each(subList, function(i, knode) { + wrapper.append(knode); + }); + }); + range.moveToBookmark(bookmark); + self.addBookmark(); + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('table', function(K) { + var self = this, name = 'table', lang = self.lang(name + '.'), zeroborder = 'ke-zeroborder'; + function _setColor(box, color) { + color = color.toUpperCase(); + box.css('background-color', color); + box.css('color', color === '#000000' ? '#FFFFFF' : '#000000'); + box.html(color); + } + var pickerList = []; + function _initColorPicker(dialogDiv, colorBox) { + colorBox.bind('click,mousedown', function(e){ + e.stopPropagation(); + }); + function removePicker() { + K.each(pickerList, function() { + this.remove(); + }); + pickerList = []; + K(document).unbind('click,mousedown', removePicker); + dialogDiv.unbind('click,mousedown', removePicker); + } + colorBox.click(function(e) { + removePicker(); + var box = K(this), + pos = box.pos(); + var picker = K.colorpicker({ + x : pos.x, + y : pos.y + box.height(), + z : 811214, + selectedColor : K(this).html(), + colors : self.colorTable, + noColor : self.lang('noColor'), + shadowMode : self.shadowMode, + click : function(color) { + _setColor(box, color); + removePicker(); + } + }); + pickerList.push(picker); + K(document).bind('click,mousedown', removePicker); + dialogDiv.bind('click,mousedown', removePicker); + }); + } + function _getCellIndex(table, row, cell) { + var rowSpanCount = 0; + for (var i = 0, len = row.cells.length; i < len; i++) { + if (row.cells[i] == cell) { + break; + } + rowSpanCount += row.cells[i].rowSpan - 1; + } + return cell.cellIndex - rowSpanCount; + } + self.plugin.table = { + prop : function(isInsert) { + var html = [ + '
    ', + '
    ', + '', + lang.rows + '   ', + lang.cols + ' ', + '
    ', + '
    ', + '', + lang.width + '   ', + '   ', + lang.height + '   ', + '', + '
    ', + '
    ', + '', + lang.padding + '   ', + lang.spacing + ' ', + '
    ', + '
    ', + '', + '', + '
    ', + '
    ', + '', + lang.borderWidth + '   ', + lang.borderColor + ' ', + '
    ', + '
    ', + '', + '', + '
    ', + '
    ' + ].join(''); + var bookmark = self.cmd.range.createBookmark(); + var dialog = self.createDialog({ + name : name, + width : 500, + title : self.lang(name), + body : html, + beforeRemove : function() { + colorBox.unbind(); + }, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var rows = rowsBox.val(), + cols = colsBox.val(), + width = widthBox.val(), + height = heightBox.val(), + widthType = widthTypeBox.val(), + heightType = heightTypeBox.val(), + padding = paddingBox.val(), + spacing = spacingBox.val(), + align = alignBox.val(), + border = borderBox.val(), + borderColor = K(colorBox[0]).html() || '', + bgColor = K(colorBox[1]).html() || ''; + if (rows == 0 || !/^\d+$/.test(rows)) { + alert(self.lang('invalidRows')); + rowsBox[0].focus(); + return; + } + if (cols == 0 || !/^\d+$/.test(cols)) { + alert(self.lang('invalidRows')); + colsBox[0].focus(); + return; + } + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + if (!/^\d*$/.test(padding)) { + alert(self.lang('invalidPadding')); + paddingBox[0].focus(); + return; + } + if (!/^\d*$/.test(spacing)) { + alert(self.lang('invalidSpacing')); + spacingBox[0].focus(); + return; + } + if (!/^\d*$/.test(border)) { + alert(self.lang('invalidBorder')); + borderBox[0].focus(); + return; + } + if (table) { + if (width !== '') { + table.width(width + widthType); + } else { + table.css('width', ''); + } + if (table[0].width !== undefined) { + table.removeAttr('width'); + } + if (height !== '') { + table.height(height + heightType); + } else { + table.css('height', ''); + } + if (table[0].height !== undefined) { + table.removeAttr('height'); + } + table.css('background-color', bgColor); + if (table[0].bgColor !== undefined) { + table.removeAttr('bgColor'); + } + if (padding !== '') { + table[0].cellPadding = padding; + } else { + table.removeAttr('cellPadding'); + } + if (spacing !== '') { + table[0].cellSpacing = spacing; + } else { + table.removeAttr('cellSpacing'); + } + if (align !== '') { + table[0].align = align; + } else { + table.removeAttr('align'); + } + if (border !== '') { + table.attr('border', border); + } else { + table.removeAttr('border'); + } + if (border === '' || border === '0') { + table.addClass(zeroborder); + } else { + table.removeClass(zeroborder); + } + if (borderColor !== '') { + table.attr('borderColor', borderColor); + } else { + table.removeAttr('borderColor'); + } + self.hideDialog().focus(); + self.cmd.range.moveToBookmark(bookmark); + self.cmd.select(); + self.addBookmark(); + return; + } + var style = ''; + if (width !== '') { + style += 'width:' + width + widthType + ';'; + } + if (height !== '') { + style += 'height:' + height + heightType + ';'; + } + if (bgColor !== '') { + style += 'background-color:' + bgColor + ';'; + } + var html = '') + ''; + } + html += ''; + } + html += ''; + if (!K.IE) { + html += '
    '; + } + self.insertHtml(html); + self.select().hideDialog().focus(); + self.addBookmark(); + } + } + }), + div = dialog.div, + rowsBox = K('[name="rows"]', div).val(3), + colsBox = K('[name="cols"]', div).val(2), + widthBox = K('[name="width"]', div).val(100), + heightBox = K('[name="height"]', div), + widthTypeBox = K('[name="widthType"]', div), + heightTypeBox = K('[name="heightType"]', div), + paddingBox = K('[name="padding"]', div).val(2), + spacingBox = K('[name="spacing"]', div).val(0), + alignBox = K('[name="align"]', div), + borderBox = K('[name="border"]', div).val(1), + colorBox = K('.ke-input-color', div); + _initColorPicker(div, colorBox.eq(0)); + _initColorPicker(div, colorBox.eq(1)); + _setColor(colorBox.eq(0), '#000000'); + _setColor(colorBox.eq(1), ''); + rowsBox[0].focus(); + rowsBox[0].select(); + var table; + if (isInsert) { + return; + } + table = self.plugin.getSelectedTable(); + if (table) { + rowsBox.val(table[0].rows.length); + colsBox.val(table[0].rows.length > 0 ? table[0].rows[0].cells.length : 0); + rowsBox.attr('disabled', true); + colsBox.attr('disabled', true); + var match, + tableWidth = table[0].style.width || table[0].width, + tableHeight = table[0].style.height || table[0].height; + if (tableWidth !== undefined && (match = /^(\d+)((?:px|%)*)$/.exec(tableWidth))) { + widthBox.val(match[1]); + widthTypeBox.val(match[2]); + } else { + widthBox.val(''); + } + if (tableHeight !== undefined && (match = /^(\d+)((?:px|%)*)$/.exec(tableHeight))) { + heightBox.val(match[1]); + heightTypeBox.val(match[2]); + } + paddingBox.val(table[0].cellPadding || ''); + spacingBox.val(table[0].cellSpacing || ''); + alignBox.val(table[0].align || ''); + borderBox.val(table[0].border === undefined ? '' : table[0].border); + _setColor(colorBox.eq(0), K.toHex(table.attr('borderColor') || '')); + _setColor(colorBox.eq(1), K.toHex(table[0].style.backgroundColor || table[0].bgColor || '')); + widthBox[0].focus(); + widthBox[0].select(); + } + }, + cellprop : function() { + var html = [ + '
    ', + '
    ', + '', + lang.width + '   ', + '   ', + lang.height + '   ', + '', + '
    ', + '
    ', + '', + lang.textAlign + ' ', + lang.verticalAlign + ' ', + '
    ', + '
    ', + '', + lang.borderWidth + '   ', + lang.borderColor + ' ', + '
    ', + '
    ', + '', + '', + '
    ', + '
    ' + ].join(''); + var bookmark = self.cmd.range.createBookmark(); + var dialog = self.createDialog({ + name : name, + width : 500, + title : self.lang('tablecell'), + body : html, + beforeRemove : function() { + colorBox.unbind(); + }, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var width = widthBox.val(), + height = heightBox.val(), + widthType = widthTypeBox.val(), + heightType = heightTypeBox.val(), + padding = paddingBox.val(), + spacing = spacingBox.val(), + textAlign = textAlignBox.val(), + verticalAlign = verticalAlignBox.val(), + border = borderBox.val(), + borderColor = K(colorBox[0]).html() || '', + bgColor = K(colorBox[1]).html() || ''; + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + if (!/^\d*$/.test(border)) { + alert(self.lang('invalidBorder')); + borderBox[0].focus(); + return; + } + cell.css({ + width : width !== '' ? (width + widthType) : '', + height : height !== '' ? (height + heightType) : '', + 'background-color' : bgColor, + 'text-align' : textAlign, + 'vertical-align' : verticalAlign, + 'border-width' : border, + 'border-style' : border !== '' ? 'solid' : '', + 'border-color' : borderColor + }); + self.hideDialog().focus(); + self.cmd.range.moveToBookmark(bookmark); + self.cmd.select(); + self.addBookmark(); + } + } + }), + div = dialog.div, + widthBox = K('[name="width"]', div).val(100), + heightBox = K('[name="height"]', div), + widthTypeBox = K('[name="widthType"]', div), + heightTypeBox = K('[name="heightType"]', div), + paddingBox = K('[name="padding"]', div).val(2), + spacingBox = K('[name="spacing"]', div).val(0), + textAlignBox = K('[name="textAlign"]', div), + verticalAlignBox = K('[name="verticalAlign"]', div), + borderBox = K('[name="border"]', div).val(1), + colorBox = K('.ke-input-color', div); + _initColorPicker(div, colorBox.eq(0)); + _initColorPicker(div, colorBox.eq(1)); + _setColor(colorBox.eq(0), '#000000'); + _setColor(colorBox.eq(1), ''); + widthBox[0].focus(); + widthBox[0].select(); + var cell = self.plugin.getSelectedCell(); + var match, + cellWidth = cell[0].style.width || cell[0].width || '', + cellHeight = cell[0].style.height || cell[0].height || ''; + if ((match = /^(\d+)((?:px|%)*)$/.exec(cellWidth))) { + widthBox.val(match[1]); + widthTypeBox.val(match[2]); + } else { + widthBox.val(''); + } + if ((match = /^(\d+)((?:px|%)*)$/.exec(cellHeight))) { + heightBox.val(match[1]); + heightTypeBox.val(match[2]); + } + textAlignBox.val(cell[0].style.textAlign || ''); + verticalAlignBox.val(cell[0].style.verticalAlign || ''); + var border = cell[0].style.borderWidth || ''; + if (border) { + border = parseInt(border); + } + borderBox.val(border); + _setColor(colorBox.eq(0), K.toHex(cell[0].style.borderColor || '')); + _setColor(colorBox.eq(1), K.toHex(cell[0].style.backgroundColor || '')); + widthBox[0].focus(); + widthBox[0].select(); + }, + insert : function() { + this.prop(true); + }, + 'delete' : function() { + var table = self.plugin.getSelectedTable(); + self.cmd.range.setStartBefore(table[0]).collapse(true); + self.cmd.select(); + table.remove(); + self.addBookmark(); + }, + colinsert : function(offset) { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + index = cell.cellIndex + offset; + index += table.rows[0].cells.length - row.cells.length; + for (var i = 0, len = table.rows.length; i < len; i++) { + var newRow = table.rows[i], + newCell = newRow.insertCell(index); + newCell.innerHTML = K.IE ? '' : '
    '; + index = _getCellIndex(table, newRow, newCell); + } + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colinsertleft : function() { + this.colinsert(0); + }, + colinsertright : function() { + this.colinsert(1); + }, + rowinsert : function(offset) { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0]; + var rowIndex = row.rowIndex; + if (offset === 1) { + rowIndex = row.rowIndex + (cell.rowSpan - 1) + offset; + } + var newRow = table.insertRow(rowIndex); + for (var i = 0, len = row.cells.length; i < len; i++) { + if (row.cells[i].rowSpan > 1) { + len -= row.cells[i].rowSpan - 1; + } + var newCell = newRow.insertCell(i); + if (offset === 1 && row.cells[i].colSpan > 1) { + newCell.colSpan = row.cells[i].colSpan; + } + newCell.innerHTML = K.IE ? '' : '
    '; + } + for (var j = rowIndex; j >= 0; j--) { + var cells = table.rows[j].cells; + if (cells.length > i) { + for (var k = cell.cellIndex; k >= 0; k--) { + if (cells[k].rowSpan > 1) { + cells[k].rowSpan += 1; + } + } + break; + } + } + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + rowinsertabove : function() { + this.rowinsert(0); + }, + rowinsertbelow : function() { + this.rowinsert(1); + }, + rowmerge : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex, + nextRowIndex = rowIndex + cell.rowSpan, + nextRow = table.rows[nextRowIndex]; + if (table.rows.length <= nextRowIndex) { + return; + } + var cellIndex = cell.cellIndex; + if (nextRow.cells.length <= cellIndex) { + return; + } + var nextCell = nextRow.cells[cellIndex]; + if (cell.colSpan !== nextCell.colSpan) { + return; + } + cell.rowSpan += nextCell.rowSpan; + nextRow.deleteCell(cellIndex); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colmerge : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex, + cellIndex = cell.cellIndex, + nextCellIndex = cellIndex + 1; + if (row.cells.length <= nextCellIndex) { + return; + } + var nextCell = row.cells[nextCellIndex]; + if (cell.rowSpan !== nextCell.rowSpan) { + return; + } + cell.colSpan += nextCell.colSpan; + row.deleteCell(nextCellIndex); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + rowsplit : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex; + if (cell.rowSpan === 1) { + return; + } + var cellIndex = _getCellIndex(table, row, cell); + for (var i = 1, len = cell.rowSpan; i < len; i++) { + var newRow = table.rows[rowIndex + i], + newCell = newRow.insertCell(cellIndex); + if (cell.colSpan > 1) { + newCell.colSpan = cell.colSpan; + } + newCell.innerHTML = K.IE ? '' : '
    '; + cellIndex = _getCellIndex(table, newRow, newCell); + } + K(cell).removeAttr('rowSpan'); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colsplit : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + cellIndex = cell.cellIndex; + if (cell.colSpan === 1) { + return; + } + for (var i = 1, len = cell.colSpan; i < len; i++) { + var newCell = row.insertCell(cellIndex + i); + if (cell.rowSpan > 1) { + newCell.rowSpan = cell.rowSpan; + } + newCell.innerHTML = K.IE ? '' : '
    '; + } + K(cell).removeAttr('colSpan'); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + coldelete : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + index = cell.cellIndex; + for (var i = 0, len = table.rows.length; i < len; i++) { + var newRow = table.rows[i], + newCell = newRow.cells[index]; + if (newCell.colSpan > 1) { + newCell.colSpan -= 1; + if (newCell.colSpan === 1) { + K(newCell).removeAttr('colSpan'); + } + } else { + newRow.deleteCell(index); + } + if (newCell.rowSpan > 1) { + i += newCell.rowSpan - 1; + } + } + if (row.cells.length === 0) { + self.cmd.range.setStartBefore(table).collapse(true); + self.cmd.select(); + K(table).remove(); + } else { + self.cmd.selection(true); + } + self.addBookmark(); + }, + rowdelete : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex; + for (var i = cell.rowSpan - 1; i >= 0; i--) { + table.deleteRow(rowIndex + i); + } + if (table.rows.length === 0) { + self.cmd.range.setStartBefore(table).collapse(true); + self.cmd.select(); + K(table).remove(); + } else { + self.cmd.selection(true); + } + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.table.prop); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('template', function(K) { + var self = this, name = 'template', lang = self.lang(name + '.'), + htmlPath = self.pluginsPath + name + '/html/'; + function getFilePath(fileName) { + return htmlPath + fileName + '?ver=' + encodeURIComponent(K.DEBUG ? K.TIME : K.VERSION); + } + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + arr = ['
    ', + '
    ', + '
    ', + lang. selectTemplate + '
    ', + '
    ', + ' ', + '
    ', + '
    ', + '
    ', + '', + '
    '].join(''); + var dialog = self.createDialog({ + name : name, + width : 500, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var doc = K.iframeDoc(iframe); + self[checkbox[0].checked ? 'html' : 'insertHtml'](doc.body.innerHTML).hideDialog().focus(); + } + } + }); + var selectBox = K('select', dialog.div), + checkbox = K('[name="replaceFlag"]', dialog.div), + iframe = K('iframe', dialog.div); + checkbox[0].checked = true; + iframe.attr('src', getFilePath(selectBox.val())); + selectBox.change(function() { + iframe.attr('src', getFilePath(this.value)); + }); + }); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ +KindEditor.plugin('wordpaste', function(K) { + var self = this, name = 'wordpaste'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '
    ' + + '
    ' + lang.comment + '
    ' + + '' + + '
    ', + dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var str = doc.body.innerHTML; + str = K.clearMsWord(str, self.filterMode ? self.htmlTags : K.options.htmlTags); + self.insertHtml(str).hideDialog().focus(); + } + } + }), + div = dialog.div, + iframe = K('iframe', div), + doc = K.iframeDoc(iframe); + if (!K.IE) { + doc.designMode = 'on'; + } + doc.open(); + doc.write('WordPaste'); + doc.write(''); + if (!K.IE) { + doc.write('
    '); + } + doc.write(''); + doc.close(); + if (K.IE) { + doc.body.contentEditable = 'true'; + } + iframe[0].contentWindow.focus(); + }); +}); + + +KindEditor.plugin('fixtoolbar', function (K) { + var self = this; + if (!self.fixToolBar) { + return; + } + function init() { + var toolbar = K('.ke-toolbar'); + var originY = toolbar.pos().y; + K(window).bind('scroll', function () { + if (toolbar.css('position') == 'fixed') { + if(document.body.scrollTop - originY < 0){ + toolbar.css('position', 'static'); + toolbar.css('top', 'auto'); + } + } else { + if (toolbar.pos().y - document.body.scrollTop < 0) { + toolbar.css('position', 'fixed'); + toolbar.css('top', 0); + } + } + }); + } + if (self.isCreated) { + init(); + } else { + self.afterCreate(init); + } +}); diff --git a/infoport/static/js/lib/kindeditor/kindeditor-min.js b/infoport/static/js/lib/kindeditor/kindeditor-min.js new file mode 100644 index 0000000..7b35f52 --- /dev/null +++ b/infoport/static/js/lib/kindeditor/kindeditor-min.js @@ -0,0 +1,182 @@ +/* KindEditor 4.1.10 (2013-11-23), Copyright (C) kindsoft.net, Licence: http://www.kindsoft.net/license.php */(function(w,i){function Z(a){if(!a)return!1;return Object.prototype.toString.call(a)==="[object Array]"}function wa(a){if(!a)return!1;return Object.prototype.toString.call(a)==="[object Function]"}function J(a,b){for(var c=0,d=b.length;c=0}function s(a,b){b=b||"px";return a&&/^\d+$/.test(a)?a+b:a}function t(a){var b;return a&&(b=/(\d+)/.exec(a))?parseInt(b[1],10):0}function C(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function fa(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function ga(a){var b=a.split("-"),a="";m(b,function(b,d){a+=b>0?d.charAt(0).toUpperCase()+ +d.substr(1):d});return a}function ya(a){function b(a){a=parseInt(a,10).toString(16).toUpperCase();return a.length>1?a:"0"+a}return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(a,d,e,g){return"#"+b(d)+b(e)+b(g)})}function u(a,b){var b=b===i?",":b,c={},d=Z(a)?a:a.split(b),e;m(d,function(a,b){if(e=/^(\d+)\.\.(\d+)$/.exec(b))for(var d=parseInt(e[1],10);d<=parseInt(e[2],10);d++)c[d.toString()]=!0;else c[b]=!0});return c}function Ja(a,b){return Array.prototype.slice.call(a,b||0)} +function l(a,b){return a===i?b:a}function E(a,b,c){c||(c=b,b=null);var d;if(b){var e=function(){};e.prototype=b.prototype;d=new e;m(c,function(a,b){d[a]=b})}else d=c;d.constructor=a;a.prototype=d;a.parent=b?b.prototype:null}function eb(a){var b;if(b=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(a))a=b[0];b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;b.lastIndex=0;b.test(a)&&(a=a.replace(b,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})); +if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+a+")");throw"JSON parse error";}function Rb(a,b,c){a.addEventListener?a.addEventListener(b,c,fb):a.attachEvent&&a.attachEvent("on"+b,c)}function za(a,b,c){a.removeEventListener?a.removeEventListener(b,c,fb):a.detachEvent&&a.detachEvent("on"+b,c)}function gb(a,b){this.init(a,b)}function hb(a){try{delete a[$]}catch(b){a.removeAttribute&& +a.removeAttribute($)}}function aa(a,b,c){if(b.indexOf(",")>=0)m(b.split(","),function(){aa(a,this,c)});else{var d=a[$]||null;d||(a[$]=++ib,d=ib);v[d]===i&&(v[d]={});var e=v[d][b];e&&e.length>0?za(a,b,e[0]):(v[d][b]=[],v[d].el=a);e=v[d][b];e.length===0&&(e[0]=function(b){var c=b?new gb(a,b):i;m(e,function(b,d){b>0&&d&&d.call(a,c)})});J(c,e)<0&&e.push(c);Rb(a,b,e[0])}}function ha(a,b,c){if(b&&b.indexOf(",")>=0)m(b.split(","),function(){ha(a,this,c)});else{var d=a[$]||null;if(d)if(b===i)d in v&&(m(v[d], +function(b,c){b!="el"&&c.length>0&&za(a,b,c[0])}),delete v[d],hb(a));else if(v[d]){var e=v[d][b];if(e&&e.length>0){c===i?(za(a,b,e[0]),delete v[d][b]):(m(e,function(a,b){a>0&&b===c&&e.splice(a,1)}),e.length==1&&(za(a,b,e[0]),delete v[d][b]));var g=0;m(v[d],function(){g++});g<2&&(delete v[d],hb(a))}}}}function jb(a,b){if(b.indexOf(",")>=0)m(b.split(","),function(){jb(a,this)});else{var c=a[$]||null;if(c){var d=v[c][b];if(v[c]&&d&&d.length>0)d[0]()}}}function Ka(a,b,c){b=/^\d{2,}$/.test(b)?b:b.toUpperCase().charCodeAt(0); +aa(a,"keydown",function(d){d.ctrlKey&&d.which==b&&!d.shiftKey&&!d.altKey&&(c.call(a),d.stop())})}function ba(a){for(var b={},c=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,d;d=c.exec(a);){var e=B(d[1].toLowerCase());d=B(ya(d[2]));b[e]=d}return b}function I(a){for(var b={},c=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,d;d=c.exec(a);){var e=(d[1]||d[2]||d[4]||d[6]).toLowerCase();b[e]=(d[2]?d[3]:d[4]?d[5]:d[7])||""}return b}function Sb(a,b){return a= +/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(a,d,e,g){return(" "+e+" ").indexOf(" "+b+" ")<0?e===""?d+b+g:d+e+" "+b+g:a}):a.substr(0,a.length-1)+' class="'+b+'">'}function Tb(a){var b="";m(ba(a),function(a,d){b+=a+":"+d+";"});return b}function ia(a,b,c,d){function e(a){for(var a=a.split("/"),b=[],c=0,d=a.length;c0&&b.pop():e!==""&&e!="."&&b.push(e)}return"/"+b.join("/")}function g(b,c){if(a.substr(0,b.length)===b){for(var e=[], +h=0;h0&&(h+="/"+e.join("/"));d=="/"&&(h+="/");return h+a.substr(b.length)}else if(f=/^(.*)\//.exec(b))return g(f[1],++c)}b=l(b,"").toLowerCase();a.substr(0,5)!="data:"&&(a=a.replace(/([^:])\/\//g,"$1/"));if(J(b,["absolute","relative","domain"])<0)return a;c=c||location.protocol+"//"+location.host;if(d===i)var h=location.pathname.match(/^(\/.*)\//),d=h?h[1]:"";var f;if(f=/^(\w+:\/\/[^\/]*)/.exec(a)){if(f[1]!==c)return a}else if(/^\w+:/.test(a))return a;/^\//.test(a)? +a=c+e(a.substr(1)):/^\w+:\/\//.test(a)||(a=c+e(d+"/"+a));b==="relative"?a=g(c+d,0).substr(2):b==="absolute"&&a.substr(0,c.length)===c&&(a=a.substr(c.length));return a}function U(a,b,c,d,e){a==null&&(a="");var c=c||"",d=l(d,!1),e=l(e,"\t"),g="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,b,c,d){return b+c.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+d}),a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,"

    "),a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig, +"$1
    $2"),a=a.replace(/\u200B/g,""),a=a.replace(/\u00A9/g,"©"),a=a.replace(/\u00AE/g,"®"),a=a.replace(/<[^>]+/g,function(a){return a.replace(/\s+/g," ")}),h={};b&&(m(b,function(a,b){for(var c=a.split(","),d=0,e=c.length;d]*)>)([\s\S]*?)(<\/script>)/ig,"")),h.style||(a=a.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig,"")));var f=[],a=a.replace(/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g, +function(a,n,q,r,K,ja,i){var n=n||"",q=q||"",l=r.toLowerCase(),o=K||"",r=ja?" "+ja:"",i=i||"";if(b&&!h[l])return"";r===""&&kb[l]&&(r=" /");lb[l]&&(n&&(n=" "),i&&(i=" "));La[l]&&(q?i="\n":n="\n");d&&l=="br"&&(i="\n");if(mb[l]&&!La[l])if(d){q&&f.length>0&&f[f.length-1]===l?f.pop():f.push(l);i=n="\n";K=0;for(ja=q?f.length:f.length-1;K=0&&(z[a]=ia(d,c));(b&&a!=="style"&&!h[l]["*"]&&!h[l][a]||l==="body"&&a==="contenteditable"||/^kindeditor_\d+$/.test(a))&&delete z[a];if(a==="style"&&d!==""){var e=ba(d);m(e,function(a){b&&!h[l].style&&!h[l]["."+a]&&delete e[a]}); +var g="";m(e,function(a,b){g+=a+":"+b+";"});z.style=g}});o="";m(z,function(a,b){a==="style"&&b===""||(b=b.replace(/"/g,"""),o+=" "+a+'="'+b+'"')})}l==="font"&&(l="span");return n+"<"+q+l+o+r+">"+i}),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,b,c,d){return b+c.replace(/\n/g,'\n')+d}),a=a.replace(/\n\s*\n/g,"\n"),a=a.replace(/\n/g,"\n");return B(a)}function nb(a,b){a=a.replace(//ig, +"").replace(//ig,"").replace(/]*>[\s\S]*?<\/style>/ig,"").replace(/]*>[\s\S]*?<\/script>/ig,"").replace(/]+>[\s\S]*?<\/w:[^>]+>/ig,"").replace(/]+>[\s\S]*?<\/o:[^>]+>/ig,"").replace(/[\s\S]*?<\/xml>/ig,"").replace(/<(?:table|td)[^>]*>/ig,function(a){return a.replace(/border-bottom:([#\w\s]+)/ig,"border:$1")});return U(a,b)}function ob(a){if(/\.(rm|rmvb)(\?|$)/i.test(a))return"audio/x-pn-realaudio-plugin";if(/\.(swf|flv)(\?|$)/i.test(a))return"application/x-shockwave-flash"; +return"video/x-ms-asf-plugin"}function pb(a){return I(unescape(a))}function Ma(a){var b="0&&(h+="width:"+c+"px;");/\D/.test(d)?h+="height:"+d+";":d>0&&(h+="height:"+d+"px;");c=/realaudio/i.test(e)?"ke-rm":/flash/i.test(e)?"ke-flash":"ke-media";c='';return c}function Aa(a,b){if(a.nodeType==9&&b.nodeType!=9)return!0;for(;b=b.parentNode;)if(b==a)return!0;return!1}function Ba(a,b){var b=b.toLowerCase(),c=null;if(!Vb&&a.nodeName.toLowerCase()!="script"){var d=a.ownerDocument.createElement("div");d.appendChild(a.cloneNode(!1));d=I(fa(d.innerHTML));b in d&&(c=d[b])}else try{c=a.getAttribute(b,2)}catch(e){c=a.getAttribute(b,1)}b==="style"&&c!==null&&(c=Tb(c));return c}function Ca(a,b){function c(a){if(typeof a!="string")return a;return a.replace(/([^\w\-])/g, +"\\$1")}function d(a,b){return a==="*"||a.toLowerCase()===c(b.toLowerCase())}function e(a,b,c){var e=[];(a=(c.ownerDocument||c).getElementById(a.replace(/\\/g,"")))&&d(b,a.nodeName)&&Aa(c,a)&&e.push(a);return e}function g(a,b,c){var e=c.ownerDocument||c,g=[],h,f,j;if(c.getElementsByClassName){e=c.getElementsByClassName(a.replace(/\\/g,""));h=0;for(f=e.length;h-1&&g.push(j)}return g}function h(a,b,d,e){for(var g=[],d=e.getElementsByTagName(d),h=0,f=d.length;h])+)/.exec(a))?j[1]:"*";if(j=/#((?:[\w\-]|\\.)+)$/.exec(a))c= +e(j[1],k,b);else if(j=/\.((?:[\w\-]|\\.)+)$/.exec(a))c=g(j[1],k,b);else if(j=/\[((?:[\w\-]|\\.)+)\]/.exec(a))c=h(j[1].toLowerCase(),null,k,b);else if(j=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(a)){c=j[1].toLowerCase();j=j[2];if(c==="id")k=e(j,k,b);else if(c==="class")k=g(j,k,b);else if(c==="name"){c=[];j=(b.ownerDocument||b).getElementsByName(j.replace(/\\/g,""));for(var n,r=0,q=j.length;r1){var n=[];m(k,function(){m(Ca(this,b),function(){J(this,n)<0&&n.push(this)})});return n}for(var b=b||document,k=[],q,r=/((?:\\.|[^\s>])+|[\s>])/g;q=r.exec(a);)q[1]!==" "&&k.push(q[1]);q=[];if(k.length==1)return f(k[0],b);var r=!1,K,l,i,o,p,z,L,F,s,t;z=0;for(lenth=k.length;z")r=!0;else{if(z>0){l=[];L=0;for(s=q.length;L'+h+''+m+''+s+'秒') //竞价暂未开始 document.getElementById('biddingTitle').innerHTML = '竞价暂未开始...'; - $('#countDown').html('暂未开始') module.data.biddingTimeType = 3; }