diff --git a/.travis.yml b/.travis.yml index 80ef2910..36f7b6f9 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,42 +1,42 @@ -sudo: false - -language: php - -branches: - only: - - stable - -cache: - directories: - - $HOME/.composer/cache - -before_install: - - composer self-update - -install: - - composer install --no-dev --no-interaction --ignore-platform-reqs - - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip . - - composer require --update-no-dev --no-interaction "topthink/think-image:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0" - - composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0" - - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip . - -script: - - php think unit - -deploy: - provider: releases - api_key: - secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw= - file: - - ThinkPHP_Core.zip - - ThinkPHP_Full.zip - skip_cleanup: true - on: - tags: true +sudo: false + +language: php + +branches: + only: + - stable + +cache: + directories: + - $HOME/.composer/cache + +before_install: + - composer self-update + +install: + - composer install --no-dev --no-interaction --ignore-platform-reqs + - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip . + - composer require --update-no-dev --no-interaction "topthink/think-image:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0" + - composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0" + - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip . + +script: + - php think unit + +deploy: + provider: releases + api_key: + secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw= + file: + - ThinkPHP_Core.zip + - ThinkPHP_Full.zip + skip_cleanup: true + on: + tags: true diff --git a/LICENSE b/LICENSE index 2e38b714..088bc3f5 100755 --- a/LICENSE +++ b/LICENSE @@ -1,191 +1,191 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "{}" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright 2017 Karson - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "{}" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright 2017 Karson + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and limitations under the License. \ No newline at end of file diff --git a/application/admin/command/Addon/stubs/config.stub b/application/admin/command/Addon/stubs/config.stub index 4ad20dcc..034d7376 100644 --- a/application/admin/command/Addon/stubs/config.stub +++ b/application/admin/command/Addon/stubs/config.stub @@ -1,40 +1,40 @@ - 'usernmae', - //显示的标题 - 'title' => '用户名', - //类型 - 'type' => 'string', - //数据字典 - 'content' => [ - ], - //值 - 'value' => '', - //验证规则 - 'rule' => 'required', - //错误消息 - 'msg' => '', - //提示消息 - 'tip' => '', - //成功消息 - 'ok' => '', - //扩展信息 - 'extend' => '' - ], - [ - 'name' => 'password', - 'title' => '密码', - 'type' => 'string', - 'content' => [ - ], - 'value' => '', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '' - ], -]; + 'usernmae', + //显示的标题 + 'title' => '用户名', + //类型 + 'type' => 'string', + //数据字典 + 'content' => [ + ], + //值 + 'value' => '', + //验证规则 + 'rule' => 'required', + //错误消息 + 'msg' => '', + //提示消息 + 'tip' => '', + //成功消息 + 'ok' => '', + //扩展信息 + 'extend' => '' + ], + [ + 'name' => 'password', + 'title' => '密码', + 'type' => 'string', + 'content' => [ + ], + 'value' => '', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '' + ], +]; diff --git a/application/admin/command/Addon/stubs/info.stub b/application/admin/command/Addon/stubs/info.stub index 27570c3c..599bf2a5 100644 --- a/application/admin/command/Addon/stubs/info.stub +++ b/application/admin/command/Addon/stubs/info.stub @@ -1,7 +1,7 @@ -name = {%name%} -title = 插件名称 -intro = FastAdmin插件 -author = yourname -website = http://www.fastadmin.net -version = 1.0.0 +name = {%name%} +title = 插件名称 +intro = FastAdmin插件 +author = yourname +website = http://www.fastadmin.net +version = 1.0.0 state = 1 \ No newline at end of file diff --git a/application/admin/command/Crud/stubs/controller.stub b/application/admin/command/Crud/stubs/controller.stub index 2c9ca9ec..8953c2be 100644 --- a/application/admin/command/Crud/stubs/controller.stub +++ b/application/admin/command/Crud/stubs/controller.stub @@ -1,37 +1,37 @@ -model = model('{%modelName%}'); -{%controllerAssignList%} - } - - /** - * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法 - * 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑 - * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 - */ - -{%controllerIndex%} -} +model = model('{%modelName%}'); +{%controllerAssignList%} + } + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法 + * 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + +{%controllerIndex%} +} diff --git a/application/admin/command/Crud/stubs/model.stub b/application/admin/command/Crud/stubs/model.stub index 83615116..ae3da174 100644 --- a/application/admin/command/Crud/stubs/model.stub +++ b/application/admin/command/Crud/stubs/model.stub @@ -1,33 +1,33 @@ - [], - 'edit' => [], - ]; - -} + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/common.php b/application/admin/common.php index c23f2ca4..3e177ffc 100644 --- a/application/admin/common.php +++ b/application/admin/common.php @@ -114,7 +114,7 @@ function build_toolbar($btns = NULL, $attr = []) continue; } list($href, $class, $icon, $text, $title) = $btnAttr[$v]; - $extend = $v == 'import' ? 'id="btn-import-' . \fast\Random::alpha() . '" data-url="ajax/upload" data-mimetype="csv,xsl,xslx" data-multiple="false"' : ''; + $extend = $v == 'import' ? 'id="btn-import-' . \fast\Random::alpha() . '" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"' : ''; $html[] = ' ' . $text . ''; } return implode(' ', $html); diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index b7d033b2..b183cd06 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -1,349 +1,349 @@ - &$v) - { - $config = get_addon_config($v['name']); - $v['config'] = $config ? 1 : 0; - } - $this->assignconfig(['addons' => $addons]); - return $this->view->fetch(); - } - - /** - * 配置 - */ - public function config($ids = NULL) - { - $name = $this->request->get("name"); - if (!$name) - { - $this->error(__('Parameter %s can not be empty', $ids ? 'id' : 'name')); - } - if (!is_dir(ADDON_PATH . $name)) - { - $this->error(__('Directory not found')); - } - $info = get_addon_info($name); - $config = get_addon_fullconfig($name); - if (!$info) - $this->error(__('No Results were found')); - if ($this->request->isPost()) - { - $params = $this->request->post("row/a"); - if ($params) - { - $configList = []; - foreach ($config as $k => &$v) - { - if (isset($params[$v['name']])) - { - if ($v['type'] == 'array') - { - $fieldarr = $valuearr = []; - $field = $params[$v['name']]['field']; - $value = $params[$v['name']]['value']; - - foreach ($field as $m => $n) - { - if ($n != '') - { - $fieldarr[] = $field[$m]; - $valuearr[] = $value[$m]; - } - } - $params[$v['name']] = array_combine($fieldarr, $valuearr); - $value = $params[$v['name']]; - } - else - { - $value = is_array($params[$v['name']]) ? implode(',', $params[$v['name']]) : $params[$v['name']]; - } - - $v['value'] = $value; - } - } - try - { - //更新配置文件 - set_addon_fullconfig($name, $config); - $this->success(); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - $this->view->assign("addon", ['info' => $info, 'config' => $config]); - return $this->view->fetch(); - } - - /** - * 安装 - */ - public function install() - { - $name = $this->request->post("name"); - $force = (int) $this->request->post("force"); - if (!$name) - { - $this->error(__('Parameter %s can not be empty', 'name')); - } - try - { - $uid = $this->request->post("uid"); - $token = $this->request->post("token"); - Service::install($name, $force, ['uid' => $uid, 'token' => $token]); - $info = get_addon_info($name); - $info['config'] = get_addon_config($name) ? 1 : 0; - $this->success(__('Install successful'), null, ['addon' => $info]); - } - catch (AddonException $e) - { - $this->result($e->getData(), $e->getCode(), $e->getMessage()); - } - catch (Exception $e) - { - $this->error($e->getMessage(), $e->getCode()); - } - } - - /** - * 卸载 - */ - public function uninstall() - { - $name = $this->request->post("name"); - $force = (int) $this->request->post("force"); - if (!$name) - { - $this->error(__('Parameter %s can not be empty', 'name')); - } - try - { - Service::uninstall($name, $force); - $this->success(__('Uninstall successful')); - } - catch (AddonException $e) - { - $this->result($e->getData(), $e->getCode(), $e->getMessage()); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - - /** - * 禁用启用 - */ - public function state() - { - $name = $this->request->post("name"); - $action = $this->request->post("action"); - $force = (int) $this->request->post("force"); - if (!$name) - { - $this->error(__('Parameter %s can not be empty', 'name')); - } - try - { - $action = $action == 'enable' ? $action : 'disable'; - //调用启用、禁用的方法 - Service::$action($name, $force); - $this->success(__('Operate successful')); - } - catch (AddonException $e) - { - $this->result($e->getData(), $e->getCode(), $e->getMessage()); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - - /** - * 本地上传 - */ - public function local() - { - Config::set('default_return_type', 'json'); - - $file = $this->request->file('file'); - $addonTmpDir = RUNTIME_PATH . 'addons' . DS; - if (!is_dir($addonTmpDir)) - { - @mkdir($addonTmpDir, 0755, true); - } - $info = $file->rule('uniqid')->validate(['size' => 10240000, 'ext' => 'zip'])->move($addonTmpDir); - if ($info) - { - $tmpName = substr($info->getFilename(), 0, stripos($info->getFilename(), '.')); - $tmpAddonDir = ADDON_PATH . $tmpName . DS; - $tmpFile = $addonTmpDir . $info->getSaveName(); - try - { - Service::unzip($tmpName); - @unlink($tmpFile); - $infoFile = $tmpAddonDir . 'info.ini'; - if (!is_file($infoFile)) - { - throw new Exception(__('Addon info file was not found')); - } - - $config = Config::parse($infoFile, '', $tmpName); - $name = isset($config['name']) ? $config['name'] : ''; - if (!$name) - { - throw new Exception(__('Addon info file data incorrect')); - } - - $newAddonDir = ADDON_PATH . $name . DS; - if (is_dir($newAddonDir)) - { - throw new Exception(__('Addon already exists')); - } - - //重命名插件文件夹 - rename($tmpAddonDir, $newAddonDir); - try - { - //默认禁用该插件 - $info = get_addon_info($name); - if ($info['state']) - { - $info['state'] = 0; - set_addon_info($name, $info); - } - - //执行插件的安装方法 - $class = get_addon_class($name); - if (class_exists($class)) - { - $addon = new $class(); - $addon->install(); - } - - //导入SQL - Service::importsql($name); - - $info['config'] = get_addon_config($name) ? 1 : 0; - $this->success(__('Offline installed tips'), null, ['addon' => $info]); - } - catch (Exception $e) - { - @rmdirs($newAddonDir); - throw new Exception($e->getMessage()); - } - } - catch (Exception $e) - { - @unlink($tmpFile); - @rmdirs($tmpAddonDir); - $this->error($e->getMessage()); - } - } - else - { - // 上传失败获取错误信息 - $this->error($file->getError()); - } - } - - /** - * 刷新缓存 - */ - public function refresh() - { - try - { - Service::refresh(); - $this->success(__('Operate successful')); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - - /** - * 已装插件 - */ - public function downloaded() - { - $offset = (int) $this->request->get("offset"); - $limit = (int) $this->request->get("limit"); - $filter = $this->request->get("filter"); - $filter = (array) json_decode($filter, true); - foreach ($filter as $k => &$v) - { - $v = htmlspecialchars(strip_tags($v)); - } - unset($v); - $where = ['status' => 'normal']; - if (isset($filter['id'])) - { - $where['id'] = (int) $filter['id']; - } - if (isset($filter['name'])) - { - $where['name'] = ['like', "%{$filter['name']}%"]; - } - if (isset($filter['title'])) - { - $where['title'] = ['like', "%{$filter['title']}%"]; - } - - $addons = get_addon_list(); - $list = []; - foreach ($addons as $k => $v) - { - $v['flag'] = ''; - $v['banner'] = ''; - $v['image'] = ''; - $v['donateimage'] = ''; - $v['demourl'] = ''; - $v['price'] = '0.00'; - $v['url'] = '/addons/' . $v['name']; - $v['createtime'] = 0; - $list[] = $v; - } - $list = array_slice($list, $offset, $limit); - $result = array("total" => count($addons), "rows" => $list); - - $callback = $this->request->get('callback') ? "jsonp" : "json"; - return $callback($result); - } - -} + &$v) + { + $config = get_addon_config($v['name']); + $v['config'] = $config ? 1 : 0; + } + $this->assignconfig(['addons' => $addons]); + return $this->view->fetch(); + } + + /** + * 配置 + */ + public function config($ids = NULL) + { + $name = $this->request->get("name"); + if (!$name) + { + $this->error(__('Parameter %s can not be empty', $ids ? 'id' : 'name')); + } + if (!is_dir(ADDON_PATH . $name)) + { + $this->error(__('Directory not found')); + } + $info = get_addon_info($name); + $config = get_addon_fullconfig($name); + if (!$info) + $this->error(__('No Results were found')); + if ($this->request->isPost()) + { + $params = $this->request->post("row/a"); + if ($params) + { + $configList = []; + foreach ($config as $k => &$v) + { + if (isset($params[$v['name']])) + { + if ($v['type'] == 'array') + { + $fieldarr = $valuearr = []; + $field = $params[$v['name']]['field']; + $value = $params[$v['name']]['value']; + + foreach ($field as $m => $n) + { + if ($n != '') + { + $fieldarr[] = $field[$m]; + $valuearr[] = $value[$m]; + } + } + $params[$v['name']] = array_combine($fieldarr, $valuearr); + $value = $params[$v['name']]; + } + else + { + $value = is_array($params[$v['name']]) ? implode(',', $params[$v['name']]) : $params[$v['name']]; + } + + $v['value'] = $value; + } + } + try + { + //更新配置文件 + set_addon_fullconfig($name, $config); + $this->success(); + } + catch (Exception $e) + { + $this->error($e->getMessage()); + } + } + $this->error(__('Parameter %s can not be empty', '')); + } + $this->view->assign("addon", ['info' => $info, 'config' => $config]); + return $this->view->fetch(); + } + + /** + * 安装 + */ + public function install() + { + $name = $this->request->post("name"); + $force = (int) $this->request->post("force"); + if (!$name) + { + $this->error(__('Parameter %s can not be empty', 'name')); + } + try + { + $uid = $this->request->post("uid"); + $token = $this->request->post("token"); + Service::install($name, $force, ['uid' => $uid, 'token' => $token]); + $info = get_addon_info($name); + $info['config'] = get_addon_config($name) ? 1 : 0; + $this->success(__('Install successful'), null, ['addon' => $info]); + } + catch (AddonException $e) + { + $this->result($e->getData(), $e->getCode(), $e->getMessage()); + } + catch (Exception $e) + { + $this->error($e->getMessage(), $e->getCode()); + } + } + + /** + * 卸载 + */ + public function uninstall() + { + $name = $this->request->post("name"); + $force = (int) $this->request->post("force"); + if (!$name) + { + $this->error(__('Parameter %s can not be empty', 'name')); + } + try + { + Service::uninstall($name, $force); + $this->success(__('Uninstall successful')); + } + catch (AddonException $e) + { + $this->result($e->getData(), $e->getCode(), $e->getMessage()); + } + catch (Exception $e) + { + $this->error($e->getMessage()); + } + } + + /** + * 禁用启用 + */ + public function state() + { + $name = $this->request->post("name"); + $action = $this->request->post("action"); + $force = (int) $this->request->post("force"); + if (!$name) + { + $this->error(__('Parameter %s can not be empty', 'name')); + } + try + { + $action = $action == 'enable' ? $action : 'disable'; + //调用启用、禁用的方法 + Service::$action($name, $force); + $this->success(__('Operate successful')); + } + catch (AddonException $e) + { + $this->result($e->getData(), $e->getCode(), $e->getMessage()); + } + catch (Exception $e) + { + $this->error($e->getMessage()); + } + } + + /** + * 本地上传 + */ + public function local() + { + Config::set('default_return_type', 'json'); + + $file = $this->request->file('file'); + $addonTmpDir = RUNTIME_PATH . 'addons' . DS; + if (!is_dir($addonTmpDir)) + { + @mkdir($addonTmpDir, 0755, true); + } + $info = $file->rule('uniqid')->validate(['size' => 10240000, 'ext' => 'zip'])->move($addonTmpDir); + if ($info) + { + $tmpName = substr($info->getFilename(), 0, stripos($info->getFilename(), '.')); + $tmpAddonDir = ADDON_PATH . $tmpName . DS; + $tmpFile = $addonTmpDir . $info->getSaveName(); + try + { + Service::unzip($tmpName); + @unlink($tmpFile); + $infoFile = $tmpAddonDir . 'info.ini'; + if (!is_file($infoFile)) + { + throw new Exception(__('Addon info file was not found')); + } + + $config = Config::parse($infoFile, '', $tmpName); + $name = isset($config['name']) ? $config['name'] : ''; + if (!$name) + { + throw new Exception(__('Addon info file data incorrect')); + } + + $newAddonDir = ADDON_PATH . $name . DS; + if (is_dir($newAddonDir)) + { + throw new Exception(__('Addon already exists')); + } + + //重命名插件文件夹 + rename($tmpAddonDir, $newAddonDir); + try + { + //默认禁用该插件 + $info = get_addon_info($name); + if ($info['state']) + { + $info['state'] = 0; + set_addon_info($name, $info); + } + + //执行插件的安装方法 + $class = get_addon_class($name); + if (class_exists($class)) + { + $addon = new $class(); + $addon->install(); + } + + //导入SQL + Service::importsql($name); + + $info['config'] = get_addon_config($name) ? 1 : 0; + $this->success(__('Offline installed tips'), null, ['addon' => $info]); + } + catch (Exception $e) + { + @rmdirs($newAddonDir); + throw new Exception($e->getMessage()); + } + } + catch (Exception $e) + { + @unlink($tmpFile); + @rmdirs($tmpAddonDir); + $this->error($e->getMessage()); + } + } + else + { + // 上传失败获取错误信息 + $this->error($file->getError()); + } + } + + /** + * 刷新缓存 + */ + public function refresh() + { + try + { + Service::refresh(); + $this->success(__('Operate successful')); + } + catch (Exception $e) + { + $this->error($e->getMessage()); + } + } + + /** + * 已装插件 + */ + public function downloaded() + { + $offset = (int) $this->request->get("offset"); + $limit = (int) $this->request->get("limit"); + $filter = $this->request->get("filter"); + $filter = (array) json_decode($filter, true); + foreach ($filter as $k => &$v) + { + $v = htmlspecialchars(strip_tags($v)); + } + unset($v); + $where = ['status' => 'normal']; + if (isset($filter['id'])) + { + $where['id'] = (int) $filter['id']; + } + if (isset($filter['name'])) + { + $where['name'] = ['like', "%{$filter['name']}%"]; + } + if (isset($filter['title'])) + { + $where['title'] = ['like', "%{$filter['title']}%"]; + } + + $addons = get_addon_list(); + $list = []; + foreach ($addons as $k => $v) + { + $v['flag'] = ''; + $v['banner'] = ''; + $v['image'] = ''; + $v['donateimage'] = ''; + $v['demourl'] = ''; + $v['price'] = '0.00'; + $v['url'] = '/addons/' . $v['name']; + $v['createtime'] = 0; + $list[] = $v; + } + $list = array_slice($list, $offset, $limit); + $result = array("total" => count($addons), "rows" => $list); + + $callback = $this->request->get('callback') ? "jsonp" : "json"; + return $callback($result); + } + +} diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php index f625b87a..d8970964 100644 --- a/application/admin/controller/Ajax.php +++ b/application/admin/controller/Ajax.php @@ -1,283 +1,283 @@ -request->filter(['strip_tags', 'htmlspecialchars']); - } - - /** - * 加载语言包 - */ - public function lang() - { - header('Content-Type: application/javascript'); - $controllername = input("controllername"); - //默认只加载了控制器对应的语言名,你还根据控制器名来加载额外的语言包 - $this->loadlang($controllername); - return jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]); - } - - /** - * 上传文件 - */ - public function upload() - { - Config::set('default_return_type', 'json'); - $file = $this->request->file('file'); - if (empty($file)) - { - $this->error("未上传文件或超出服务器上传限制"); - } - - //判断是否已经存在附件 - $sha1 = $file->hash(); - - $upload = Config::get('upload'); - - preg_match('/(\d+)(\w+)/', $upload['maxsize'], $matches); - $type = strtolower($matches[2]); - $typeDict = ['b' => 0, 'k' => 1, 'kb' => 1, 'm' => 2, 'mb' => 2, 'gb' => 3, 'g' => 3]; - $size = (int) $upload['maxsize'] * pow(1024, isset($typeDict[$type]) ? $typeDict[$type] : 0); - $fileInfo = $file->getInfo(); - $suffix = strtolower(pathinfo($fileInfo['name'], PATHINFO_EXTENSION)); - $suffix = $suffix ? $suffix : 'file'; - $replaceArr = [ - '{year}' => date("Y"), - '{mon}' => date("m"), - '{day}' => date("d"), - '{hour}' => date("H"), - '{min}' => date("i"), - '{sec}' => date("s"), - '{random}' => Random::alnum(16), - '{random32}' => Random::alnum(32), - '{filename}' => $suffix ? substr($fileInfo['name'], 0, strripos($fileInfo['name'], '.')) : $fileInfo['name'], - '{suffix}' => $suffix, - '{.suffix}' => $suffix ? '.' . $suffix : '', - '{filemd5}' => md5_file($fileInfo['tmp_name']), - ]; - $savekey = $upload['savekey']; - $savekey = str_replace(array_keys($replaceArr), array_values($replaceArr), $savekey); - - $uploadDir = substr($savekey, 0, strripos($savekey, '/') + 1); - $fileName = substr($savekey, strripos($savekey, '/') + 1); - // - $splInfo = $file->validate(['size' => $size])->move(ROOT_PATH . '/public' . $uploadDir, $fileName); - if ($splInfo) - { - $imagewidth = $imageheight = 0; - if (in_array($suffix, ['gif', 'jpg', 'jpeg', 'bmp', 'png', 'swf'])) - { - $imgInfo = getimagesize($splInfo->getPathname()); - $imagewidth = isset($imgInfo[0]) ? $imgInfo[0] : $imagewidth; - $imageheight = isset($imgInfo[1]) ? $imgInfo[1] : $imageheight; - } - $params = array( - 'filesize' => $fileInfo['size'], - 'imagewidth' => $imagewidth, - 'imageheight' => $imageheight, - 'imagetype' => $suffix, - 'imageframes' => 0, - 'mimetype' => $fileInfo['type'], - 'url' => $uploadDir . $splInfo->getSaveName(), - 'uploadtime' => time(), - 'storage' => 'local', - 'sha1' => $sha1, - ); - $attachment = model("attachment"); - $attachment->data(array_filter($params)); - $attachment->save(); - \think\Hook::listen("upload_after", $attachment); - $this->success('上传成功', null, [ - 'url' => $uploadDir . $splInfo->getSaveName() - ]); - } - else - { - // 上传失败获取错误信息 - $this->error($file->getError()); - } - } - - /** - * 通用排序 - */ - public function weigh() - { - //排序的数组 - $ids = $this->request->post("ids"); - //拖动的记录ID - $changeid = $this->request->post("changeid"); - //操作字段 - $field = $this->request->post("field"); - //操作的数据表 - $table = $this->request->post("table"); - //排序的方式 - $orderway = $this->request->post("orderway", 'strtolower'); - $orderway = $orderway == 'asc' ? 'ASC' : 'DESC'; - $sour = $weighdata = []; - $ids = explode(',', $ids); - $prikey = 'id'; - $pid = $this->request->post("pid"); - //限制更新的字段 - $field = in_array($field, ['weigh']) ? $field : 'weigh'; - - // 如果设定了pid的值,此时只匹配满足条件的ID,其它忽略 - if ($pid !== '') - { - $hasids = []; - $list = Db::name($table)->where($prikey, 'in', $ids)->where('pid', 'in', $pid)->field('id,pid')->select(); - foreach ($list as $k => $v) - { - $hasids[] = $v['id']; - } - $ids = array_values(array_intersect($ids, $hasids)); - } - - //直接修复排序 - $one = Db::name($table)->field("{$field},COUNT(*) AS nums")->group($field)->having('nums > 1')->find(); - if ($one) - { - $list = Db::name($table)->field("$prikey,$field")->order($field, $orderway)->select(); - foreach ($list as $k => $v) - { - Db::name($table)->where($prikey, $v[$prikey])->update([$field => $k + 1]); - } - $this->success(); - } - else - { - $list = Db::name($table)->field("$prikey,$field")->where($prikey, 'in', $ids)->order($field, $orderway)->select(); - foreach ($list as $k => $v) - { - $sour[] = $v[$prikey]; - $weighdata[$v[$prikey]] = $v[$field]; - } - $position = array_search($changeid, $ids); - $desc_id = $sour[$position]; //移动到目标的ID值,取出所处改变前位置的值 - $sour_id = $changeid; - $desc_value = $weighdata[$desc_id]; - $sour_value = $weighdata[$sour_id]; - //echo "移动的ID:{$sour_id}\n"; - //echo "替换的ID:{$desc_id}\n"; - $weighids = array(); - $temp = array_values(array_diff_assoc($ids, $sour)); - foreach ($temp as $m => $n) - { - if ($n == $sour_id) - { - $offset = $desc_id; - } - else - { - if ($sour_id == $temp[0]) - { - $offset = isset($temp[$m + 1]) ? $temp[$m + 1] : $sour_id; - } - else - { - $offset = isset($temp[$m - 1]) ? $temp[$m - 1] : $sour_id; - } - } - $weighids[$n] = $weighdata[$offset]; - Db::name($table)->where($prikey, $n)->update([$field => $weighdata[$offset]]); - } - $this->success(); - } - } - - /** - * 清空系统缓存 - */ - public function wipecache() - { - $wipe_cache_type = ['TEMP_PATH', 'LOG_PATH', 'CACHE_PATH']; - foreach ($wipe_cache_type as $item) - { - $dir = constant($item); - if (!is_dir($dir)) - continue; - rmdirs($dir); - } - Cache::clear(); - \think\Hook::listen("wipecache_after"); - $this->success(); - } - - /** - * 读取分类数据,联动列表 - */ - public function category() - { - $type = $this->request->get('type'); - $pid = $this->request->get('pid'); - $where = ['status' => 'normal']; - $categorylist = null; - if ($pid !== '') - { - if ($type) - { - $where['type'] = $type; - } - if ($pid) - { - $where['pid'] = $pid; - } - - $categorylist = Db::name('category')->where($where)->field('id as value,name')->order('weigh desc,id desc')->select(); - } - $this->success('', null, $categorylist); - } - - /** - * 读取省市区数据,联动列表 - */ - public function area() - { - $province = $this->request->get('province'); - $city = $this->request->get('city'); - $where = ['pid' => 0, 'level' => 1]; - $provincelist = null; - if ($province !== '') - { - if ($province) - { - $where['pid'] = $province; - $where['level'] = 2; - } - if ($city !== '') - { - if ($city) - { - $where['pid'] = $city; - $where['level'] = 3; - } - $provincelist = Db::name('area')->where($where)->field('id as value,name')->select(); - } - } - $this->success('', null, $provincelist); - } - -} +request->filter(['strip_tags', 'htmlspecialchars']); + } + + /** + * 加载语言包 + */ + public function lang() + { + header('Content-Type: application/javascript'); + $controllername = input("controllername"); + //默认只加载了控制器对应的语言名,你还根据控制器名来加载额外的语言包 + $this->loadlang($controllername); + return jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]); + } + + /** + * 上传文件 + */ + public function upload() + { + Config::set('default_return_type', 'json'); + $file = $this->request->file('file'); + if (empty($file)) + { + $this->error("未上传文件或超出服务器上传限制"); + } + + //判断是否已经存在附件 + $sha1 = $file->hash(); + + $upload = Config::get('upload'); + + preg_match('/(\d+)(\w+)/', $upload['maxsize'], $matches); + $type = strtolower($matches[2]); + $typeDict = ['b' => 0, 'k' => 1, 'kb' => 1, 'm' => 2, 'mb' => 2, 'gb' => 3, 'g' => 3]; + $size = (int) $upload['maxsize'] * pow(1024, isset($typeDict[$type]) ? $typeDict[$type] : 0); + $fileInfo = $file->getInfo(); + $suffix = strtolower(pathinfo($fileInfo['name'], PATHINFO_EXTENSION)); + $suffix = $suffix ? $suffix : 'file'; + $replaceArr = [ + '{year}' => date("Y"), + '{mon}' => date("m"), + '{day}' => date("d"), + '{hour}' => date("H"), + '{min}' => date("i"), + '{sec}' => date("s"), + '{random}' => Random::alnum(16), + '{random32}' => Random::alnum(32), + '{filename}' => $suffix ? substr($fileInfo['name'], 0, strripos($fileInfo['name'], '.')) : $fileInfo['name'], + '{suffix}' => $suffix, + '{.suffix}' => $suffix ? '.' . $suffix : '', + '{filemd5}' => md5_file($fileInfo['tmp_name']), + ]; + $savekey = $upload['savekey']; + $savekey = str_replace(array_keys($replaceArr), array_values($replaceArr), $savekey); + + $uploadDir = substr($savekey, 0, strripos($savekey, '/') + 1); + $fileName = substr($savekey, strripos($savekey, '/') + 1); + // + $splInfo = $file->validate(['size' => $size])->move(ROOT_PATH . '/public' . $uploadDir, $fileName); + if ($splInfo) + { + $imagewidth = $imageheight = 0; + if (in_array($suffix, ['gif', 'jpg', 'jpeg', 'bmp', 'png', 'swf'])) + { + $imgInfo = getimagesize($splInfo->getPathname()); + $imagewidth = isset($imgInfo[0]) ? $imgInfo[0] : $imagewidth; + $imageheight = isset($imgInfo[1]) ? $imgInfo[1] : $imageheight; + } + $params = array( + 'filesize' => $fileInfo['size'], + 'imagewidth' => $imagewidth, + 'imageheight' => $imageheight, + 'imagetype' => $suffix, + 'imageframes' => 0, + 'mimetype' => $fileInfo['type'], + 'url' => $uploadDir . $splInfo->getSaveName(), + 'uploadtime' => time(), + 'storage' => 'local', + 'sha1' => $sha1, + ); + $attachment = model("attachment"); + $attachment->data(array_filter($params)); + $attachment->save(); + \think\Hook::listen("upload_after", $attachment); + $this->success('上传成功', null, [ + 'url' => $uploadDir . $splInfo->getSaveName() + ]); + } + else + { + // 上传失败获取错误信息 + $this->error($file->getError()); + } + } + + /** + * 通用排序 + */ + public function weigh() + { + //排序的数组 + $ids = $this->request->post("ids"); + //拖动的记录ID + $changeid = $this->request->post("changeid"); + //操作字段 + $field = $this->request->post("field"); + //操作的数据表 + $table = $this->request->post("table"); + //排序的方式 + $orderway = $this->request->post("orderway", 'strtolower'); + $orderway = $orderway == 'asc' ? 'ASC' : 'DESC'; + $sour = $weighdata = []; + $ids = explode(',', $ids); + $prikey = 'id'; + $pid = $this->request->post("pid"); + //限制更新的字段 + $field = in_array($field, ['weigh']) ? $field : 'weigh'; + + // 如果设定了pid的值,此时只匹配满足条件的ID,其它忽略 + if ($pid !== '') + { + $hasids = []; + $list = Db::name($table)->where($prikey, 'in', $ids)->where('pid', 'in', $pid)->field('id,pid')->select(); + foreach ($list as $k => $v) + { + $hasids[] = $v['id']; + } + $ids = array_values(array_intersect($ids, $hasids)); + } + + //直接修复排序 + $one = Db::name($table)->field("{$field},COUNT(*) AS nums")->group($field)->having('nums > 1')->find(); + if ($one) + { + $list = Db::name($table)->field("$prikey,$field")->order($field, $orderway)->select(); + foreach ($list as $k => $v) + { + Db::name($table)->where($prikey, $v[$prikey])->update([$field => $k + 1]); + } + $this->success(); + } + else + { + $list = Db::name($table)->field("$prikey,$field")->where($prikey, 'in', $ids)->order($field, $orderway)->select(); + foreach ($list as $k => $v) + { + $sour[] = $v[$prikey]; + $weighdata[$v[$prikey]] = $v[$field]; + } + $position = array_search($changeid, $ids); + $desc_id = $sour[$position]; //移动到目标的ID值,取出所处改变前位置的值 + $sour_id = $changeid; + $desc_value = $weighdata[$desc_id]; + $sour_value = $weighdata[$sour_id]; + //echo "移动的ID:{$sour_id}\n"; + //echo "替换的ID:{$desc_id}\n"; + $weighids = array(); + $temp = array_values(array_diff_assoc($ids, $sour)); + foreach ($temp as $m => $n) + { + if ($n == $sour_id) + { + $offset = $desc_id; + } + else + { + if ($sour_id == $temp[0]) + { + $offset = isset($temp[$m + 1]) ? $temp[$m + 1] : $sour_id; + } + else + { + $offset = isset($temp[$m - 1]) ? $temp[$m - 1] : $sour_id; + } + } + $weighids[$n] = $weighdata[$offset]; + Db::name($table)->where($prikey, $n)->update([$field => $weighdata[$offset]]); + } + $this->success(); + } + } + + /** + * 清空系统缓存 + */ + public function wipecache() + { + $wipe_cache_type = ['TEMP_PATH', 'LOG_PATH', 'CACHE_PATH']; + foreach ($wipe_cache_type as $item) + { + $dir = constant($item); + if (!is_dir($dir)) + continue; + rmdirs($dir); + } + Cache::clear(); + \think\Hook::listen("wipecache_after"); + $this->success(); + } + + /** + * 读取分类数据,联动列表 + */ + public function category() + { + $type = $this->request->get('type'); + $pid = $this->request->get('pid'); + $where = ['status' => 'normal']; + $categorylist = null; + if ($pid !== '') + { + if ($type) + { + $where['type'] = $type; + } + if ($pid) + { + $where['pid'] = $pid; + } + + $categorylist = Db::name('category')->where($where)->field('id as value,name')->order('weigh desc,id desc')->select(); + } + $this->success('', null, $categorylist); + } + + /** + * 读取省市区数据,联动列表 + */ + public function area() + { + $province = $this->request->get('province'); + $city = $this->request->get('city'); + $where = ['pid' => 0, 'level' => 1]; + $provincelist = null; + if ($province !== '') + { + if ($province) + { + $where['pid'] = $province; + $where['level'] = 2; + } + if ($city !== '') + { + if ($city) + { + $where['pid'] = $city; + $where['level'] = 3; + } + $provincelist = Db::name('area')->where($where)->field('id as value,name')->select(); + } + } + $this->success('', null, $provincelist); + } + +} diff --git a/application/admin/controller/Category.php b/application/admin/controller/Category.php index e86118c4..6c6ffbe0 100644 --- a/application/admin/controller/Category.php +++ b/application/admin/controller/Category.php @@ -1,83 +1,83 @@ -request->filter(['strip_tags']); - $this->model = model('Category'); - - $tree = Tree::instance(); - $tree->init(collection($this->model->order('weigh desc,id desc')->select())->toArray(), 'pid'); - $this->categorylist = $tree->getTreeList($tree->getTreeArray(0), 'name'); - $categorydata = [0 => ['type' => 'all', 'name' => __('None')]]; - foreach ($this->categorylist as $k => $v) - { - $categorydata[$v['id']] = $v; - } - $this->view->assign("flagList", $this->model->getFlagList()); - $this->view->assign("typeList", CategoryModel::getTypeList()); - $this->view->assign("parentList", $categorydata); - } - - /** - * 查看 - */ - public function index() - { - if ($this->request->isAjax()) - { - $search = $this->request->request("search"); - //构造父类select列表选项数据 - $list = []; - if ($search) - { - foreach ($this->categorylist as $k => $v) - { - if (stripos($v['name'], $search) !== false || stripos($v['nickname'], $search) !== false) - { - $list[] = $v; - } - } - } - else - { - $list = $this->categorylist; - } - $total = count($list); - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - return $this->view->fetch(); - } - - /** - * Selectpage搜索 - * - * @internal - */ - public function selectpage() - { - return parent::selectpage(); - } - -} +request->filter(['strip_tags']); + $this->model = model('Category'); + + $tree = Tree::instance(); + $tree->init(collection($this->model->order('weigh desc,id desc')->select())->toArray(), 'pid'); + $this->categorylist = $tree->getTreeList($tree->getTreeArray(0), 'name'); + $categorydata = [0 => ['type' => 'all', 'name' => __('None')]]; + foreach ($this->categorylist as $k => $v) + { + $categorydata[$v['id']] = $v; + } + $this->view->assign("flagList", $this->model->getFlagList()); + $this->view->assign("typeList", CategoryModel::getTypeList()); + $this->view->assign("parentList", $categorydata); + } + + /** + * 查看 + */ + public function index() + { + if ($this->request->isAjax()) + { + $search = $this->request->request("search"); + //构造父类select列表选项数据 + $list = []; + if ($search) + { + foreach ($this->categorylist as $k => $v) + { + if (stripos($v['name'], $search) !== false || stripos($v['nickname'], $search) !== false) + { + $list[] = $v; + } + } + } + else + { + $list = $this->categorylist; + } + $total = count($list); + $result = array("total" => $total, "rows" => $list); + + return json($result); + } + return $this->view->fetch(); + } + + /** + * Selectpage搜索 + * + * @internal + */ + public function selectpage() + { + return parent::selectpage(); + } + +} diff --git a/application/admin/controller/Dashboard.php b/application/admin/controller/Dashboard.php index 4b2ce9e1..ccb215e8 100644 --- a/application/admin/controller/Dashboard.php +++ b/application/admin/controller/Dashboard.php @@ -1,50 +1,50 @@ -view->assign([ - 'totaluser' => 35200, - 'totalviews' => 219390, - 'totalorder' => 32143, - 'totalorderamount' => 174800, - 'todayuserlogin' => 321, - 'todayusersignup' => 430, - 'todayorder' => 2324, - 'unsettleorder' => 132, - 'sevendnu' => '80%', - 'sevendau' => '32%', - 'paylist' => $paylist, - 'createlist' => $createlist, - 'uploadmode' => $uploadmode - ]); - - return $this->view->fetch(); - } - -} +view->assign([ + 'totaluser' => 35200, + 'totalviews' => 219390, + 'totalorder' => 32143, + 'totalorderamount' => 174800, + 'todayuserlogin' => 321, + 'todayusersignup' => 430, + 'todayorder' => 2324, + 'unsettleorder' => 132, + 'sevendnu' => '80%', + 'sevendau' => '32%', + 'paylist' => $paylist, + 'createlist' => $createlist, + 'uploadmode' => $uploadmode + ]); + + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index b00870e9..f3f60e27 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -1,103 +1,103 @@ -auth->getSidebar([ - 'dashboard' => 'hot', - 'addon' => ['new', 'red', 'badge'], - 'auth/rule' => 'side', - 'general' => ['18', 'purple'], - ], $this->view->site['fixedpage']); - $this->view->assign('menulist', $menulist); - $this->view->assign('title', __('Home')); - return $this->view->fetch(); - } - - /** - * 管理员登录 - */ - public function login() - { - $url = $this->request->get('url', 'index/index'); - if ($this->auth->isLogin()) - { - $this->error(__("You've logged in, do not login again"), $url); - } - if ($this->request->isPost()) - { - $username = $this->request->post('username'); - $password = $this->request->post('password'); - $keeplogin = $this->request->post('keeplogin'); - $token = $this->request->post('__token__'); - $rule = [ - 'username' => 'require|length:3,30', - 'password' => 'require|length:3,30', - '__token__' => 'token', - ]; - $data = [ - 'username' => $username, - 'password' => $password, - '__token__' => $token, - ]; - $validate = new Validate($rule); - $result = $validate->check($data); - if (!$result) - { - $this->error($validate->getError(), $url, ['token' => $this->request->token()]); - } - \app\admin\model\AdminLog::setTitle(__('Login')); - $result = $this->auth->login($username, $password, $keeplogin ? 86400 : 0); - if ($result === true) - { - $this->success(__('Login successful'), $url, ['url' => $url, 'id' => $this->auth->id, 'username' => $username, 'avatar' => $this->auth->avatar]); - } - else - { - $this->error(__('Username or password is incorrect'), $url, ['token' => $this->request->token()]); - } - } - - // 根据客户端的cookie,判断是否可以自动登录 - if ($this->auth->autologin()) - { - $this->redirect($url); - } - \think\Hook::listen("login_init", $this->request); - return $this->view->fetch(); - } - - /** - * 注销登录 - */ - public function logout() - { - $this->auth->logout(); - $this->success(__('Logout successful'), 'index/login'); - } - -} +auth->getSidebar([ + 'dashboard' => 'hot', + 'addon' => ['new', 'red', 'badge'], + 'auth/rule' => 'side', + 'general' => ['18', 'purple'], + ], $this->view->site['fixedpage']); + $this->view->assign('menulist', $menulist); + $this->view->assign('title', __('Home')); + return $this->view->fetch(); + } + + /** + * 管理员登录 + */ + public function login() + { + $url = $this->request->get('url', 'index/index'); + if ($this->auth->isLogin()) + { + $this->error(__("You've logged in, do not login again"), $url); + } + if ($this->request->isPost()) + { + $username = $this->request->post('username'); + $password = $this->request->post('password'); + $keeplogin = $this->request->post('keeplogin'); + $token = $this->request->post('__token__'); + $rule = [ + 'username' => 'require|length:3,30', + 'password' => 'require|length:3,30', + '__token__' => 'token', + ]; + $data = [ + 'username' => $username, + 'password' => $password, + '__token__' => $token, + ]; + $validate = new Validate($rule); + $result = $validate->check($data); + if (!$result) + { + $this->error($validate->getError(), $url, ['token' => $this->request->token()]); + } + \app\admin\model\AdminLog::setTitle(__('Login')); + $result = $this->auth->login($username, $password, $keeplogin ? 86400 : 0); + if ($result === true) + { + $this->success(__('Login successful'), $url, ['url' => $url, 'id' => $this->auth->id, 'username' => $username, 'avatar' => $this->auth->avatar]); + } + else + { + $this->error(__('Username or password is incorrect'), $url, ['token' => $this->request->token()]); + } + } + + // 根据客户端的cookie,判断是否可以自动登录 + if ($this->auth->autologin()) + { + $this->redirect($url); + } + \think\Hook::listen("login_init", $this->request); + return $this->view->fetch(); + } + + /** + * 注销登录 + */ + public function logout() + { + $this->auth->logout(); + $this->success(__('Logout successful'), 'index/login'); + } + +} diff --git a/application/admin/controller/general/Attachment.php b/application/admin/controller/general/Attachment.php index b242bf59..02b0ce46 100644 --- a/application/admin/controller/general/Attachment.php +++ b/application/admin/controller/general/Attachment.php @@ -1,95 +1,95 @@ -model = model('Attachment'); - } - - /** - * 查看 - */ - public function index() - { - //设置过滤方法 - $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) - { - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $total = $this->model - ->where($where) - ->order($sort, $order) - ->count(); - - $list = $this->model - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - $cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root()); - foreach ($list as $k => &$v) - { - $v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url']; - } - unset($v); - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - return $this->view->fetch(); - } - - /** - * 选择附件 - */ - public function select() - { - if ($this->request->isAjax()) - { - return $this->index(); - } - return $this->view->fetch(); - } - - /** - * 添加 - */ - public function add() - { - if ($this->request->isAjax()) - { - $this->error(); - } - return $this->view->fetch(); - } - - public function del($ids = "") - { - if ($ids) - { - $count = $this->model->destroy($ids); - if ($count) - { - \think\Hook::listen("upload_after", $this); - $this->success(); - } - } - $this->error(__('Parameter %s can not be empty', 'ids')); - } - -} +model = model('Attachment'); + } + + /** + * 查看 + */ + public function index() + { + //设置过滤方法 + $this->request->filter(['strip_tags']); + if ($this->request->isAjax()) + { + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + $total = $this->model + ->where($where) + ->order($sort, $order) + ->count(); + + $list = $this->model + ->where($where) + ->order($sort, $order) + ->limit($offset, $limit) + ->select(); + $cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root()); + foreach ($list as $k => &$v) + { + $v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url']; + } + unset($v); + $result = array("total" => $total, "rows" => $list); + + return json($result); + } + return $this->view->fetch(); + } + + /** + * 选择附件 + */ + public function select() + { + if ($this->request->isAjax()) + { + return $this->index(); + } + return $this->view->fetch(); + } + + /** + * 添加 + */ + public function add() + { + if ($this->request->isAjax()) + { + $this->error(); + } + return $this->view->fetch(); + } + + public function del($ids = "") + { + if ($ids) + { + $count = $this->model->destroy($ids); + if ($count) + { + \think\Hook::listen("upload_after", $this); + $this->success(); + } + } + $this->error(__('Parameter %s can not be empty', 'ids')); + } + +} diff --git a/application/admin/controller/general/Config.php b/application/admin/controller/general/Config.php index 207474cd..d0d1a9be 100644 --- a/application/admin/controller/general/Config.php +++ b/application/admin/controller/general/Config.php @@ -1,229 +1,229 @@ -model = model('Config'); - } - - public function index() - { - $siteList = []; - $groupList = ConfigModel::getGroupList(); - foreach ($groupList as $k => $v) - { - $siteList[$k]['name'] = $k; - $siteList[$k]['title'] = $v; - $siteList[$k]['list'] = []; - } - - foreach ($this->model->all() as $k => $v) - { - if (!isset($siteList[$v['group']])) - { - continue; - } - $value = $v->toArray(); - $value['title'] = __($value['title']); - if (in_array($value['type'], ['select', 'selects', 'checkbox', 'radio'])) - { - $value['value'] = explode(',', $value['value']); - } - if ($value['type'] == 'array') - { - $value['value'] = (array) json_decode($value['value'], TRUE); - } - $value['content'] = json_decode($value['content'], TRUE); - $siteList[$v['group']]['list'][] = $value; - } - $index = 0; - foreach ($siteList as $k => &$v) - { - $v['active'] = !$index ? true : false; - $index++; - } - $this->view->assign('siteList', $siteList); - $this->view->assign('typeList', ConfigModel::getTypeList()); - $this->view->assign('groupList', ConfigModel::getGroupList()); - return $this->view->fetch(); - } - - /** - * 添加 - */ - public function add() - { - if ($this->request->isPost()) - { - $params = $this->request->post("row/a"); - if ($params) - { - foreach ($params as $k => &$v) - { - $v = is_array($v) ? implode(',', $v) : $v; - } - try - { - if (in_array($params['type'], ['select', 'selects', 'checkbox', 'radio', 'array'])) - { - $params['content'] = ConfigModel::decode($params['content']); - } - else - { - $params['content'] = ''; - } - $result = $this->model->create($params); - if ($result !== false) - { - try - { - $this->refreshFile(); - $this->success(); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - else - { - $this->error($this->model->getError()); - } - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - return $this->view->fetch(); - } - - public function edit($ids = NULL) - { - if ($this->request->isPost()) - { - $row = $this->request->post("row/a"); - if ($row) - { - $configList = []; - foreach ($this->model->all() as $v) - { - if (isset($row[$v['name']])) - { - $value = $row[$v['name']]; - if (is_array($value) && isset($value['field'])) - { - $value = json_encode(\app\common\model\Config::getArrayData($value), JSON_UNESCAPED_UNICODE); - } - else - { - $value = is_array($value) ? implode(',', $value) : $value; - } - $v['value'] = $value; - $configList[] = $v->toArray(); - } - } - $this->model->allowField(true)->saveAll($configList); - try - { - $this->refreshFile(); - $this->success(); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - } - - protected function refreshFile() - { - $config = []; - foreach ($this->model->all() as $k => $v) - { - - $value = $v->toArray(); - if (in_array($value['type'], ['selects', 'checkbox', 'images', 'files'])) - { - $value['value'] = explode(',', $value['value']); - } - if ($value['type'] == 'array') - { - $value['value'] = (array) json_decode($value['value'], TRUE); - } - $config[$value['name']] = $value['value']; - } - file_put_contents(APP_PATH . 'extra' . DS . 'site.php', 'request->post("row/a"); - if ($params) - { - - $config = $this->model->get($params); - if (!$config) - { - return json(['ok' => '']); - } - else - { - return json(['error' => __('Name already exist')]); - } - } - else - { - return json(['error' => __('Invalid parameters')]); - } - } - - /** - * 发送测试邮件 - * @internal - */ - public function emailtest() - { - $receiver = $this->request->request("receiver"); - $email = new Email; - $result = $email - ->to($receiver) - ->subject(__("This is a test mail")) - ->message('
基于完善的Auth权限控制管理、无限父子级权限分组、可自由分配子级权限、一个管理员可同时属于多个组别
-基于Bootstrap和AdminLTE进行二次开发,手机、平板、PC均自动适配,无需要担心兼容性问题
-不仅仅后台开发支持多语言,同时视图部分和JS部分仍然共享同一个语言包,语法相同且自动加载
-控制器、模型、视图、JS一一对应,使用RequireJS进行JS模块化管理,采用Bower进行前端包组件管理
-控制台进行一键生成控制器、模型、视图和JS文件,同时可一键生成后台权限节点和菜单栏
-FastAdmin提供强大的扩展中心,可直接在线安装和卸载插件,同时支持命令行一键操作
-基于完善的Auth权限控制管理、无限父子级权限分组、可自由分配子级权限、一个管理员可同时属于多个组别
+基于Bootstrap和AdminLTE进行二次开发,手机、平板、PC均自动适配,无需要担心兼容性问题
+不仅仅后台开发支持多语言,同时视图部分和JS部分仍然共享同一个语言包,语法相同且自动加载
+控制器、模型、视图、JS一一对应,使用RequireJS进行JS模块化管理,采用Bower进行前端包组件管理
+控制台进行一键生成控制器、模型、视图和JS文件,同时可一键生成后台权限节点和菜单栏
+FastAdmin提供强大的扩展中心,可直接在线安装和卸载插件,同时支持命令行一键操作
+| "+w(b,d,f)+" | "}});0"+w(d,f,g).replace(/\n/g," ")+" | "}});0
|---|
| "+w(c(" "+ -a.tableName+" "))+" |
"+a.tableName+"
"))+"]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)});
+!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r0&&c(n,function(n,u){var c=-1!==h(e(n),["array","object"]);return n===r||t&&o[u]===r?!0:(c&&i&&(n=a(n)),e(o[u])===e(n)&&c?s(t,i,[o[u],n]):o[u]=n,void 0)})}),o}function u(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.parent=t.prototype,e}function c(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function l(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function d(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++ri;i++)if(t[i]===e)return i}return-1}function f(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===h(t[r],i)&&n.push(t[r]);return n.length?n:!1}function p(e,t){var i=[];return c(e,function(e){-1!==h(e,t)&&i.push(e)}),i.length?i:null}function g(e){var t,i=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:E,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,clone:o,inherit:u,each:c,isEmptyObj:l,inSeries:d,inParallel:m,inArray:h,arrayDiff:f,arrayIntersect:p,toArray:g,trim:x,sprintf:w,parseSizeStr:v,delay:y}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(mn;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a=")),i.use_blob_uri},use_data_uri:function(){var e=new Image;return e.onload=function(){i.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return i.use_data_uri&&("IE"!==a.browser||a.version>=9)},use_data_uri_of:function(e){return i.use_data_uri&&33e3>e||i.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),i.use_fileinput=!e.disabled},use_webgl:function(){var e,n=document.createElement("canvas"),r=null;try{r=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(o){}return r||(r=null),e=!!r,i.use_webgl=e,n=t,e}};return function(t){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(i[t])?i[t].apply(this,n):!!i[t]}}(),o=(new n).getResult(),a={can:r,uaParser:n,browser:o.browser.name,version:o.browser.version,os:o.os.name,osVersion:o.os.version,verComp:i,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return a.OS=a.os,a}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t;return e?(e=e.toLowerCase(),t=r[this.uid]&&r[this.uid][e]):t=r[this.uid],t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.getGlobalEventTarget=function(){if(/^moxie\./.test(e.global_event_dispatcher)&&!e.can("access_global_ns")){var i=t.guid("moxie_event_target_");window[i]=function(e,t){n.instance.dispatchEvent(e,t)},e.global_event_dispatcher=i}return e.global_event_dispatcher},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb xlt xla,application/vnd.ms-powerpoint,ppt pps pot ppa,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={},r={},o=function(e){var t,i,o,a=e.split(/,/);for(t=0;ta;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){_&&(_.destroy(),_=null),s.dispatchEvent("loadend"),s=null}function r(r){_.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),_.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),_.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),_.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(_,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(_,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(_,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),_.bind("Abort",function(e){s.dispatchEvent(e),n()}),_.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(_,"XMLHttpRequest","send",{url:x,method:v,async:T,user:w,password:y,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),_=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(_.connectRuntime(k)):(_.bind("RuntimeInit",function(e,t){r(t)}),_.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),_.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,w,y,E,b,_,R,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(w=u||l.user,y=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},hasRequestHeader:function(e){return e&&S[e.toLowerCase()]||!1},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(R||(R={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),R[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),R.hasOwnProperty(t))?R[t].header+": "+R[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!_)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);_.getRuntime().exec.call(_,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){_&&("function"===e.typeOf(_.destroy)&&_.destroy(),_=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){try{return e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name),!0}catch(t){return this.trigger("error",t.code),!1}}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height),r>1&&!s.fit&&(r=1);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,fit:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='
',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,fit:!0,resample:"nearest"},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){this.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy(),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){return n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))},this.destroy=function(){this.getRuntime().getShim().removeInstance(this.uid)}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),(g.can("summon_file_dialog")?c:m).setAttribute("tabindex",-1),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){};try{if(m.status>=200&&m.status<400){s.trigger("load");break}}catch(r){}s.trigger("error")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},w={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=w[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;ii.height?"width":"height",a=Math.round(i[o]*n),s=!1;"nearest"!==r&&(.5>n||n>2)&&(n=.5>n?.5:2,s=!0);var u=t(i,n);return s?e(u,a/u[o],r):u}function t(e,t){var i=e.width,n=e.height,r=Math.round(i*t),o=Math.round(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,y.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t.call(r,this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t.call(this,e.getAsDataURL())}function f(e,i){var n=Math.PI/180,r=document.createElement("canvas"),o=r.getContext("2d"),a=e.width,s=e.height;switch(t.inArray(i,[5,6,7,8])>-1?(r.width=s,r.height=a):(r.width=a,r.height=s),i){case 2:o.translate(a,0),o.scale(-1,1);break;case 3:o.translate(a,s),o.rotate(180*n);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(90*n),o.scale(1,-1);break;case 6:o.rotate(90*n),o.translate(0,-s);break;case 7:o.rotate(90*n),o.translate(a,-s),o.scale(-1,1);break;case 8:o.rotate(-90*n),o.translate(-a,0)}return o.drawImage(e,0,0,a,s),r}function p(){x&&(x.purge(),x=null),w=g=v=y=null,b=!1}var g,x,v,w,y,E=this,b=!1,_=!0;t.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),n=arguments.length>1?arguments[1]:!0;if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return y=e,e.isDetached()?(w=e.getSource(),m.call(this,w),void 0):(h.call(this,e.getSource(),function(e){n&&(w=l(e)),m.call(this,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,y=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?w=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&w&&i.can("access_image_binary")&&(x=new a(w)),t={width:e().width||0,height:e().height||0,type:y.type||u.getFileMime(y.name),size:w&&w.length||y.size||0,name:y.name||"",meta:null},_&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),_=n.preserveHeaders,!_){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;v=f(v,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:y.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:y.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return w||(w=l(E.getAsDataURL(e,t))),w;if("image/jpeg"!==e)w=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}w=l(i),x&&(w=x.stripHeaders(w),_&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),w=x.writeHeaders(w)),x.purge(),x=null)}return b=!1,w},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,a;a=this.getShimContainer(),e.extend(a.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i='","IE"===t.browser?(r=document.createElement("div"),a.appendChild(r),r.outerHTML=i,r=a=null):a.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){var r={init:function(e){var r=this,o=this.getRuntime(),a=i.get(e.browse_button);a&&(a.setAttribute("tabindex",-1),a=null),this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],n.each(e,function(e){r.files.push(new t(o.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=r}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof n)&&(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){function r(e){for(var t="",i=0;ii;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),r.meta&&r.meta.thumb&&r.meta.thumb.data&&!(e.meta.thumb.data instanceof i)&&(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&(i.extend(d.style,{top:"100%"}),d.firstChild.setAttribute("tabindex",-1))),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),g.can("summon_file_dialog")&&h.setAttribute("tabindex",-1),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;this.value&&(i=this.files?this.files[0]:{name:this.value},i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null)},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")?("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})):e.setAttribute("tabindex",-1),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=w.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,w=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),w.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})},destroy:function(){this.getRuntime().getShim().removeInstance(this.uid)}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)});
define("../libs/plupload/js/moxie.min", function(){});
/**
* Plupload - multi-runtime File Uploader
- * v2.3.1
+ * v2.3.6
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
@@ -9939,9 +9995,9 @@ define("../libs/plupload/js/moxie.min", function(){});
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
- * Date: 2017-02-06
+ * Date: 2017-11-03
*/
-!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size&&e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.3.1",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t,n,r=0;for(w.reset(),e=0;eI)&&(r+=n),w.loaded+=n):w.size=i,t.status==l.DONE?w.uploaded++:t.status==l.FAILED?w.failed++:w.queued++;w.size===i?w.percent=x.length>0?Math.ceil(100*(w.uploaded/x.length)):0:(w.bytesPerSec=Math.ceil(r/((+new Date-I||1)/1e3)),w.percent=w.size>0?Math.ceil(100*(w.loaded/w.size)):0)}function c(){var e=U[0]||F[0];return e?e.getRuntime().uid:!1}function f(e,t){if(e.ruid){var i=o.getInfo(e.ruid);if(i)return i.can(t)}return!1}function p(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",_),this.bind("UploadFile",E),this.bind("UploadProgress",v),this.bind("StateChanged",b),this.bind("QueueChanged",d),this.bind("Error",z),this.bind("FileUploaded",R),this.bind("Destroy",O)}function g(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:P,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,U.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){A||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,F.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function h(e,n,r){var s=new t.image.Image;try{s.onload=function(){return n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),r(e)):(s.downsize(n.width,n.height,n.crop,n.preserve_headers),void 0)},s.onresize=function(){r(this.getAsBlob(e.type,n.quality)),this.destroy()},s.onerror=function(){r(e)},s.load(e)}catch(a){r(e)}}function m(e,i,r){function s(e,i,n){var r=S[e];switch(e){case"max_file_size":"max_file_size"===e&&(S.max_file_size=S.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(S[e]=i,S.send_file_name=!0);break;case"multipart":S[e]=i,i||(S.send_file_name=!0);break;case"http_method":S[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":S[e]=i,i&&(S.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(S.filters,i):S.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),S.filters.mime_types=i.mime_types);break;case"resize":S.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":S.prevent_duplicates=S.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":S[e]=i,n||(u=!0);break;default:S[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(S.required_features=n(l.extend({},S)),P=n(l.extend({},S,{required_features:!0}))):u&&(a.trigger("Destroy"),g.call(a,S,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function _(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function E(e,i){function n(){c-->0?r(s,1e3):(i.loaded=g,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function s(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),d&&p.chunks&&o.size>d?(n=Math.min(d,o.size-g),t=o.slice(g,g+n)):(n=o.size,t=o),d&&p.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(g/d),r.chunks=Math.ceil(o.size/d)):(r.offset=g,r.total=o.size)),e.trigger("BeforeChunkUpload",i,r,t,g)&&a(r,t,n))}function a(a,d,f){var h;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,g+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status>=400?(n(),void 0):(c=e.settings.max_retries,f=o.size?(i.size!=i.origSize&&(o.destroy(),o=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(s,1),void 0)},T.onerror=function(){n()},T.onloadend=function(){this.destroy(),T=null},e.settings.multipart&&p.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),h=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){h.append(t,e)}),h.append(e.settings.file_data_name,d),T.send(h,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:P,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:P,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var o,u=e.settings.url,d=e.settings.chunk_size,c=e.settings.max_retries,p=e.features,g=0;i.loaded&&(g=i.loaded=d?d*Math.floor(i.loaded/d):0),o=i.getSource(),!l.isEmptyObj(e.settings.resize)&&f(o,"send_binary_string")&&-1!==l.inArray(o.type,["image/jpeg","image/png"])?h.call(this,o,e.settings.resize,function(e){o=e,i.size=e.size,s()}):s()}function v(e,t){u(t)}function b(e){if(e.state==l.STARTED)I=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function y(){T&&T.abort()}function R(e){d(),r(function(){a.call(e)},1)}function z(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function O(e){e.stop(),l.each(x,function(e){e.destroy()}),x=[],U.length&&(l.each(U,function(e){e.destroy()}),U=[]),F.length&&(l.each(F,function(e){e.destroy()}),F=[]),P={},A=!1,I=T=null,w.reset()}var S,I,w,T,D=l.guid(),x=[],P={},U=[],F=[],A=!1;S={chunk_size:0,file_data_name:"file",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:o.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},m.call(this,e,null,!0),w=new l.QueueProgress,l.extend(this,{id:D,uid:D,state:l.STOPPED,features:{},runtime:null,files:x,settings:S,total:w,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),p.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):S.browse_button||S.drop_element?(g.call(i,S,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){m.call(this,e,t,!this.runtime)},getOption:function(e){return e?S[e]:S},refresh:function(){U.length&&l.each(U,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){A=arguments[0]!==i?arguments[0]:!0,U.length&&l.each(U,function(e){e.disable(A)}),this.trigger("DisableBrowse",A)},getFile:function(e){var t;for(t=x.length-1;t>=0;t--)if(x[t].id===e)return x[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(x.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=x.length-1;i>=0;i--)if(x[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=x.splice(e===i?0:e,t===i?x.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.3.6",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,moxie:t,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.addFileFilter("prevent_empty",function(e,t,n){e&&!t.size&&t.size!==i?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),n(!1)):n(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t,n,r=0;for(I.reset(),e=0;eS)&&(r+=n),I.loaded+=n):I.size=i,t.status==l.DONE?I.uploaded++:t.status==l.FAILED?I.failed++:I.queued++;I.size===i?I.percent=D.length>0?Math.ceil(100*(I.uploaded/D.length)):0:(I.bytesPerSec=Math.ceil(r/((+new Date-S||1)/1e3)),I.percent=I.size>0?Math.ceil(100*(I.loaded/I.size)):0)}function c(){var e=F[0]||P[0];return e?e.getRuntime().uid:!1}function f(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",b),this.bind("BeforeUpload",m),this.bind("UploadFile",_),this.bind("UploadProgress",E),this.bind("StateChanged",v),this.bind("QueueChanged",d),this.bind("Error",R),this.bind("FileUploaded",y),this.bind("Destroy",z)}function p(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:x,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,F.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){U||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,P.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function g(e,n,r,s){var a=new t.image.Image;try{a.onload=function(){n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),s(e)):a.downsize(n.width,n.height,n.crop,n.preserve_headers)},a.onresize=function(){var t=this.getAsBlob(e.type,n.quality);this.destroy(),s(t)},a.bind("error runtimeerror",function(){this.destroy(),s(e)}),a.load(e,r)}catch(o){s(e)}}function h(e,i,r){function s(e,i,n){var r=O[e];switch(e){case"max_file_size":"max_file_size"===e&&(O.max_file_size=O.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(O[e]=i,O.send_file_name=!0);break;case"multipart":O[e]=i,i||(O.send_file_name=!0);break;case"http_method":O[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":O[e]=i,i&&(O.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(O.filters,i):O.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),O.filters.mime_types=i.mime_types);break;case"resize":O.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":O.prevent_duplicates=O.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":O[e]=i,n||(u=!0);break;default:O[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(O.required_features=n(l.extend({},O)),x=n(l.extend({},O,{required_features:!0}))):u&&(a.trigger("Destroy"),p.call(a,O,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function _(e,i){function n(){c-->0?r(s,1e3):(i.loaded=p,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function s(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),d&&f.chunks&&o.size>d?(n=Math.min(d,o.size-p),t=o.slice(p,p+n)):(n=o.size,t=o),d&&f.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(p/d),r.chunks=Math.ceil(o.size/d)):(r.offset=p,r.total=o.size)),e.trigger("BeforeChunkUpload",i,r,t,p)&&a(r,t,n))}function a(a,d,g){var m;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,p+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status<200||T.status>=400?(n(),void 0):(c=e.settings.max_retries,g=o.size?(i.size!=i.origSize&&(o.destroy(),o=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(s,1),void 0)},T.onerror=function(){n()},T.onloadend=function(){this.destroy()},e.settings.multipart&&f.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),m=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){m.append(t,e)}),m.append(e.settings.file_data_name,d),T.send(m,h)):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(d,h))}var o,u=e.settings.url,d=e.settings.chunk_size,c=e.settings.max_retries,f=e.features,p=0,h={runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:x,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url};i.loaded&&(p=i.loaded=d?d*Math.floor(i.loaded/d):0),o=i.getSource(),l.isEmptyObj(e.settings.resize)||-1===l.inArray(o.type,["image/jpeg","image/png"])?s():g(o,e.settings.resize,h,function(e){o=e,i.size=e.size,s()})}function E(e,t){u(t)}function v(e){if(e.state==l.STARTED)S=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function b(){T&&T.abort()}function y(e){d(),r(function(){a.call(e)},1)}function R(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function z(e){e.stop(),l.each(D,function(e){e.destroy()}),D=[],F.length&&(l.each(F,function(e){e.destroy()}),F=[]),P.length&&(l.each(P,function(e){e.destroy()}),P=[]),x={},U=!1,S=T=null,I.reset()}var O,S,I,T,w=l.guid(),D=[],x={},F=[],P=[],U=!1;O={chunk_size:0,file_data_name:"file",filters:{mime_types:[],max_file_size:0,prevent_duplicates:!1,prevent_empty:!0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:o.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},h.call(this,e,null,!0),I=new l.QueueProgress,l.extend(this,{id:w,uid:w,state:l.STOPPED,features:{},runtime:null,files:D,settings:O,total:I,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),f.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):O.browse_button||O.drop_element?(p.call(i,O,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){h.call(this,e,t,!this.runtime)},getOption:function(e){return e?O[e]:O},refresh:function(){F.length&&l.each(F,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){U=arguments[0]!==i?arguments[0]:!0,F.length&&l.each(F,function(e){e.disable(U)}),this.trigger("DisableBrowse",U)},getFile:function(e){var t;for(t=D.length-1;t>=0;t--)if(D[t].id===e)return D[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(D.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=D.length-1;i>=0;i--)if(D[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=D.splice(e===i?0:e,t===i?D.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n, MIT Licensed
* https://github.com/niceue/nice-validator
*/
@@ -11421,12 +11477,12 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un
'for': datafor
});
- if ( _checkable(el) ) {
- var $parent = $el.parent();
- $msgbox.appendTo( $parent.is('label') ? $parent.parent() : $parent );
+ if (container) {
+ $msgbox.appendTo(container);
} else {
- if (container) {
- $msgbox.appendTo(container);
+ if ( _checkable(el) ) {
+ var $parent = $el.parent();
+ $msgbox.appendTo( $parent.is('label') ? $parent.parent() : $parent );
} else {
$msgbox[!msgOpt.pos || msgOpt.pos === 'right' ? 'insertAfter' : 'insertBefore']($el);
}
@@ -12024,7 +12080,7 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un
}
re = '^(?:' + re + ')$';
- return new RegExp(re).test(this.value) || this.messages.integer[key];
+ return new RegExp(re).test(this.value) || (this.messages.integer && this.messages.integer[key]);
},
/**
@@ -12045,6 +12101,7 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un
if (!params) return;
var me = this,
+ isValid = true,
a, b,
key, msg, type = 'eq', parser,
selector2, elem2, field2;
@@ -12092,22 +12149,25 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un
return true;
}
- msg = me.messages.match[type].replace( '{1}', me._getDisplay( element, field2.display || key ) );
-
switch (type) {
case 'lt':
- return (+a < +b) || msg;
+ isValid = +a < +b; break;
case 'lte':
- return (+a <= +b) || msg;
+ isValid = +a <= +b; break;
case 'gte':
- return (+a >= +b) || msg;
+ isValid = +a >= +b; break;
case 'gt':
- return (+a > +b) || msg;
+ isValid = +a > +b; break;
case 'neq':
- return (a !== b) || msg;
+ isValid = a !== b; break;
default:
- return (a === b) || msg;
+ isValid = a === b;
}
+
+ return isValid || (
+ isObject(me.messages.match)
+ && me.messages.match[type].replace( '{1}', me._getDisplay( element, field2.display || key ) )
+ );
},
/**
@@ -12152,7 +12212,7 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un
if (params) {
return me.getRangeMsg(count, params);
} else {
- return !!count || _getDataMsg(elem, me, '') || me.messages.required;
+ return !!count || _getDataMsg(elem, me, '') || me.messages.required || false;
}
},
@@ -12566,6 +12626,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef
parent.$(".btn-refresh").trigger("click");
var index = parent.Layer.getFrameIndex(window.name);
parent.Layer.close(index);
+ return false;
}, function (data, ret) {
that.holdSubmit(false);
submitBtn.removeClass("disabled");
diff --git a/public/assets/js/require-form.js b/public/assets/js/require-form.js
index 3dce566c..6b5fa420 100755
--- a/public/assets/js/require-form.js
+++ b/public/assets/js/require-form.js
@@ -44,6 +44,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
parent.$(".btn-refresh").trigger("click");
var index = parent.Layer.getFrameIndex(window.name);
parent.Layer.close(index);
+ return false;
}, function (data, ret) {
that.holdSubmit(false);
submitBtn.removeClass("disabled");
diff --git a/public/assets/less/backend.less b/public/assets/less/backend.less
index 24dc7033..bb39776b 100644
--- a/public/assets/less/backend.less
+++ b/public/assets/less/backend.less
@@ -1,771 +1,771 @@
-@import (reference) "bootstrap-less/mixins.less";
-@import (reference) "bootstrap-less/variables.less";
-@import (reference) "fastadmin/mixins.less";
-@import (reference) "fastadmin/variables.less";
-@import "lesshat.less";
-
-@import url("../css/bootstrap.min.css");
-@import url("../css/fastadmin.min.css");
-@import url("../css/skins/skin-green.css");
-@import url("../css/iconfont.css");
-@import url("../libs/font-awesome/css/font-awesome.min.css");
-@import url("../libs/toastr/toastr.min.css");
-@import url("../libs/layer/build/skin/default/layer.css");
-@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css");
-@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css");
-@import url("../libs/bootstrap-daterangepicker/daterangepicker.css");
-@import url("../libs/nice-validator/dist/jquery.validator.css");
-@import url("../libs/selectpage/selectpage.css");
-
-@main-bg: #f1f4f6;
-@panel-intro-bg: darken(@main-bg,3%);
-@panel-nav-bg: #fff;
-
-body {
- background:#f1f4f6;
-}
-body.is-dialog {
- background:#fff;
-}
-
-.selection {
- position: absolute;
- border: 1px solid #8B9;
- background-color: #BEC;
-}
-.main-header {
- .logo,.navbar {
- .transition(none);
- }
- .navbar{
- position:relative;
- .sidebar-toggle{
- position:absolute;
- width:45px;
- text-align: center;
- }
- #nav{
- position:absolute;
- left:45px;
- }
- .navbar-custom-menu {
- position:absolute;
- right:0;
- }
- }
-}
-.note-dialog .modal {z-index:1060;}
-
-.bootstrap-dialog .modal-dialog {
- /*width: 70%;*/
- max-width:885px;
-}
-/*iOS兼容*/
-html.ios-fix,html.ios-fix body {
- height: 100%;
- overflow: auto;
- -webkit-overflow-scrolling: touch;
-}
-.content {
- min-height:500px;
-}
-#header {
- background: #fff;
- box-shadow: 0 2px 2px rgba(0,0,0,.05),0 1px 0 rgba(0,0,0,.05);
-}
-.content-wrapper {
- position:relative;
-}
-.control-relative{
- position:relative;
-}
-.tab-addtabs {
- overflow: hidden;
- .tab-pane {
- height: 100%;
- width: 100%;
- }
-}
-
-.row-between{
- .col-xs-6 + .col-xs-6:before {
- content: "-";
- position: absolute;
- left: -2%;
- top: 6px;
- }
-}
-
-@media only screen and (min-width : 481px) {
- .row-flex {
- display: flex;
- flex-wrap: wrap;
- }
- .row-flex > [class*='col-'] {
- display: flex;
- flex-direction: column;
- }
- .row-flex.row:after,
- .row-flex.row:before {
- display: flex;
- }
-}
-.common-search-table {
- min-height: 20px;
- padding: 15px;
- margin-bottom: 15px;
- background-color: #f5f5f5;
-}
-.searchit{
- border-bottom:1px dashed @link-color;
-}
-/* 固定的底部按钮 */
-.fixed-footer {
- position: fixed;
- bottom:0;
- background-color: #ecf0f1;
- width:100%;
- margin-bottom:0;
- padding:10px;
-}
-/* 包裹在layer外层 */
-.layer-footer {
- display:none;
-}
-
-table.table-template{
- overflow:hidden;
-}
-.sp_container .msg-box{
- position: absolute;
- right: 0;
- top: 0;
-}
-.toast-top-right-index{
- top:62px;
- right:12px;
-}
-
-.bootstrap-select .status {
- background: #f0f0f0;
- clear: both;
- color: #999;
- font-size: 12px;
- font-weight: 500;
- line-height: 1;
- margin-bottom: -5px;
- padding: 10px 20px;
-}
-
-.img-center {
- margin:0 auto;
- display: inline;
- float:none;
-}
-
-/*
- * RIBBON
- */
-#ribbon {
- overflow:hidden;
- padding: 15px 15px 0 15px;
- position: relative;
-
- a {
- color: #777 !important;
- text-decoration: none !important;
- }
- .breadcrumb {
- display: inline-block;
- margin: 0;
- padding: 0;
- background: none;
- vertical-align: top;
- }
-
- .breadcrumb > .active,
- .breadcrumb li {
- color: #aaa;
- }
- .shortcut {
- a{
- margin-left:10px;
- }
- }
-
-}
-
-.is-dialog {
- #main {
- background:#fff;
- }
-}
-form.form-horizontal .control-label {
- font-weight: normal;
-}
-
-.user-panel > .image img{
- width:45px;
- height:45px;
-}
-
-/*panel扩展描述样式*/
-.panel-intro {
- margin-bottom:0;
- border:none;
- > .panel-heading {
- padding:15px;
- padding-bottom:0;
- background:@panel-intro-bg;
- border-color:@panel-intro-bg;
- position:relative;
- .panel-lead {
- margin-bottom:15px;
- em {
- display: block;
- font-weight: bold;
- font-style:normal;
- }
- }
-
- .panel-title {
- height:25px;
- font-weight: normal;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- .panel-control {
- height: 42px;
- position:absolute;
- top:8px;
- right:8px;
- .fa {
- font-size:14px;
- }
- }
- .nav-tabs {
- border-bottom:0;
- margin-bottom:0;
- }
-
-
- .nav-tabs > li > a{
- margin-right:4px;
- color: #95a5a6;
- background-color: darken(@panel-intro-bg, 5%);
- border: 1px solid @panel-intro-bg;
- border-bottom-color: transparent;
- }
- .nav-tabs > li > a:hover, .nav-tabs > li > a:focus{
- border: 1px solid @panel-intro-bg;
- color: #7b8a8b;
- background-color: darken(@panel-intro-bg, 10%);
- }
- .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
- color: #7b8a8b;
- background-color: #ffffff;
- border-bottom-color: transparent;
- cursor: default;
- }
- }
-}
-/*单表格*/
-.panel-tabs {
- .panel-heading {
- padding:12px 15px 12px 15px;
- .panel-lead {
- margin-bottom:0px;
- }
- .panel-title {
-
- }
- }
-}
-/*选项卡*/
-.panel-nav {
-
- .panel-heading {
- padding:0px;
- padding-bottom:0;
- background:@main-bg;
- border-color:@main-bg;
- }
- .nav-tabs > li > a{
- padding: 12px 15px;
- background-color: @panel-intro-bg;
- border: 1px solid @main-bg;
- }
- .nav-tabs > li > a:hover, .nav-tabs > li > a:focus{
- border: 1px solid @panel-intro-bg;
- background-color: @panel-intro-bg;
- }
- .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
- border-color: @main-bg;
- border-bottom-color: transparent;
- }
-}
-/*顶栏addtabs*/
-.nav-addtabs{
- &.disable-top-badge {
- > li > a > .pull-right-container{
- display:none;
- }
- }
- border:none;
- > li{
- margin:0;
- > a{
- height:49px;
- line-height:49px;
- padding:0 15px;
- border-radius:0;
- border:none;
- border-right:1px solid rgba(0, 0, 0, 0.05);
- margin:0;
- color:#95a5a6;
- &:hover, &:focus{
- border:none;
- color:#2c3e50;
- border-right:1px solid rgba(0, 0, 0, 0.05);
- }
- i{
- margin-right:3px;
- }
- }
- &.active > a{
- height:49px;line-height:49px;
- padding:0 15px;
- border-radius:0;
- border:none;
- border-right:1px solid rgba(0, 0, 0, 0.05);
- background:#f1f4f6;
- color:#2c3e50;
- overflow:hidden;
- &:hover, &:focus{
- border:none;
- color:#2c3e50;
- border-right:1px solid rgba(0, 0, 0, 0.05);
- background:#f1f4f6;
- }
- }
- .close-tab {
- font-size: 10px;
- position:absolute;
- right: 5px;
- top: 50%;
- margin-top:-7px;
- z-index: 100;
- cursor: hand;
- cursor: pointer;
- color: #fff;
- display:none;
- }
- }
- .open > a{
- &:hover,&:focus{
- border-right:1px solid rgba(0, 0, 0, 0.05);
- }
- }
- ul li {
- position:relative;
- }
- li:hover > .close-tab {
- display:block;
- }
-}
-.main-sidebar .sidebar-form {
- overflow:visible;
- .menuresult {
- z-index:999;
- position: absolute;
- top:34px;
- left:-1px;
- width:100%;
- max-height:250px;
- overflow:auto;
- margin:0;
- border-top:none;
- border-top-left-radius:0;
- border-top-right-radius:0;
- a {
- border-top:1px solid #eee;
- display: block;
- background-color: #fff;
- border-bottom:1px solid #eee;
- margin-bottom:-1px;
- display:block;
- padding: 10px 15px;
- color:#222d32;
- &:hover{
- background:#eee;
- }
- }
- }
-}
-.input-group .sp_result_area {
- width:100%;
-}
-.sidebar-menu{
- &.show-submenu {
- .treeview-menu {
- display: block;
- }
- }
- > li .badge {
- margin-top:0;
- }
-}
-.sidebar-collapse {
- .user-panel > .image img{
- width:25px;
- height:25px;
- }
-}
-
-@media (min-width: 768px){
- .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
- top: 41px;
- }
-}
-
-.fieldlist dd {
- display:block;margin:5px 0;
- input{display: inline-block;width:300px;}
- input:first-child{width:110px;}
- ins{width:110px;display: inline-block;text-decoration:none;font-weight: bold;}
-}
-
-#treeview {
- .jstree-container-ul .jstree-node{
- display:block;clear:both;
- }
- .jstree-leaf:not(:first-child) {
- float:left;
- background:none;
- margin-left:0;
- width:80px;
- clear:none;
- }
- .jstree-leaf {
- float:left;
- margin-left:0;padding-left:24px;
- width:80px;
- clear:none;
- color:#777;
- }
- .jstree-leaf > .jstree-icon,.jstree-leaf .jstree-themeicon{
- display:none;
- }
- .jstree-last{
- background-image: url("../img/32px.png");
- background-position: -292px -4px;
- background-repeat: repeat-y;
- }
- .jstree-children {
- .clearfix();
- }
- .jstree-themeicon {
- display: none;
- }
-}
-
-/*去除bootstrap-table的边框*/
-.fixed-table-container {
- border:none!important;
-}
-
-/*修复nice-validator和summernote的编辑框冲突*/
-.nice-validator .note-editor .note-editing-area .note-editable{
- display:inherit;
-}
-
-/*预览区域*/
-.plupload-preview {
- padding:0 10px;
- margin-bottom:0;
- li {
- margin-top:15px;
- }
- .thumbnail {
- margin-bottom:10px;
- }
- a{
- display:block;
- &:first-child{
- height:90px;
- }
- img{
- height:80px;
- object-fit: cover;
- }
- }
-}
-
-.pjax-loader-bar .progress {
- position: fixed;
- top: 0;
- left: 0;
- height: 2px;
- background: #77b6ff;
- box-shadow: 0 0 10px rgba(119,182,255,0.7);
- -webkit-transition: width 0.4s ease;
- transition: width 0.4s ease;
-}
-.dropdown-menu.text-left {
- a,li{
- text-align: left!important;
- }
-}
-.bootstrap-table .fixed-table-toolbar .dropdown-menu{
- overflow:auto;
-}
-.toolbar{
- margin-top:10px;
- margin-bottom:10px;
-}
-.fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search{
- line-height:inherit;
-}
-.fixed-table-toolbar .toolbar{
- margin-top:0;
- margin-bottom:0;
-}
-
-.bootstrap-table table tbody tr:first-child td .bs-checkbox {
- vertical-align: middle;
-}
-.bootstrap-table td.bs-checkbox {
- vertical-align: middle;
-}
-.dropdown-submenu {
- position: relative;
- >.dropdown-menu {
- overflow:auto;
- top: 0;
- left: 100%;
- margin-top: -6px;
- margin-left: -1px;
- .border-radius(0 6px 6px 6px);
- }
- &:hover {
- >.dropdown-menu {
- display: block;
- }
- >a:after {
- border-left-color: #fff;
- }
- }
- >a:after {
- display: block;
- content: " ";
- float: right;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
- border-width: 5px 0 5px 5px;
- border-left-color: #ccc;
- margin-top: 5px;
- margin-right: -10px;
- }
- &.pull-left {
- float: none;
- >.dropdown-menu {
- left: -100%;
- margin-left: 10px;
- .border-radius(6px 0 6px 6px);
- }
- }
-}
-
-/*重写toast的几个背景色*/
-.toast-primary {
- background-color: #48c9b0!important;
-}
-.toast-success {
- background-color: #18bc9c!important;
-}
-.toast-error {
- background-color: #e74c3c!important;
-}
-.toast-info {
- background-color: #5dade2!important;
-}
-.toast-warning {
- background-color: #f1c40f!important;
-}
-.toast-inverse {
- background-color: #34495e!important;
-}
-.toast-default {
- background-color: #bdc3c7!important;
-}
-#toast-container{
- >div, >div:hover{
- .box-shadow(0 0 3px #eee);
- }
-}
-.layui-layer-fast {
-
- .layui-layer-title {
- background:#2c3e50!important;
- color:#fff!important;
- border-bottom:none;
- //只有当包含layui-layer-title标题时才显示按钮
- ~.layui-layer-setwin{
- top: 0px;
- height:42px;
- > a{
- height:42px;
- line-height:42px;
- display:inline-block;
- }
- }
- }
-
- &.layui-layer-border {
- border:none!important;
- box-shadow: 1px 1px 50px rgba(0,0,0,.3)!important;
- }
- &.layui-layer-iframe {
- //overflow:hidden!important;
- overflow:visible;
- }
- .layui-layer-moves{
- .box-sizing(content-box);
- }
- /*自定义底部灰色操作区*/
- .layui-layer-btn {
- text-align: center!important;
- padding: 10px!important;
- background: #ecf0f1;
- overflow:hidden;
- a {
- background-color: #95a5a6!important;
- border-color: #95a5a6!important;
- color:#fff!important;
- }
- .layui-layer-btn0{
- background-color: #18bc9c!important;
- border-color: #18bc9c!important;
- }
- }
- .layui-layer-footer {
- padding:8px 20px;
- background-color:#ecf0f1;
- height:auto;
- text-align:inherit!important;
- }
-
- .layui-layer-setwin {
- > a {
- background:none!important;
- cite {
- display:none;
- }
- &:after {
- content: "\e625";
- font-family: iconfont;
- font-style: normal;
- font-weight: normal;
- text-decoration: inherit;
- position: absolute;
- font-size: 18px;
- color: #fff;
- margin: 0;
- z-index: 1;
- }
- &:hover {
- text-decoration: none!important;
- background:none!important;
- }
- &:focus {
- text-decoration: none!important;
- }
- }
- .layui-layer-min{
- display:none;
- &:after {
- content: "\e625";
- }
- }
- .layui-layer-max{
- display:none;
- &:after {
- content: "\e623";
- }
- }
- .layui-layer-maxmin{
- display:none;
- &:after {
- content: "\e624";
- }
- }
- .layui-layer-close1{
- &:after {
- content: "\e626";
- }
- }
- //样式二关闭按钮
- .layui-layer-close2,.layui-layer-close2:hover{
- background:url('../libs/layer/build/skin/default/icon.png') no-repeat -149px -31px !important;
- top:-30px;
- right:-30px;
- &:after {
- display:none;
- }
- }
- }
-}
-
-.n-bootstrap {
- .input-group > .n-right {
- position:absolute;
- }
-}
-
-/*手机版样式*/
-@media (max-width: @screen-phone) {
- .nav-addtabs {
- display:none;
- }
- .fixed-table-toolbar {
- .columns-right.btn-group{
- display:none;
- }
- }
-}
-/*平板样式*/
-@media (max-width: @screen-tablet) {
-
- .n-bootstrap {
- .n-right {
- margin-top:0;
- top:-20px;
- position:absolute;
- left:0;
- text-align:right;
- width:100%;
- .msg-wrap {
- position:relative;
- }
- }
- .col-xs-12 > .n-right {
- .msg-wrap {
- margin-right:15px;
- }
- }
- }
-}
-
-/*修复radio和checkbox样式对齐*/
-.radio, .checkbox {
- > label {
- margin-right: 10px;
- > input {
- margin: 2px 0 0;
- }
- }
+@import (reference) "bootstrap-less/mixins.less";
+@import (reference) "bootstrap-less/variables.less";
+@import (reference) "fastadmin/mixins.less";
+@import (reference) "fastadmin/variables.less";
+@import "lesshat.less";
+
+@import url("../css/bootstrap.min.css");
+@import url("../css/fastadmin.min.css");
+@import url("../css/skins/skin-green.css");
+@import url("../css/iconfont.css");
+@import url("../libs/font-awesome/css/font-awesome.min.css");
+@import url("../libs/toastr/toastr.min.css");
+@import url("../libs/layer/build/skin/default/layer.css");
+@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css");
+@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css");
+@import url("../libs/bootstrap-daterangepicker/daterangepicker.css");
+@import url("../libs/nice-validator/dist/jquery.validator.css");
+@import url("../libs/selectpage/selectpage.css");
+
+@main-bg: #f1f4f6;
+@panel-intro-bg: darken(@main-bg,3%);
+@panel-nav-bg: #fff;
+
+body {
+ background:#f1f4f6;
+}
+body.is-dialog {
+ background:#fff;
+}
+
+.selection {
+ position: absolute;
+ border: 1px solid #8B9;
+ background-color: #BEC;
+}
+.main-header {
+ .logo,.navbar {
+ .transition(none);
+ }
+ .navbar{
+ position:relative;
+ .sidebar-toggle{
+ position:absolute;
+ width:45px;
+ text-align: center;
+ }
+ #nav{
+ position:absolute;
+ left:45px;
+ }
+ .navbar-custom-menu {
+ position:absolute;
+ right:0;
+ }
+ }
+}
+.note-dialog .modal {z-index:1060;}
+
+.bootstrap-dialog .modal-dialog {
+ /*width: 70%;*/
+ max-width:885px;
+}
+/*iOS兼容*/
+html.ios-fix,html.ios-fix body {
+ height: 100%;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+}
+.content {
+ min-height:500px;
+}
+#header {
+ background: #fff;
+ box-shadow: 0 2px 2px rgba(0,0,0,.05),0 1px 0 rgba(0,0,0,.05);
+}
+.content-wrapper {
+ position:relative;
+}
+.control-relative{
+ position:relative;
+}
+.tab-addtabs {
+ overflow: hidden;
+ .tab-pane {
+ height: 100%;
+ width: 100%;
+ }
+}
+
+.row-between{
+ .col-xs-6 + .col-xs-6:before {
+ content: "-";
+ position: absolute;
+ left: -2%;
+ top: 6px;
+ }
+}
+
+@media only screen and (min-width : 481px) {
+ .row-flex {
+ display: flex;
+ flex-wrap: wrap;
+ }
+ .row-flex > [class*='col-'] {
+ display: flex;
+ flex-direction: column;
+ }
+ .row-flex.row:after,
+ .row-flex.row:before {
+ display: flex;
+ }
+}
+.common-search-table {
+ min-height: 20px;
+ padding: 15px;
+ margin-bottom: 15px;
+ background-color: #f5f5f5;
+}
+.searchit{
+ border-bottom:1px dashed @link-color;
+}
+/* 固定的底部按钮 */
+.fixed-footer {
+ position: fixed;
+ bottom:0;
+ background-color: #ecf0f1;
+ width:100%;
+ margin-bottom:0;
+ padding:10px;
+}
+/* 包裹在layer外层 */
+.layer-footer {
+ display:none;
+}
+
+table.table-template{
+ overflow:hidden;
+}
+.sp_container .msg-box{
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+.toast-top-right-index{
+ top:62px;
+ right:12px;
+}
+
+.bootstrap-select .status {
+ background: #f0f0f0;
+ clear: both;
+ color: #999;
+ font-size: 12px;
+ font-weight: 500;
+ line-height: 1;
+ margin-bottom: -5px;
+ padding: 10px 20px;
+}
+
+.img-center {
+ margin:0 auto;
+ display: inline;
+ float:none;
+}
+
+/*
+ * RIBBON
+ */
+#ribbon {
+ overflow:hidden;
+ padding: 15px 15px 0 15px;
+ position: relative;
+
+ a {
+ color: #777 !important;
+ text-decoration: none !important;
+ }
+ .breadcrumb {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ background: none;
+ vertical-align: top;
+ }
+
+ .breadcrumb > .active,
+ .breadcrumb li {
+ color: #aaa;
+ }
+ .shortcut {
+ a{
+ margin-left:10px;
+ }
+ }
+
+}
+
+.is-dialog {
+ #main {
+ background:#fff;
+ }
+}
+form.form-horizontal .control-label {
+ font-weight: normal;
+}
+
+.user-panel > .image img{
+ width:45px;
+ height:45px;
+}
+
+/*panel扩展描述样式*/
+.panel-intro {
+ margin-bottom:0;
+ border:none;
+ > .panel-heading {
+ padding:15px;
+ padding-bottom:0;
+ background:@panel-intro-bg;
+ border-color:@panel-intro-bg;
+ position:relative;
+ .panel-lead {
+ margin-bottom:15px;
+ em {
+ display: block;
+ font-weight: bold;
+ font-style:normal;
+ }
+ }
+
+ .panel-title {
+ height:25px;
+ font-weight: normal;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ .panel-control {
+ height: 42px;
+ position:absolute;
+ top:8px;
+ right:8px;
+ .fa {
+ font-size:14px;
+ }
+ }
+ .nav-tabs {
+ border-bottom:0;
+ margin-bottom:0;
+ }
+
+
+ .nav-tabs > li > a{
+ margin-right:4px;
+ color: #95a5a6;
+ background-color: darken(@panel-intro-bg, 5%);
+ border: 1px solid @panel-intro-bg;
+ border-bottom-color: transparent;
+ }
+ .nav-tabs > li > a:hover, .nav-tabs > li > a:focus{
+ border: 1px solid @panel-intro-bg;
+ color: #7b8a8b;
+ background-color: darken(@panel-intro-bg, 10%);
+ }
+ .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
+ color: #7b8a8b;
+ background-color: #ffffff;
+ border-bottom-color: transparent;
+ cursor: default;
+ }
+ }
+}
+/*单表格*/
+.panel-tabs {
+ .panel-heading {
+ padding:12px 15px 12px 15px;
+ .panel-lead {
+ margin-bottom:0px;
+ }
+ .panel-title {
+
+ }
+ }
+}
+/*选项卡*/
+.panel-nav {
+
+ .panel-heading {
+ padding:0px;
+ padding-bottom:0;
+ background:@main-bg;
+ border-color:@main-bg;
+ }
+ .nav-tabs > li > a{
+ padding: 12px 15px;
+ background-color: @panel-intro-bg;
+ border: 1px solid @main-bg;
+ }
+ .nav-tabs > li > a:hover, .nav-tabs > li > a:focus{
+ border: 1px solid @panel-intro-bg;
+ background-color: @panel-intro-bg;
+ }
+ .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
+ border-color: @main-bg;
+ border-bottom-color: transparent;
+ }
+}
+/*顶栏addtabs*/
+.nav-addtabs{
+ &.disable-top-badge {
+ > li > a > .pull-right-container{
+ display:none;
+ }
+ }
+ border:none;
+ > li{
+ margin:0;
+ > a{
+ height:49px;
+ line-height:49px;
+ padding:0 15px;
+ border-radius:0;
+ border:none;
+ border-right:1px solid rgba(0, 0, 0, 0.05);
+ margin:0;
+ color:#95a5a6;
+ &:hover, &:focus{
+ border:none;
+ color:#2c3e50;
+ border-right:1px solid rgba(0, 0, 0, 0.05);
+ }
+ i{
+ margin-right:3px;
+ }
+ }
+ &.active > a{
+ height:49px;line-height:49px;
+ padding:0 15px;
+ border-radius:0;
+ border:none;
+ border-right:1px solid rgba(0, 0, 0, 0.05);
+ background:#f1f4f6;
+ color:#2c3e50;
+ overflow:hidden;
+ &:hover, &:focus{
+ border:none;
+ color:#2c3e50;
+ border-right:1px solid rgba(0, 0, 0, 0.05);
+ background:#f1f4f6;
+ }
+ }
+ .close-tab {
+ font-size: 10px;
+ position:absolute;
+ right: 5px;
+ top: 50%;
+ margin-top:-7px;
+ z-index: 100;
+ cursor: hand;
+ cursor: pointer;
+ color: #fff;
+ display:none;
+ }
+ }
+ .open > a{
+ &:hover,&:focus{
+ border-right:1px solid rgba(0, 0, 0, 0.05);
+ }
+ }
+ ul li {
+ position:relative;
+ }
+ li:hover > .close-tab {
+ display:block;
+ }
+}
+.main-sidebar .sidebar-form {
+ overflow:visible;
+ .menuresult {
+ z-index:999;
+ position: absolute;
+ top:34px;
+ left:-1px;
+ width:100%;
+ max-height:250px;
+ overflow:auto;
+ margin:0;
+ border-top:none;
+ border-top-left-radius:0;
+ border-top-right-radius:0;
+ a {
+ border-top:1px solid #eee;
+ display: block;
+ background-color: #fff;
+ border-bottom:1px solid #eee;
+ margin-bottom:-1px;
+ display:block;
+ padding: 10px 15px;
+ color:#222d32;
+ &:hover{
+ background:#eee;
+ }
+ }
+ }
+}
+.input-group .sp_result_area {
+ width:100%;
+}
+.sidebar-menu{
+ &.show-submenu {
+ .treeview-menu {
+ display: block;
+ }
+ }
+ > li .badge {
+ margin-top:0;
+ }
+}
+.sidebar-collapse {
+ .user-panel > .image img{
+ width:25px;
+ height:25px;
+ }
+}
+
+@media (min-width: 768px){
+ .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
+ top: 41px;
+ }
+}
+
+.fieldlist dd {
+ display:block;margin:5px 0;
+ input{display: inline-block;width:300px;}
+ input:first-child{width:110px;}
+ ins{width:110px;display: inline-block;text-decoration:none;font-weight: bold;}
+}
+
+#treeview {
+ .jstree-container-ul .jstree-node{
+ display:block;clear:both;
+ }
+ .jstree-leaf:not(:first-child) {
+ float:left;
+ background:none;
+ margin-left:0;
+ width:80px;
+ clear:none;
+ }
+ .jstree-leaf {
+ float:left;
+ margin-left:0;padding-left:24px;
+ width:80px;
+ clear:none;
+ color:#777;
+ }
+ .jstree-leaf > .jstree-icon,.jstree-leaf .jstree-themeicon{
+ display:none;
+ }
+ .jstree-last{
+ background-image: url("../img/32px.png");
+ background-position: -292px -4px;
+ background-repeat: repeat-y;
+ }
+ .jstree-children {
+ .clearfix();
+ }
+ .jstree-themeicon {
+ display: none;
+ }
+}
+
+/*去除bootstrap-table的边框*/
+.fixed-table-container {
+ border:none!important;
+}
+
+/*修复nice-validator和summernote的编辑框冲突*/
+.nice-validator .note-editor .note-editing-area .note-editable{
+ display:inherit;
+}
+
+/*预览区域*/
+.plupload-preview {
+ padding:0 10px;
+ margin-bottom:0;
+ li {
+ margin-top:15px;
+ }
+ .thumbnail {
+ margin-bottom:10px;
+ }
+ a{
+ display:block;
+ &:first-child{
+ height:90px;
+ }
+ img{
+ height:80px;
+ object-fit: cover;
+ }
+ }
+}
+
+.pjax-loader-bar .progress {
+ position: fixed;
+ top: 0;
+ left: 0;
+ height: 2px;
+ background: #77b6ff;
+ box-shadow: 0 0 10px rgba(119,182,255,0.7);
+ -webkit-transition: width 0.4s ease;
+ transition: width 0.4s ease;
+}
+.dropdown-menu.text-left {
+ a,li{
+ text-align: left!important;
+ }
+}
+.bootstrap-table .fixed-table-toolbar .dropdown-menu{
+ overflow:auto;
+}
+.toolbar{
+ margin-top:10px;
+ margin-bottom:10px;
+}
+.fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search{
+ line-height:inherit;
+}
+.fixed-table-toolbar .toolbar{
+ margin-top:0;
+ margin-bottom:0;
+}
+
+.bootstrap-table table tbody tr:first-child td .bs-checkbox {
+ vertical-align: middle;
+}
+.bootstrap-table td.bs-checkbox {
+ vertical-align: middle;
+}
+.dropdown-submenu {
+ position: relative;
+ >.dropdown-menu {
+ overflow:auto;
+ top: 0;
+ left: 100%;
+ margin-top: -6px;
+ margin-left: -1px;
+ .border-radius(0 6px 6px 6px);
+ }
+ &:hover {
+ >.dropdown-menu {
+ display: block;
+ }
+ >a:after {
+ border-left-color: #fff;
+ }
+ }
+ >a:after {
+ display: block;
+ content: " ";
+ float: right;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid;
+ border-width: 5px 0 5px 5px;
+ border-left-color: #ccc;
+ margin-top: 5px;
+ margin-right: -10px;
+ }
+ &.pull-left {
+ float: none;
+ >.dropdown-menu {
+ left: -100%;
+ margin-left: 10px;
+ .border-radius(6px 0 6px 6px);
+ }
+ }
+}
+
+/*重写toast的几个背景色*/
+.toast-primary {
+ background-color: #48c9b0!important;
+}
+.toast-success {
+ background-color: #18bc9c!important;
+}
+.toast-error {
+ background-color: #e74c3c!important;
+}
+.toast-info {
+ background-color: #5dade2!important;
+}
+.toast-warning {
+ background-color: #f1c40f!important;
+}
+.toast-inverse {
+ background-color: #34495e!important;
+}
+.toast-default {
+ background-color: #bdc3c7!important;
+}
+#toast-container{
+ >div, >div:hover{
+ .box-shadow(0 0 3px #eee);
+ }
+}
+.layui-layer-fast {
+
+ .layui-layer-title {
+ background:#2c3e50!important;
+ color:#fff!important;
+ border-bottom:none;
+ //只有当包含layui-layer-title标题时才显示按钮
+ ~.layui-layer-setwin{
+ top: 0px;
+ height:42px;
+ > a{
+ height:42px;
+ line-height:42px;
+ display:inline-block;
+ }
+ }
+ }
+
+ &.layui-layer-border {
+ border:none!important;
+ box-shadow: 1px 1px 50px rgba(0,0,0,.3)!important;
+ }
+ &.layui-layer-iframe {
+ //overflow:hidden!important;
+ overflow:visible;
+ }
+ .layui-layer-moves{
+ .box-sizing(content-box);
+ }
+ /*自定义底部灰色操作区*/
+ .layui-layer-btn {
+ text-align: center!important;
+ padding: 10px!important;
+ background: #ecf0f1;
+ overflow:hidden;
+ a {
+ background-color: #95a5a6!important;
+ border-color: #95a5a6!important;
+ color:#fff!important;
+ }
+ .layui-layer-btn0{
+ background-color: #18bc9c!important;
+ border-color: #18bc9c!important;
+ }
+ }
+ .layui-layer-footer {
+ padding:8px 20px;
+ background-color:#ecf0f1;
+ height:auto;
+ text-align:inherit!important;
+ }
+
+ .layui-layer-setwin {
+ > a {
+ background:none!important;
+ cite {
+ display:none;
+ }
+ &:after {
+ content: "\e625";
+ font-family: iconfont;
+ font-style: normal;
+ font-weight: normal;
+ text-decoration: inherit;
+ position: absolute;
+ font-size: 18px;
+ color: #fff;
+ margin: 0;
+ z-index: 1;
+ }
+ &:hover {
+ text-decoration: none!important;
+ background:none!important;
+ }
+ &:focus {
+ text-decoration: none!important;
+ }
+ }
+ .layui-layer-min{
+ display:none;
+ &:after {
+ content: "\e625";
+ }
+ }
+ .layui-layer-max{
+ display:none;
+ &:after {
+ content: "\e623";
+ }
+ }
+ .layui-layer-maxmin{
+ display:none;
+ &:after {
+ content: "\e624";
+ }
+ }
+ .layui-layer-close1{
+ &:after {
+ content: "\e626";
+ }
+ }
+ //样式二关闭按钮
+ .layui-layer-close2,.layui-layer-close2:hover{
+ background:url('../libs/layer/build/skin/default/icon.png') no-repeat -149px -31px !important;
+ top:-30px;
+ right:-30px;
+ &:after {
+ display:none;
+ }
+ }
+ }
+}
+
+.n-bootstrap {
+ .input-group > .n-right {
+ position:absolute;
+ }
+}
+
+/*手机版样式*/
+@media (max-width: @screen-phone) {
+ .nav-addtabs {
+ display:none;
+ }
+ .fixed-table-toolbar {
+ .columns-right.btn-group{
+ display:none;
+ }
+ }
+}
+/*平板样式*/
+@media (max-width: @screen-tablet) {
+
+ .n-bootstrap {
+ .n-right {
+ margin-top:0;
+ top:-20px;
+ position:absolute;
+ left:0;
+ text-align:right;
+ width:100%;
+ .msg-wrap {
+ position:relative;
+ }
+ }
+ .col-xs-12 > .n-right {
+ .msg-wrap {
+ margin-right:15px;
+ }
+ }
+ }
+}
+
+/*修复radio和checkbox样式对齐*/
+.radio, .checkbox {
+ > label {
+ margin-right: 10px;
+ > input {
+ margin: 2px 0 0;
+ }
+ }
}
\ No newline at end of file
diff --git a/public/assets/less/frontend.less b/public/assets/less/frontend.less
index fcd9ee02..76dcc658 100644
--- a/public/assets/less/frontend.less
+++ b/public/assets/less/frontend.less
@@ -1,12 +1,12 @@
-@import (reference) "bootstrap-less/mixins.less";
-@import (reference) "bootstrap-less/variables.less";
-@import "lesshat.less";
-
-@import url("../css/bootstrap.min.css");
-@import url("../css/fastadmin.min.css");
-@import url("../css/skins/skin-green.css");
-@import url("../css/iconfont.css");
-@import url("../libs/font-awesome/css/font-awesome.min.css");
-@import url("../libs/toastr/toastr.min.css");
-@import url("../libs/layer/build/skin/default/layer.css");
-
+@import (reference) "bootstrap-less/mixins.less";
+@import (reference) "bootstrap-less/variables.less";
+@import "lesshat.less";
+
+@import url("../css/bootstrap.min.css");
+@import url("../css/fastadmin.min.css");
+@import url("../css/skins/skin-green.css");
+@import url("../css/iconfont.css");
+@import url("../libs/font-awesome/css/font-awesome.min.css");
+@import url("../libs/toastr/toastr.min.css");
+@import url("../libs/layer/build/skin/default/layer.css");
+
diff --git a/public/index.php b/public/index.php
index 9ebd9e3a..249ed699 100755
--- a/public/index.php
+++ b/public/index.php
@@ -1,24 +1,24 @@
-
-// +----------------------------------------------------------------------
-// [ 应用入口文件 ]
-// 定义应用目录
-define('APP_PATH', __DIR__ . '/../application/');
-
-// 判断是否安装FastAdmin
-if (!file_exists(APP_PATH . 'admin/command/Install/install.lock'))
-{
- header("location:./install.php");
- exit;
-}
-
-// 加载框架引导文件
-require __DIR__ . '/../thinkphp/start.php';
+
+// +----------------------------------------------------------------------
+// [ 应用入口文件 ]
+// 定义应用目录
+define('APP_PATH', __DIR__ . '/../application/');
+
+// 判断是否安装FastAdmin
+if (!file_exists(APP_PATH . 'admin/command/Install/install.lock'))
+{
+ header("location:./install.php");
+ exit;
+}
+
+// 加载框架引导文件
+require __DIR__ . '/../thinkphp/start.php';
diff --git a/public/robots.txt b/public/robots.txt
index a82d96e8..eb053628 100755
--- a/public/robots.txt
+++ b/public/robots.txt
@@ -1,2 +1,2 @@
-User-agent: *
-Disallow:
+User-agent: *
+Disallow:
diff --git a/public/router.php b/public/router.php
index 635b4bfc..6ba1fabf 100755
--- a/public/router.php
+++ b/public/router.php
@@ -1,17 +1,17 @@
-
-// +----------------------------------------------------------------------
-// $Id$
-
-if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"])) {
- return false;
-} else {
- require __DIR__ . "/index.php";
-}
+
+// +----------------------------------------------------------------------
+// $Id$
+
+if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"])) {
+ return false;
+} else {
+ require __DIR__ . "/index.php";
+}
diff --git a/think b/think
index 33022aff..8afa938a 100755
--- a/think
+++ b/think
@@ -1,17 +1,17 @@
-#!/usr/bin/env php
-
-// +----------------------------------------------------------------------
-
-// 定义项目路径
-define('APP_PATH', __DIR__ . '/application/');
-
-// 加载框架引导文件
+#!/usr/bin/env php
+
+// +----------------------------------------------------------------------
+
+// 定义项目路径
+define('APP_PATH', __DIR__ . '/application/');
+
+// 加载框架引导文件
require './thinkphp/console.php';
\ No newline at end of file