From 93e29ad7d5c9ba017252cb7b25aca94657023dd7 Mon Sep 17 00:00:00 2001 From: nancylizi Date: Mon, 20 Mar 2017 16:47:42 +0800 Subject: Resolve the dependent problem. Issue-Id: CLIENT-171 Change-Id: Ifad1deec7b7c737b5b2e44950720189248c2666d Signed-off-by: nancylizi --- catalog/src/main/webapp/catalog/csarPackage.html | 46 +- catalog/src/main/webapp/catalog/nodesDetail.html | 28 +- catalog/src/main/webapp/catalog/template.html | 26 +- .../src/main/webapp/catalog/templateDetail.html | 28 +- .../src/main/webapp/catalog/topologyDetail.html | 28 +- .../main/webapp/thirdparty/animate/animate.min.css | 6 + common/src/main/webapp/thirdparty/avalon/avalon.js | 5819 ++ .../main/webapp/thirdparty/avalon/avalon.modern.js | 4935 ++ .../src/main/webapp/thirdparty/bootbox/LICENSE.md | 23 + .../src/main/webapp/thirdparty/bootbox/README.md | 91 + .../main/webapp/thirdparty/bootbox/bootbox.min.js | 6 + .../bootstrap-growl/bootstrap-growl.min.js | 2 + .../thirdparty/bootstrap/css/bootstrap-dt.css | 5804 ++ .../thirdparty/bootstrap/css/bootstrap.min.css | 7 + .../fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20127 bytes .../fonts/glyphicons-halflings-regular.svg | 288 + .../fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 45404 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23424 bytes .../fonts/glyphicons-halflings-regular.woff2 | Bin 0 -> 18028 bytes .../webapp/thirdparty/bootstrap/js/bootstrap.js | 1951 + .../thirdparty/bootstrap/js/bootstrap.min.js | 6 + .../bootstrap/js/bootstrap2-typeahead.min.js | 21 + common/src/main/webapp/thirdparty/cometd/cometd.js | 3045 ++ .../thirdparty/cometd/cometd/AckExtension.js | 112 + .../thirdparty/cometd/cometd/ReloadExtension.js | 234 + .../thirdparty/cometd/cometd/TimeStampExtension.js | 42 + .../thirdparty/cometd/cometd/TimeSyncExtension.js | 216 + .../thirdparty/cometd/jquery/jquery.cometd-ack.js | 34 + .../cometd/jquery/jquery.cometd-reload.js | 42 + .../cometd/jquery/jquery.cometd-timestamp.js | 34 + .../cometd/jquery/jquery.cometd-timesync.js | 34 + .../thirdparty/cometd/jquery/jquery.cometd.js | 139 + .../main/webapp/thirdparty/css/ngict-component.css | 789 + common/src/main/webapp/thirdparty/css/plugins.css | 1561 + common/src/main/webapp/thirdparty/css/style.css | 4715 ++ .../webapp/thirdparty/css/uniform.default.min.css | 1 + .../webapp/thirdparty/data-tables/DT_bootstrap.css | 240 + .../webapp/thirdparty/data-tables/DT_bootstrap.js | 363 + .../webapp/thirdparty/data-tables/DataTableICT.js | 1459 + .../thirdparty/data-tables/DataTableSmartClient.js | 1215 + .../data-tables/DataTableSmartClientApp.js | 1312 + .../data-tables/app-test-i18n-datatable-zh-CN.json | 51 + .../app-universal-i18n-datatable-en-US.json | 89 + .../app-universal-i18n-datatable-zh-CN.json | 90 + .../webapp/thirdparty/data-tables/dataTable.html | 155 + .../data-tables/dataTables.bootstrap.css | 331 + .../data-tables/images/loading-spinner-grey.gif | Bin 0 -> 5203 bytes .../thirdparty/data-tables/images/sort_asc.png | Bin 0 -> 1118 bytes .../thirdparty/data-tables/images/sort_both.png | Bin 0 -> 1136 bytes .../thirdparty/data-tables/images/sort_desc.png | Bin 0 -> 1127 bytes .../data-tables/jquery.dataTables-1.9.4.js | 12101 ++++ .../data-tables/jquery.dataTables-1.9.4.min.js | 155 + .../thirdparty/data-tables/jquery.dataTables.js | 15268 ++++++ .../data-tables/jquery.dataTables.min.css | 1 + .../data-tables/jquery.dataTables.min.js | 166 + .../thirdparty/data-tables/style-datatable.css | 154 + .../main/webapp/thirdparty/echarts/echarts-all.js | 50 + .../src/main/webapp/thirdparty/echarts/echarts.js | 54502 +++++++++++++++++++ .../thirdparty/font-awesome/css/font-awesome.css | 1672 + .../font-awesome/css/font-awesome.min.css | 4 + .../thirdparty/font-awesome/fonts/FontAwesome.otf | Bin 0 -> 85908 bytes .../font-awesome/fonts/fontawesome-webfont.eot | Bin 0 -> 56006 bytes .../font-awesome/fonts/fontawesome-webfont.svg | 520 + .../font-awesome/fonts/fontawesome-webfont.ttf | Bin 0 -> 112160 bytes .../font-awesome/fonts/fontawesome-webfont.woff | Bin 0 -> 65452 bytes .../font-awesome/less/bordered-pulled.less | 16 + .../webapp/thirdparty/font-awesome/less/core.less | 11 + .../thirdparty/font-awesome/less/fixed-width.less | 6 + .../thirdparty/font-awesome/less/font-awesome.less | 17 + .../webapp/thirdparty/font-awesome/less/icons.less | 552 + .../thirdparty/font-awesome/less/larger.less | 13 + .../webapp/thirdparty/font-awesome/less/list.less | 19 + .../thirdparty/font-awesome/less/mixins.less | 25 + .../webapp/thirdparty/font-awesome/less/path.less | 14 + .../font-awesome/less/rotated-flipped.less | 20 + .../thirdparty/font-awesome/less/spinning.less | 29 + .../thirdparty/font-awesome/less/stacked.less | 20 + .../thirdparty/font-awesome/less/variables.less | 561 + .../font-awesome/scss/_bordered-pulled.scss | 16 + .../webapp/thirdparty/font-awesome/scss/_core.scss | 11 + .../thirdparty/font-awesome/scss/_fixed-width.scss | 6 + .../thirdparty/font-awesome/scss/_icons.scss | 552 + .../thirdparty/font-awesome/scss/_larger.scss | 13 + .../webapp/thirdparty/font-awesome/scss/_list.scss | 19 + .../thirdparty/font-awesome/scss/_mixins.scss | 25 + .../webapp/thirdparty/font-awesome/scss/_path.scss | 14 + .../font-awesome/scss/_rotated-flipped.scss | 20 + .../thirdparty/font-awesome/scss/_spinning.scss | 29 + .../thirdparty/font-awesome/scss/_stacked.scss | 20 + .../thirdparty/font-awesome/scss/_variables.scss | 561 + .../thirdparty/font-awesome/scss/font-awesome.scss | 17 + .../jQuery-File-Upload/css/jquery.fileupload.css | 37 + .../thirdparty/jQuery-File-Upload/img/loading.gif | Bin 0 -> 3897 bytes .../jQuery-File-Upload/img/progressbar.gif | Bin 0 -> 3323 bytes .../jQuery-File-Upload/js/jquery.fileupload.js | 1477 + .../js/jquery.iframe-transport.js | 217 + .../js/vendor/jquery.ui.widget.js | 572 + .../webapp/thirdparty/jquery-validation/README.md | 72 + .../jquery-validation/dist/additional-methods.js | 617 + .../dist/additional-methods.min.js | 11 + .../jquery-validation/dist/jquery.validate.js | 1231 + .../jquery-validation/dist/jquery.validate.min.js | 12 + .../jquery-validation/js/additional-methods.js | 928 + .../jquery-validation/js/additional-methods.min.js | 4 + .../jquery-validation/js/jquery.validate.js | 1357 + .../jquery-validation/js/jquery.validate.min.js | 4 + .../js/localization/messages_ar.js | 33 + .../js/localization/messages_ar.min.js | 4 + .../js/localization/messages_bg.js | 33 + .../js/localization/messages_bg.min.js | 4 + .../js/localization/messages_ca.js | 33 + .../js/localization/messages_ca.min.js | 4 + .../js/localization/messages_cs.js | 33 + .../js/localization/messages_cs.min.js | 4 + .../js/localization/messages_da.js | 30 + .../js/localization/messages_da.min.js | 4 + .../js/localization/messages_de.js | 30 + .../js/localization/messages_de.min.js | 4 + .../js/localization/messages_el.js | 33 + .../js/localization/messages_el.min.js | 4 + .../js/localization/messages_es.js | 36 + .../js/localization/messages_es.min.js | 4 + .../js/localization/messages_es_AR.js | 37 + .../js/localization/messages_es_AR.min.js | 4 + .../js/localization/messages_et.js | 31 + .../js/localization/messages_et.min.js | 4 + .../js/localization/messages_eu.js | 33 + .../js/localization/messages_eu.min.js | 4 + .../js/localization/messages_fa.js | 36 + .../js/localization/messages_fa.min.js | 4 + .../js/localization/messages_fi.js | 31 + .../js/localization/messages_fi.min.js | 4 + .../js/localization/messages_fr.js | 59 + .../js/localization/messages_fr.min.js | 4 + .../js/localization/messages_gl.js | 38 + .../js/localization/messages_gl.min.js | 4 + .../js/localization/messages_he.js | 33 + .../js/localization/messages_he.min.js | 4 + .../js/localization/messages_hr.js | 33 + .../js/localization/messages_hr.min.js | 4 + .../js/localization/messages_hu.js | 32 + .../js/localization/messages_hu.min.js | 4 + .../js/localization/messages_id.js | 32 + .../js/localization/messages_id.min.js | 4 + .../js/localization/messages_is.js | 31 + .../js/localization/messages_is.min.js | 4 + .../js/localization/messages_it.js | 36 + .../js/localization/messages_it.min.js | 4 + .../js/localization/messages_ja.js | 33 + .../js/localization/messages_ja.min.js | 4 + .../js/localization/messages_ka.js | 33 + .../js/localization/messages_ka.min.js | 4 + .../js/localization/messages_kk.js | 33 + .../js/localization/messages_kk.min.js | 4 + .../js/localization/messages_ko.js | 33 + .../js/localization/messages_ko.min.js | 4 + .../js/localization/messages_lt.js | 33 + .../js/localization/messages_lt.min.js | 4 + .../js/localization/messages_lv.js | 33 + .../js/localization/messages_lv.min.js | 4 + .../js/localization/messages_my.js | 33 + .../js/localization/messages_my.min.js | 4 + .../js/localization/messages_nl.js | 43 + .../js/localization/messages_nl.min.js | 4 + .../js/localization/messages_no.js | 33 + .../js/localization/messages_no.min.js | 4 + .../js/localization/messages_pl.js | 33 + .../js/localization/messages_pl.min.js | 4 + .../js/localization/messages_pt_BR.js | 37 + .../js/localization/messages_pt_BR.min.js | 4 + .../js/localization/messages_pt_PT.js | 37 + .../js/localization/messages_pt_PT.min.js | 4 + .../js/localization/messages_ro.js | 33 + .../js/localization/messages_ro.min.js | 4 + .../js/localization/messages_ru.js | 33 + .../js/localization/messages_ru.min.js | 4 + .../js/localization/messages_si.js | 33 + .../js/localization/messages_si.min.js | 4 + .../js/localization/messages_sk.js | 30 + .../js/localization/messages_sk.min.js | 4 + .../js/localization/messages_sl.js | 33 + .../js/localization/messages_sl.min.js | 4 + .../js/localization/messages_sr.js | 33 + .../js/localization/messages_sr.min.js | 4 + .../js/localization/messages_sr_lat.js | 33 + .../js/localization/messages_sr_lat.min.js | 4 + .../js/localization/messages_sv.js | 31 + .../js/localization/messages_sv.min.js | 4 + .../js/localization/messages_th.js | 33 + .../js/localization/messages_th.min.js | 4 + .../js/localization/messages_tj.js | 33 + .../js/localization/messages_tj.min.js | 4 + .../js/localization/messages_tr.js | 33 + .../js/localization/messages_tr.min.js | 4 + .../js/localization/messages_uk.js | 33 + .../js/localization/messages_uk.min.js | 4 + .../js/localization/messages_vi.js | 33 + .../js/localization/messages_vi.min.js | 4 + .../js/localization/messages_zh.js | 33 + .../js/localization/messages_zh.min.js | 4 + .../js/localization/messages_zh_TW.js | 34 + .../js/localization/messages_zh_TW.min.js | 4 + .../js/localization/methods_de.js | 22 + .../js/localization/methods_de.min.js | 4 + .../js/localization/methods_es_CL.js | 22 + .../js/localization/methods_es_CL.min.js | 4 + .../js/localization/methods_fi.js | 22 + .../js/localization/methods_fi.min.js | 4 + .../js/localization/methods_nl.js | 19 + .../js/localization/methods_nl.min.js | 4 + .../js/localization/methods_pt.js | 19 + .../js/localization/methods_pt.min.js | 4 + .../jquery.i18n/jquery.i18n.properties-1.0.9.js | 479 + .../webapp/thirdparty/jquery/jquery-1.10.2.min.js | 4 + .../main/webapp/thirdparty/jquery/jquery-1.11.2.js | 10346 ++++ .../webapp/thirdparty/jquery/jquery-1.11.2.min.js | 4 + .../webapp/thirdparty/jquery/jquery-1.11.2.min.map | 1 + .../webapp/thirdparty/jquery/jquery-1.4.4.min.js | 167 + .../main/webapp/thirdparty/jquery/jquery-2.1.3.js | 9205 ++++ .../webapp/thirdparty/jquery/jquery-2.1.3.min.js | 4 + .../webapp/thirdparty/jquery/jquery-2.1.3.min.map | 1 + .../thirdparty/jquery/jquery-migrate-1.2.1.js | 521 + .../thirdparty/jquery/jquery-migrate-1.2.1.min.js | 2 + .../main/webapp/thirdparty/jquery/jquery.reveal.js | 152 + common/src/main/webapp/thirdparty/js/core/const.js | 46 + .../src/main/webapp/thirdparty/js/core/hk.min.js | 819 + .../webapp/thirdparty/js/core/load_menuList.js | 70 + .../webapp/thirdparty/js/core/openoFrameWork.js | 3701 ++ .../src/main/webapp/thirdparty/js/core/pym.min.js | 16 + common/src/main/webapp/thirdparty/js/tools.js | 1021 + .../src/main/webapp/thirdparty/uniform/README.md | 389 + .../thirdparty/uniform/css/uniform.default.css | 366 + .../thirdparty/uniform/css/uniform.default.min.css | 1 + .../thirdparty/uniform/css/uniform.default.scss | 150 + .../thirdparty/uniform/images/bg-input-focus.png | Bin 0 -> 143 bytes .../webapp/thirdparty/uniform/images/bg-input.png | Bin 0 -> 143 bytes .../webapp/thirdparty/uniform/images/sprite.png | Bin 0 -> 31815 bytes .../thirdparty/uniform/images/sprite_original.png | Bin 0 -> 34229 bytes .../webapp/thirdparty/uniform/jquery.uniform.js | 1068 + .../thirdparty/uniform/jquery.uniform.min.js | 1 + extsys/src/main/webapp/extsys/vim/vimChart.html | 28 +- extsys/src/main/webapp/extsys/vim/vimView.html | 34 +- extsys/src/main/webapp/extsys/vnfm/vnfmView.html | 32 +- login/src/main/webapp/login/css/datatable-sort.css | 30 + login/src/main/webapp/login/css/fileupload.css | 81 + login/src/main/webapp/login/css/package.css | 470 + login/src/main/webapp/login/css/template.css | 405 + login/src/main/webapp/login/css/templateDetail.css | 480 + login/src/main/webapp/login/css/topology.css | 393 + login/src/main/webapp/login/css/vnfm.css | 491 + 250 files changed, 161953 insertions(+), 125 deletions(-) create mode 100644 common/src/main/webapp/thirdparty/animate/animate.min.css create mode 100644 common/src/main/webapp/thirdparty/avalon/avalon.js create mode 100644 common/src/main/webapp/thirdparty/avalon/avalon.modern.js create mode 100644 common/src/main/webapp/thirdparty/bootbox/LICENSE.md create mode 100644 common/src/main/webapp/thirdparty/bootbox/README.md create mode 100644 common/src/main/webapp/thirdparty/bootbox/bootbox.min.js create mode 100644 common/src/main/webapp/thirdparty/bootstrap-growl/bootstrap-growl.min.js create mode 100644 common/src/main/webapp/thirdparty/bootstrap/css/bootstrap-dt.css create mode 100644 common/src/main/webapp/thirdparty/bootstrap/css/bootstrap.min.css create mode 100644 common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.eot create mode 100644 common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.svg create mode 100644 common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.ttf create mode 100644 common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.woff create mode 100644 common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.woff2 create mode 100644 common/src/main/webapp/thirdparty/bootstrap/js/bootstrap.js create mode 100644 common/src/main/webapp/thirdparty/bootstrap/js/bootstrap.min.js create mode 100644 common/src/main/webapp/thirdparty/bootstrap/js/bootstrap2-typeahead.min.js create mode 100644 common/src/main/webapp/thirdparty/cometd/cometd.js create mode 100644 common/src/main/webapp/thirdparty/cometd/cometd/AckExtension.js create mode 100644 common/src/main/webapp/thirdparty/cometd/cometd/ReloadExtension.js create mode 100644 common/src/main/webapp/thirdparty/cometd/cometd/TimeStampExtension.js create mode 100644 common/src/main/webapp/thirdparty/cometd/cometd/TimeSyncExtension.js create mode 100644 common/src/main/webapp/thirdparty/cometd/jquery/jquery.cometd-ack.js create mode 100644 common/src/main/webapp/thirdparty/cometd/jquery/jquery.cometd-reload.js create mode 100644 common/src/main/webapp/thirdparty/cometd/jquery/jquery.cometd-timestamp.js create mode 100644 common/src/main/webapp/thirdparty/cometd/jquery/jquery.cometd-timesync.js create mode 100644 common/src/main/webapp/thirdparty/cometd/jquery/jquery.cometd.js create mode 100644 common/src/main/webapp/thirdparty/css/ngict-component.css create mode 100644 common/src/main/webapp/thirdparty/css/plugins.css create mode 100644 common/src/main/webapp/thirdparty/css/style.css create mode 100644 common/src/main/webapp/thirdparty/css/uniform.default.min.css create mode 100644 common/src/main/webapp/thirdparty/data-tables/DT_bootstrap.css create mode 100644 common/src/main/webapp/thirdparty/data-tables/DT_bootstrap.js create mode 100644 common/src/main/webapp/thirdparty/data-tables/DataTableICT.js create mode 100644 common/src/main/webapp/thirdparty/data-tables/DataTableSmartClient.js create mode 100644 common/src/main/webapp/thirdparty/data-tables/DataTableSmartClientApp.js create mode 100644 common/src/main/webapp/thirdparty/data-tables/app-test-i18n-datatable-zh-CN.json create mode 100644 common/src/main/webapp/thirdparty/data-tables/app-universal-i18n-datatable-en-US.json create mode 100644 common/src/main/webapp/thirdparty/data-tables/app-universal-i18n-datatable-zh-CN.json create mode 100644 common/src/main/webapp/thirdparty/data-tables/dataTable.html create mode 100644 common/src/main/webapp/thirdparty/data-tables/dataTables.bootstrap.css create mode 100644 common/src/main/webapp/thirdparty/data-tables/images/loading-spinner-grey.gif create mode 100644 common/src/main/webapp/thirdparty/data-tables/images/sort_asc.png create mode 100644 common/src/main/webapp/thirdparty/data-tables/images/sort_both.png create mode 100644 common/src/main/webapp/thirdparty/data-tables/images/sort_desc.png create mode 100644 common/src/main/webapp/thirdparty/data-tables/jquery.dataTables-1.9.4.js create mode 100644 common/src/main/webapp/thirdparty/data-tables/jquery.dataTables-1.9.4.min.js create mode 100644 common/src/main/webapp/thirdparty/data-tables/jquery.dataTables.js create mode 100644 common/src/main/webapp/thirdparty/data-tables/jquery.dataTables.min.css create mode 100644 common/src/main/webapp/thirdparty/data-tables/jquery.dataTables.min.js create mode 100644 common/src/main/webapp/thirdparty/data-tables/style-datatable.css create mode 100644 common/src/main/webapp/thirdparty/echarts/echarts-all.js create mode 100644 common/src/main/webapp/thirdparty/echarts/echarts.js create mode 100644 common/src/main/webapp/thirdparty/font-awesome/css/font-awesome.css create mode 100644 common/src/main/webapp/thirdparty/font-awesome/css/font-awesome.min.css create mode 100644 common/src/main/webapp/thirdparty/font-awesome/fonts/FontAwesome.otf create mode 100644 common/src/main/webapp/thirdparty/font-awesome/fonts/fontawesome-webfont.eot create mode 100644 common/src/main/webapp/thirdparty/font-awesome/fonts/fontawesome-webfont.svg create mode 100644 common/src/main/webapp/thirdparty/font-awesome/fonts/fontawesome-webfont.ttf create mode 100644 common/src/main/webapp/thirdparty/font-awesome/fonts/fontawesome-webfont.woff create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/bordered-pulled.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/core.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/fixed-width.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/font-awesome.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/icons.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/larger.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/list.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/mixins.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/path.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/rotated-flipped.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/spinning.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/stacked.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/less/variables.less create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_bordered-pulled.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_core.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_fixed-width.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_icons.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_larger.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_list.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_mixins.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_path.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_rotated-flipped.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_spinning.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_stacked.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/_variables.scss create mode 100644 common/src/main/webapp/thirdparty/font-awesome/scss/font-awesome.scss create mode 100644 common/src/main/webapp/thirdparty/jQuery-File-Upload/css/jquery.fileupload.css create mode 100644 common/src/main/webapp/thirdparty/jQuery-File-Upload/img/loading.gif create mode 100644 common/src/main/webapp/thirdparty/jQuery-File-Upload/img/progressbar.gif create mode 100644 common/src/main/webapp/thirdparty/jQuery-File-Upload/js/jquery.fileupload.js create mode 100644 common/src/main/webapp/thirdparty/jQuery-File-Upload/js/jquery.iframe-transport.js create mode 100644 common/src/main/webapp/thirdparty/jQuery-File-Upload/js/vendor/jquery.ui.widget.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/README.md create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/dist/additional-methods.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/dist/additional-methods.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/dist/jquery.validate.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/dist/jquery.validate.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/additional-methods.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/additional-methods.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/jquery.validate.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/jquery.validate.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ar.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ar.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_bg.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_bg.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ca.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ca.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_cs.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_cs.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_da.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_da.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_de.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_de.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_el.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_el.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_es.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_es.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_es_AR.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_es_AR.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_et.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_et.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_eu.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_eu.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_fa.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_fa.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_fi.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_fi.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_fr.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_fr.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_gl.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_gl.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_he.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_he.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_hr.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_hr.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_hu.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_hu.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_id.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_id.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_is.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_is.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_it.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_it.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ja.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ja.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ka.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ka.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_kk.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_kk.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ko.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ko.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_lt.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_lt.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_lv.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_lv.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_my.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_my.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_nl.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_nl.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_no.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_no.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_pl.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_pl.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_pt_BR.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_pt_BR.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_pt_PT.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_pt_PT.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ro.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ro.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ru.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_ru.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_si.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_si.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sk.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sk.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sl.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sl.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sr.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sr.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sr_lat.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sr_lat.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sv.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_sv.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_th.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_th.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_tj.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_tj.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_tr.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_tr.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_uk.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_uk.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_vi.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_vi.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_zh.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_zh.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_zh_TW.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/messages_zh_TW.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_de.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_de.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_es_CL.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_es_CL.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_fi.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_fi.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_nl.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_nl.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_pt.js create mode 100644 common/src/main/webapp/thirdparty/jquery-validation/js/localization/methods_pt.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-1.10.2.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-1.11.2.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-1.11.2.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-1.11.2.min.map create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-1.4.4.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-2.1.3.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-2.1.3.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-2.1.3.min.map create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-migrate-1.2.1.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery-migrate-1.2.1.min.js create mode 100644 common/src/main/webapp/thirdparty/jquery/jquery.reveal.js create mode 100644 common/src/main/webapp/thirdparty/js/core/const.js create mode 100644 common/src/main/webapp/thirdparty/js/core/hk.min.js create mode 100644 common/src/main/webapp/thirdparty/js/core/load_menuList.js create mode 100644 common/src/main/webapp/thirdparty/js/core/openoFrameWork.js create mode 100644 common/src/main/webapp/thirdparty/js/core/pym.min.js create mode 100644 common/src/main/webapp/thirdparty/js/tools.js create mode 100644 common/src/main/webapp/thirdparty/uniform/README.md create mode 100644 common/src/main/webapp/thirdparty/uniform/css/uniform.default.css create mode 100644 common/src/main/webapp/thirdparty/uniform/css/uniform.default.min.css create mode 100644 common/src/main/webapp/thirdparty/uniform/css/uniform.default.scss create mode 100644 common/src/main/webapp/thirdparty/uniform/images/bg-input-focus.png create mode 100644 common/src/main/webapp/thirdparty/uniform/images/bg-input.png create mode 100644 common/src/main/webapp/thirdparty/uniform/images/sprite.png create mode 100644 common/src/main/webapp/thirdparty/uniform/images/sprite_original.png create mode 100644 common/src/main/webapp/thirdparty/uniform/jquery.uniform.js create mode 100644 common/src/main/webapp/thirdparty/uniform/jquery.uniform.min.js create mode 100644 login/src/main/webapp/login/css/datatable-sort.css create mode 100644 login/src/main/webapp/login/css/fileupload.css create mode 100644 login/src/main/webapp/login/css/package.css create mode 100644 login/src/main/webapp/login/css/template.css create mode 100644 login/src/main/webapp/login/css/templateDetail.css create mode 100644 login/src/main/webapp/login/css/topology.css create mode 100644 login/src/main/webapp/login/css/vnfm.css diff --git a/catalog/src/main/webapp/catalog/csarPackage.html b/catalog/src/main/webapp/catalog/csarPackage.html index e200e91e..5ed9f1ec 100644 --- a/catalog/src/main/webapp/catalog/csarPackage.html +++ b/catalog/src/main/webapp/catalog/csarPackage.html @@ -20,13 +20,13 @@ - - - - - - - + + + + + + + " +ifGroup.setAttribute("ms-skip", "1") +ifGroup.className = "avalonHide" +var rnative = /\[native code\]/ //判定是å¦åŽŸç”Ÿå‡½æ•° +function log() { + if (window.console && avalon.config.debug) { + // http://stackoverflow.com/questions/8785624/how-to-safely-wrap-console-log + Function.apply.call(console.log, console, arguments) + } +} + + +var subscribers = "$" + expose +var otherRequire = window.require +var otherDefine = window.define +var innerRequire +var stopRepeatAssign = false +var rword = /[^, ]+/g //切割字符串为一个个å°å—,以空格或豆å·åˆ†å¼€å®ƒä»¬ï¼Œç»“åˆreplace实现字符串的forEach +var rcomplexType = /^(?:object|array)$/ +var rsvg = /^\[object SVG\w*Element\]$/ +var rwindow = /^\[object (?:Window|DOMWindow|global)\]$/ +var oproto = Object.prototype +var ohasOwn = oproto.hasOwnProperty +var serialize = oproto.toString +var ap = Array.prototype +var aslice = ap.slice +var Registry = {} //将函数æ›å…‰åˆ°æ­¤å¯¹è±¡ä¸Šï¼Œæ–¹ä¾¿è®¿é—®å™¨æ”¶é›†ä¾èµ– +var W3C = window.dispatchEvent +var root = DOC.documentElement +var avalonFragment = DOC.createDocumentFragment() +var cinerator = DOC.createElement("div") +var class2type = {} +"Boolean Number String Function Array Date RegExp Object Error".replace(rword, function (name) { + class2type["[object " + name + "]"] = name.toLowerCase() +}) + + +function noop() { +} + + +function oneObject(array, val) { + if (typeof array === "string") { + array = array.match(rword) || [] + } + var result = {}, + value = val !== void 0 ? val : 1 + for (var i = 0, n = array.length; i < n; i++) { + result[array[i]] = value + } + return result +} + +//生æˆUUID http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript +var generateID = function (prefix) { + prefix = prefix || "avalon" + return String(Math.random() + Math.random()).replace(/\d\.\d{4}/, prefix) +} +function IE() { + if (window.VBArray) { + var mode = document.documentMode + return mode ? mode : window.XMLHttpRequest ? 7 : 6 + } else { + return NaN + } +} +var IEVersion = IE() + +avalon = function (el) { //创建jQueryå¼çš„æ— new 实例化结构 + return new avalon.init(el) +} + +avalon.profile = function () { + if (window.console && avalon.config.profile) { + Function.apply.call(console.log, console, arguments) + } +} + +/*视æµè§ˆå™¨æƒ…况采用最快的异步回调*/ +avalon.nextTick = new function () {// jshint ignore:line + var tickImmediate = window.setImmediate + var tickObserver = window.MutationObserver + var tickPost = W3C && window.postMessage + if (tickImmediate) { + return tickImmediate.bind(window) + } + + var queue = [] + function callback() { + var n = queue.length + for (var i = 0; i < n; i++) { + queue[i]() + } + queue = queue.slice(n) + } + + if (tickObserver) { + var node = document.createTextNode("avalon") + new tickObserver(callback).observe(node, {characterData: true})// jshint ignore:line + return function (fn) { + queue.push(fn) + node.data = Math.random() + } + } + + if (tickPost) { + window.addEventListener("message", function (e) { + var source = e.source + if ((source === window || source === null) && e.data === "process-tick") { + e.stopPropagation() + callback() + } + }) + + return function (fn) { + queue.push(fn) + window.postMessage('process-tick', '*') + } + } + + return function (fn) { + setTimeout(fn, 0) + } +}// jshint ignore:line +/********************************************************************* + * avalonçš„é™æ€æ–¹æ³•å®šä¹‰åŒº * + **********************************************************************/ +avalon.init = function (el) { + this[0] = this.element = el +} +avalon.fn = avalon.prototype = avalon.init.prototype + +avalon.type = function (obj) { //å–得目标的类型 + if (obj == null) { + return String(obj) + } + // 早期的webkit内核æµè§ˆå™¨å®žçŽ°äº†å·²åºŸå¼ƒçš„ecma262v4标准,å¯ä»¥å°†æ­£åˆ™å­—é¢é‡å½“作函数使用,因此typeof在判定正则时会返回function + return typeof obj === "object" || typeof obj === "function" ? + class2type[serialize.call(obj)] || "object" : + typeof obj +} + +var isFunction = typeof alert === "object" ? function (fn) { + try { + return /^\s*\bfunction\b/.test(fn + "") + } catch (e) { + return false + } +} : function (fn) { + return serialize.call(fn) === "[object Function]" +} +avalon.isFunction = isFunction + +avalon.isWindow = function (obj) { + if (!obj) + return false + // 利用IE678 window == document为true,document == window竟然为false的神奇特性 + // 标准æµè§ˆå™¨åŠIE9,IE10等使用 正则检测 + return obj == obj.document && obj.document != obj //jshint ignore:line +} + +function isWindow(obj) { + return rwindow.test(serialize.call(obj)) +} +if (isWindow(window)) { + avalon.isWindow = isWindow +} +var enu +for (enu in avalon({})) { + break +} +var enumerateBUG = enu !== "0" //IE6下为true, 其他为false +/*判定是å¦æ˜¯ä¸€ä¸ªæœ´ç´ çš„javascript对象(Object),ä¸æ˜¯DOM对象,ä¸æ˜¯BOM对象,ä¸æ˜¯è‡ªå®šä¹‰ç±»çš„实例*/ +avalon.isPlainObject = function (obj, key) { + if (!obj || avalon.type(obj) !== "object" || obj.nodeType || avalon.isWindow(obj)) { + return false; + } + try { //IE内置对象没有constructor + if (obj.constructor && !ohasOwn.call(obj, "constructor") && !ohasOwn.call(obj.constructor.prototype, "isPrototypeOf")) { + return false; + } + } catch (e) { //IE8 9会在这里抛错 + return false; + } + if (enumerateBUG) { + for (key in obj) { + return ohasOwn.call(obj, key) + } + } + for (key in obj) { + } + return key === void 0 || ohasOwn.call(obj, key) +} +if (rnative.test(Object.getPrototypeOf)) { + avalon.isPlainObject = function (obj) { + // 简å•çš„ typeof obj === "object"检测,会致使用isPlainObject(window)在opera下通ä¸è¿‡ + return serialize.call(obj) === "[object Object]" && Object.getPrototypeOf(obj) === oproto + } +} +//与jQuery.extend方法,å¯ç”¨äºŽæµ…æ‹·è´ï¼Œæ·±æ‹·è´ +avalon.mix = avalon.fn.mix = function () { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false + + // 如果第一个å‚数为布尔,判定是å¦æ·±æ‹·è´ + if (typeof target === "boolean") { + deep = target + target = arguments[1] || {} + i++ + } + + //ç¡®ä¿æŽ¥å—方为一个å¤æ‚çš„æ•°æ®ç±»åž‹ + if (typeof target !== "object" && !isFunction(target)) { + target = {} + } + + //如果åªæœ‰ä¸€ä¸ªå‚数,那么新æˆå‘˜æ·»åŠ äºŽmix所在的对象上 + if (i === length) { + target = this + i-- + } + + for (; i < length; i++) { + //åªå¤„ç†éžç©ºå‚æ•° + if ((options = arguments[i]) != null) { + for (name in options) { + src = target[name] + try { + copy = options[name] //当options为VBS对象时报错 + } catch (e) { + continue + } + + // 防止环引用 + if (target === copy) { + continue + } + if (deep && copy && (avalon.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) { + + if (copyIsArray) { + copyIsArray = false + clone = src && Array.isArray(src) ? src : [] + + } else { + clone = src && avalon.isPlainObject(src) ? src : {} + } + + target[name] = avalon.mix(deep, clone, copy) + } else if (copy !== void 0) { + target[name] = copy + } + } + } + } + return target +} + +function _number(a, len) { //用于模拟slice, splice的效果 + a = Math.floor(a) || 0 + return a < 0 ? Math.max(len + a, 0) : Math.min(a, len); +} +avalon.mix({ + rword: rword, + subscribers: subscribers, + version: 1.45, + ui: {}, + log: log, + slice: W3C ? function (nodes, start, end) { + return aslice.call(nodes, start, end) + } : function (nodes, start, end) { + var ret = [] + var len = nodes.length + if (end === void 0) + end = len + if (typeof end === "number" && isFinite(end)) { + start = _number(start, len) + end = _number(end, len) + for (var i = start; i < end; ++i) { + ret[i - start] = nodes[i] + } + } + return ret + }, + noop: noop, + /*如果ä¸ç”¨Error对象å°è£…一下,str在控制å°ä¸‹å¯èƒ½ä¼šä¹±ç */ + error: function (str, e) { + throw (e || Error)(str) + }, + /*将一个以空格或逗å·éš”开的字符串或数组,转æ¢æˆä¸€ä¸ªé”®å€¼éƒ½ä¸º1的对象*/ + oneObject: oneObject, + /* avalon.range(10) + => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + avalon.range(1, 11) + => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + avalon.range(0, 30, 5) + => [0, 5, 10, 15, 20, 25] + avalon.range(0, -10, -1) + => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] + avalon.range(0) + => []*/ + range: function (start, end, step) { // 用于生æˆæ•´æ•°æ•°ç»„ + step || (step = 1) + if (end == null) { + end = start || 0 + start = 0 + } + var index = -1, + length = Math.max(0, Math.ceil((end - start) / step)), + result = new Array(length) + while (++index < length) { + result[index] = start + start += step + } + return result + }, + eventHooks: [], + /*绑定事件*/ + bind: function(el, type, fn, phase) { + var hooks = avalon.eventHooks + var hook = hooks[type] + if (typeof hook === "object") { + type = hook.type + if (hook.deel) { + fn = hook.deel(el, type, fn, phase) + } + } + var callback = W3C ? fn : function(e) { + fn.call(el, fixEvent(e)); + } + if (W3C) { + el.addEventListener(type, callback, !!phase) + } else { + el.attachEvent("on" + type, callback) + } + return callback + }, + /*å¸è½½äº‹ä»¶*/ + unbind: function(el, type, fn, phase) { + var hooks = avalon.eventHooks + var hook = hooks[type] + var callback = fn || noop + if (typeof hook === "object") { + type = hook.type + if (hook.deel) { + fn = hook.deel(el, type, fn, false) + } + } + if (W3C) { + el.removeEventListener(type, callback, !!phase) + } else { + el.detachEvent("on" + type, callback) + } + }, + /*读写删除元素节点的样å¼*/ + css: function (node, name, value) { + if (node instanceof avalon) { + node = node[0] + } + var prop = /[_-]/.test(name) ? camelize(name) : name, fn + name = avalon.cssName(prop) || prop + if (value === void 0 || typeof value === "boolean") { //获å–æ ·å¼ + fn = cssHooks[prop + ":get"] || cssHooks["@:get"] + if (name === "background") { + name = "backgroundColor" + } + var val = fn(node, name) + return value === true ? parseFloat(val) || 0 : val + } else if (value === "") { //è¯·é™¤æ ·å¼ + node.style[name] = "" + } else { //è®¾ç½®æ ·å¼ + if (value == null || value !== value) { + return + } + if (isFinite(value) && !avalon.cssNumber[prop]) { + value += "px" + } + fn = cssHooks[prop + ":set"] || cssHooks["@:set"] + fn(node, name, value) + } + }, + /*é历数组与对象,回调的第一个å‚数为索引或键å,第二个或元素或键值*/ + each: function (obj, fn) { + if (obj) { //排除null, undefined + var i = 0 + if (isArrayLike(obj)) { + for (var n = obj.length; i < n; i++) { + if (fn(i, obj[i]) === false) + break + } + } else { + for (i in obj) { + if (obj.hasOwnProperty(i) && fn(i, obj[i]) === false) { + break + } + } + } + } + }, + //收集元素的data-{{prefix}}-*属性,并转æ¢ä¸ºå¯¹è±¡ + getWidgetData: function (elem, prefix) { + var raw = avalon(elem).data() + var result = {} + for (var i in raw) { + if (i.indexOf(prefix) === 0) { + result[i.replace(prefix, "").replace(/\w/, function (a) { + return a.toLowerCase() + })] = raw[i] + } + } + return result + }, + Array: { + /*åªæœ‰å½“å‰æ•°ç»„ä¸å­˜åœ¨æ­¤å…ƒç´ æ—¶åªæ·»åŠ å®ƒ*/ + ensure: function (target, item) { + if (target.indexOf(item) === -1) { + return target.push(item) + } + }, + /*移除数组中指定ä½ç½®çš„元素,返回布尔表示æˆåŠŸä¸Žå¦*/ + removeAt: function (target, index) { + return !!target.splice(index, 1).length + }, + /*移除数组中第一个匹é…ä¼ å‚的那个元素,返回布尔表示æˆåŠŸä¸Žå¦*/ + remove: function (target, item) { + var index = target.indexOf(item) + if (~index) + return avalon.Array.removeAt(target, index) + return false + } + } +}) + +var bindingHandlers = avalon.bindingHandlers = {} +var bindingExecutors = avalon.bindingExecutors = {} + +/*判定是å¦ç±»æ•°ç»„,如节点集åˆï¼Œçº¯æ•°ç»„,arguments与拥有éžè´Ÿæ•´æ•°çš„length属性的纯JS对象*/ +function isArrayLike(obj) { + if (!obj) + return false + var n = obj.length + if (n === (n >>> 0)) { //检测length属性是å¦ä¸ºéžè´Ÿæ•´æ•° + var type = serialize.call(obj).slice(8, -1) + if (/(?:regexp|string|function|window|global)$/i.test(type)) + return false + if (type === "Array") + return true + try { + if ({}.propertyIsEnumerable.call(obj, "length") === false) { //如果是原生对象 + return /^\s?function/.test(obj.item || obj.callee) + } + return true + } catch (e) { //IEçš„NodeList直接抛错 + return !obj.window //IE6-8 window + } + } + return false +} + + +// https://github.com/rsms/js-lru +var Cache = new function() {// jshint ignore:line + function LRU(maxLength) { + this.size = 0 + this.limit = maxLength + this.head = this.tail = void 0 + this._keymap = {} + } + + var p = LRU.prototype + + p.put = function(key, value) { + var entry = { + key: key, + value: value + } + this._keymap[key] = entry + if (this.tail) { + this.tail.newer = entry + entry.older = this.tail + } else { + this.head = entry + } + this.tail = entry + if (this.size === this.limit) { + this.shift() + } else { + this.size++ + } + return value + } + + p.shift = function() { + var entry = this.head + if (entry) { + this.head = this.head.newer + this.head.older = + entry.newer = + entry.older = + this._keymap[entry.key] = void 0 + } + } + p.get = function(key) { + var entry = this._keymap[key] + if (entry === void 0) + return + if (entry === this.tail) { + return entry.value + } + // HEAD--------------TAIL + // <.older .newer> + // <--- add direction -- + // A B C E + if (entry.newer) { + if (entry === this.head) { + this.head = entry.newer + } + entry.newer.older = entry.older // C <-- E. + } + if (entry.older) { + entry.older.newer = entry.newer // C. --> E + } + entry.newer = void 0 // D --x + entry.older = this.tail // D. --> E + if (this.tail) { + this.tail.newer = entry // E. <-- D + } + this.tail = entry + return entry.value + } + return LRU +}// jshint ignore:line + +/********************************************************************* + * javascript åº•å±‚è¡¥ä¸ * + **********************************************************************/ +if (!"å¸å¾’正美".trim) { + var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g + String.prototype.trim = function () { + return this.replace(rtrim, "") + } +} +var hasDontEnumBug = !({ + 'toString': null +}).propertyIsEnumerable('toString'), + hasProtoEnumBug = (function () { + }).propertyIsEnumerable('prototype'), + dontEnums = [ + "toString", + "toLocaleString", + "valueOf", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "constructor" + ], + dontEnumsLength = dontEnums.length; +if (!Object.keys) { + Object.keys = function (object) { //ecma262v5 15.2.3.14 + var theKeys = [] + var skipProto = hasProtoEnumBug && typeof object === "function" + if (typeof object === "string" || (object && object.callee)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)) + } + } else { + for (var name in object) { + if (!(skipProto && name === "prototype") && ohasOwn.call(object, name)) { + theKeys.push(String(name)) + } + } + } + + if (hasDontEnumBug) { + var ctor = object.constructor, + skipConstructor = ctor && ctor.prototype === object + for (var j = 0; j < dontEnumsLength; j++) { + var dontEnum = dontEnums[j] + if (!(skipConstructor && dontEnum === "constructor") && ohasOwn.call(object, dontEnum)) { + theKeys.push(dontEnum) + } + } + } + return theKeys + } +} +if (!Array.isArray) { + Array.isArray = function (a) { + return serialize.call(a) === "[object Array]" + } +} + +if (!noop.bind) { + Function.prototype.bind = function (scope) { + if (arguments.length < 2 && scope === void 0) + return this + var fn = this, + argv = arguments + return function () { + var args = [], + i + for (i = 1; i < argv.length; i++) + args.push(argv[i]) + for (i = 0; i < arguments.length; i++) + args.push(arguments[i]) + return fn.apply(scope, args) + } + } +} + +function iterator(vars, body, ret) { + var fun = 'for(var ' + vars + 'i=0,n = this.length; i < n; i++){' + body.replace('_', '((i in this) && fn.call(scope,this[i],i,this))') + '}' + ret + /* jshint ignore:start */ + return Function("fn,scope", fun) + /* jshint ignore:end */ +} +if (!rnative.test([].map)) { + avalon.mix(ap, { + //定ä½æ“作,返回数组中第一个等于给定å‚数的元素的索引值。 + indexOf: function (item, index) { + var n = this.length, + i = ~~index + if (i < 0) + i += n + for (; i < n; i++) + if (this[i] === item) + return i + return -1 + }, + //定ä½æ“作,åŒä¸Šï¼Œä¸è¿‡æ˜¯ä»ŽåŽé历。 + lastIndexOf: function (item, index) { + var n = this.length, + i = index == null ? n - 1 : index + if (i < 0) + i = Math.max(0, n + i) + for (; i >= 0; i--) + if (this[i] === item) + return i + return -1 + }, + //迭代æ“作,将数组的元素挨个儿传入一个函数中执行。Prototype.js的对应å字为each。 + forEach: iterator("", '_', ""), + //迭代类 在数组中的æ¯ä¸ªé¡¹ä¸Šè¿è¡Œä¸€ä¸ªå‡½æ•°ï¼Œå¦‚果此函数的值为真,则此元素作为新数组的元素收集起æ¥ï¼Œå¹¶è¿”回新数组 + filter: iterator('r=[],j=0,', 'if(_)r[j++]=this[i]', 'return r'), + //收集æ“作,将数组的元素挨个儿传入一个函数中执行,然åŽæŠŠå®ƒä»¬çš„返回值组æˆä¸€ä¸ªæ–°æ•°ç»„返回。Prototype.js的对应å字为collect。 + map: iterator('r=[],', 'r[i]=_', 'return r'), + //åªè¦æ•°ç»„中有一个元素满足æ¡ä»¶ï¼ˆæ”¾è¿›ç»™å®šå‡½æ•°è¿”回true),那么它就返回true。Prototype.js的对应å字为any。 + some: iterator("", 'if(_)return true', 'return false'), + //åªæœ‰æ•°ç»„中的元素都满足æ¡ä»¶ï¼ˆæ”¾è¿›ç»™å®šå‡½æ•°è¿”回true),它æ‰è¿”回true。Prototype.js的对应å字为all。 + every: iterator("", 'if(!_)return false', 'return true') + }) +} +/********************************************************************* + * DOM åº•å±‚è¡¥ä¸ * + **********************************************************************/ + +function fixContains(root, el) { + try { //IE6-8,游离于DOM树外的文本节点,访问parentNode有时会抛错 + while ((el = el.parentNode)) + if (el === root) + return true + return false + } catch (e) { + return false + } +} +avalon.contains = fixContains +//IE6-11的文档对象没有contains +if (!DOC.contains) { + DOC.contains = function (b) { + return fixContains(DOC, b) + } +} + +function outerHTML() { + return new XMLSerializer().serializeToString(this) +} + +if (window.SVGElement) { + //safari5+是把contains方法放在Element.prototype上而ä¸æ˜¯Node.prototype + if (!DOC.createTextNode("x").contains) { + Node.prototype.contains = function (arg) {//IE6-8没有Node对象 + return !!(this.compareDocumentPosition(arg) & 16) + } + } + var svgns = "http://www.w3.org/2000/svg" + var svg = DOC.createElementNS(svgns, "svg") + svg.innerHTML = '' + if (!rsvg.test(svg.firstChild)) { // #409 + function enumerateNode(node, targetNode) {// jshint ignore:line + if (node && node.childNodes) { + var nodes = node.childNodes + for (var i = 0, el; el = nodes[i++]; ) { + if (el.tagName) { + var svg = DOC.createElementNS(svgns, + el.tagName.toLowerCase()) + ap.forEach.call(el.attributes, function (attr) { + svg.setAttribute(attr.name, attr.value) //å¤åˆ¶å±žæ€§ + })// jshint ignore:line + // 递归处ç†å­èŠ‚点 + enumerateNode(el, svg) + targetNode.appendChild(svg) + } + } + } + } + Object.defineProperties(SVGElement.prototype, { + "outerHTML": {//IE9-11,firefoxä¸æ”¯æŒSVG元素的innerHTML,outerHTML属性 + enumerable: true, + configurable: true, + get: outerHTML, + set: function (html) { + var tagName = this.tagName.toLowerCase(), + par = this.parentNode, + frag = avalon.parseHTML(html) + // æ“作的svg,直接æ’å…¥ + if (tagName === "svg") { + par.insertBefore(frag, this) + // svg节点的å­èŠ‚点类似 + } else { + var newFrag = DOC.createDocumentFragment() + enumerateNode(frag, newFrag) + par.insertBefore(newFrag, this) + } + par.removeChild(this) + } + }, + "innerHTML": { + enumerable: true, + configurable: true, + get: function () { + var s = this.outerHTML + var ropen = new RegExp("<" + this.nodeName + '\\b(?:(["\'])[^"]*?(\\1)|[^>])*>', "i") + var rclose = new RegExp("<\/" + this.nodeName + ">$", "i") + return s.replace(ropen, "").replace(rclose, "") + }, + set: function (html) { + if (avalon.clearHTML) { + avalon.clearHTML(this) + var frag = avalon.parseHTML(html) + enumerateNode(frag, this) + } + } + } + }) + } +} +if (!root.outerHTML && window.HTMLElement) { //firefox 到11æ—¶æ‰æœ‰outerHTML + HTMLElement.prototype.__defineGetter__("outerHTML", outerHTML); +} + + +//============================= event binding ======================= +var rmouseEvent = /^(?:mouse|contextmenu|drag)|click/ +function fixEvent(event) { + var ret = {} + for (var i in event) { + ret[i] = event[i] + } + var target = ret.target = event.srcElement + if (event.type.indexOf("key") === 0) { + ret.which = event.charCode != null ? event.charCode : event.keyCode + } else if (rmouseEvent.test(event.type)) { + var doc = target.ownerDocument || DOC + var box = doc.compatMode === "BackCompat" ? doc.body : doc.documentElement + ret.pageX = event.clientX + (box.scrollLeft >> 0) - (box.clientLeft >> 0) + ret.pageY = event.clientY + (box.scrollTop >> 0) - (box.clientTop >> 0) + ret.wheelDeltaY = ret.wheelDelta + ret.wheelDeltaX = 0 + } + ret.timeStamp = new Date() - 0 + ret.originalEvent = event + ret.preventDefault = function () { //阻止默认行为 + event.returnValue = false + } + ret.stopPropagation = function () { //阻止事件在DOM树中的传播 + event.cancelBubble = true + } + return ret +} + +var eventHooks = avalon.eventHooks +//针对firefox, chrome修正mouseenter, mouseleave +if (!("onmouseenter" in root)) { + avalon.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" + }, function (origType, fixType) { + eventHooks[origType] = { + type: fixType, + deel: function (elem, _, fn) { + return function (e) { + var t = e.relatedTarget + if (!t || (t !== elem && !(elem.compareDocumentPosition(t) & 16))) { + delete e.type + e.type = origType + return fn.call(elem, e) + } + } + } + } + }) +} +//针对IE9+, w3c修正animationend +avalon.each({ + AnimationEvent: "animationend", + WebKitAnimationEvent: "webkitAnimationEnd" +}, function (construct, fixType) { + if (window[construct] && !eventHooks.animationend) { + eventHooks.animationend = { + type: fixType + } + } +}) +//针对IE6-8修正input +if (!("oninput" in DOC.createElement("input"))) { + eventHooks.input = { + type: "propertychange", + deel: function (elem, _, fn) { + return function (e) { + if (e.propertyName === "value") { + e.type = "input" + return fn.call(elem, e) + } + } + } + } +} +if (DOC.onmousewheel === void 0) { + /* IE6-11 chrome mousewheel wheelDetla 下 -120 上 120 + firefox DOMMouseScroll detail 下3 上-3 + firefox wheel detlaY 下3 上-3 + IE9-11 wheel deltaY 下40 上-40 + chrome wheel deltaY 下100 上-100 */ + var fixWheelType = DOC.onwheel !== void 0 ? "wheel" : "DOMMouseScroll" + var fixWheelDelta = fixWheelType === "wheel" ? "deltaY" : "detail" + eventHooks.mousewheel = { + type: fixWheelType, + deel: function (elem, _, fn) { + return function (e) { + e.wheelDeltaY = e.wheelDelta = e[fixWheelDelta] > 0 ? -120 : 120 + e.wheelDeltaX = 0 + if (Object.defineProperty) { + Object.defineProperty(e, "type", { + value: "mousewheel" + }) + } + fn.call(elem, e) + } + } + } +} + + + +/********************************************************************* + * é…置系统 * + **********************************************************************/ + +function kernel(settings) { + for (var p in settings) { + if (!ohasOwn.call(settings, p)) + continue + var val = settings[p] + if (typeof kernel.plugins[p] === "function") { + kernel.plugins[p](val) + } else if (typeof kernel[p] === "object") { + avalon.mix(kernel[p], val) + } else { + kernel[p] = val + } + } + return this +} +var openTag, closeTag, rexpr, rexprg, rbind, rregexp = /[-.*+?^${}()|[\]\/\\]/g + +function escapeRegExp(target) { + //http://stevenlevithan.com/regex/xregexp/ + //将字符串安全格å¼åŒ–为正则表达å¼çš„æºç  + return (target + "").replace(rregexp, "\\$&") +} + +var plugins = { + loader: function (builtin) { + var flag = innerRequire && builtin + window.require = flag ? innerRequire : otherRequire + window.define = flag ? innerRequire.define : otherDefine + }, + interpolate: function (array) { + openTag = array[0] + closeTag = array[1] + if (openTag === closeTag) { + throw new SyntaxError("openTag!==closeTag") + var test = openTag + "test" + closeTag + cinerator.innerHTML = test + if (cinerator.innerHTML !== test && cinerator.innerHTML.indexOf("<") > -1) { + throw new SyntaxError("此定界符ä¸åˆæ³•") + } + cinerator.innerHTML = "" + } + var o = escapeRegExp(openTag), + c = escapeRegExp(closeTag) + rexpr = new RegExp(o + "(.*?)" + c) + rexprg = new RegExp(o + "(.*?)" + c, "g") + rbind = new RegExp(o + ".*?" + c + "|\\sms-") + } +} + +kernel.debug = true +kernel.plugins = plugins +kernel.plugins['interpolate'](["{{", "}}"]) +kernel.paths = {} +kernel.shim = {} +kernel.maxRepeatSize = 100 +avalon.config = kernel +var ravalon = /(\w+)\[(avalonctrl)="(\S+)"\]/ +var findNodes = DOC.querySelectorAll ? function(str) { + return DOC.querySelectorAll(str) +} : function(str) { + var match = str.match(ravalon) + var all = DOC.getElementsByTagName(match[1]) + var nodes = [] + for (var i = 0, el; el = all[i++]; ) { + if (el.getAttribute(match[2]) === match[3]) { + nodes.push(el) + } + } + return nodes +} +/********************************************************************* + * 事件总线 * + **********************************************************************/ +var EventBus = { + $watch: function (type, callback) { + if (typeof callback === "function") { + var callbacks = this.$events[type] + if (callbacks) { + callbacks.push(callback) + } else { + this.$events[type] = [callback] + } + } else { //é‡æ–°å¼€å§‹ç›‘å¬æ­¤VM的第一é‡ç®€å•å±žæ€§çš„å˜åŠ¨ + this.$events = this.$watch.backup + } + return this + }, + $unwatch: function (type, callback) { + var n = arguments.length + if (n === 0) { //让此VM的所有$watch回调无效化 + this.$watch.backup = this.$events + this.$events = {} + } else if (n === 1) { + this.$events[type] = [] + } else { + var callbacks = this.$events[type] || [] + var i = callbacks.length + while (~--i < 0) { + if (callbacks[i] === callback) { + return callbacks.splice(i, 1) + } + } + } + return this + }, + $fire: function (type) { + var special, i, v, callback + if (/^(\w+)!(\S+)$/.test(type)) { + special = RegExp.$1 + type = RegExp.$2 + } + var events = this.$events + if (!events) + return + var args = aslice.call(arguments, 1) + var detail = [type].concat(args) + if (special === "all") { + for (i in avalon.vmodels) { + v = avalon.vmodels[i] + if (v !== this) { + v.$fire.apply(v, detail) + } + } + } else if (special === "up" || special === "down") { + var elements = events.expr ? findNodes(events.expr) : [] + if (elements.length === 0) + return + for (i in avalon.vmodels) { + v = avalon.vmodels[i] + if (v !== this) { + if (v.$events.expr) { + var eventNodes = findNodes(v.$events.expr) + if (eventNodes.length === 0) { + continue + } + //循环两个vmodel中的节点,查找匹é…(å‘上匹é…或者å‘下匹é…)的节点并设置标识 + /* jshint ignore:start */ + ap.forEach.call(eventNodes, function (node) { + ap.forEach.call(elements, function (element) { + var ok = special === "down" ? element.contains(node) : //å‘下æ•èŽ· + node.contains(element) //å‘上冒泡 + if (ok) { + node._avalon = v //符åˆæ¡ä»¶çš„加一个标识 + } + }); + }) + /* jshint ignore:end */ + } + } + } + var nodes = DOC.getElementsByTagName("*") //å®žçŽ°èŠ‚ç‚¹æŽ’åº + var alls = [] + ap.forEach.call(nodes, function (el) { + if (el._avalon) { + alls.push(el._avalon) + el._avalon = "" + el.removeAttribute("_avalon") + } + }) + if (special === "up") { + alls.reverse() + } + for (i = 0; callback = alls[i++]; ) { + if (callback.$fire.apply(callback, detail) === false) { + break + } + } + } else { + var callbacks = events[type] || [] + var all = events.$all || [] + for (i = 0; callback = callbacks[i++]; ) { + if (isFunction(callback)) + callback.apply(this, args) + } + for (i = 0; callback = all[i++]; ) { + if (isFunction(callback)) + callback.apply(this, arguments) + } + } + } +} + +/********************************************************************* + * modelFactory * + **********************************************************************/ +//avalon最核心的方法的两个方法之一(å¦ä¸€ä¸ªæ˜¯avalon.scan),返回一个ViewModel(VM) +var VMODELS = avalon.vmodels = {} //所有vmodel都储存在这里 +avalon.define = function (id, factory) { + var $id = id.$id || id + if (!$id) { + log("warning: vm必须指定$id") + } + if (VMODELS[$id]) { + log("warning: " + $id + " å·²ç»å­˜åœ¨äºŽavalon.vmodels中") + } + if (typeof id === "object") { + var model = modelFactory(id) + } else { + var scope = { + $watch: noop + } + factory(scope) //得到所有定义 + + model = modelFactory(scope) //å·å¤©æ¢æ—¥ï¼Œå°†scopeæ¢ä¸ºmodel + stopRepeatAssign = true + factory(model) + stopRepeatAssign = false + } + model.$id = $id + return VMODELS[$id] = model +} + +//一些ä¸éœ€è¦è¢«ç›‘å¬çš„属性 +var $$skipArray = String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray,$proxy,$reinitialize,$propertyNames").match(rword) +var defineProperty = Object.defineProperty +var canHideOwn = true +//如果æµè§ˆå™¨ä¸æ”¯æŒecma262v5çš„Object.defineProperties或者存在BUG,比如IE8 +//标准æµè§ˆå™¨ä½¿ç”¨__defineGetter__, __defineSetter__实现 +try { + defineProperty({}, "_", { + value: "x" + }) + var defineProperties = Object.defineProperties +} catch (e) { + canHideOwn = false +} + +function modelFactory(source, $special, $model) { + if (Array.isArray(source)) { + var arr = source.concat() + source.length = 0 + var collection = arrayFactory(source) + collection.pushArray(arr) + return collection + } + //0 null undefined || Node || VModel(fix IE6-8 createWithProxy $val: val引å‘çš„BUG) + if (!source || source.nodeType > 0 || (source.$id && source.$events)) { + return source + } + var $skipArray = Array.isArray(source.$skipArray) ? source.$skipArray : [] + $skipArray.$special = $special || {} //强制è¦ç›‘å¬çš„属性 + var $vmodel = {} //è¦è¿”回的对象, 它在IE6-8下å¯èƒ½è¢«å·é¾™è½¬å‡¤ + $model = $model || {} //vmodels.$model属性 + var $events = {} //vmodel.$events属性 + var accessors = {} //监控属性 + var computed = [] + $$skipArray.forEach(function (name) { + delete source[name] + }) + var names = Object.keys(source) + /* jshint ignore:start */ + names.forEach(function (name, accessor) { + var val = source[name] + $model[name] = val + if (isObservable(name, val, $skipArray)) { + //总共产生三ç§accessor + $events[name] = [] + var valueType = avalon.type(val) + //总共产生三ç§accessor + if (valueType === "object" && isFunction(val.get) && Object.keys(val).length <= 2) { + accessor = makeComputedAccessor(name, val) + computed.push(accessor) + } else if (rcomplexType.test(valueType)) { + accessor = makeComplexAccessor(name, val, valueType, $events[name]) + } else { + accessor = makeSimpleAccessor(name, val) + } + accessors[name] = accessor + } + }) + /* jshint ignore:end */ + + $vmodel = defineProperties($vmodel, descriptorFactory(accessors), source) //生æˆä¸€ä¸ªç©ºçš„ViewModel + for (var i = 0; i < names.length; i++) { + var name = names[i] + if (!accessors[name]) { + $vmodel[name] = source[name] + } + } + //添加$id, $model, $events, $watch, $unwatch, $fire + $vmodel.$propertyNames = names.join("­") + $vmodel.$id = generateID() + $vmodel.$model = $model + $vmodel.$events = $events + for (i in EventBus) { + var fn = EventBus[i] + if (!W3C) { //在IE6-8下,VB对象的方法里的this并ä¸æŒ‡å‘自身,需è¦ç”¨bind处ç†ä¸€ä¸‹ + fn = fn.bind($vmodel) + } + $vmodel[i] = fn + } + if (canHideOwn) { + Object.defineProperty($vmodel, "hasOwnProperty", hasOwnDescriptor) + } else { + /* jshint ignore:start */ + $vmodel.hasOwnProperty = function (name) { + return name in $vmodel.$model + } + /* jshint ignore:end */ + } + + $vmodel.$reinitialize = function () { + computed.forEach(function (accessor) { + delete accessor._value + delete accessor.oldArgs + accessor.digest = function () { + accessor.call($vmodel) + } + dependencyDetection.begin({ + callback: function (vm, dependency) {//dependency为一个accessor + var name = dependency._name + if (dependency !== accessor) { + var list = vm.$events[name] + injectDependency(list, accessor.digest) + } + } + }) + try { + accessor.get.call($vmodel) + } finally { + dependencyDetection.end() + } + }) + } + $vmodel.$reinitialize() + return $vmodel +} + +var hasOwnDescriptor = { + value: function (name) { + return name in this.$model + }, + writable: false, + enumerable: false, + configurable: true +} +//创建一个简å•è®¿é—®å™¨ +function makeSimpleAccessor(name, value) { + function accessor(value) { + var oldValue = accessor._value + if (arguments.length > 0) { + if (!stopRepeatAssign && !isEqual(value, oldValue)) { + accessor.updateValue(this, value) + accessor.notify(this, value, oldValue) + } + return this + } else { + dependencyDetection.collectDependency(this, accessor) + return oldValue + } + } + accessorFactory(accessor, name) + accessor._value = value + return accessor; +} + +//创建一个计算访问器 +function makeComputedAccessor(name, options) { + function accessor(value) {//计算属性 + var oldValue = accessor._value + var init = ("_value" in accessor) + if (arguments.length > 0) { + if (stopRepeatAssign) { + return this + } + if (typeof accessor.set === "function") { + if (accessor.oldArgs !== value) { + accessor.oldArgs = value + var $events = this.$events + var lock = $events[name] + $events[name] = [] //清空回调,防止内部冒泡而触å‘多次$fire + accessor.set.call(this, value) + $events[name] = lock + value = accessor.get.call(this) + if (value !== oldValue) { + accessor.updateValue(this, value) + accessor.notify(this, value, oldValue) //触å‘$watch回调 + } + } + } + return this + } else { + //å°†ä¾èµ–于自己的高层访问器或视图刷新函数(以绑定对象形å¼ï¼‰æ”¾åˆ°è‡ªå·±çš„订阅数组中 + //将自己注入到低层访问器的订阅数组中 + value = accessor.get.call(this) + accessor.updateValue(this, value) + if (init && oldValue !== value) { + accessor.notify(this, value, oldValue) //触å‘$watch回调 + } + return value + } + } + accessor.set = options.set + accessor.get = options.get + accessorFactory(accessor, name) + return accessor +} + +//创建一个å¤æ‚访问器 +function makeComplexAccessor(name, initValue, valueType, list) { + function accessor(value) { + var oldValue = accessor._value + + var son = accessor._vmodel + if (arguments.length > 0) { + if (stopRepeatAssign) { + return this + } + if (valueType === "array") { + var a = son, b = value, + an = a.length, + bn = b.length + a.$lock = true + if (an > bn) { + a.splice(bn, an - bn) + } else if (bn > an) { + a.push.apply(a, b.slice(an)) + } + var n = Math.min(an, bn) + for (var i = 0; i < n; i++) { + a.set(i, b[i]) + } + delete a.$lock + a._fire("set") + } else if (valueType === "object") { + var newPropertyNames = Object.keys(value).join("­") + if (son.$propertyNames === newPropertyNames) { + for (i in value) { + son[i] = value[i] + } + } else { + var sson = accessor._vmodel = modelFactory(value) + var sevent = sson.$events + var oevent = son.$events + for (var i in sevent) { + var arr = sevent[i] + if (Array.isArray(arr)) { + arr = arr.concat(oevent[i]) + } + } + sevent[subscribers] = oevent[subscribers] + sson.$proxy = son.$proxy + son = sson + } + } + accessor.updateValue(this, son.$model) + accessor.notify(this, this._value, oldValue) + return this + } else { + dependencyDetection.collectDependency(this, accessor) + return son + } + } + accessorFactory(accessor, name) + var son = accessor._vmodel = modelFactory(initValue) + son.$events[subscribers] = list + return accessor +} + +function globalUpdateValue(vmodel, value) { + vmodel.$model[this._name] = this._value = value +} + +function globalNotify(vmodel, value, oldValue) { + var name = this._name + var array = vmodel.$events[name] //刷新值 + if (array) { + fireDependencies(array) //åŒæ­¥è§†å›¾ + EventBus.$fire.call(vmodel, name, value, oldValue) //触å‘$watch回调 + } +} + +function accessorFactory(accessor, name) { + accessor._name = name + //åŒæ—¶æ›´æ–°_value与model + accessor.updateValue = globalUpdateValue + accessor.notify = globalNotify +} + +//比较两个值是å¦ç›¸ç­‰ +var isEqual = Object.is || function (v1, v2) { + if (v1 === 0 && v2 === 0) { + return 1 / v1 === 1 / v2 + } else if (v1 !== v1) { + return v2 !== v2 + } else { + return v1 === v2 + } +} + +function isObservable(name, value, $skipArray) { + if (isFunction(value) || value && value.nodeType) { + return false + } + if ($skipArray.indexOf(name) !== -1) { + return false + } + var $special = $skipArray.$special + if (name && name.charAt(0) === "$" && !$special[name]) { + return false + } + return true +} + +var descriptorFactory = W3C ? function (obj) { + var descriptors = {} + for (var i in obj) { + descriptors[i] = { + get: obj[i], + set: obj[i], + enumerable: true, + configurable: true + } + } + return descriptors +} : function (a) { + return a +} + +//===================ä¿®å¤æµè§ˆå™¨å¯¹Object.defineProperties的支æŒ================= +if (!canHideOwn) { + if ("__defineGetter__" in avalon) { + defineProperty = function (obj, prop, desc) { + if ('value' in desc) { + obj[prop] = desc.value + } + if ("get" in desc) { + obj.__defineGetter__(prop, desc.get) + } + if ('set' in desc) { + obj.__defineSetter__(prop, desc.set) + } + return obj + } + defineProperties = function (obj, descs) { + for (var prop in descs) { + if (descs.hasOwnProperty(prop)) { + defineProperty(obj, prop, descs[prop]) + } + } + return obj + } + } + if (IEVersion) { + var VBClassPool = {} + window.execScript([// jshint ignore:line + "Function parseVB(code)", + "\tExecuteGlobal(code)", + "End Function" //转æ¢ä¸€æ®µæ–‡æœ¬ä¸ºVBä»£ç  + ].join("\n"), "VBScript") + function VBMediator(instance, accessors, name, value) {// jshint ignore:line + var accessor = accessors[name] + if (arguments.length === 4) { + accessor.call(instance, value) + } else { + return accessor.call(instance) + } + } + defineProperties = function (name, accessors, properties) { + // jshint ignore:line + var buffer = [] + buffer.push( + "\r\n\tPrivate [__data__], [__proxy__]", + "\tPublic Default Function [__const__](d, p)", + "\t\tSet [__data__] = d: set [__proxy__] = p", + "\t\tSet [__const__] = Me", //链å¼è°ƒç”¨ + "\tEnd Function") + //添加普通属性,因为VBScript对象ä¸èƒ½åƒJS那样éšæ„增删属性,必须在这里预先定义好 + for (name in properties) { + if (!accessors.hasOwnProperty(name)) { + buffer.push("\tPublic [" + name + "]") + } + } + $$skipArray.forEach(function (name) { + if (!accessors.hasOwnProperty(name)) { + buffer.push("\tPublic [" + name + "]") + } + }) + buffer.push("\tPublic [" + 'hasOwnProperty' + "]") + //添加访问器属性 + for (name in accessors) { + buffer.push( + //由于ä¸çŸ¥å¯¹æ–¹ä¼šä¼ å…¥ä»€ä¹ˆ,å› æ­¤set, let都用上 + "\tPublic Property Let [" + name + "](val" + expose + ")", //setter + "\t\tCall [__proxy__](Me,[__data__], \"" + name + "\", val" + expose + ")", + "\tEnd Property", + "\tPublic Property Set [" + name + "](val" + expose + ")", //setter + "\t\tCall [__proxy__](Me,[__data__], \"" + name + "\", val" + expose + ")", + "\tEnd Property", + "\tPublic Property Get [" + name + "]", //getter + "\tOn Error Resume Next", //必须优先使用set语å¥,å¦åˆ™å®ƒä¼šè¯¯å°†æ•°ç»„当字符串返回 + "\t\tSet[" + name + "] = [__proxy__](Me,[__data__],\"" + name + "\")", + "\tIf Err.Number <> 0 Then", + "\t\t[" + name + "] = [__proxy__](Me,[__data__],\"" + name + "\")", + "\tEnd If", + "\tOn Error Goto 0", + "\tEnd Property") + + } + + buffer.push("End Class") + var body = buffer.join("\r\n") + var className =VBClassPool[body] + if (!className) { + className = generateID("VBClass") + window.parseVB("Class " + className + body) + window.parseVB([ + "Function " + className + "Factory(a, b)", //创建实例并传入两个关键的å‚æ•° + "\tDim o", + "\tSet o = (New " + className + ")(a, b)", + "\tSet " + className + "Factory = o", + "End Function" + ].join("\r\n")) + VBClassPool[body] = className + } + var ret = window[className + "Factory"](accessors, VBMediator) //å¾—åˆ°å…¶äº§å“ + return ret //å¾—åˆ°å…¶äº§å“ + } + } +} + +/********************************************************************* + * 监控数组(与ms-each, ms-repeaté…åˆä½¿ç”¨ï¼‰ * + **********************************************************************/ + +function arrayFactory(model) { + var array = [] + array.$id = generateID() + array.$model = model //æ•°æ®æ¨¡åž‹ + array.$events = {} + array.$events[subscribers] = [] + array._ = modelFactory({ + length: model.length + }) + array._.$watch("length", function (a, b) { + array.$fire("length", a, b) + }) + for (var i in EventBus) { + array[i] = EventBus[i] + } + avalon.mix(array, arrayPrototype) + return array +} + +function mutateArray(method, pos, n, index, method2, pos2, n2) { + var oldLen = this.length, loop = 2 + while (--loop) { + switch (method) { + case "add": + /* jshint ignore:start */ + var array = this.$model.slice(pos, pos + n).map(function (el) { + if (rcomplexType.test(avalon.type(el))) { + return el.$id ? el : modelFactory(el, 0, el) + } else { + return el + } + }) + /* jshint ignore:end */ + _splice.apply(this, [pos, 0].concat(array)) + this._fire("add", pos, n) + break + case "del": + var ret = this._splice(pos, n) + this._fire("del", pos, n) + break + } + if (method2) { + method = method2 + pos = pos2 + n = n2 + loop = 2 + method2 = 0 + } + } + this._fire("index", index) + if (this.length !== oldLen) { + this._.length = this.length + } + return ret +} + +var _splice = ap.splice +var arrayPrototype = { + _splice: _splice, + _fire: function (method, a, b) { + fireDependencies(this.$events[subscribers], method, a, b) + }, + size: function () { //å–得数组长度,这个函数å¯ä»¥åŒæ­¥è§†å›¾ï¼Œlengthä¸èƒ½ + return this._.length + }, + pushArray: function (array) { + var m = array.length, n = this.length + if (m) { + ap.push.apply(this.$model, array) + mutateArray.call(this, "add", n, m, Math.max(0, n - 1)) + } + return m + n + }, + push: function () { + //http://jsperf.com/closure-with-arguments + var array = [] + var i, n = arguments.length + for (i = 0; i < n; i++) { + array[i] = arguments[i] + } + return this.pushArray(array) + }, + unshift: function () { + var m = arguments.length, n = this.length + if (m) { + ap.unshift.apply(this.$model, arguments) + mutateArray.call(this, "add", 0, m, 0) + } + return m + n //IE67çš„unshiftä¸ä¼šè¿”回长度 + }, + shift: function () { + if (this.length) { + var el = this.$model.shift() + mutateArray.call(this, "del", 0, 1, 0) + return el //返回被移除的元素 + } + }, + pop: function () { + var n = this.length + if (n) { + var el = this.$model.pop() + mutateArray.call(this, "del", n - 1, 1, Math.max(0, n - 2)) + return el //返回被移除的元素 + } + }, + splice: function (start) { + var m = arguments.length, args = [], change + var removed = _splice.apply(this.$model, arguments) + if (removed.length) { //如果用户删掉了元素 + args.push("del", start, removed.length, 0) + change = true + } + if (m > 2) { //如果用户添加了元素 + if (change) { + args.splice(3, 1, 0, "add", start, m - 2) + } else { + args.push("add", start, m - 2, 0) + } + change = true + } + if (change) { //返回被移除的元素 + return mutateArray.apply(this, args) + } else { + return [] + } + }, + contains: function (el) { //判定是å¦åŒ…å« + return this.indexOf(el) !== -1 + }, + remove: function (el) { //移除第一个等于给定值的元素 + return this.removeAt(this.indexOf(el)) + }, + removeAt: function (index) { //移除指定索引上的元素 + if (index >= 0) { + this.$model.splice(index, 1) + return mutateArray.call(this, "del", index, 1, 0) + } + return [] + }, + clear: function () { + this.$model.length = this.length = this._.length = 0 //清空数组 + this._fire("clear", 0) + return this + }, + removeAll: function (all) { //移除N个元素 + if (Array.isArray(all)) { + for (var i = this.length - 1; i >= 0; i--) { + if (all.indexOf(this[i]) !== -1) { + this.removeAt(i) + } + } + } else if (typeof all === "function") { + for ( i = this.length - 1; i >= 0; i--) { + var el = this[i] + if (all(el, i)) { + this.removeAt(i) + } + } + } else { + this.clear() + } + }, + ensure: function (el) { + if (!this.contains(el)) { //åªæœ‰ä¸å­˜åœ¨æ‰push + this.push(el) + } + return this + }, + set: function (index, val) { + if (index >= 0) { + var valueType = avalon.type(val) + if (val && val.$model) { + val = val.$model + } + var target = this[index] + if (valueType === "object") { + for (var i in val) { + if (target.hasOwnProperty(i)) { + target[i] = val[i] + } + } + } else if (valueType === "array") { + target.clear().push.apply(target, val) + } else if (target !== val) { + this[index] = val + this.$model[index] = val + this._fire("set", index, val) + } + } + return this + } +} +//相当于原æ¥bindingExecutors.repeat çš„index分支 +function resetIndex(array, pos) { + var last = array.length - 1 + for (var el; el = array[pos]; pos++) { + el.$index = pos + el.$first = pos === 0 + el.$last = pos === last + } +} + +function sortByIndex(array, indexes) { + var map = {}; + for (var i = 0, n = indexes.length; i < n; i++) { + map[i] = array[i] // preserve + var j = indexes[i] + if (j in map) { + array[i] = map[j] + delete map[j] + } else { + array[i] = array[j] + } + } +} + +"sort,reverse".replace(rword, function (method) { + arrayPrototype[method] = function () { + var newArray = this.$model//这是è¦æŽ’åºçš„新数组 + var oldArray = newArray.concat() //ä¿æŒåŽŸæ¥çŠ¶æ€çš„旧数组 + var mask = Math.random() + var indexes = [] + var hasSort + ap[method].apply(newArray, arguments) //æŽ’åº + for (var i = 0, n = oldArray.length; i < n; i++) { + var neo = newArray[i] + var old = oldArray[i] + if (isEqual(neo, old)) { + indexes.push(i) + } else { + var index = oldArray.indexOf(neo) + indexes.push(index)//得到新数组的æ¯ä¸ªå…ƒç´ åœ¨æ—§æ•°ç»„对应的ä½ç½® + oldArray[index] = mask //å±è”½å·²ç»æ‰¾è¿‡çš„元素 + hasSort = true + } + } + if (hasSort) { + sortByIndex(this, indexes) + // sortByIndex(this.$proxy, indexes) + this._fire("move", indexes) + this._fire("index", 0) + } + return this + } +}) + + +/********************************************************************* + * ä¾èµ–调度系统 * + **********************************************************************/ +//检测两个对象间的ä¾èµ–关系 +var dependencyDetection = (function () { + var outerFrames = [] + var currentFrame + return { + begin: function (accessorObject) { + //accessorObject为一个拥有callback的对象 + outerFrames.push(currentFrame) + currentFrame = accessorObject + }, + end: function () { + currentFrame = outerFrames.pop() + }, + collectDependency: function (vmodel, accessor) { + if (currentFrame) { + //被dependencyDetection.begin调用 + currentFrame.callback(vmodel, accessor); + } + } + }; +})() +//将绑定对象注入到其ä¾èµ–项的订阅数组中 +var ronduplex = /^(duplex|on)$/ +avalon.injectBinding = function (data) { + var valueFn = data.evaluator + if (valueFn) { //如果是求值函数 + dependencyDetection.begin({ + callback: function (vmodel, dependency) { + injectDependency(vmodel.$events[dependency._name], data) + } + }) + try { + var value = ronduplex.test(data.type) ? data : valueFn.apply(0, data.args) + if(value === void 0){ + delete data.evaluator + } + data.handler(value, data.element, data) + } catch (e) { + //log("warning:exception throwed in [avalon.injectBinding] " + e) + delete data.evaluator + var node = data.element + if (node.nodeType === 3) { + var parent = node.parentNode + if (kernel.commentInterpolate) { + parent.replaceChild(DOC.createComment(data.value), node) + } else { + node.data = openTag + (data.oneTime ? "::" : "") + data.value + closeTag + } + } + } finally { + dependencyDetection.end() + } + } +} + +//å°†ä¾èµ–项(比它高层的访问器或构建视图刷新函数的绑定对象)注入到订阅者数组 +function injectDependency(list, data) { + if (data.oneTime) + return + if (list && avalon.Array.ensure(list, data) && data.element) { + injectDisposeQueue(data, list) + } +} + +//通知ä¾èµ–于这个访问器的订阅者更新自身 +function fireDependencies(list) { + if (list && list.length) { + if (new Date() - beginTime > 444 && typeof list[0] === "object") { + rejectDisposeQueue() + } + var args = aslice.call(arguments, 1) + for (var i = list.length, fn; fn = list[--i]; ) { + var el = fn.element + if (el && el.parentNode) { + try { + var valueFn = fn.evaluator + if (fn.$repeat) { + fn.handler.apply(fn, args) //处ç†ç›‘控数组的方法 + }else if("$repeat" in fn || !valueFn ){//如果没有eval,å…ˆeval + bindingHandlers[fn.type](fn, fn.vmodels) + } else if (fn.type !== "on") { //事件绑定åªèƒ½ç”±ç”¨æˆ·è§¦å‘,ä¸èƒ½ç”±ç¨‹åºè§¦å‘ + var value = valueFn.apply(0, fn.args || []) + fn.handler(value, el, fn) + } + } catch (e) { } + } + } + } +} +/********************************************************************* + * 定时GC回收机制 * + **********************************************************************/ +var disposeCount = 0 +var disposeQueue = avalon.$$subscribers = [] +var beginTime = new Date() +var oldInfo = {} +var uuid2Node = {} +function getUid(obj, makeID) { //IE9+,标准æµè§ˆå™¨ + if (!obj.uuid && !makeID) { + obj.uuid = ++disposeCount + uuid2Node[obj.uuid] = obj + } + return obj.uuid +} +function getNode(uuid) { + return uuid2Node[uuid] +} +//添加到回收列队中 +function injectDisposeQueue(data, list) { + var elem = data.element + if (!data.uuid) { + if (elem.nodeType !== 1) { + data.uuid = data.type + (data.pos || 0) + "-" + getUid(elem.parentNode) + } else { + data.uuid = data.name + "-" + getUid(elem) + } + } + var lists = data.lists || (data.lists = []) + avalon.Array.ensure(lists, list) + list.$uuid = list.$uuid || generateID() + if (!disposeQueue[data.uuid]) { + disposeQueue[data.uuid] = 1 + disposeQueue.push(data) + } +} + +function rejectDisposeQueue(data) { + if (avalon.optimize) + return + var i = disposeQueue.length + var n = i + var allTypes = [] + var iffishTypes = {} + var newInfo = {} + //对页é¢ä¸Šæ‰€æœ‰ç»‘定对象进行分门别类, åªæ£€æµ‹ä¸ªæ•°å‘生å˜åŒ–的类型 + while (data = disposeQueue[--i]) { + var type = data.type + if (newInfo[type]) { + newInfo[type]++ + } else { + newInfo[type] = 1 + allTypes.push(type) + } + } + var diff = false + allTypes.forEach(function (type) { + if (oldInfo[type] !== newInfo[type]) { + iffishTypes[type] = 1 + diff = true + } + }) + i = n + if (diff) { + while (data = disposeQueue[--i]) { + if (!data.element) + continue + if (iffishTypes[data.type] && shouldDispose(data.element)) { //如果它没有在DOMæ ‘ + disposeQueue.splice(i, 1) + delete disposeQueue[data.uuid] + delete uuid2Node[data.element.uuid] + var lists = data.lists + for (var k = 0, list; list = lists[k++]; ) { + avalon.Array.remove(lists, list) + avalon.Array.remove(list, data) + } + disposeData(data) + } + } + } + oldInfo = newInfo + beginTime = new Date() +} + +function disposeData(data) { + data.element = null + data.rollback && data.rollback() + for (var key in data) { + data[key] = null + } +} + +function shouldDispose(el) { + try {//IE下,如果文本节点脱离DOM树,访问parentNode会报错 + if (!el.parentNode) { + return true + } + } catch (e) { + return true + } + + return el.msRetain ? 0 : (el.nodeType === 1 ? !root.contains(el) : !avalon.contains(root, el)) +} + +/************************************************************************ + * HTML处ç†(parseHTML, innerHTML, clearHTML) * + ************************************************************************/ +// We have to close these tags to support XHTML +var tagHooks = { + area: [1, "", ""], + param: [1, "", ""], + col: [2, "", "
"], + legend: [1, "
", "
"], + option: [1, ""], + thead: [1, "", "
"], + tr: [2, "", "
"], + td: [3, "", "
"], + g: [1, '', ''], + //IE6-8在用innerHTML生æˆèŠ‚点时,ä¸èƒ½ç›´æŽ¥åˆ›å»ºno-scope元素与HTML5的新标签 + _default: W3C ? [0, "", ""] : [1, "X
", "
"] //divå¯ä»¥ä¸ç”¨é—­åˆ +} +tagHooks.th = tagHooks.td +tagHooks.optgroup = tagHooks.option +tagHooks.tbody = tagHooks.tfoot = tagHooks.colgroup = tagHooks.caption = tagHooks.thead +String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(rword, function (tag) { + tagHooks[tag] = tagHooks.g //处ç†SVG +}) +var rtagName = /<([\w:]+)/ //å–å¾—å…¶tagName +var rxhtml = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig +var rcreate = W3C ? /[^\d\D]/ : /(<(?:script|link|style|meta|noscript))/ig +var scriptTypes = oneObject(["", "text/javascript", "text/ecmascript", "application/ecmascript", "application/javascript"]) +var rnest = /<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/ //需è¦å¤„ç†å¥—嵌关系的标签 +var script = DOC.createElement("script") +var rhtml = /<|&#?\w+;/ +avalon.parseHTML = function (html) { + var fragment = avalonFragment.cloneNode(false) + if (typeof html !== "string") { + return fragment + } + if (!rhtml.test(html)) { + fragment.appendChild(DOC.createTextNode(html)) + return fragment + } + html = html.replace(rxhtml, "<$1>").trim() + var tag = (rtagName.exec(html) || ["", ""])[1].toLowerCase(), + //å–得其标签å + wrap = tagHooks[tag] || tagHooks._default, + wrapper = cinerator, + firstChild, neo + if (!W3C) { //fix IE + html = html.replace(rcreate, "
$1") //在link style script等标签之å‰æ·»åŠ ä¸€ä¸ªè¡¥ä¸ + } + wrapper.innerHTML = wrap[1] + html + wrap[2] + var els = wrapper.getElementsByTagName("script") + if (els.length) { //使用innerHTML生æˆçš„script节点ä¸ä¼šå‘出请求与执行text属性 + for (var i = 0, el; el = els[i++]; ) { + if (scriptTypes[el.type]) { + //以å·é¾™è½¬å‡¤æ–¹å¼æ¢å¤æ‰§è¡Œè„šæœ¬åŠŸèƒ½ + neo = script.cloneNode(false) //FFä¸èƒ½çœç•¥å‚æ•° + ap.forEach.call(el.attributes, function (attr) { + if (attr && attr.specified) { + neo[attr.name] = attr.value //å¤åˆ¶å…¶å±žæ€§ + neo.setAttribute(attr.name, attr.value) + } + }) // jshint ignore:line + neo.text = el.text + el.parentNode.replaceChild(neo, el) //替æ¢èŠ‚点 + } + } + } + if (!W3C) { //fix IE + var target = wrap[1] === "X
" ? wrapper.lastChild.firstChild : wrapper.lastChild + if (target && target.tagName === "TABLE" && tag !== "tbody") { + //IE6-7å¤„ç† --> , + // --> , + // -->
+ for (els = target.childNodes, i = 0; el = els[i++]; ) { + if (el.tagName === "TBODY" && !el.innerHTML) { + target.removeChild(el) + break + } + } + } + els = wrapper.getElementsByTagName("br") + var n = els.length + while (el = els[--n]) { + if (el.className === "msNoScope") { + el.parentNode.removeChild(el) + } + } + for (els = wrapper.all, i = 0; el = els[i++]; ) { //fix VML + if (isVML(el)) { + fixVML(el) + } + } + } + //移除我们为了符åˆå¥—嵌关系而添加的标签 + for (i = wrap[0]; i--; wrapper = wrapper.lastChild) { + } + while (firstChild = wrapper.firstChild) { // å°†wrapperä¸Šçš„èŠ‚ç‚¹è½¬ç§»åˆ°æ–‡æ¡£ç¢Žç‰‡ä¸Šï¼ + fragment.appendChild(firstChild) + } + return fragment +} + +function isVML(src) { + var nodeName = src.nodeName + return nodeName.toLowerCase() === nodeName && src.scopeName && src.outerText === "" +} + +function fixVML(node) { + if (node.currentStyle.behavior !== "url(#default#VML)") { + node.style.behavior = "url(#default#VML)" + node.style.display = "inline-block" + node.style.zoom = 1 //hasLayout + } +} +avalon.innerHTML = function (node, html) { + if (!W3C && (!rcreate.test(html) && !rnest.test(html))) { + try { + node.innerHTML = html + return + } catch (e) { + } + } + var a = this.parseHTML(html) + this.clearHTML(node).appendChild(a) +} +avalon.clearHTML = function (node) { + node.textContent = "" + while (node.firstChild) { + node.removeChild(node.firstChild) + } + return node +} + +/********************************************************************* + * avalon的原型方法定义区 * + **********************************************************************/ + +function hyphen(target) { + //转æ¢ä¸ºè¿žå­—符线风格 + return target.replace(/([a-z\d])([A-Z]+)/g, "$1-$2").toLowerCase() +} + +function camelize(target) { + //æå‰åˆ¤æ–­ï¼Œæ高getStyle等的效率 + if (!target || target.indexOf("-") < 0 && target.indexOf("_") < 0) { + return target + } + //转æ¢ä¸ºé©¼å³°é£Žæ ¼ + return target.replace(/[-_][^-_]/g, function(match) { + return match.charAt(1).toUpperCase() + }) +} + +var fakeClassListMethods = { + _toString: function() { + var node = this.node + var cls = node.className + var str = typeof cls === "string" ? cls : cls.baseVal + return str.split(/\s+/).join(" ") + }, + _contains: function(cls) { + return (" " + this + " ").indexOf(" " + cls + " ") > -1 + }, + _add: function(cls) { + if (!this.contains(cls)) { + this._set(this + " " + cls) + } + }, + _remove: function(cls) { + this._set((" " + this + " ").replace(" " + cls + " ", " ")) + }, + __set: function(cls) { + cls = cls.trim() + var node = this.node + if (rsvg.test(node)) { + //SVG元素的className是一个对象 SVGAnimatedString { baseVal="", animVal=""},åªèƒ½é€šè¿‡set/getAttributeæ“作 + node.setAttribute("class", cls) + } else { + node.className = cls + } + } //toggle存在版本差异,因此ä¸ä½¿ç”¨å®ƒ +} + + function fakeClassList(node) { + if (!("classList" in node)) { + node.classList = { + node: node + } + for (var k in fakeClassListMethods) { + node.classList[k.slice(1)] = fakeClassListMethods[k] + } + } + return node.classList + } + + + "add,remove".replace(rword, function(method) { + avalon.fn[method + "Class"] = function(cls) { + var el = this[0] + //https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/26 + if (cls && typeof cls === "string" && el && el.nodeType === 1) { + cls.replace(/\S+/g, function(c) { + fakeClassList(el)[method](c) + }) + } + return this + } + }) + avalon.fn.mix({ + hasClass: function(cls) { + var el = this[0] || {} + return el.nodeType === 1 && fakeClassList(el).contains(cls) + }, + toggleClass: function(value, stateVal) { + var className, i = 0 + var classNames = String(value).split(/\s+/) + var isBool = typeof stateVal === "boolean" + while ((className = classNames[i++])) { + var state = isBool ? stateVal : !this.hasClass(className) + this[state ? "addClass" : "removeClass"](className) + } + return this + }, + attr: function(name, value) { + if (arguments.length === 2) { + this[0].setAttribute(name, value) + return this + } else { + return this[0].getAttribute(name) + } + }, + data: function(name, value) { + name = "data-" + hyphen(name || "") + switch (arguments.length) { + case 2: + this.attr(name, value) + return this + case 1: + var val = this.attr(name) + return parseData(val) + case 0: + var ret = {} + ap.forEach.call(this[0].attributes, function(attr) { + if (attr) { + name = attr.name + if (!name.indexOf("data-")) { + name = camelize(name.slice(5)) + ret[name] = parseData(attr.value) + } + } + }) + return ret + } + }, + removeData: function(name) { + name = "data-" + hyphen(name) + this[0].removeAttribute(name) + return this + }, + css: function(name, value) { + if (avalon.isPlainObject(name)) { + for (var i in name) { + avalon.css(this, i, name[i]) + } + } else { + var ret = avalon.css(this, name, value) + } + return ret !== void 0 ? ret : this + }, + position: function() { + var offsetParent, offset, + elem = this[0], + parentOffset = { + top: 0, + left: 0 + } + if (!elem) { + return + } + if (this.css("position") === "fixed") { + offset = elem.getBoundingClientRect() + } else { + offsetParent = this.offsetParent() //得到真正的offsetParent + offset = this.offset() // 得到正确的offsetParent + if (offsetParent[0].tagName !== "HTML") { + parentOffset = offsetParent.offset() + } + parentOffset.top += avalon.css(offsetParent[0], "borderTopWidth", true) + parentOffset.left += avalon.css(offsetParent[0], "borderLeftWidth", true) + + // Subtract offsetParent scroll positions + parentOffset.top -= offsetParent.scrollTop() + parentOffset.left -= offsetParent.scrollLeft() + } + return { + top: offset.top - parentOffset.top - avalon.css(elem, "marginTop", true), + left: offset.left - parentOffset.left - avalon.css(elem, "marginLeft", true) + } + }, + offsetParent: function() { + var offsetParent = this[0].offsetParent + while (offsetParent && avalon.css(offsetParent, "position") === "static") { + offsetParent = offsetParent.offsetParent; + } + return avalon(offsetParent || root) + }, + bind: function(type, fn, phase) { + if (this[0]) { //此方法ä¸ä¼šé“¾ + return avalon.bind(this[0], type, fn, phase) + } + }, + unbind: function(type, fn, phase) { + if (this[0]) { + avalon.unbind(this[0], type, fn, phase) + } + return this + }, + val: function(value) { + var node = this[0] + if (node && node.nodeType === 1) { + var get = arguments.length === 0 + var access = get ? ":get" : ":set" + var fn = valHooks[getValType(node) + access] + if (fn) { + var val = fn(node, value) + } else if (get) { + return (node.value || "").replace(/\r/g, "") + } else { + node.value = value + } + } + return get ? val : this + } + }) + + function parseData(data) { + try { + if (typeof data === "object") + return data + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? avalon.parseJSON(data) : data + } catch (e) {} + return data + } +var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, + rvalidchars = /^[\],:{}\s]*$/, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, + rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g +avalon.parseJSON = window.JSON ? JSON.parse : function(data) { + if (typeof data === "string") { + data = data.trim(); + if (data) { + if (rvalidchars.test(data.replace(rvalidescape, "@") + .replace(rvalidtokens, "]") + .replace(rvalidbraces, ""))) { + return (new Function("return " + data))() // jshint ignore:line + } + } + avalon.error("Invalid JSON: " + data) + } + return data +} + +//生æˆavalon.fn.scrollLeft, avalon.fn.scrollTop方法 +avalon.each({ + scrollLeft: "pageXOffset", + scrollTop: "pageYOffset" +}, function(method, prop) { + avalon.fn[method] = function(val) { + var node = this[0] || {}, win = getWindow(node), + top = method === "scrollTop" + if (!arguments.length) { + return win ? (prop in win) ? win[prop] : root[method] : node[method] + } else { + if (win) { + win.scrollTo(!top ? val : avalon(win).scrollLeft(), top ? val : avalon(win).scrollTop()) + } else { + node[method] = val + } + } + } +}) + +function getWindow(node) { + return node.window && node.document ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false; +} +//=============================css相关======================= +var cssHooks = avalon.cssHooks = {} +var prefixes = ["", "-webkit-", "-o-", "-moz-", "-ms-"] +var cssMap = { + "float": W3C ? "cssFloat" : "styleFloat" +} +avalon.cssNumber = oneObject("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom") + +avalon.cssName = function(name, host, camelCase) { + if (cssMap[name]) { + return cssMap[name] + } + host = host || root.style + for (var i = 0, n = prefixes.length; i < n; i++) { + camelCase = camelize(prefixes[i] + name) + if (camelCase in host) { + return (cssMap[name] = camelCase) + } + } + return null +} +cssHooks["@:set"] = function(node, name, value) { + try { //node.style.width = NaN;node.style.width = "xxxxxxx";node.style.width = undefine 在旧å¼IE下会抛异常 + node.style[name] = value + } catch (e) {} +} +if (window.getComputedStyle) { + cssHooks["@:get"] = function(node, name) { + if (!node || !node.style) { + throw new Error("getComputedStyleè¦æ±‚传入一个节点 " + node) + } + var ret, styles = getComputedStyle(node, null) + if (styles) { + ret = name === "filter" ? styles.getPropertyValue(name) : styles[name] + if (ret === "") { + ret = node.style[name] //其他æµè§ˆå™¨éœ€è¦æˆ‘们手动å–内è”æ ·å¼ + } + } + return ret + } + cssHooks["opacity:get"] = function(node) { + var ret = cssHooks["@:get"](node, "opacity") + return ret === "" ? "1" : ret + } +} else { + var rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i + var rposition = /^(top|right|bottom|left)$/ + var ralpha = /alpha\([^)]*\)/i + var ie8 = !! window.XDomainRequest + var salpha = "DXImageTransform.Microsoft.Alpha" + var border = { + thin: ie8 ? '1px' : '2px', + medium: ie8 ? '3px' : '4px', + thick: ie8 ? '5px' : '6px' + } + cssHooks["@:get"] = function(node, name) { + //å–得精确值,ä¸è¿‡å®ƒæœ‰å¯èƒ½æ˜¯å¸¦em,pc,mm,pt,%ç­‰å•ä½ + var currentStyle = node.currentStyle + var ret = currentStyle[name] + if ((rnumnonpx.test(ret) && !rposition.test(ret))) { + //①,ä¿å­˜åŽŸæœ‰çš„style.left, runtimeStyle.left, + var style = node.style, + left = style.left, + rsLeft = node.runtimeStyle.left + //②由于③处的style.left = xxx会影å“到currentStyle.left, + //因此把它currentStyle.left放到runtimeStyle.left, + //runtimeStyle.left拥有最高优先级,ä¸ä¼šstyle.leftå½±å“ + node.runtimeStyle.left = currentStyle.left + //③将精确值赋给到style.left,然åŽé€šè¿‡IEçš„å¦ä¸€ä¸ªç§æœ‰å±žæ€§ style.pixelLeft + //得到å•ä½ä¸ºpx的结果;fontSize的分支è§http://bugs.jquery.com/ticket/760 + style.left = name === 'fontSize' ? '1em' : (ret || 0) + ret = style.pixelLeft + "px" + //④还原 style.left,runtimeStyle.left + style.left = left + node.runtimeStyle.left = rsLeft + } + if (ret === "medium") { + name = name.replace("Width", "Style") + //border width 默认值为medium,å³ä½¿å…¶ä¸º0" + if (currentStyle[name] === "none") { + ret = "0px" + } + } + return ret === "" ? "auto" : border[ret] || ret + } + cssHooks["opacity:set"] = function(node, name, value) { + var style = node.style + var opacity = isFinite(value) && value <= 1 ? "alpha(opacity=" + value * 100 + ")" : "" + var filter = style.filter || ""; + style.zoom = 1 + //ä¸èƒ½ä½¿ç”¨ä»¥ä¸‹æ–¹å¼è®¾ç½®é€æ˜Žåº¦ + //node.filters.alpha.opacity = value * 100 + style.filter = (ralpha.test(filter) ? + filter.replace(ralpha, opacity) : + filter + " " + opacity).trim() + if (!style.filter) { + style.removeAttribute("filter") + } + } + cssHooks["opacity:get"] = function(node) { + //这是最快的获å–IEé€æ˜Žå€¼çš„æ–¹å¼ï¼Œä¸éœ€è¦åŠ¨ç”¨æ­£åˆ™äº†ï¼ + var alpha = node.filters.alpha || node.filters[salpha], + op = alpha && alpha.enabled ? alpha.opacity : 100 + return (op / 100) + "" //ç¡®ä¿è¿”回的是字符串 + } +} + +"top,left".replace(rword, function(name) { + cssHooks[name + ":get"] = function(node) { + var computed = cssHooks["@:get"](node, name) + return /px$/.test(computed) ? computed : + avalon(node).position()[name] + "px" + } +}) + +var cssShow = { + position: "absolute", + visibility: "hidden", + display: "block" +} + +var rdisplayswap = /^(none|table(?!-c[ea]).+)/ + + function showHidden(node, array) { + //http://www.cnblogs.com/rubylouvre/archive/2012/10/27/2742529.html + if (node.offsetWidth <= 0) { //opera.offsetWidthå¯èƒ½å°äºŽ0 + if (rdisplayswap.test(cssHooks["@:get"](node, "display"))) { + var obj = { + node: node + } + for (var name in cssShow) { + obj[name] = node.style[name] + node.style[name] = cssShow[name] + } + array.push(obj) + } + var parent = node.parentNode + if (parent && parent.nodeType === 1) { + showHidden(parent, array) + } + } + } + "Width,Height".replace(rword, function(name) { //fix 481 + var method = name.toLowerCase(), + clientProp = "client" + name, + scrollProp = "scroll" + name, + offsetProp = "offset" + name + cssHooks[method + ":get"] = function(node, which, override) { + var boxSizing = -4 + if (typeof override === "number") { + boxSizing = override + } + which = name === "Width" ? ["Left", "Right"] : ["Top", "Bottom"] + var ret = node[offsetProp] // border-box 0 + if (boxSizing === 2) { // margin-box 2 + return ret + avalon.css(node, "margin" + which[0], true) + avalon.css(node, "margin" + which[1], true) + } + if (boxSizing < 0) { // padding-box -2 + ret = ret - avalon.css(node, "border" + which[0] + "Width", true) - avalon.css(node, "border" + which[1] + "Width", true) + } + if (boxSizing === -4) { // content-box -4 + ret = ret - avalon.css(node, "padding" + which[0], true) - avalon.css(node, "padding" + which[1], true) + } + return ret + } + cssHooks[method + "&get"] = function(node) { + var hidden = []; + showHidden(node, hidden); + var val = cssHooks[method + ":get"](node) + for (var i = 0, obj; obj = hidden[i++];) { + node = obj.node + for (var n in obj) { + if (typeof obj[n] === "string") { + node.style[n] = obj[n] + } + } + } + return val; + } + avalon.fn[method] = function(value) { //会忽视其display + var node = this[0] + if (arguments.length === 0) { + if (node.setTimeout) { //å–得窗å£å°ºå¯¸,IE9åŽå¯ä»¥ç”¨node.innerWidth /innerHeight代替 + return node["inner" + name] || node.document.documentElement[clientProp] + } + if (node.nodeType === 9) { //å–得页é¢å°ºå¯¸ + var doc = node.documentElement + //FF chrome html.scrollHeight< body.scrollHeight + //IE æ ‡å‡†æ¨¡å¼ : html.scrollHeight> body.scrollHeight + //IE æ€ªå¼‚æ¨¡å¼ : html.scrollHeight 最大等于å¯è§†çª—å£å¤šä¸€ç‚¹ï¼Ÿ + return Math.max(node.body[scrollProp], doc[scrollProp], node.body[offsetProp], doc[offsetProp], doc[clientProp]) + } + return cssHooks[method + "&get"](node) + } else { + return this.css(method, value) + } + } + avalon.fn["inner" + name] = function() { + return cssHooks[method + ":get"](this[0], void 0, -2) + } + avalon.fn["outer" + name] = function(includeMargin) { + return cssHooks[method + ":get"](this[0], void 0, includeMargin === true ? 2 : 0) + } + }) + avalon.fn.offset = function() { //å–å¾—è·ç¦»é¡µé¢å·¦å³è§’çš„åæ ‡ + var node = this[0], + box = { + left: 0, + top: 0 + } + if (!node || !node.tagName || !node.ownerDocument) { + return box + } + var doc = node.ownerDocument, + body = doc.body, + root = doc.documentElement, + win = doc.defaultView || doc.parentWindow + if (!avalon.contains(root, node)) { + return box + } + //http://hkom.blog1.fc2.com/?mode=m&no=750 bodyçš„å移é‡æ˜¯ä¸åŒ…å«marginçš„ + //我们å¯ä»¥é€šè¿‡getBoundingClientRectæ¥èŽ·å¾—元素相对于clientçš„rect. + //http://msdn.microsoft.com/en-us/library/ms536433.aspx + if (node.getBoundingClientRect) { + box = node.getBoundingClientRect() // BlackBerry 5, iOS 3 (original iPhone) + } + //chrome/IE6: body.scrollTop, firefox/other: root.scrollTop + var clientTop = root.clientTop || body.clientTop, + clientLeft = root.clientLeft || body.clientLeft, + scrollTop = Math.max(win.pageYOffset || 0, root.scrollTop, body.scrollTop), + scrollLeft = Math.max(win.pageXOffset || 0, root.scrollLeft, body.scrollLeft) + // 把滚动è·ç¦»åŠ åˆ°left,top中去。 + // IE一些版本中会自动为HTML元素加上2pxçš„border,我们需è¦åŽ»æŽ‰å®ƒ + // http://msdn.microsoft.com/en-us/library/ms533564(VS.85).aspx + return { + top: box.top + scrollTop - clientTop, + left: box.left + scrollLeft - clientLeft + } + } + + //==================================val相关============================ + + function getValType(elem) { + var ret = elem.tagName.toLowerCase() + return ret === "input" && /checkbox|radio/.test(elem.type) ? "checked" : ret + } +var roption = /^]+))?)*\s+value[\s=]/i +var valHooks = { + "option:get": IEVersion ? function(node) { + //在IE11åŠW3C,如果没有指定value,那么node.value默认为node.text(存在trim作),但IE9-10则是å–innerHTML(没trimæ“作) + //specified并ä¸å¯é ï¼Œå› æ­¤é€šè¿‡åˆ†æžouterHTML判定用户有没有显示定义value + return roption.test(node.outerHTML) ? node.value : node.text.trim() + } : function(node) { + return node.value + }, + "select:get": function(node, value) { + var option, options = node.options, + index = node.selectedIndex, + getter = valHooks["option:get"], + one = node.type === "select-one" || index < 0, + values = one ? null : [], + max = one ? index + 1 : options.length, + i = index < 0 ? max : one ? index : 0 + for (; i < max; i++) { + option = options[i] + //æ—§å¼IE在resetåŽä¸ä¼šæ”¹å˜selected,需è¦æ”¹ç”¨i === index判定 + //我们过滤所有disabledçš„option元素,但在safari5下,如果设置select为disable,那么其所有孩å­éƒ½disable + //因此当一个元素为disable,需è¦æ£€æµ‹å…¶æ˜¯å¦æ˜¾å¼è®¾ç½®äº†disableåŠå…¶çˆ¶èŠ‚点的disable情况 + if ((option.selected || i === index) && !option.disabled) { + value = getter(option) + if (one) { + return value + } + //收集所有selected值组æˆæ•°ç»„返回 + values.push(value) + } + } + return values + }, + "select:set": function(node, values, optionSet) { + values = [].concat(values) //强制转æ¢ä¸ºæ•°ç»„ + var getter = valHooks["option:get"] + for (var i = 0, el; el = node.options[i++];) { + if ((el.selected = values.indexOf(getter(el)) > -1)) { + optionSet = true + } + } + if (!optionSet) { + node.selectedIndex = -1 + } + } +} + +/********************************************************************* + * 编译系统 * + **********************************************************************/ +var meta = { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"': '\\"', + '\\': '\\\\' +} +var quote = window.JSON && JSON.stringify || function(str) { + return '"' + str.replace(/[\\\"\x00-\x1f]/g, function(a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' +} + +var keywords = [ + "break,case,catch,continue,debugger,default,delete,do,else,false", + "finally,for,function,if,in,instanceof,new,null,return,switch,this", + "throw,true,try,typeof,var,void,while,with", /* 关键字*/ + "abstract,boolean,byte,char,class,const,double,enum,export,extends", + "final,float,goto,implements,import,int,interface,long,native", + "package,private,protected,public,short,static,super,synchronized", + "throws,transient,volatile", /*ä¿ç•™å­—*/ + "arguments,let,yield,undefined" /* ECMA 5 - use strict*/].join(",") +var rrexpstr = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g +var rsplit = /[^\w$]+/g +var rkeywords = new RegExp(["\\b" + keywords.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g') +var rnumber = /\b\d[^,]*/g +var rcomma = /^,+|,+$/g +var variablePool = new Cache(512) +var getVariables = function (code) { + var key = "," + code.trim() + var ret = variablePool.get(key) + if (ret) { + return ret + } + var match = code + .replace(rrexpstr, "") + .replace(rsplit, ",") + .replace(rkeywords, "") + .replace(rnumber, "") + .replace(rcomma, "") + .split(/^$|,+/) + return variablePool.put(key, uniqSet(match)) +} +/*添加赋值语å¥*/ + +function addAssign(vars, scope, name, data) { + var ret = [], + prefix = " = " + name + "." + for (var i = vars.length, prop; prop = vars[--i]; ) { + if (scope.hasOwnProperty(prop)) { + ret.push(prop + prefix + prop) + data.vars.push(prop) + if (data.type === "duplex") { + vars.get = name + "." + prop + } + vars.splice(i, 1) + } + } + return ret +} + +function uniqSet(array) { + var ret = [], + unique = {} + for (var i = 0; i < array.length; i++) { + var el = array[i] + var id = el && typeof el.$id === "string" ? el.$id : el + if (!unique[id]) { + unique[id] = ret.push(el) + } + } + return ret +} +//缓存求值函数,以便多次利用 +var evaluatorPool = new Cache(128) +//å–得求值函数åŠå…¶ä¼ å‚ +var rduplex = /\w\[.*\]|\w\.\w/ +var rproxy = /(\$proxy\$[a-z]+)\d+$/ +var rthimRightParentheses = /\)\s*$/ +var rthimOtherParentheses = /\)\s*\|/g +var rquoteFilterName = /\|\s*([$\w]+)/g +var rpatchBracket = /"\s*\["/g +var rthimLeftParentheses = /"\s*\(/g +function parseFilter(val, filters) { + filters = filters + .replace(rthimRightParentheses, "")//处ç†æœ€åŽçš„å°æ‹¬å· + .replace(rthimOtherParentheses, function () {//处ç†å…¶ä»–å°æ‹¬å· + return "],|" + }) + .replace(rquoteFilterName, function (a, b) { //处ç†|åŠå®ƒåŽé¢çš„过滤器的åå­— + return "[" + quote(b) + }) + .replace(rpatchBracket, function () { + return '"],["' + }) + .replace(rthimLeftParentheses, function () { + return '",' + }) + "]" + return "return avalon.filters.$filter(" + val + ", " + filters + ")" +} + +function parseExpr(code, scopes, data) { + var dataType = data.type + var filters = data.filters || "" + var exprId = scopes.map(function (el) { + return String(el.$id).replace(rproxy, "$1") + }) + code + dataType + filters + var vars = getVariables(code).concat(), + assigns = [], + names = [], + args = [], + prefix = "" + //args 是一个对象数组, names 是将è¦ç”Ÿæˆçš„求值函数的å‚æ•° + scopes = uniqSet(scopes) + data.vars = [] + for (var i = 0, sn = scopes.length; i < sn; i++) { + if (vars.length) { + var name = "vm" + expose + "_" + i + names.push(name) + args.push(scopes[i]) + assigns.push.apply(assigns, addAssign(vars, scopes[i], name, data)) + } + } + if (!assigns.length && dataType === "duplex") { + return + } + if (dataType !== "duplex" && (code.indexOf("||") > -1 || code.indexOf("&&") > -1)) { + //https://github.com/RubyLouvre/avalon/issues/583 + data.vars.forEach(function (v) { + var reg = new RegExp("\\b" + v + "(?:\\.\\w+|\\[\\w+\\])+", "ig") + code = code.replace(reg, function (_) { + var c = _.charAt(v.length) + var r = IEVersion ? code.slice(arguments[1] + _.length) : RegExp.rightContext + var method = /^\s*\(/.test(r) + if (c === "." || c === "[" || method) {//比如v为aa,我们åªåŒ¹é…aa.bb,aa[cc],ä¸åŒ¹é…aaa.xxx + var name = "var" + String(Math.random()).replace(/^0\./, "") + if (method) {//array.size() + var array = _.split(".") + if (array.length > 2) { + var last = array.pop() + assigns.push(name + " = " + array.join(".")) + return name + "." + last + } else { + return _ + } + } + assigns.push(name + " = " + _) + return name + } else { + return _ + } + }) + }) + } + //---------------args---------------- + data.args = args + //---------------cache---------------- + delete data.vars + var fn = evaluatorPool.get(exprId) //直接从缓存,å…å¾—é‡å¤ç”Ÿæˆ + if (fn) { + data.evaluator = fn + return + } + prefix = assigns.join(", ") + if (prefix) { + prefix = "var " + prefix + } + if (/\S/.test(filters)) { //文本绑定,åŒå·¥ç»‘定æ‰æœ‰è¿‡æ»¤å™¨ + if (!/text|html/.test(data.type)) { + throw Error("ms-" + data.type + "ä¸æ”¯æŒè¿‡æ»¤å™¨") + } + code = "\nvar ret" + expose + " = " + code + ";\r\n" + code += parseFilter("ret" + expose, filters) + } else if (dataType === "duplex") { //åŒå·¥ç»‘定 + var _body = "'use strict';\nreturn function(vvv){\n\t" + + prefix + + ";\n\tif(!arguments.length){\n\t\treturn " + + code + + "\n\t}\n\t" + (!rduplex.test(code) ? vars.get : code) + + "= vvv;\n} " + try { + fn = Function.apply(noop, names.concat(_body)) + data.evaluator = evaluatorPool.put(exprId, fn) + } catch (e) { + log("debug: parse error," + e.message) + } + return + } else if (dataType === "on") { //事件绑定 + if (code.indexOf("(") === -1) { + code += ".call(this, $event)" + } else { + code = code.replace("(", ".call(this,") + } + names.push("$event") + code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需è¦Function("return ;") + var lastIndex = code.lastIndexOf("\nreturn") + var header = code.slice(0, lastIndex) + var footer = code.slice(lastIndex) + code = header + "\n" + footer + } else { //其他绑定 + code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需è¦Function("return ;") + } + try { + fn = Function.apply(noop, names.concat("'use strict';\n" + prefix + code)) + data.evaluator = evaluatorPool.put(exprId, fn) + } catch (e) { + log("debug: parse error," + e.message) + } finally { + vars = assigns = names = null //释放内存 + } +} + + +//parseExprçš„æ™ºèƒ½å¼•ç”¨ä»£ç† + +function parseExprProxy(code, scopes, data, tokens, noRegister) { + if (Array.isArray(tokens)) { + code = tokens.map(function (el) { + return el.expr ? "(" + el.value + ")" : quote(el.value) + }).join(" + ") + } + parseExpr(code, scopes, data) + if (data.evaluator && !noRegister) { + data.handler = bindingExecutors[data.handlerName || data.type] + //方便调试 + //这里éžå¸¸é‡è¦,我们通过判定视图刷新函数的element是å¦åœ¨DOM树决定 + //将它移出订阅者列表 + avalon.injectBinding(data) + } +} +avalon.parseExprProxy = parseExprProxy +/********************************************************************* + * 扫æ系统 * + **********************************************************************/ + +avalon.scan = function(elem, vmodel) { + elem = elem || root + var vmodels = vmodel ? [].concat(vmodel) : [] + scanTag(elem, vmodels) +} + +//http://www.w3.org/TR/html5/syntax.html#void-elements +var stopScan = oneObject("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()) + +function checkScan(elem, callback, innerHTML) { + var id = setTimeout(function() { + var currHTML = elem.innerHTML + clearTimeout(id) + if (currHTML === innerHTML) { + callback() + } else { + checkScan(elem, callback, currHTML) + } + }) +} + + +function createSignalTower(elem, vmodel) { + var id = elem.getAttribute("avalonctrl") || vmodel.$id + elem.setAttribute("avalonctrl", id) + vmodel.$events.expr = elem.tagName + '[avalonctrl="' + id + '"]' +} + +var getBindingCallback = function(elem, name, vmodels) { + var callback = elem.getAttribute(name) + if (callback) { + for (var i = 0, vm; vm = vmodels[i++]; ) { + if (vm.hasOwnProperty(callback) && typeof vm[callback] === "function") { + return vm[callback] + } + } + } +} + +function executeBindings(bindings, vmodels) { + for (var i = 0, data; data = bindings[i++]; ) { + data.vmodels = vmodels + bindingHandlers[data.type](data, vmodels) + if (data.evaluator && data.element && data.element.nodeType === 1) { //移除数æ®ç»‘å®šï¼Œé˜²æ­¢è¢«äºŒæ¬¡è§£æž + //chrome使用removeAttributeNode移除ä¸å­˜åœ¨çš„特性节点时会报错 https://github.com/RubyLouvre/avalon/issues/99 + data.element.removeAttribute(data.name) + } + } + bindings.length = 0 +} + +//https://github.com/RubyLouvre/avalon/issues/636 +var mergeTextNodes = IEVersion && window.MutationObserver ? function (elem) { + var node = elem.firstChild, text + while (node) { + var aaa = node.nextSibling + if (node.nodeType === 3) { + if (text) { + text.nodeValue += node.nodeValue + elem.removeChild(node) + } else { + text = node + } + } else { + text = null + } + node = aaa + } +} : 0 +var roneTime = /^\s*::/ +var rmsAttr = /ms-(\w+)-?(.*)/ +var priorityMap = { + "if": 10, + "repeat": 90, + "data": 100, + "widget": 110, + "each": 1400, + "with": 1500, + "duplex": 2000, + "on": 3000 +} + +var events = oneObject("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit") +var obsoleteAttrs = oneObject("value,title,alt,checked,selected,disabled,readonly,enabled") +function bindingSorter(a, b) { + return a.priority - b.priority +} + +function scanAttr(elem, vmodels, match) { + var scanNode = true + if (vmodels.length) { + var attributes = getAttributes ? getAttributes(elem) : elem.attributes + var bindings = [] + var fixAttrs = [] + var msData = {} + for (var i = 0, attr; attr = attributes[i++]; ) { + if (attr.specified) { + if (match = attr.name.match(rmsAttr)) { + //如果是以指定å‰ç¼€å‘½åçš„ + var type = match[1] + var param = match[2] || "" + var value = attr.value + var name = attr.name + if (events[type]) { + param = type + type = "on" + } else if (obsoleteAttrs[type]) { + if (type === "enabled") {//åƒæŽ‰ms-enabled绑定,用ms-disabled代替 + log("warning!ms-enabled或ms-attr-enabledå·²ç»è¢«åºŸå¼ƒ") + type = "disabled" + value = "!(" + value + ")" + } + param = type + type = "attr" + name = "ms-" + type + "-"+ param + fixAttrs.push([attr.name, name, value]) + } + msData[name] = value + if (typeof bindingHandlers[type] === "function") { + var newValue = value.replace(roneTime, "") + var oneTime = value !== newValue + var binding = { + type: type, + param: param, + element: elem, + name: name, + value: newValue, + oneTime: oneTime, + uuid: name+"-"+getUid(elem), + //chrome与firefox下Number(param)得到的值ä¸ä¸€æ · #855 + priority: (priorityMap[type] || type.charCodeAt(0) * 10 )+ (Number(param.replace(/\D/g, "")) || 0) + } + if (type === "html" || type === "text") { + var token = getToken(value) + avalon.mix(binding, token) + binding.filters = binding.filters.replace(rhasHtml, function () { + binding.type = "html" + binding.group = 1 + return "" + })// jshint ignore:line + } else if (type === "duplex") { + var hasDuplex = name + } else if (name === "ms-if-loop") { + binding.priority += 100 + } + bindings.push(binding) + if (type === "widget") { + elem.msData = elem.msData || msData + } + } + } + } + } + if (bindings.length) { + bindings.sort(bindingSorter) + fixAttrs.forEach(function (arr) { + log("warning!请改用" + arr[1] + "代替" + arr[0] + "!") + elem.removeAttribute(arr[0]) + elem.setAttribute(arr[1], arr[2]) + }) + //http://bugs.jquery.com/ticket/7071 + //在IE下对VML读å–type属性,会让此元素所有属性都å˜æˆ + if (hasDuplex) { + if (msData["ms-attr-checked"]) { + log("warning!一个控件ä¸èƒ½åŒæ—¶å®šä¹‰ms-attr-checked与" + hasDuplex) + } + if (msData["ms-attr-value"]) { + log("warning!一个控件ä¸èƒ½åŒæ—¶å®šä¹‰ms-attr-value与" + hasDuplex) + } + } + for (i = 0; binding = bindings[i]; i++) { + type = binding.type + if (rnoscanAttrBinding.test(type)) { + return executeBindings(bindings.slice(0, i + 1), vmodels) + } else if (scanNode) { + scanNode = !rnoscanNodeBinding.test(type) + } + } + executeBindings(bindings, vmodels) + } + } + if (scanNode && !stopScan[elem.tagName] && rbind.test(elem.innerHTML.replace(rlt, "<").replace(rgt, ">"))) { + mergeTextNodes && mergeTextNodes(elem) + scanNodeList(elem, vmodels) //扫æå­å­™å…ƒç´  + } +} +var rnoscanAttrBinding = /^if|widget|repeat$/ +var rnoscanNodeBinding = /^each|with|html|include$/ +//IE67下,在循环绑定中,一个节点如果是通过cloneNode得到,自定义属性的specified为false,无法进入里é¢çš„分支, +//但如果我们去掉scanAttr中的attr.specified检测,一个元素会有80+个特性节点(因为它ä¸åŒºåˆ†å›ºæœ‰å±žæ€§ä¸Žè‡ªå®šä¹‰å±žæ€§ï¼‰ï¼Œå¾ˆå®¹æ˜“å¡æ­»é¡µé¢ +if (!"1" [0]) { + var attrPool = new Cache(512) + var rattrs = /\s+(ms-[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g, + rquote = /^['"]/, + rtag = /<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i, + ramp = /&/g + //IE6-8解æžHTML5新标签,会将它分解两个元素节点与一个文本节点 + //
ddd
+ // window.onload = function() { + // var body = document.body + // for (var i = 0, el; el = body.children[i++]; ) { + // avalon.log(el.outerHTML) + // } + // } + //ä¾æ¬¡è¾“出
,
+ var getAttributes = function (elem) { + var html = elem.outerHTML + //处ç†IE6-8解æžHTML5新标签的情况,åŠ
ç­‰åŠé—­åˆæ ‡ç­¾outerHTML为空的情况 + if (html.slice(0, 2) === " ms-important(1) --> ms-controller(2) --> ms-if(10) --> ms-repeat(100) + //--> ms-if-loop(110) --> ms-attr(970) ...--> ms-each(1400)-->ms-with(1500)--〉ms-duplex(2000)åž«åŽ + var a = elem.getAttribute("ms-skip") + //#360 在旧å¼IE中 Object标签在引入Flash等资æºæ—¶,å¯èƒ½å‡ºçŽ°æ²¡æœ‰getAttributeNode,innerHTML的情形 + if (!elem.getAttributeNode) { + return log("warning " + elem.tagName + " no getAttributeNode method") + } + var b = elem.getAttributeNode("ms-important") + var c = elem.getAttributeNode("ms-controller") + if (typeof a === "string") { + return + } else if (node = b || c) { + var newVmodel = avalon.vmodels[node.value] + if (!newVmodel) { + return + } + //ms-importantä¸åŒ…å«çˆ¶VM,ms-controller相å + vmodels = node === b ? [newVmodel] : [newVmodel].concat(vmodels) + var name = node.name + elem.removeAttribute(name) //removeAttributeNodeä¸ä¼šåˆ·æ–°[ms-controller]æ ·å¼è§„则 + avalon(elem).removeClass(name) + createSignalTower(elem, newVmodel) + } + scanAttr(elem, vmodels) //扫æ特性节点 +} +var rhasHtml = /\|\s*html(?:\b|$)/, + r11a = /\|\|/g, + rlt = /</g, + rgt = />/g, + rstringLiteral = /(['"])(\\\1|.)+?\1/g +function getToken(value) { + if (value.indexOf("|") > 0) { + var scapegoat = value.replace(rstringLiteral, function (_) { + return Array(_.length + 1).join("1")// jshint ignore:line + }) + var index = scapegoat.replace(r11a, "\u1122\u3344").indexOf("|") //干掉所有短路或 + if (index > -1) { + return { + filters: value.slice(index), + value: value.slice(0, index), + expr: true + } + } + } + return { + value: value, + filters: "", + expr: true + } +} + +function scanExpr(str) { + var tokens = [], + value, start = 0, + stop + do { + stop = str.indexOf(openTag, start) + if (stop === -1) { + break + } + value = str.slice(start, stop) + if (value) { // {{ 左边的文本 + tokens.push({ + value: value, + filters: "", + expr: false + }) + } + start = stop + openTag.length + stop = str.indexOf(closeTag, start) + if (stop === -1) { + break + } + value = str.slice(start, stop) + if (value) { //处ç†{{ }}æ’å€¼è¡¨è¾¾å¼ + tokens.push(getToken(value, start)) + } + start = stop + closeTag.length + } while (1) + value = str.slice(start) + if (value) { //}} å³è¾¹çš„文本 + tokens.push({ + value: value, + expr: false, + filters: "" + }) + } + return tokens +} + +function scanText(textNode, vmodels, index) { + var bindings = [] + tokens = scanExpr(textNode.data) + if (tokens.length) { + for (var i = 0; token = tokens[i++]; ) { + var node = DOC.createTextNode(token.value) //将文本转æ¢ä¸ºæ–‡æœ¬èŠ‚点,并替æ¢åŽŸæ¥çš„文本节点 + if (token.expr) { + token.value = token.value.replace(roneTime, function () { + token.oneTime = true + return "" + }) + token.type = "text" + token.element = node + token.filters = token.filters.replace(rhasHtml, function (a, b,c) { + token.type = "html" + return "" + })// jshint ignore:line + token.pos = index * 1000 + i + bindings.push(token) //收集带有æ’值表达å¼çš„文本 + } + avalonFragment.appendChild(node) + } + textNode.parentNode.replaceChild(avalonFragment, textNode) + if (bindings.length) + executeBindings(bindings, vmodels) + } +} + +var bools = ["autofocus,autoplay,async,allowTransparency,checked,controls", + "declare,disabled,defer,defaultChecked,defaultSelected", + "contentEditable,isMap,loop,multiple,noHref,noResize,noShade", + "open,readOnly,selected" +].join(",") +var boolMap = {} +bools.replace(rword, function(name) { + boolMap[name.toLowerCase()] = name +}) + +var propMap = { //属性å映射 + "accept-charset": "acceptCharset", + "char": "ch", + "charoff": "chOff", + "class": "className", + "for": "htmlFor", + "http-equiv": "httpEquiv" +} + +var anomaly = ["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan", + "dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight", + "rowSpan,tabIndex,useMap,vSpace,valueType,vAlign" +].join(",") +anomaly.replace(rword, function(name) { + propMap[name.toLowerCase()] = name +}) + +var rnoscripts = /(?:[\s\S]+?)<\/noscript>/img +var rnoscriptText = /([\s\S]+?)<\/noscript>/im + +var getXHR = function() { + return new(window.XMLHttpRequest || ActiveXObject)("Microsoft.XMLHTTP") // jshint ignore:line +} + +var templatePool = avalon.templateCache = {} + +bindingHandlers.attr = function(data, vmodels) { + var text = data.value.trim(), + simple = true + if (text.indexOf(openTag) > -1 && text.indexOf(closeTag) > 2) { + simple = false + if (rexpr.test(text) && RegExp.rightContext === "" && RegExp.leftContext === "") { + simple = true + text = RegExp.$1 + } + } + if (data.type === "include") { + var elem = data.element + data.includeRendered = getBindingCallback(elem, "data-include-rendered", vmodels) + data.includeLoaded = getBindingCallback(elem, "data-include-loaded", vmodels) + var outer = data.includeReplace = !! avalon(elem).data("includeReplace") + if (avalon(elem).data("includeCache")) { + data.templateCache = {} + } + data.startInclude = DOC.createComment("ms-include") + data.endInclude = DOC.createComment("ms-include-end") + if (outer) { + data.element = data.startInclude + elem.parentNode.insertBefore(data.startInclude, elem) + elem.parentNode.insertBefore(data.endInclude, elem.nextSibling) + } else { + elem.insertBefore(data.startInclude, elem.firstChild) + elem.appendChild(data.endInclude) + } + } + data.handlerName = "attr" //handleName用于处ç†å¤šç§ç»‘定共用åŒä¸€ç§bindingExecutor的情况 + parseExprProxy(text, vmodels, data, (simple ? 0 : scanExpr(data.value))) +} + +bindingExecutors.attr = function(val, elem, data) { + var method = data.type, + attrName = data.param + if (method === "css") { + avalon(elem).css(attrName, val) + } else if (method === "attr") { + + // ms-attr-class="xxx" vm.xxx="aaa bbb ccc"将元素的className设置为aaa bbb ccc + // ms-attr-class="xxx" vm.xxx=false 清空元素的所有类å + // ms-attr-name="yyy" vm.yyy="ooo" 为元素设置name属性 + var toRemove = (val === false) || (val === null) || (val === void 0) + + if (!W3C && propMap[attrName]) { //æ—§å¼IE下需è¦è¿›è¡Œå字映射 + attrName = propMap[attrName] + } + var bool = boolMap[attrName] + if (typeof elem[bool] === "boolean") { + elem[bool] = !! val //布尔属性必须使用el.xxx = true|falseæ–¹å¼è®¾å€¼ + if (!val) { //如果为false, IE全系列下相当于setAttribute(xxx,''),会影å“到样å¼,需è¦è¿›ä¸€æ­¥å¤„ç† + toRemove = true + } + } + if (toRemove) { + return elem.removeAttribute(attrName) + } + //SVGåªèƒ½ä½¿ç”¨setAttribute(xxx, yyy), VMLåªèƒ½ä½¿ç”¨elem.xxx = yyy ,HTML的固有属性必须elem.xxx = yyy + var isInnate = rsvg.test(elem) ? false : (DOC.namespaces && isVML(elem)) ? true : attrName in elem.cloneNode(false) + if (isInnate) { + elem[attrName] = val+"" + } else { + elem.setAttribute(attrName, val) + } + } else if (method === "include" && val) { + var vmodels = data.vmodels + var rendered = data.includeRendered + var loaded = data.includeLoaded + var replace = data.includeReplace + var target = replace ? elem.parentNode : elem + var scanTemplate = function(text) { + if (loaded) { + var newText = loaded.apply(target, [text].concat(vmodels)) + if (typeof newText === "string") + text = newText + } + if (rendered) { + checkScan(target, function() { + rendered.call(target) + }, NaN) + } + var lastID = data.includeLastID + if (data.templateCache && lastID && lastID !== val) { + var lastTemplate = data.templateCache[lastID] + if (!lastTemplate) { + lastTemplate = data.templateCache[lastID] = DOC.createElement("div") + ifGroup.appendChild(lastTemplate) + } + } + data.includeLastID = val + while (true) { + var node = data.startInclude.nextSibling + if (node && node !== data.endInclude) { + target.removeChild(node) + if (lastTemplate) + lastTemplate.appendChild(node) + } else { + break + } + } + var dom = getTemplateNodes(data, val, text) + var nodes = avalon.slice(dom.childNodes) + target.insertBefore(dom, data.endInclude) + scanNodeArray(nodes, vmodels) + } + + if (data.param === "src") { + if (typeof templatePool[val] === "string") { + avalon.nextTick(function() { + scanTemplate(templatePool[val]) + }) + } else if (Array.isArray(templatePool[val])) { //#805 防止在循环绑定中å‘出许多相åŒçš„请求 + templatePool[val].push(scanTemplate) + } else { + var xhr = getXHR() + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + var s = xhr.status + if (s >= 200 && s < 300 || s === 304 || s === 1223) { + var text = xhr.responseText + for (var f = 0, fn; fn = templatePool[val][f++];) { + fn(text) + } + templatePool[val] = text + } + } + } + templatePool[val] = [scanTemplate] + xhr.open("GET", val, true) + if ("withCredentials" in xhr) { + xhr.withCredentials = true + } + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest") + xhr.send(null) + } + } else { + //IE系列与够新的标准æµè§ˆå™¨æ”¯æŒé€šè¿‡IDå–得元素(firefox14+) + //http://tjvantoll.com/2012/07/19/dom-element-references-as-global-variables/ + var el = val && val.nodeType === 1 ? val : DOC.getElementById(val) + if (el) { + if (el.tagName === "NOSCRIPT" && !(el.innerHTML || el.fixIE78)) { //IE7-8 innerText,innerHTML都无法å–得其内容,IE6能å–å¾—å…¶innerHTML + xhr = getXHR() //IE9-11与chromeçš„innerHTML会得到转义的内容,它们的innerTextå¯ä»¥ + xhr.open("GET", location, false) //谢谢Nodejs 乱炖群 深圳-纯属虚构 + xhr.send(null) + //http://bbs.csdn.net/topics/390349046?page=1#post-393492653 + var noscripts = DOC.getElementsByTagName("noscript") + var array = (xhr.responseText || "").match(rnoscripts) || [] + var n = array.length + for (var i = 0; i < n; i++) { + var tag = noscripts[i] + if (tag) { //IE6-8中noscript标签的innerHTML,innerText是åªè¯»çš„ + tag.style.display = "none" //http://haslayout.net/css/noscript-Ghost-Bug + tag.fixIE78 = (array[i].match(rnoscriptText) || ["", " "])[1] + } + } + } + avalon.nextTick(function() { + scanTemplate(el.fixIE78 || el.value || el.innerText || el.innerHTML) + }) + } + } + } else { + if (!root.hasAttribute && typeof val === "string" && (method === "src" || method === "href")) { + val = val.replace(/&/g, "&") //处ç†IE67自动转义的问题 + } + elem[method] = val + if (window.chrome && elem.tagName === "EMBED") { + var parent = elem.parentNode //#525 chrome1-37下embed标签动æ€è®¾ç½®srcä¸èƒ½å‘生请求 + var comment = document.createComment("ms-src") + parent.replaceChild(comment, elem) + parent.replaceChild(elem, comment) + } + } +} + +function getTemplateNodes(data, id, text) { + var div = data.templateCache && data.templateCache[id] + if (div) { + var dom = DOC.createDocumentFragment(), + firstChild + while (firstChild = div.firstChild) { + dom.appendChild(firstChild) + } + return dom + } + return avalon.parseHTML(text) +} + +//这几个指令都å¯ä»¥ä½¿ç”¨æ’值表达å¼ï¼Œå¦‚ms-src="aaa/{{b}}/{{c}}.html" +"title,alt,src,value,css,include,href".replace(rword, function(name) { + bindingHandlers[name] = bindingHandlers.attr +}) +//æ ¹æ®VM的属性值或表达å¼çš„值切æ¢ç±»å,ms-class="xxx yyy zzz:flag" +//http://www.cnblogs.com/rubylouvre/archive/2012/12/17/2818540.html +bindingHandlers["class"] = function(data, vmodels) { + var oldStyle = data.param, + text = data.value, + rightExpr + data.handlerName = "class" + if (!oldStyle || isFinite(oldStyle)) { + data.param = "" //去掉数字 + var noExpr = text.replace(rexprg, function(a) { + return a.replace(/./g, "0") + //return Math.pow(10, a.length - 1) //å°†æ’值表达å¼æ’å…¥10çš„N-1次方æ¥å ä½ + }) + var colonIndex = noExpr.indexOf(":") //å–得第一个冒å·çš„ä½ç½® + if (colonIndex === -1) { // 比如 ms-class="aaa bbb ccc" 的情况 + var className = text + } else { // 比如 ms-class-1="ui-state-active:checked" 的情况 + className = text.slice(0, colonIndex) + rightExpr = text.slice(colonIndex + 1) + parseExpr(rightExpr, vmodels, data) //决定是添加还是删除 + if (!data.evaluator) { + log("debug: ms-class '" + (rightExpr || "").trim() + "' ä¸å­˜åœ¨äºŽVM中") + return false + } else { + data._evaluator = data.evaluator + data._args = data.args + } + } + var hasExpr = rexpr.test(className) //比如ms-class="width{{w}}"的情况 + if (!hasExpr) { + data.immobileClass = className + } + parseExprProxy("", vmodels, data, (hasExpr ? scanExpr(className) : 0)) + } else { + data.immobileClass = data.oldStyle = data.param + parseExprProxy(text, vmodels, data) + } +} + +bindingExecutors["class"] = function(val, elem, data) { + var $elem = avalon(elem), + method = data.type + if (method === "class" && data.oldStyle) { //如果是旧风格 + $elem.toggleClass(data.oldStyle, !! val) + } else { + //如果存在冒å·å°±æœ‰æ±‚值函数 + data.toggleClass = data._evaluator ? !! data._evaluator.apply(elem, data._args) : true + data.newClass = data.immobileClass || val + if (data.oldClass && data.newClass !== data.oldClass) { + $elem.removeClass(data.oldClass) + } + data.oldClass = data.newClass + switch (method) { + case "class": + $elem.toggleClass(data.newClass, data.toggleClass) + break + case "hover": + case "active": + if (!data.hasBindEvent) { //ç¡®ä¿åªç»‘定一次 + var activate = "mouseenter" //在移出移入时切æ¢ç±»å + var abandon = "mouseleave" + if (method === "active") { //在èšç„¦å¤±ç„¦ä¸­åˆ‡æ¢ç±»å + elem.tabIndex = elem.tabIndex || -1 + activate = "mousedown" + abandon = "mouseup" + var fn0 = $elem.bind("mouseleave", function() { + data.toggleClass && $elem.removeClass(data.newClass) + }) + } + var fn1 = $elem.bind(activate, function() { + data.toggleClass && $elem.addClass(data.newClass) + }) + var fn2 = $elem.bind(abandon, function() { + data.toggleClass && $elem.removeClass(data.newClass) + }) + data.rollback = function() { + $elem.unbind("mouseleave", fn0) + $elem.unbind(activate, fn1) + $elem.unbind(abandon, fn2) + } + data.hasBindEvent = true + } + break; + } + } +} + +"hover,active".replace(rword, function(method) { + bindingHandlers[method] = bindingHandlers["class"] +}) +//ms-controller绑定已ç»åœ¨scanTag 方法中实现 +//ms-css绑定已由ms-attr绑定实现 + + +// bindingHandlers.data 定义在if.js +bindingExecutors.data = function(val, elem, data) { + var key = "data-" + data.param + if (val && typeof val === "object") { + elem[key] = val + } else { + elem.setAttribute(key, String(val)) + } +} +//åŒå·¥ç»‘定 +var duplexBinding = bindingHandlers.duplex = function(data, vmodels) { + var elem = data.element, + hasCast + parseExprProxy(data.value, vmodels, data, 0, 1) + + data.changed = getBindingCallback(elem, "data-duplex-changed", vmodels) || noop + if (data.evaluator && data.args) { + var params = [] + var casting = oneObject("string,number,boolean,checked") + if (elem.type === "radio" && data.param === "") { + data.param = "checked" + } + if (elem.msData) { + elem.msData["ms-duplex"] = data.value + } + data.param.replace(/\w+/g, function(name) { + if (/^(checkbox|radio)$/.test(elem.type) && /^(radio|checked)$/.test(name)) { + if (name === "radio") + log("ms-duplex-radioå·²ç»æ›´å为ms-duplex-checked") + name = "checked" + data.isChecked = true + } + if (name === "bool") { + name = "boolean" + log("ms-duplex-boolå·²ç»æ›´å为ms-duplex-boolean") + } else if (name === "text") { + name = "string" + log("ms-duplex-textå·²ç»æ›´å为ms-duplex-string") + } + if (casting[name]) { + hasCast = true + } + avalon.Array.ensure(params, name) + }) + if (!hasCast) { + params.push("string") + } + data.param = params.join("-") + data.bound = function(type, callback) { + if (elem.addEventListener) { + elem.addEventListener(type, callback, false) + } else { + elem.attachEvent("on" + type, callback) + } + var old = data.rollback + data.rollback = function() { + elem.avalonSetter = null + avalon.unbind(elem, type, callback) + old && old() + } + } + for (var i in avalon.vmodels) { + var v = avalon.vmodels[i] + v.$fire("avalon-ms-duplex-init", data) + } + var cpipe = data.pipe || (data.pipe = pipe) + cpipe(null, data, "init") + var tagName = elem.tagName + duplexBinding[tagName] && duplexBinding[tagName](elem, data.evaluator.apply(null, data.args), data) + } +} +//ä¸å­˜åœ¨ bindingExecutors.duplex + + function fixNull(val) { + return val == null ? "" : val + } +avalon.duplexHooks = { + checked: { + get: function(val, data) { + return !data.element.oldValue + } + }, + string: { + get: function(val) { //åŒæ­¥åˆ°VM + return val + }, + set: fixNull + }, + "boolean": { + get: function(val) { + return val === "true" + }, + set: fixNull + }, + number: { + get: function(val, data) { + var number = parseFloat(val) + if (-val === -number) { + return number + } + var arr = /strong|medium|weak/.exec(data.element.getAttribute("data-duplex-number")) || ["medium"] + switch (arr[0]) { + case "strong": + return 0 + case "medium": + return val === "" ? "" : 0 + case "weak": + return val + } + }, + set: fixNull + } +} + +function pipe(val, data, action, e) { + data.param.replace(/\w+/g, function(name) { + var hook = avalon.duplexHooks[name] + if (hook && typeof hook[action] === "function") { + val = hook[action](val, data) + } + }) + return val +} + +var TimerID, ribbon = [] + + avalon.tick = function(fn) { + if (ribbon.push(fn) === 1) { + TimerID = setInterval(ticker, 60) + } + } + + function ticker() { + for (var n = ribbon.length - 1; n >= 0; n--) { + var el = ribbon[n] + if (el() === false) { + ribbon.splice(n, 1) + } + } + if (!ribbon.length) { + clearInterval(TimerID) + } + } + +var watchValueInTimer = noop +var rmsinput = /text|password|hidden/ +new function() { // jshint ignore:line + try { //#272 IE9-IE11, firefox + var setters = {} + var aproto = HTMLInputElement.prototype + var bproto = HTMLTextAreaElement.prototype + function newSetter(value) { // jshint ignore:line + setters[this.tagName].call(this, value) + if (rmsinput.test(this.type) && !this.msFocus && this.avalonSetter) { + this.avalonSetter() + } + } + var inputProto = HTMLInputElement.prototype + Object.getOwnPropertyNames(inputProto) //æ•…æ„引å‘IE6-8ç­‰æµè§ˆå™¨æŠ¥é”™ + setters["INPUT"] = Object.getOwnPropertyDescriptor(aproto, "value").set + + Object.defineProperty(aproto, "value", { + set: newSetter + }) + setters["TEXTAREA"] = Object.getOwnPropertyDescriptor(bproto, "value").set + Object.defineProperty(bproto, "value", { + set: newSetter + }) + } catch (e) { + //在chrome 43中 ms-duplex终于ä¸éœ€è¦ä½¿ç”¨å®šæ—¶å™¨å®žçŽ°åŒå‘绑定了 + // http://updates.html5rocks.com/2015/04/DOM-attributes-now-on-the-prototype + // https://docs.google.com/document/d/1jwA8mtClwxI-QJuHT7872Z0pxpZz8PBkf2bGAbsUtqs/edit?pli=1 + watchValueInTimer = avalon.tick + } +} // jshint ignore:line +if (IEVersion) { + avalon.bind(DOC, "selectionchange", function(e) { + var el = DOC.activeElement + if (el && typeof el.avalonSetter === "function") { + el.avalonSetter() + } + }) +} + +//处ç†radio, checkbox, text, textarea, password +duplexBinding.INPUT = function(element, evaluator, data) { + var $type = element.type, + bound = data.bound, + $elem = avalon(element), + composing = false + + function callback(value) { + data.changed.call(this, value, data) + } + + function compositionStart() { + composing = true + } + + function compositionEnd() { + composing = false + } + //当valueå˜åŒ–时改å˜model的值 + var updateVModel = function() { + if (composing) //处ç†ä¸­æ–‡è¾“入法在minlengh下引å‘çš„BUG + return + var val = element.oldValue = element.value //防止递归调用形æˆæ­»å¾ªçŽ¯ + var lastValue = data.pipe(val, data, "get") + if ($elem.data("duplexObserve") !== false) { + evaluator(lastValue) + callback.call(element, lastValue) + if ($elem.data("duplex-focus")) { + avalon.nextTick(function() { + element.focus() + }) + } + } + } + //当modelå˜åŒ–æ—¶,它就会改å˜value的值 + data.handler = function() { + var val = data.pipe(evaluator(), data, "set") + "" //fix #673 + if (val !== element.oldValue) { + element.value = val + } + } + if (data.isChecked || $type === "radio") { + var IE6 = IEVersion === 6 + updateVModel = function() { + if ($elem.data("duplexObserve") !== false) { + var lastValue = data.pipe(element.value, data, "get") + evaluator(lastValue) + callback.call(element, lastValue) + } + } + data.handler = function() { + var val = evaluator() + var checked = data.isChecked ? !! val : val + "" === element.value + element.oldValue = checked + if (IE6) { + setTimeout(function() { + //IE8 checkbox, radio是使用defaultChecked控制选中状æ€ï¼Œ + //并且è¦å…ˆè®¾ç½®defaultCheckedåŽè®¾ç½®checked + //并且必须设置延迟 + element.defaultChecked = checked + element.checked = checked + }, 31) + } else { + element.checked = checked + } + } + bound("click", updateVModel) + } else if ($type === "checkbox") { + updateVModel = function() { + if ($elem.data("duplexObserve") !== false) { + var method = element.checked ? "ensure" : "remove" + var array = evaluator() + if (!Array.isArray(array)) { + log("ms-duplex应用于checkbox上è¦å¯¹åº”一个数组") + array = [array] + } + var val = data.pipe(element.value, data, "get") + avalon.Array[method](array, val) + callback.call(element, array) + } + } + + data.handler = function() { + var array = [].concat(evaluator()) //强制转æ¢ä¸ºæ•°ç»„ + var val = data.pipe(element.value, data, "get") + element.checked = array.indexOf(val) > -1 + } + bound(W3C ? "change" : "click", updateVModel) + } else { + var events = element.getAttribute("data-duplex-event") || "input" + if (element.attributes["data-event"]) { + log("data-event指令已ç»åºŸå¼ƒï¼Œè¯·æ”¹ç”¨data-duplex-event") + } + + function delay(e) { // jshint ignore:line + setTimeout(function() { + updateVModel(e) + }) + } + events.replace(rword, function(name) { + switch (name) { + case "input": + if (!IEVersion) { // W3C + bound("input", updateVModel) + //éžIEæµè§ˆå™¨æ‰ç”¨è¿™ä¸ª + bound("compositionstart", compositionStart) + bound("compositionend", compositionEnd) + bound("DOMAutoComplete", updateVModel) + } else { //onpropertychange事件无法区分是程åºè§¦å‘è¿˜æ˜¯ç”¨æˆ·è§¦å‘ + // IE下通过selectionchange事件监å¬IE9+点击inputå³è¾¹çš„X的清空行为,åŠç²˜è´´ï¼Œå‰ªåˆ‡ï¼Œåˆ é™¤è¡Œä¸º + if (IEVersion > 8) { + bound("input", updateVModel) //IE9使用propertychange无法监å¬ä¸­æ–‡è¾“入改动 + } else { + bound("propertychange", function(e) { //IE6-8下第一次修改时ä¸ä¼šè§¦å‘,需è¦ä½¿ç”¨keydown或selectionchange修正 + if (e.propertyName === "value") { + updateVModel() + } + }) + } + bound("dragend", delay) + //http://www.cnblogs.com/rubylouvre/archive/2013/02/17/2914604.html + //http://www.matts411.com/post/internet-explorer-9-oninput/ + } + break + default: + bound(name, updateVModel) + break + } + }) + bound("focus", function() { + element.msFocus = true + }) + bound("blur", function() { + element.msFocus = false + }) + + if (rmsinput.test($type)) { + watchValueInTimer(function() { + if (root.contains(element)) { + if (!element.msFocus && element.oldValue !== element.value) { + updateVModel() + } + } else if (!element.msRetain) { + return false + } + }) + } + + element.avalonSetter = updateVModel //#765 + } + + element.oldValue = element.value + avalon.injectBinding(data) + callback.call(element, element.value) +} +duplexBinding.TEXTAREA = duplexBinding.INPUT +duplexBinding.SELECT = function(element, evaluator, data) { + var $elem = avalon(element) + + function updateVModel() { + if ($elem.data("duplexObserve") !== false) { + var val = $elem.val() //字符串或字符串数组 + if (Array.isArray(val)) { + val = val.map(function(v) { + return data.pipe(v, data, "get") + }) + } else { + val = data.pipe(val, data, "get") + } + if (val + "" !== element.oldValue) { + evaluator(val) + } + data.changed.call(element, val, data) + } + } + data.handler = function() { + var val = evaluator() + val = val && val.$model || val + if (Array.isArray(val)) { + if (!element.multiple) { + log("ms-duplex在ä¸èƒ½å¯¹åº”一个数组") + } + } + //å¿…é¡»å˜æˆå­—符串åŽæ‰èƒ½æ¯”较 + val = Array.isArray(val) ? val.map(String) : val + "" + if (val + "" !== element.oldValue) { + $elem.val(val) + element.oldValue = val + "" + } + } + data.bound("change", updateVModel) + element.msCallback = function() { + avalon.injectBinding(data) + data.changed.call(element, evaluator(), data) + } +} +// bindingHandlers.html 定义在if.js +bindingExecutors.html = function (val, elem, data) { + var isHtmlFilter = elem.nodeType !== 1 + var parent = isHtmlFilter ? elem.parentNode : elem + if (!parent) + return + val = val == null ? "" : val + if (data.oldText !== val) { + data.oldText = val + } else { + return + } + if (elem.nodeType === 3) { + var signature = generateID("html") + parent.insertBefore(DOC.createComment(signature), elem) + data.element = DOC.createComment(signature + ":end") + parent.replaceChild(data.element, elem) + elem = data.element + } + if (typeof val !== "object") {//string, number, boolean + var fragment = avalon.parseHTML(String(val)) + } else if (val.nodeType === 11) { //å°†val转æ¢ä¸ºæ–‡æ¡£ç¢Žç‰‡ + fragment = val + } else if (val.nodeType === 1 || val.item) { + var nodes = val.nodeType === 1 ? val.childNodes : val.item + fragment = avalonFragment.cloneNode(true) + while (nodes[0]) { + fragment.appendChild(nodes[0]) + } + } + + nodes = avalon.slice(fragment.childNodes) + //æ’å…¥å ä½ç¬¦, 如果是过滤器,需è¦æœ‰èŠ‚制地移除指定的数é‡,如果是html指令,直接清空 + if (isHtmlFilter) { + var endValue = elem.nodeValue.slice(0, -4) + while (true) { + var node = elem.previousSibling + if (!node || node.nodeType === 8 && node.nodeValue === endValue) { + break + } else { + parent.removeChild(node) + } + } + parent.insertBefore(fragment, elem) + } else { + avalon.clearHTML(elem).appendChild(fragment) + } + scanNodeArray(nodes, data.vmodels) +} +bindingHandlers["if"] = + bindingHandlers.data = + bindingHandlers.text = + bindingHandlers.html = + function(data, vmodels) { + parseExprProxy(data.value, vmodels, data) +} + +bindingExecutors["if"] = function(val, elem, data) { + try { + if(!elem.parentNode) return + } catch(e) {return} + if (val) { //æ’回DOMæ ‘ + if (elem.nodeType === 8) { + elem.parentNode.replaceChild(data.template, elem) + // animate.enter(data.template, elem.parentNode) + elem = data.element = data.template //这时å¯èƒ½ä¸ºnull + } + if (elem.getAttribute(data.name)) { + elem.removeAttribute(data.name) + scanAttr(elem, data.vmodels) + } + data.rollback = null + } else { //移出DOM树,并用注释节点å æ®åŽŸä½ç½® + if (elem.nodeType === 1) { + var node = data.element = DOC.createComment("ms-if") + elem.parentNode.replaceChild(node, elem) + // animate.leave(elem, node.parentNode, node) + data.template = elem //元素节点 + ifGroup.appendChild(elem) + data.rollback = function() { + if (elem.parentNode === ifGroup) { + ifGroup.removeChild(elem) + } + } + } + } +} +//ms-important绑定已ç»åœ¨scanTag 方法中实现 +//ms-include绑定已由ms-attr绑定实现 + +var rdash = /\(([^)]*)\)/ +bindingHandlers.on = function(data, vmodels) { + var value = data.value + data.type = "on" + var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10 + if (typeof bindingHandlers.on[eventType + "Hook"] === "function") { + bindingHandlers.on[eventType + "Hook"](data) + } + if (value.indexOf("(") > 0 && value.indexOf(")") > -1) { + var matched = (value.match(rdash) || ["", ""])[1].trim() + if (matched === "" || matched === "$event") { // aaa() aaa($event)当æˆaaaå¤„ç† + value = value.replace(rdash, "") + } + } + parseExprProxy(value, vmodels, data) +} + +bindingExecutors.on = function(callback, elem, data) { + callback = function(e) { + var fn = data.evaluator || noop + return fn.apply(this, data.args.concat(e)) + } + var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10 + if (eventType === "scan") { + callback.call(elem, { + type: eventType + }) + } else if (typeof data.specialBind === "function") { + data.specialBind(elem, callback) + } else { + var removeFn = avalon.bind(elem, eventType, callback) + } + data.rollback = function() { + if (typeof data.specialUnbind === "function") { + data.specialUnbind() + } else { + avalon.unbind(elem, eventType, removeFn) + } + } +} +bindingHandlers.repeat = function (data, vmodels) { + var type = data.type + parseExprProxy(data.value, vmodels, data, 0, 1) + data.proxies = [] + var freturn = false + try { + var $repeat = data.$repeat = data.evaluator.apply(0, data.args || []) + var xtype = avalon.type($repeat) + if (xtype !== "object" && xtype !== "array") { + freturn = true + avalon.log("warning:" + data.value + "åªèƒ½æ˜¯å¯¹è±¡æˆ–数组") + } + } catch (e) { + freturn = true + } + var arr = data.value.split(".") || [] + if (arr.length > 1) { + arr.pop() + var n = arr[0] + for (var i = 0, v; v = vmodels[i++]; ) { + if (v && v.hasOwnProperty(n)) { + var events = v[n].$events || {} + events[subscribers] = events[subscribers] || [] + events[subscribers].push(data) + break + } + } + } + + var elem = data.element + if (elem.nodeType === 1) { + elem.removeAttribute(data.name) + data.sortedCallback = getBindingCallback(elem, "data-with-sorted", vmodels) + data.renderedCallback = getBindingCallback(elem, "data-" + type + "-rendered", vmodels) + var signature = generateID(type) + var start = DOC.createComment(signature) + var end = DOC.createComment(signature + ":end") + data.signature = signature + data.template = avalonFragment.cloneNode(false) + if (type === "repeat") { + var parent = elem.parentNode + parent.replaceChild(end, elem) + parent.insertBefore(start, end) + data.template.appendChild(elem) + } else { + while (elem.firstChild) { + data.template.appendChild(elem.firstChild) + } + elem.appendChild(start) + elem.appendChild(end) + } + data.element = end + data.handler = bindingExecutors.repeat + data.rollback = function () { + var elem = data.element + if (!elem) + return + data.handler("clear") + } + } + + if (freturn) { + return + } + + data.$outer = {} + var check0 = "$key" + var check1 = "$val" + if (Array.isArray($repeat)) { + check0 = "$first" + check1 = "$last" + } + + for (i = 0; v = vmodels[i++]; ) { + if (v.hasOwnProperty(check0) && v.hasOwnProperty(check1)) { + data.$outer = v + break + } + } + var $events = $repeat.$events + var $list = ($events || {})[subscribers] + injectDependency($list, data) + if (xtype === "object") { + data.$with = true + $repeat.$proxy || ($repeat.$proxy = {}) + data.handler("append", $repeat) + } else if ($repeat.length) { + data.handler("add", 0, $repeat.length) + } +} + +bindingExecutors.repeat = function (method, pos, el) { + if (!method && this.$with) { + method = "append" + var flag = "update" + } + if (method) { + var data = this, start, fragment + var end = data.element + var comments = getComments(data) + var parent = end.parentNode + var proxies = data.proxies + var transation = avalonFragment.cloneNode(false) + switch (method) { + case "add": //在posä½ç½®åŽæ·»åŠ el数组(pos为æ’å…¥ä½ç½®,el为è¦æ’入的个数) + var n = pos + el + var fragments = [] + for (var i = pos; i < n; i++) { + var proxy = eachProxyAgent(i, data) + proxies.splice(i, 0, proxy) + shimController(data, transation, proxy, fragments) + } + var now = new Date() - 0 + avalon.optimize = avalon.optimize || now + for (i = 0; fragment = fragments[i++]; ) { + scanNodeArray(fragment.nodes, fragment.vmodels) + fragment.nodes = fragment.vmodels = null + } + if (avalon.optimize === now) { + avalon.optimize = null + } + parent.insertBefore(transation, comments[pos] || end) + avalon.profile("æ’å…¥æ“作花费了 " + (new Date - now)) + break + case "del": //å°†posåŽçš„el个元素删掉(pos, el都是数字) + sweepNodes(comments[pos], comments[pos + el] || end) + var removed = proxies.splice(pos, el) + recycleProxies(removed, "each") + break + case "clear": + start = comments[0] + if (start) { + sweepNodes(start, end) + if (data.$with) { + parent.insertBefore(start, end) + } + } + recycleProxies(proxies, "each") + break + case "move": + start = comments[0] + if (start) { + var signature = start.nodeValue + var rooms = [] + var room = [], + node + sweepNodes(start, end, function () { + room.unshift(this) + if (this.nodeValue === signature) { + rooms.unshift(room) + room = [] + } + }) + sortByIndex(rooms, pos) + sortByIndex(proxies, pos) + while (room = rooms.shift()) { + while (node = room.shift()) { + transation.appendChild(node) + } + } + parent.insertBefore(transation, end) + } + break + case "index": //å°†proxies中的第pos个起的所有元素é‡æ–°ç´¢å¼• + var last = proxies.length - 1 + for (; el = proxies[pos]; pos++) { + el.$index = pos + el.$first = pos === 0 + el.$last = pos === last + } + return + case "set": //å°†proxies中的第pos个元素的VM设置为el(pos为数字,elä»»æ„) + proxy = proxies[pos] + if (proxy) { + fireDependencies(proxy.$events[data.param || "el"]) + } + break + case "append": + var object = data.$repeat //原æ¥ç¬¬2å‚数, 被循环对象 + var oldProxy = object.$proxy //代ç†å¯¹è±¡ç»„æˆçš„hash + var keys = [] + now = new Date() - 0 + avalon.optimize = avalon.optimize || now + if (flag === "update") { + if (!data.evaluator) { + parseExprProxy(data.value, data.vmodels, data, 0, 1) + } + object = data.$repeat = data.evaluator.apply(0, data.args || []) + object.$proxy = oldProxy + } + var pool = object.$proxy || {} + removed = [] + var nodes = data.element.parentNode.childNodes + var add = false + for (i = 0; node = nodes[i++]; ) { + if (node.nodeValue === data.signature) { + add = true + } else if (node.nodeValue === data.signature + ":end") { + add = false + } + if (add) { + removed.push(node) + } + } + + var indexNode = [], item + var keyIndex = data.keyIndex || (data.keyIndex = {}) + //将现有的节点全部移出DOMæ ‘ + for ( i = 0; i < removed.length; i++) { + el = removed[i] + if (el.nodeValue === data.signature) { + item = avalonFragment.cloneNode(false) + indexNode.push(item) + } + item.appendChild(el) + } + + + for (var key in object) { //当å‰å¯¹è±¡çš„所有键å + if (object.hasOwnProperty(key) && key !== "hasOwnProperty" && key !== "$proxy") { + keys.push(key) + } + } + + for (var i = 0; key = keys[i++]; ) { + if (!pool.hasOwnProperty(key)) {//添加缺失的代ç†VM + pool[key] = withProxyAgent(pool[key], key, data) + } else { + pool[key].$val = object[key] + } + } + + for ( key in pool) { + if (keys.indexOf(key) === -1) {//删除没用的代ç†VM + proxyRecycler(pool[key], withProxyPool) //去掉之å‰çš„代ç†VM + delete pool[key] + } + } + var fragments = [] + var renderKeys = keys //需è¦æ¸²æŸ“到DOM树去的键å + var end = data.element + if (data.sortedCallback) { //å¦‚æžœæœ‰å›žè°ƒï¼Œåˆ™è®©å®ƒä»¬æŽ’åº + var keys2 = data.sortedCallback.call(parent, keys) + if (keys2 && Array.isArray(keys2)) { + renderKeys = keys2 + } + } + + for (i = 0; i < renderKeys.length; i++) { + key = renderKeys[i] + if (typeof keyIndex[key] === "number") { + transation.appendChild(indexNode[keyIndex[key]]) + fragments.push({}) + } else { + shimController(data, transation, pool[key], fragments) + } + } + + for (i = 0; i < renderKeys.length; i++) { + keyIndex[renderKeys[i]] = i + } + + for (i = 0; fragment = fragments[i++]; ) { + if (fragment.nodes) { + scanNodeArray(fragment.nodes, fragment.vmodels) + fragment.nodes = fragment.vmodels = null + } + } + if (avalon.optimize === now) { + avalon.optimize = null + } + parent.insertBefore(transation, end) + avalon.profile("æ’å…¥æ“作花费了 " + (new Date - now)) + break + } + if (!data.$repeat || data.$repeat.hasOwnProperty("$lock")) //IE6-8 VBScript对象会报错, 有时候data.$repeatä¸å­˜åœ¨ + return + if (method === "clear") + method = "del" + var callback = data.renderedCallback || noop, + args = arguments + if (parent.oldValue && parent.tagName === "SELECT") { //fix #503 + avalon(parent).val(parent.oldValue.split(",")) + } + callback.apply(parent, args) + } +} +"with,each".replace(rword, function (name) { + bindingHandlers[name] = bindingHandlers.repeat +}) + +function shimController(data, transation, proxy, fragments) { + var content = data.template.cloneNode(true) + var nodes = avalon.slice(content.childNodes) + content.insertBefore(DOC.createComment(data.signature), content.firstChild) + transation.appendChild(content) + var nv = [proxy].concat(data.vmodels) + var fragment = { + nodes: nodes, + vmodels: nv + } + fragments.push(fragment) +} + +function getComments(data) { + var ret = [] + var nodes = data.element.parentNode.childNodes + for(var i= 0, node; node = nodes[i++];){ + if(node.nodeValue === data.signature){ + ret.push( node ) + }else if(node.nodeValue === data.signature+":end"){ + break + } + } + return ret +} + + +//移除掉start与end之间的节点(ä¿ç•™end) +function sweepNodes(start, end, callback) { + while (true) { + var node = end.previousSibling + if (!node) + break + node.parentNode.removeChild(node) + callback && callback.call(node) + if (node === start) { + break + } + } +} + +// 为ms-each,ms-with, ms-repeat会创建一个代ç†VM, +// 通过它们ä¿æŒä¸€ä¸ªä¸‹ä¸Šæ–‡ï¼Œè®©ç”¨æˆ·èƒ½è°ƒç”¨$index,$first,$last,$remove,$key,$val,$outer等属性与方法 +// 所有代ç†VM的产生,消费,收集,存放通过xxxProxyFactory,xxxProxyAgent, recycleProxies,xxxProxyPool实现 +var withProxyPool = [] +function withProxyFactory() { + var proxy = modelFactory({ + $key: "", + $outer: {}, + $host: {}, + $val: { + get: function () { + return this.$host[this.$key] + }, + set: function (val) { + this.$host[this.$key] = val + } + } + }, { + $val: 1 + }) + proxy.$id = generateID("$proxy$with") + return proxy +} + +function withProxyAgent(proxy, key, data) { + proxy = proxy || withProxyPool.pop() + if (!proxy) { + proxy = withProxyFactory() + } else { + proxy.$reinitialize() + } + var host = data.$repeat + proxy.$key = key + proxy.$host = host + proxy.$outer = data.$outer + if (host.$events) { + proxy.$events.$val = host.$events[key] + } else { + proxy.$events = {} + } + return proxy +} + + +function recycleProxies(proxies) { + eachProxyRecycler(proxies) +} +function eachProxyRecycler(proxies) { + proxies.forEach(function (proxy) { + proxyRecycler(proxy, eachProxyPool) + }) + proxies.length = 0 +} + + +var eachProxyPool = [] +function eachProxyFactory(name) { + var source = { + $host: [], + $outer: {}, + $index: 0, + $first: false, + $last: false, + $remove: avalon.noop + } + source[name] = { + get: function () { + var e = this.$events + var array = e.$index + e.$index = e[name] //#817 通过$index为el收集ä¾èµ– + try { + return this.$host[this.$index] + } finally { + e.$index = array + } + }, + set: function (val) { + try { + var e = this.$events + var array = e.$index + e.$index = [] + this.$host.set(this.$index, val) + } finally { + e.$index = array + } + } + } + var second = { + $last: 1, + $first: 1, + $index: 1 + } + var proxy = modelFactory(source, second) + proxy.$id = generateID("$proxy$each") + return proxy +} + +function eachProxyAgent(index, data) { + var param = data.param || "el", + proxy + for (var i = 0, n = eachProxyPool.length; i < n; i++) { + var candidate = eachProxyPool[i] + if (candidate && candidate.hasOwnProperty(param)) { + proxy = candidate + eachProxyPool.splice(i, 1) + } + } + if (!proxy) { + proxy = eachProxyFactory(param) + } + var host = data.$repeat + var last = host.length - 1 + proxy.$index = index + proxy.$first = index === 0 + proxy.$last = index === last + proxy.$host = host + proxy.$outer = data.$outer + proxy.$remove = function () { + return host.removeAt(proxy.$index) + } + return proxy +} + + +function proxyRecycler(proxy, proxyPool) { + for (var i in proxy.$events) { + if (Array.isArray(proxy.$events[i])) { + proxy.$events[i].forEach(function (data) { + if (typeof data === "object") + disposeData(data) + })// jshint ignore:line + proxy.$events[i].length = 0 + } + } + proxy.$host = proxy.$outer = {} + if (proxyPool.unshift(proxy) > kernel.maxRepeatSize) { + proxyPool.pop() + } +} +/********************************************************************* + * å„ç§æŒ‡ä»¤ * + **********************************************************************/ +//ms-skip绑定已ç»åœ¨scanTag 方法中实现 +// bindingHandlers.text 定义在if.js +bindingExecutors.text = function(val, elem) { + val = val == null ? "" : val //ä¸åœ¨é¡µé¢ä¸Šæ˜¾ç¤ºundefined null + if (elem.nodeType === 3) { //绑定在文本节点上 + try { //IE对游离于DOM树外的节点赋值会报错 + elem.data = val + } catch (e) {} + } else { //绑定在特性节点上 + if ("textContent" in elem) { + elem.textContent = val + } else { + elem.innerText = val + } + } +} +function parseDisplay(nodeName, val) { + //用于å–得此类标签的默认display值 + var key = "_" + nodeName + if (!parseDisplay[key]) { + var node = DOC.createElement(nodeName) + root.appendChild(node) + if (W3C) { + val = getComputedStyle(node, null).display + } else { + val = node.currentStyle.display + } + root.removeChild(node) + parseDisplay[key] = val + } + return parseDisplay[key] +} + +avalon.parseDisplay = parseDisplay + +bindingHandlers.visible = function(data, vmodels) { + var elem = data.element + var display = elem.style.display + if(display === "none"){ + display = parseDisplay(elem.nodeName) + } + data.display = display + parseExprProxy(data.value, vmodels, data) +} + +bindingExecutors.visible = function(val, elem, data) { + elem.style.display = val ? data.display : "none" +} +bindingHandlers.widget = function(data, vmodels) { + var args = data.value.match(rword) + var elem = data.element + var widget = args[0] + var id = args[1] + if (!id || id === "$") { //没有定义或为$时,å–组件å+éšæœºæ•° + id = generateID(widget) + } + var optName = args[2] || widget //没有定义,å–组件å + var constructor = avalon.ui[widget] + if (typeof constructor === "function") { //ms-widget="tabs,tabsAAA,optname" + vmodels = elem.vmodels || vmodels + for (var i = 0, v; v = vmodels[i++];) { + if (v.hasOwnProperty(optName) && typeof v[optName] === "object") { + var vmOptions = v[optName] + vmOptions = vmOptions.$model || vmOptions + break + } + } + if (vmOptions) { + var wid = vmOptions[widget + "Id"] + if (typeof wid === "string") { + log("warning!ä¸å†æ”¯æŒ" + widget + "Id") + id = wid + } + } + //抽å–data-tooltip-textã€data-tooltip-attr属性,组æˆä¸€ä¸ªé…置对象 + var widgetData = avalon.getWidgetData(elem, widget) + data.value = [widget, id, optName].join(",") + data[widget + "Id"] = id + data.evaluator = noop + elem.msData["ms-widget-id"] = id + var options = data[widget + "Options"] = avalon.mix({}, constructor.defaults, vmOptions || {}, widgetData) + elem.removeAttribute("ms-widget") + var vmodel = constructor(elem, data, vmodels) || {} //防止组件ä¸è¿”回VM + if (vmodel.$id) { + avalon.vmodels[id] = vmodel + createSignalTower(elem, vmodel) + try { + vmodel.$init(function() { + avalon.scan(elem, [vmodel].concat(vmodels)) + if (typeof options.onInit === "function") { + options.onInit.call(elem, vmodel, options, vmodels) + } + }) + } catch (e) {} + data.rollback = function() { + try { + vmodel.widgetElement = null + vmodel.$remove() + } catch (e) {} + elem.msData = {} + delete avalon.vmodels[vmodel.$id] + } + injectDisposeQueue(data, widgetList) + if (window.chrome) { + elem.addEventListener("DOMNodeRemovedFromDocument", function() { + setTimeout(rejectDisposeQueue) + }) + } + } else { + avalon.scan(elem, vmodels) + } + } else if (vmodels.length) { //如果该组件还没有加载,那么ä¿å­˜å½“å‰çš„vmodels + elem.vmodels = vmodels + } +} +var widgetList = [] +//ä¸å­˜åœ¨ bindingExecutors.widget +/********************************************************************* + * 自带过滤器 * + **********************************************************************/ +var rscripts = /]*>([\S\s]*?)<\/script\s*>/gim +var ron = /\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g +var ropen = /<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/ig +var rsanitize = { + a: /\b(href)\=("javascript[^"]*"|'javascript[^']*')/ig, + img: /\b(src)\=("javascript[^"]*"|'javascript[^']*')/ig, + form: /\b(action)\=("javascript[^"]*"|'javascript[^']*')/ig +} +var rsurrogate = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g +var rnoalphanumeric = /([^\#-~| |!])/g; + +function numberFormat(number, decimals, point, thousands) { + //form http://phpjs.org/functions/number_format/ + //number 必需,è¦æ ¼å¼åŒ–çš„æ•°å­— + //decimals å¯é€‰ï¼Œè§„定多少个å°æ•°ä½ã€‚ + //point å¯é€‰ï¼Œè§„定用作å°æ•°ç‚¹çš„字符串(默认为 . )。 + //thousands å¯é€‰ï¼Œè§„定用作åƒä½åˆ†éš”符的字符串(默认为 , ),如果设置了该å‚数,那么所有其他å‚数都是必需的。 + number = (number + '') + .replace(/[^0-9+\-Ee.]/g, '') + var n = !isFinite(+number) ? 0 : +number, + prec = !isFinite(+decimals) ? 3 : Math.abs(decimals), + sep = thousands || ",", + dec = point || ".", + s = '', + toFixedFix = function(n, prec) { + var k = Math.pow(10, prec) + return '' + (Math.round(n * k) / k) + .toFixed(prec) + } + // Fix for IE parseFloat(0.55).toFixed(0) = 0; + s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)) + .split('.') + if (s[0].length > 3) { + s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep) + } + if ((s[1] || '') + .length < prec) { + s[1] = s[1] || '' + s[1] += new Array(prec - s[1].length + 1) + .join('0') + } + return s.join(dec) +} + + +var filters = avalon.filters = { + uppercase: function(str) { + return str.toUpperCase() + }, + lowercase: function(str) { + return str.toLowerCase() + }, + truncate: function(str, length, truncation) { + //length,新字符串长度,truncation,新字符串的结尾的字段,返回新字符串 + length = length || 30 + truncation = typeof truncation === "string" ? truncation : "..." + return str.length > length ? str.slice(0, length - truncation.length) + truncation : String(str) + }, + $filter: function(val) { + for (var i = 1, n = arguments.length; i < n; i++) { + var array = arguments[i] + var fn = avalon.filters[array.shift()] + if (typeof fn === "function") { + var arr = [val].concat(array) + val = fn.apply(null, arr) + } + } + return val + }, + camelize: camelize, + //https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet + // chrome + // chrome + // IE67chrome + // IE67chrome + // IE67chrome + sanitize: function(str) { + return str.replace(rscripts, "").replace(ropen, function(a, b) { + var match = a.toLowerCase().match(/<(\w+)\s/) + if (match) { //处ç†a标签的href属性,img标签的src属性,form标签的action属性 + var reg = rsanitize[match[1]] + if (reg) { + a = a.replace(reg, function(s, name, value) { + var quote = value.charAt(0) + return name + "=" + quote + "javascript:void(0)" + quote// jshint ignore:line + }) + } + } + return a.replace(ron, " ").replace(/\s+/g, " ") //移除onXXX事件 + }) + }, + escape: function(str) { + //将字符串ç»è¿‡ str 转义得到适åˆåœ¨é¡µé¢ä¸­æ˜¾ç¤ºçš„内容, ä¾‹å¦‚æ›¿æ¢ < 为 < + return String(str). + replace(/&/g, '&'). + replace(rsurrogate, function(value) { + var hi = value.charCodeAt(0) + var low = value.charCodeAt(1) + return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';' + }). + replace(rnoalphanumeric, function(value) { + return '&#' + value.charCodeAt(0) + ';' + }). + replace(//g, '>') + }, + currency: function(amount, symbol, fractionSize) { + return (symbol || "\uFFE5") + numberFormat(amount, isFinite(fractionSize) ? fractionSize : 2) + }, + number: numberFormat +} +/* + 'yyyy': 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) + 'yy': 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) + 'y': 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) + 'MMMM': Month in year (January-December) + 'MMM': Month in year (Jan-Dec) + 'MM': Month in year, padded (01-12) + 'M': Month in year (1-12) + 'dd': Day in month, padded (01-31) + 'd': Day in month (1-31) + 'EEEE': Day in Week,(Sunday-Saturday) + 'EEE': Day in Week, (Sun-Sat) + 'HH': Hour in day, padded (00-23) + 'H': Hour in day (0-23) + 'hh': Hour in am/pm, padded (01-12) + 'h': Hour in am/pm, (1-12) + 'mm': Minute in hour, padded (00-59) + 'm': Minute in hour (0-59) + 'ss': Second in minute, padded (00-59) + 's': Second in minute (0-59) + 'a': am/pm marker + 'Z': 4 digit (+sign) representation of the timezone offset (-1200-+1200) + format string can also be one of the following predefined localizable formats: + + 'medium': equivalent to 'MMM d, y h:mm:ss a' for en_US locale (e.g. Sep 3, 2010 12:05:08 pm) + 'short': equivalent to 'M/d/yy h:mm a' for en_US locale (e.g. 9/3/10 12:05 pm) + 'fullDate': equivalent to 'EEEE, MMMM d,y' for en_US locale (e.g. Friday, September 3, 2010) + 'longDate': equivalent to 'MMMM d, y' for en_US locale (e.g. September 3, 2010 + 'mediumDate': equivalent to 'MMM d, y' for en_US locale (e.g. Sep 3, 2010) + 'shortDate': equivalent to 'M/d/yy' for en_US locale (e.g. 9/3/10) + 'mediumTime': equivalent to 'h:mm:ss a' for en_US locale (e.g. 12:05:08 pm) + 'shortTime': equivalent to 'h:mm a' for en_US locale (e.g. 12:05 pm) + */ +new function() {// jshint ignore:line + function toInt(str) { + return parseInt(str, 10) || 0 + } + + function padNumber(num, digits, trim) { + var neg = "" + if (num < 0) { + neg = '-' + num = -num + } + num = "" + num + while (num.length < digits) + num = "0" + num + if (trim) + num = num.substr(num.length - digits) + return neg + num + } + + function dateGetter(name, size, offset, trim) { + return function(date) { + var value = date["get" + name]() + if (offset > 0 || value > -offset) + value += offset + if (value === 0 && offset === -12) { + value = 12 + } + return padNumber(value, size, trim) + } + } + + function dateStrGetter(name, shortForm) { + return function(date, formats) { + var value = date["get" + name]() + var get = (shortForm ? ("SHORT" + name) : name).toUpperCase() + return formats[get][value] + } + } + + function timeZoneGetter(date) { + var zone = -1 * date.getTimezoneOffset() + var paddedZone = (zone >= 0) ? "+" : "" + paddedZone += padNumber(Math[zone > 0 ? "floor" : "ceil"](zone / 60), 2) + padNumber(Math.abs(zone % 60), 2) + return paddedZone + } + //å–得上åˆä¸‹åˆ + + function ampmGetter(date, formats) { + return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1] + } + var DATE_FORMATS = { + yyyy: dateGetter("FullYear", 4), + yy: dateGetter("FullYear", 2, 0, true), + y: dateGetter("FullYear", 1), + MMMM: dateStrGetter("Month"), + MMM: dateStrGetter("Month", true), + MM: dateGetter("Month", 2, 1), + M: dateGetter("Month", 1, 1), + dd: dateGetter("Date", 2), + d: dateGetter("Date", 1), + HH: dateGetter("Hours", 2), + H: dateGetter("Hours", 1), + hh: dateGetter("Hours", 2, -12), + h: dateGetter("Hours", 1, -12), + mm: dateGetter("Minutes", 2), + m: dateGetter("Minutes", 1), + ss: dateGetter("Seconds", 2), + s: dateGetter("Seconds", 1), + sss: dateGetter("Milliseconds", 3), + EEEE: dateStrGetter("Day"), + EEE: dateStrGetter("Day", true), + a: ampmGetter, + Z: timeZoneGetter + } + var rdateFormat = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/ + var raspnetjson = /^\/Date\((\d+)\)\/$/ + filters.date = function(date, format) { + var locate = filters.date.locate, + text = "", + parts = [], + fn, match + format = format || "mediumDate" + format = locate[format] || format + if (typeof date === "string") { + if (/^\d+$/.test(date)) { + date = toInt(date) + } else if (raspnetjson.test(date)) { + date = +RegExp.$1 + } else { + var trimDate = date.trim() + var dateArray = [0, 0, 0, 0, 0, 0, 0] + var oDate = new Date(0) + //å–得年月日 + trimDate = trimDate.replace(/^(\d+)\D(\d+)\D(\d+)/, function(_, a, b, c) { + var array = c.length === 4 ? [c, a, b] : [a, b, c] + dateArray[0] = toInt(array[0]) //å¹´ + dateArray[1] = toInt(array[1]) - 1 //月 + dateArray[2] = toInt(array[2]) //æ—¥ + return "" + }) + var dateSetter = oDate.setFullYear + var timeSetter = oDate.setHours + trimDate = trimDate.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/, function(_, a, b, c, d) { + dateArray[3] = toInt(a) //å°æ—¶ + dateArray[4] = toInt(b) //分钟 + dateArray[5] = toInt(c) //秒 + if (d) { //毫秒 + dateArray[6] = Math.round(parseFloat("0." + d) * 1000) + } + return "" + }) + var tzHour = 0 + var tzMin = 0 + trimDate = trimDate.replace(/Z|([+-])(\d\d):?(\d\d)/, function(z, symbol, c, d) { + dateSetter = oDate.setUTCFullYear + timeSetter = oDate.setUTCHours + if (symbol) { + tzHour = toInt(symbol + c) + tzMin = toInt(symbol + d) + } + return "" + }) + + dateArray[3] -= tzHour + dateArray[4] -= tzMin + dateSetter.apply(oDate, dateArray.slice(0, 3)) + timeSetter.apply(oDate, dateArray.slice(3)) + date = oDate + } + } + if (typeof date === "number") { + date = new Date(date) + } + if (avalon.type(date) !== "date") { + return + } + while (format) { + match = rdateFormat.exec(format) + if (match) { + parts = parts.concat(match.slice(1)) + format = parts.pop() + } else { + parts.push(format) + format = null + } + } + parts.forEach(function(value) { + fn = DATE_FORMATS[value] + text += fn ? fn(date, locate) : value.replace(/(^'|'$)/g, "").replace(/''/g, "'") + }) + return text + } + var locate = { + AMPMS: { + 0: "上åˆ", + 1: "下åˆ" + }, + DAY: { + 0: "星期日", + 1: "星期一", + 2: "星期二", + 3: "星期三", + 4: "星期四", + 5: "星期五", + 6: "星期六" + }, + MONTH: { + 0: "1月", + 1: "2月", + 2: "3月", + 3: "4月", + 4: "5月", + 5: "6月", + 6: "7月", + 7: "8月", + 8: "9月", + 9: "10月", + 10: "11月", + 11: "12月" + }, + SHORTDAY: { + "0": "周日", + "1": "周一", + "2": "周二", + "3": "周三", + "4": "周四", + "5": "周五", + "6": "周六" + }, + fullDate: "yå¹´M月dæ—¥EEEE", + longDate: "yå¹´M月dæ—¥", + medium: "yyyy-M-d H:mm:ss", + mediumDate: "yyyy-M-d", + mediumTime: "H:mm:ss", + "short": "yy-M-d ah:mm", + shortDate: "yy-M-d", + shortTime: "ah:mm" + } + locate.SHORTMONTH = locate.MONTH + filters.date.locate = locate +}// jshint ignore:line +/********************************************************************* + * AMD加载器 * + **********************************************************************/ +//https://www.devbridge.com/articles/understanding-amd-requirejs/ +//http://maxogden.com/nested-dependencies.html +var modules = avalon.modules = { + "domReady!": { + exports: avalon, + state: 3 + }, + "avalon": { + exports: avalon, + state: 4 + } +} +//Object(modules[id]).state拥有如下值 +// undefined 没有定义 +// 1(send) å·²ç»å‘出请求 +// 2(loading) å·²ç»è¢«æ‰§è¡Œä½†è¿˜æ²¡æœ‰æ‰§è¡Œå®Œæˆï¼Œåœ¨è¿™ä¸ªé˜¶æ®µdefine方法会被执行 +// 3(loaded) 执行完毕,通过onload/onreadystatechange回调判定,在这个阶段checkDeps方法会执行 +// 4(execute) å…¶ä¾èµ–也执行完毕, 值放到exports对象上,在这个阶段fireFactory方法会执行 +modules.exports = modules.avalon + +new function () {// jshint ignore:line + var loadings = [] //正在加载中的模å—列表 + var factorys = [] //放置define方法的factory函数 + var rjsext = /\.js$/i + function makeRequest(name, config) { +//1. 去掉资æºå‰ç¼€ + var res = "js" + name = name.replace(/^(\w+)\!/, function (a, b) { + res = b + return "" + }) + if (res === "ready") { + log("debug: ready!å·²ç»è¢«åºŸå¼ƒï¼Œè¯·ä½¿ç”¨domReady!") + res = "domReady" + } +//2. 去掉querystring, hash + var query = "" + name = name.replace(rquery, function (a) { + query = a + return "" + }) + //3. 去掉扩展å + var suffix = "." + res + var ext = /js|css/.test(suffix) ? suffix : "" + name = name.replace(/\.[a-z0-9]+$/g, function (a) { + if (a === suffix) { + ext = a + return "" + } else { + return a + } + }) + var req = avalon.mix({ + query: query, + ext: ext, + res: res, + name: name, + toUrl: toUrl + }, config) + req.toUrl(name) + return req + } + + function fireRequest(req) { + var name = req.name + var res = req.res + //1. 如果该模å—å·²ç»å‘出请求,直接返回 + var module = modules[name] + var urlNoQuery = name && req.urlNoQuery + if (module && module.state >= 1) { + return name + } + module = modules[urlNoQuery] + if (module && module.state >= 3) { + innerRequire(module.deps || [], module.factory, urlNoQuery) + return urlNoQuery + } + if (name && !module) { + module = modules[urlNoQuery] = { + id: urlNoQuery, + state: 1 //send + } + var wrap = function (obj) { + resources[res] = obj + obj.load(name, req, function (a) { + if (arguments.length && a !== void 0) { + module.exports = a + } + module.state = 4 + checkDeps() + }) + } + + if (!resources[res]) { + innerRequire([res], wrap) + } else { + wrap(resources[res]) + } + } + return name ? urlNoQuery : res + "!" + } + +//核心API之一 require + var requireQueue = [] + var isUserFirstRequire = false + innerRequire = avalon.require = function (array, factory, parentUrl, defineConfig) { + if (!isUserFirstRequire) { + requireQueue.push(avalon.slice(arguments)) + if (arguments.length <= 2) { + isUserFirstRequire = true + var queue = requireQueue.splice(0, requireQueue.length), args + while (args = queue.shift()) { + innerRequire.apply(null, args) + } + } + return + } + + if (!Array.isArray(array)) { + avalon.error("require方法的第一个å‚数应为数组 " + array) + } + var deps = [] // 放置所有ä¾èµ–项的完整路径 + var uniq = {} + var id = parentUrl || "callback" + setTimeout("1")// jshint ignore:line + defineConfig = defineConfig || {} + defineConfig.baseUrl = kernel.baseUrl + var isBuilt = !!defineConfig.built + if (parentUrl) { + defineConfig.parentUrl = parentUrl.substr(0, parentUrl.lastIndexOf("/")) + defineConfig.mapUrl = parentUrl.replace(rjsext, "") + } + if (isBuilt) { + var req = makeRequest(defineConfig.defineName, defineConfig) + id = req.urlNoQuery + } else { + array.forEach(function (name) { + var req = makeRequest(name, defineConfig) + var url = fireRequest(req) //加载资æºï¼Œå¹¶è¿”回该资æºçš„å®Œæ•´åœ°å€ + if (url) { + if (!uniq[url]) { + deps.push(url) + uniq[url] = "å¸å¾’正美" //åŽ»é‡ + } + } + }) + } + + var module = modules[id] + if (!module || module.state !== 4) { + modules[id] = { + id: id, + deps: isBuilt ? array.concat() : deps, + factory: factory || noop, + state: 3 + } + } + if (!module) { + //如果此模å—是定义在å¦ä¸€ä¸ªJS文件中, 那必须等该文件加载完毕, æ‰èƒ½æ”¾åˆ°æ£€æµ‹åˆ—队中 + loadings.push(id) + } + checkDeps() + } + +//核心API之二 require + innerRequire.define = function (name, deps, factory) { //模å—å,ä¾èµ–列表,模å—本身 + if (typeof name !== "string") { + factory = deps + deps = name + name = "anonymous" + } + if (!Array.isArray(deps)) { + factory = deps + deps = [] + } + var config = { + built: !isUserFirstRequire, //用r.js打包åŽ,所有define会放到requirejsä¹‹å‰ + defineName: name + } + var args = [deps, factory, config] + factory.require = function (url) { + args.splice(2, 0, url) + if (modules[url]) { + modules[url].state = 3 //loaded + var isCycle = false + try { + isCycle = checkCycle(modules[url].deps, url) + } catch (e) { + } + if (isCycle) { + avalon.error(url + "模å—与之å‰çš„模å—存在循环ä¾èµ–,请ä¸è¦ç›´æŽ¥ç”¨script标签引入" + url + "模å—") + } + } + delete factory.require //释放内存 + innerRequire.apply(null, args) //0,1,2 --> 1,2,0 + } +//æ ¹æ®æ ‡å‡†,所有éµå¾ªW3C标准的æµè§ˆå™¨,script标签会按标签的出现顺åºæ‰§è¡Œã€‚ +//è€çš„æµè§ˆå™¨ä¸­ï¼ŒåŠ è½½ä¹Ÿæ˜¯æŒ‰é¡ºåºçš„:一个文件下载完æˆåŽï¼Œæ‰å¼€å§‹ä¸‹è½½ä¸‹ä¸€ä¸ªæ–‡ä»¶ã€‚ +//较新的æµè§ˆå™¨ä¸­ï¼ˆIE8+ ã€FireFox3.5+ ã€Chrome4+ ã€Safari4+),为了å‡å°è¯·æ±‚时间以优化体验, +//下载å¯ä»¥æ˜¯å¹¶è¡Œçš„,但是执行顺åºè¿˜æ˜¯æŒ‰ç…§æ ‡ç­¾å‡ºçŽ°çš„顺åºã€‚ +//但如果script标签是动æ€æ’入的, 就未必按照先请求先执行的原则了,目测åªæœ‰firefoxéµå®ˆ +//唯一比较一致的是,IE10+åŠå…¶ä»–标准æµè§ˆå™¨,一旦开始解æžè„šæœ¬, 就会一直堵在那里,直接脚本解æžå®Œæ¯• +//亦å³ï¼Œå…ˆè¿›å…¥loading阶段的script标签(模å—)必然会先进入loaded阶段 + var url = config.built ? "unknown" : getCurrentScript() + if (url) { + var module = modules[url] + if (module) { + module.state = 2 + } + factory.require(url) + } else {//åˆå¹¶å‰åŽçš„safari,åˆå¹¶åŽçš„IE6-9走此分支 + factorys.push(factory) + } + } +//核心API之三 require.config(settings) + innerRequire.config = kernel + //核心API之四 define.amd 标识其符åˆAMD规范 + innerRequire.define.amd = modules + + //==========================对用户é…置项进行å†åŠ å·¥========================== + var allpaths = kernel["orig.paths"] = {} + var allmaps = kernel["orig.map"] = {} + var allpackages = kernel["packages"] = [] + var allargs = kernel["orig.args"] = {} + avalon.mix(plugins, { + paths: function (hash) { + avalon.mix(allpaths, hash) + kernel.paths = makeIndexArray(allpaths) + }, + map: function (hash) { + avalon.mix(allmaps, hash) + var list = makeIndexArray(allmaps, 1, 1) + avalon.each(list, function (_, item) { + item.val = makeIndexArray(item.val) + }) + kernel.map = list + }, + packages: function (array) { + array = array.concat(allpackages) + var uniq = {} + var ret = [] + for (var i = 0, pkg; pkg = array[i++]; ) { + pkg = typeof pkg === "string" ? {name: pkg} : pkg + var name = pkg.name + if (!uniq[name]) { + var url = joinPath(pkg.location || name, pkg.main || "main") + url = url.replace(rjsext, "") + ret.push(pkg) + uniq[name] = pkg.location = url + pkg.reg = makeMatcher(name) + } + } + kernel.packages = ret.sort() + }, + urlArgs: function (hash) { + if (typeof hash === "string") { + hash = {"*": hash} + } + avalon.mix(allargs, hash) + kernel.urlArgs = makeIndexArray(allargs, 1) + }, + baseUrl: function (url) { + if (!isAbsUrl(url)) { + var baseElement = head.getElementsByTagName("base")[0] + if (baseElement) { + head.removeChild(baseElement) + } + var node = DOC.createElement("a") + node.href = url + url = getFullUrl(node, "href") + if (baseElement) { + head.insertBefore(baseElement, head.firstChild) + } + } + if (url.length > 3) + kernel.baseUrl = url + }, + shim: function (obj) { + for (var i in obj) { + var value = obj[i] + if (Array.isArray(value)) { + value = obj[i] = { + deps: value + } + } + if (!value.exportsFn && (value.exports || value.init)) { + value.exportsFn = makeExports(value) + } + } + kernel.shim = obj + } + + }) + + + //==============================内部方法================================= + function checkCycle(deps, nick) { + //检测是å¦å­˜åœ¨å¾ªçŽ¯ä¾èµ– + for (var i = 0, id; id = deps[i++]; ) { + if (modules[id].state !== 4 && + (id === nick || checkCycle(modules[id].deps, nick))) { + return true + } + } + } + + function checkFail(node, onError, fuckIE) { + var id = trimQuery(node.src) //检测是å¦æ­»é“¾ + node.onload = node.onreadystatechange = node.onerror = null + if (onError || (fuckIE && modules[id] && !modules[id].state)) { + setTimeout(function () { + head.removeChild(node) + node = null // 处ç†æ—§å¼IE下的循环引用问题 + }) + log("debug: 加载 " + id + " 失败" + onError + " " + (!modules[id].state)) + } else { + return true + } + } + + function checkDeps() { + //检测此JS模å—çš„ä¾èµ–是å¦éƒ½å·²å®‰è£…完毕,是则安装自身 + loop: for (var i = loadings.length, id; id = loadings[--i]; ) { + var obj = modules[id], + deps = obj.deps + if (!deps) + continue + for (var j = 0, key; key = deps[j]; j++) { + if (Object(modules[key]).state !== 4) { + continue loop + } + } + //如果deps是空对象或者其ä¾èµ–的模å—的状æ€éƒ½æ˜¯2 + if (obj.state !== 4) { + loadings.splice(i, 1) //必须先移除å†å®‰è£…,防止在IE下DOM树建完åŽæ‰‹åŠ¨åˆ·æ–°é¡µé¢ï¼Œä¼šå¤šæ¬¡æ‰§è¡Œå®ƒ + fireFactory(obj.id, obj.deps, obj.factory) + checkDeps() //如果æˆåŠŸ,则å†æ‰§è¡Œä¸€æ¬¡,以防有些模å—就差本模å—没有安装好 + } + } + } + + var rreadyState = /complete|loaded/ + function loadJS(url, id, callback) { + //通过scriptèŠ‚ç‚¹åŠ è½½ç›®æ ‡æ¨¡å— + var node = DOC.createElement("script") + node.className = subscribers //让getCurrentScriptåªå¤„ç†ç±»å为subscribersçš„script节点 + var supportLoad = "onload" in node + var onEvent = supportLoad ? "onload" : "onreadystatechange" + function onload() { + var factory = factorys.pop() + factory && factory.require(id) + if (callback) { + callback() + } + if (checkFail(node, false, !supportLoad)) { + log("debug: å·²æˆåŠŸåŠ è½½ " + url) + id && loadings.push(id) + checkDeps() + } + } + var index = 0, loadID + node[onEvent] = supportLoad ? onload : function () { + if (rreadyState.test(node.readyState)) { + ++index + if (index === 1) { + loadID = setTimeout(onload, 500) + } else { + clearTimeout(loadID) + onload() + } + } + } + node.onerror = function () { + checkFail(node, true) + } + + head.insertBefore(node, head.firstChild) //chrome下第二个å‚æ•°ä¸èƒ½ä¸ºnull + node.src = url //æ’入到head的第一个节点å‰ï¼Œé˜²æ­¢IE6下head标签没闭åˆå‰ä½¿ç”¨appendChild抛错 + log("debug: 正准备加载 " + url) //æ›´é‡è¦çš„是IE6下å¯ä»¥æ”¶çª„getCurrentScript的寻找范围 + } + + var resources = innerRequire.plugins = { + //三大常用资æºæ’件 js!, css!, text!, ready! + ready: { + load: noop + }, + js: { + load: function (name, req, onLoad) { + var url = req.url + var id = req.urlNoQuery + var shim = kernel.shim[name.replace(rjsext, "")] + if (shim) { //shim机制 + innerRequire(shim.deps || [], function () { + var args = avalon.slice(arguments) + loadJS(url, id, function () { + onLoad(shim.exportsFn ? shim.exportsFn.apply(0, args) : void 0) + }) + }) + } else { + loadJS(url, id) + } + } + }, + css: { + load: function (name, req, onLoad) { + var url = req.url + var node = DOC.createElement("link") + node.rel = "stylesheet" + node.href = url + head.insertBefore(node, head.firstChild) + log("debug: å·²æˆåŠŸåŠ è½½ " + url) + onLoad() + } + }, + text: { + load: function (name, req, onLoad) { + var url = req.url + var xhr = getXHR() + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + var status = xhr.status; + if (status > 399 && status < 600) { + avalon.error(url + " 对应资æºä¸å­˜åœ¨æˆ–æ²¡æœ‰å¼€å¯ CORS") + } else { + log("debug: å·²æˆåŠŸåŠ è½½ " + url) + onLoad(xhr.responseText) + } + } + } + var time = "_=" + (new Date() - 0) + var _url = url.indexOf("?") === -1 ? url + "?" + time : url + "&" + time + xhr.open("GET", _url, true) + if ("withCredentials" in xhr) {//这是处ç†è·¨åŸŸ + xhr.withCredentials = true + } + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")//告诉åŽç«¯è¿™æ˜¯AJAX请求 + xhr.send() + log("debug: 正准备加载 " + url) + } + } + } + innerRequire.checkDeps = checkDeps + + var rquery = /(\?[^#]*)$/ + function trimQuery(url) { + return (url || "").replace(rquery, "") + } + + function isAbsUrl(path) { + //http://stackoverflow.com/questions/10687099/how-to-test-if-a-url-string-is-absolute-or-relative + return /^(?:[a-z]+:)?\/\//i.test(String(path)) + } + + function getFullUrl(node, src) { + return"1"[0] ? node[src] : node.getAttribute(src, 4) + } + + function getCurrentScript() { + // inspireb by https://github.com/samyk/jiagra/blob/master/jiagra.js + var stack + try { + a.b.c() //强制报错,以便æ•èŽ·e.stack + } catch (e) { //safari5çš„sourceURL,firefoxçš„fileName,它们的效果与e.stackä¸ä¸€æ · + stack = e.stack + if (!stack && window.opera) { + //opera 9没有e.stack,但有e.Backtrace,但ä¸èƒ½ç›´æŽ¥å–å¾—,需è¦å¯¹eå¯¹è±¡è½¬å­—ç¬¦ä¸²è¿›è¡ŒæŠ½å– + stack = (String(e).match(/of linked script \S+/g) || []).join(" ") + } + } + if (stack) { + /**e.stack最åŽä¸€è¡Œåœ¨æ‰€æœ‰æ”¯æŒçš„æµè§ˆå™¨å¤§è‡´å¦‚下: + *chrome23: + * at http://113.93.50.63/data.js:4:1 + *firefox17: + *@http://113.93.50.63/query.js:4 + *opera12:http://www.oldapps.com/opera.php?system=Windows_XP + *@http://113.93.50.63/data.js:4 + *IE10: + * at Global code (http://113.93.50.63/data.js:4:1) + * //firefox4+ å¯ä»¥ç”¨document.currentScript + */ + stack = stack.split(/[@ ]/g).pop() //å–得最åŽä¸€è¡Œ,最åŽä¸€ä¸ªç©ºæ ¼æˆ–@之åŽçš„部分 + stack = stack[0] === "(" ? stack.slice(1, -1) : stack.replace(/\s/, "") //去掉æ¢è¡Œç¬¦ + return trimQuery(stack.replace(/(:\d+)?:\d+$/i, "")) //去掉行å·ä¸Žæˆ–许存在的出错字符起始ä½ç½® + } + var nodes = head.getElementsByTagName("script") //åªåœ¨head标签中寻找 + for (var i = nodes.length, node; node = nodes[--i]; ) { + if (node.className === subscribers && node.readyState === "interactive") { + var url = getFullUrl(node, "src") + return node.className = trimQuery(url) + } + } + } + + var rcallback = /^callback\d+$/ + function fireFactory(id, deps, factory) { + var module = Object(modules[id]) + module.state = 4 + for (var i = 0, array = [], d; d = deps[i++]; ) { + if (d === "exports") { + var obj = module.exports || (module.exports = {}) + array.push(obj) + } else { + array.push(modules[d].exports) + } + } + try { + var ret = factory.apply(window, array) + } catch (e) { + log("执行[" + id + "]模å—çš„factory抛错: ", e) + } + if (ret !== void 0) { + module.exports = ret + } + if (rcallback.test(id)) { + delete modules[id] + } + delete module.factory + return ret + } + function toUrl(id) { + if (id.indexOf(this.res + "!") === 0) { + id = id.slice(this.res.length + 1) //处ç†define("css!style",[], function(){})的情况 + } + var url = id + //1. 是å¦å‘½ä¸­pathsé…置项 + var usePath = 0 + var baseUrl = this.baseUrl + var rootUrl = this.parentUrl || baseUrl + eachIndexArray(id, kernel.paths, function (value, key) { + url = url.replace(key, value) + usePath = 1 + }) + //2. 是å¦å‘½ä¸­packagesé…置项 + if (!usePath) { + eachIndexArray(id, kernel.packages, function (value, key, item) { + url = url.replace(item.name, item.location) + }) + } + //3. 是å¦å‘½ä¸­mapé…置项 + if (this.mapUrl) { + eachIndexArray(this.mapUrl, kernel.map, function (array) { + eachIndexArray(url, array, function (mdValue, mdKey) { + url = url.replace(mdKey, mdValue) + rootUrl = baseUrl + }) + }) + } + var ext = this.ext + if (ext && usePath && url.slice(-ext.length) === ext) { + url = url.slice(0, -ext.length) + } + //4. 转æ¢ä¸ºç»å¯¹è·¯å¾„ + if (!isAbsUrl(url)) { + rootUrl = this.built || /^\w/.test(url) ? baseUrl : rootUrl + url = joinPath(rootUrl, url) + } + //5. 还原扩展å,query + var urlNoQuery = url + ext + url = urlNoQuery + this.query + //6. 处ç†urlArgs + eachIndexArray(id, kernel.urlArgs, function (value) { + url += (url.indexOf("?") === -1 ? "?" : "&") + value; + }) + this.url = url + return this.urlNoQuery = urlNoQuery + } + + function makeIndexArray(hash, useStar, part) { + //创建一个ç»è¿‡ç‰¹æ®Šç®—法排好åºçš„数组 + var index = hash2array(hash, useStar, part) + index.sort(descSorterByName) + return index + } + + function makeMatcher(prefix) { + return new RegExp('^' + prefix + '(/|$)') + } + + function makeExports(value) { + return function () { + var ret + if (value.init) { + ret = value.init.apply(window, arguments) + } + return ret || (value.exports && getGlobal(value.exports)) + } + } + + + function hash2array(hash, useStar, part) { + var array = []; + for (var key in hash) { + if (ohasOwn.call(hash, key)) { + var item = { + name: key, + val: hash[key] + } + array.push(item) + item.reg = key === "*" && useStar ? /^/ : makeMatcher(key) + if (part && key !== "*") { + item.reg = new RegExp('\/' + key.replace(/^\//, "") + '(/|$)') + } + } + } + return array + } + + function eachIndexArray(moduleID, array, matcher) { + array = array || [] + for (var i = 0, el; el = array[i++]; ) { + if (el.reg.test(moduleID)) { + matcher(el.val, el.name, el) + return false + } + } + } + // æ ¹æ®å…ƒç´ çš„name项进行数组字符数逆åºçš„排åºå‡½æ•° + function descSorterByName(a, b) { + var aaa = a.name + var bbb = b.name + if (bbb === "*") { + return -1 + } + if (aaa === "*") { + return 1 + } + return bbb.length - aaa.length + } + + var rdeuce = /\/\w+\/\.\./ + function joinPath(a, b) { + if (a.charAt(a.length - 1) !== "/") { + a += "/" + } + if (b.slice(0, 2) === "./") { //相对于兄弟路径 + return a + b.slice(2) + } + if (b.slice(0, 2) === "..") { //相对于父路径 + a += b + while (rdeuce.test(a)) { + a = a.replace(rdeuce, "") + } + return a + } + if (b.slice(0, 1) === "/") { + return a + b.slice(1) + } + return a + b + } + + function getGlobal(value) { + if (!value) { + return value + } + var g = window + value.split(".").forEach(function (part) { + g = g[part] + }) + return g + } + + var mainNode = DOC.scripts[DOC.scripts.length - 1] + var dataMain = mainNode.getAttribute("data-main") + if (dataMain) { + plugins.baseUrl(dataMain) + var href = kernel.baseUrl + kernel.baseUrl = href.slice(0, href.lastIndexOf("/") + 1) + loadJS(href.replace(rjsext, "") + ".js") + } else { + var loaderUrl = trimQuery(getFullUrl(mainNode, "src")) + kernel.baseUrl = loaderUrl.slice(0, loaderUrl.lastIndexOf("/") + 1) + } +}// jshint ignore:line + +/********************************************************************* + * DOMReady * + **********************************************************************/ + +var readyList = [], isReady +var fireReady = function(fn) { + isReady = true + if (innerRequire) { + modules["domReady!"].state = 4 + innerRequire.checkDeps() + } + while(fn = readyList.shift()){ + fn(avalon) + } +} + +function doScrollCheck() { + try { //IE下通过doScrollCheck检测DOM树是å¦å»ºå®Œ + root.doScroll("left") + fireReady() + } catch (e) { + setTimeout(doScrollCheck) + } +} + +if (DOC.readyState === "complete") { + setTimeout(fireReady) //如果在domReady之外加载 +} else if (W3C) { + DOC.addEventListener("DOMContentLoaded", fireReady) +} else { + DOC.attachEvent("onreadystatechange", function() { + if (DOC.readyState === "complete") { + fireReady() + } + }) + try { + var isTop = window.frameElement === null + } catch (e) { + } + if (root.doScroll && isTop && window.external) {//fix IE iframe BUG + doScrollCheck() + } +} +avalon.bind(window, "load", fireReady) + +avalon.ready = function(fn) { + if (!isReady) { + readyList.push(fn) + } else { + fn(avalon) + } +} + +avalon.config({ + loader: true +}) + +avalon.ready(function() { + avalon.scan(DOC.body) +}) + +// Register as a named AMD module, since avalon can be concatenated with other +// files that may use define, but not via a proper concatenation script that +// understands anonymous AMD modules. A named AMD is safest and most robust +// way to register. Lowercase avalon is used because AMD module names are +// derived from file names, and Avalon is normally delivered in a lowercase +// file name. Do this after creating the global so that if an AMD module wants +// to call noConflict to hide this version of avalon, it will work. + +// Note that for maximum portability, libraries that are not avalon should +// declare themselves as anonymous modules, and avoid setting a global if an +// AMD loader is present. avalon is a special case. For more information, see +// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon + if (typeof define === "function" && define.amd) { + define("avalon", [], function() { + return avalon + }) + } +// Map over avalon in case of overwrite + var _avalon = window.avalon + avalon.noConflict = function(deep) { + if (deep && window.avalon === avalon) { + window.avalon = _avalon + } + return avalon + } +// Expose avalon identifiers, even in AMD +// and CommonJS for browser emulators + if (noGlobal === void 0) { + window.avalon = avalon + } + return avalon + +})); \ No newline at end of file diff --git a/common/src/main/webapp/thirdparty/avalon/avalon.modern.js b/common/src/main/webapp/thirdparty/avalon/avalon.modern.js new file mode 100644 index 00000000..048b4241 --- /dev/null +++ b/common/src/main/webapp/thirdparty/avalon/avalon.modern.js @@ -0,0 +1,4935 @@ +/*================================================== + Copyright (c) 2013-2015 å¸å¾’正美 and other contributors + http://www.cnblogs.com/rubylouvre/ + https://github.com/RubyLouvre + http://weibo.com/jslouvre/ + + Released under the MIT license + avalon.modern.js 1.43 built in 2015.5.21 + support IE10+ and other browsers + ==================================================*/ +(function (global, factory) { + + if (typeof module === "object" && typeof module.exports === "object") { + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get avalon. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var avalon = require("avalon")(window); + module.exports = global.document ? factory(global, true) : function (w) { + if (!w.document) { + throw new Error("Avalon requires a window with a document") + } + return factory(w) + } + } else { + factory(global) + } + +// Pass this if window is not defined yet +}(typeof window !== "undefined" ? window : this, function (window, noGlobal) { + + /********************************************************************* + * 全局å˜é‡åŠæ–¹æ³• * + **********************************************************************/ + var expose = Date.now() +//http://stackoverflow.com/questions/7290086/javascript-use-strict-and-nicks-find-global-function + var DOC = window.document + var head = DOC.head //HEAD元素 + head.insertAdjacentHTML("afterBegin", '') + var ifGroup = head.firstChild + + function log() { + if (avalon.config.debug) { +// http://stackoverflow.com/questions/8785624/how-to-safely-wrap-console-log + console.log.apply(console, arguments) + } + } + + /** + * Creates a new object without a prototype. This object is useful for lookup without having to + * guard against prototypically inherited properties via hasOwnProperty. + * + * Related micro-benchmarks: + * - http://jsperf.com/object-create2 + * - http://jsperf.com/proto-map-lookup/2 + * - http://jsperf.com/for-in-vs-object-keys2 + */ + function createMap() { + return Object.create(null) + } + + var subscribers = "$" + expose + var otherRequire = window.require + var otherDefine = window.define + var innerRequire + var stopRepeatAssign = false + var rword = /[^, ]+/g //切割字符串为一个个å°å—,以空格或豆å·åˆ†å¼€å®ƒä»¬ï¼Œç»“åˆreplace实现字符串的forEach + var rcomplexType = /^(?:object|array)$/ + var rsvg = /^\[object SVG\w*Element\]$/ + var rwindow = /^\[object (?:Window|DOMWindow|global)\]$/ + var oproto = Object.prototype + var ohasOwn = oproto.hasOwnProperty + var serialize = oproto.toString + var ap = Array.prototype + var aslice = ap.slice + var Registry = {} //将函数æ›å…‰åˆ°æ­¤å¯¹è±¡ä¸Šï¼Œæ–¹ä¾¿è®¿é—®å™¨æ”¶é›†ä¾èµ– + var W3C = window.dispatchEvent + var root = DOC.documentElement + var hyperspace = DOC.createDocumentFragment() + var cinerator = DOC.createElement("div") + var class2type = {} + "Boolean Number String Function Array Date RegExp Object Error".replace(rword, function (name) { + class2type["[object " + name + "]"] = name.toLowerCase() + }) + + + function noop() { + } + + + function oneObject(array, val) { + if (typeof array === "string") { + array = array.match(rword) || [] + } + var result = {}, + value = val !== void 0 ? val : 1 + for (var i = 0, n = array.length; i < n; i++) { + result[array[i]] = value + } + return result + } + +//生æˆUUID http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript + var generateID = function (prefix) { + prefix = prefix || "avalon" + return String(Math.random() + Math.random()).replace(/\d\.\d{4}/, prefix) + } + + function IE() { + if (window.VBArray) { + var mode = document.documentMode + return mode ? mode : window.XMLHttpRequest ? 7 : 6 + } else { + return 0 + } + } + + var IEVersion = IE() + + avalon = function (el) { //创建jQueryå¼çš„æ— new 实例化结构 + return new avalon.init(el) + } + + /*视æµè§ˆå™¨æƒ…况采用最快的异步回调*/ + avalon.nextTick = new function () {// jshint ignore:line + var tickImmediate = window.setImmediate + var tickObserver = window.MutationObserver + var tickPost = W3C && window.postMessage + if (tickImmediate) { + return tickImmediate.bind(window) + } + + var queue = [] + + function callback() { + var n = queue.length + for (var i = 0; i < n; i++) { + queue[i]() + } + queue = queue.slice(n) + } + + if (tickObserver) { + var node = document.createTextNode("avalon") + new tickObserver(callback).observe(node, {characterData: true})// jshint ignore:line + return function (fn) { + queue.push(fn) + node.data = Math.random() + } + } + + if (tickPost) { + window.addEventListener("message", function (e) { + var source = e.source + if ((source === window || source === null) && e.data === "process-tick") { + e.stopPropagation() + callback() + } + }) + + return function (fn) { + queue.push(fn) + window.postMessage('process-tick', '*') + } + } + + return function (fn) { + setTimeout(fn, 0) + } + }// jshint ignore:line + /********************************************************************* + * avalonçš„é™æ€æ–¹æ³•å®šä¹‰åŒº * + **********************************************************************/ + avalon.init = function (el) { + this[0] = this.element = el + } + avalon.fn = avalon.prototype = avalon.init.prototype + + avalon.type = function (obj) { //å–得目标的类型 + if (obj == null) { + return String(obj) + } + // 早期的webkit内核æµè§ˆå™¨å®žçŽ°äº†å·²åºŸå¼ƒçš„ecma262v4标准,å¯ä»¥å°†æ­£åˆ™å­—é¢é‡å½“作函数使用,因此typeof在判定正则时会返回function + return typeof obj === "object" || typeof obj === "function" ? + class2type[serialize.call(obj)] || "object" : + typeof obj + } + + var isFunction = function (fn) { + return serialize.call(fn) === "[object Function]" + } + + avalon.isFunction = isFunction + + avalon.isWindow = function (obj) { + return rwindow.test(serialize.call(obj)) + } + + /*判定是å¦æ˜¯ä¸€ä¸ªæœ´ç´ çš„javascript对象(Object),ä¸æ˜¯DOM对象,ä¸æ˜¯BOM对象,ä¸æ˜¯è‡ªå®šä¹‰ç±»çš„实例*/ + + avalon.isPlainObject = function (obj) { + // 简å•çš„ typeof obj === "object"检测,会致使用isPlainObject(window)在opera下通ä¸è¿‡ + return serialize.call(obj) === "[object Object]" && Object.getPrototypeOf(obj) === oproto + } + +//与jQuery.extend方法,å¯ç”¨äºŽæµ…æ‹·è´ï¼Œæ·±æ‹·è´ + avalon.mix = avalon.fn.mix = function () { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false + + // 如果第一个å‚数为布尔,判定是å¦æ·±æ‹·è´ + if (typeof target === "boolean") { + deep = target + target = arguments[1] || {} + i++ + } + + //ç¡®ä¿æŽ¥å—方为一个å¤æ‚çš„æ•°æ®ç±»åž‹ + if (typeof target !== "object" && !isFunction(target)) { + target = {} + } + + //如果åªæœ‰ä¸€ä¸ªå‚数,那么新æˆå‘˜æ·»åŠ äºŽmix所在的对象上 + if (i === length) { + target = this + i-- + } + + for (; i < length; i++) { + //åªå¤„ç†éžç©ºå‚æ•° + if ((options = arguments[i]) != null) { + for (name in options) { + src = target[name] + copy = options[name] + // 防止环引用 + if (target === copy) { + continue + } + if (deep && copy && (avalon.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) { + + if (copyIsArray) { + copyIsArray = false + clone = src && Array.isArray(src) ? src : [] + + } else { + clone = src && avalon.isPlainObject(src) ? src : {} + } + + target[name] = avalon.mix(deep, clone, copy) + } else if (copy !== void 0) { + target[name] = copy + } + } + } + } + return target + } + + function _number(a, len) { //用于模拟slice, splice的效果 + a = Math.floor(a) || 0 + return a < 0 ? Math.max(len + a, 0) : Math.min(a, len); + } + + avalon.mix({ + rword: rword, + subscribers: subscribers, + version: 1.43, + ui: {}, + log: log, + slice: function (nodes, start, end) { + return aslice.call(nodes, start, end) + }, + noop: noop, + /*如果ä¸ç”¨Error对象å°è£…一下,str在控制å°ä¸‹å¯èƒ½ä¼šä¹±ç */ + error: function (str, e) { + throw new (e || Error)(str)// jshint ignore:line + }, + /*将一个以空格或逗å·éš”开的字符串或数组,转æ¢æˆä¸€ä¸ªé”®å€¼éƒ½ä¸º1的对象*/ + oneObject: oneObject, + /* avalon.range(10) + => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + avalon.range(1, 11) + => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + avalon.range(0, 30, 5) + => [0, 5, 10, 15, 20, 25] + avalon.range(0, -10, -1) + => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] + avalon.range(0) + => []*/ + range: function (start, end, step) { // 用于生æˆæ•´æ•°æ•°ç»„ + step || (step = 1) + if (end == null) { + end = start || 0 + start = 0 + } + var index = -1, + length = Math.max(0, Math.ceil((end - start) / step)), + result = new Array(length) + while (++index < length) { + result[index] = start + start += step + } + return result + }, + eventHooks: {}, + /*绑定事件*/ + bind: function (el, type, fn, phase) { + var hooks = avalon.eventHooks + var hook = hooks[type] + if (typeof hook === "object") { + type = hook.type + if (hook.deel) { + fn = hook.deel(el, type, fn, phase) + } + } + if (!fn.unbind) + el.addEventListener(type, fn, !!phase) + return fn + }, + /*å¸è½½äº‹ä»¶*/ + unbind: function (el, type, fn, phase) { + var hooks = avalon.eventHooks + var hook = hooks[type] + var callback = fn || noop + if (typeof hook === "object") { + type = hook.type + if (hook.deel) { + fn = hook.deel(el, type, fn, false) + } + } + el.removeEventListener(type, callback, !!phase) + }, + /*读写删除元素节点的样å¼*/ + css: function (node, name, value) { + if (node instanceof avalon) { + node = node[0] + } + var prop = /[_-]/.test(name) ? camelize(name) : name, fn + name = avalon.cssName(prop) || prop + if (value === void 0 || typeof value === "boolean") { //获å–æ ·å¼ + fn = cssHooks[prop + ":get"] || cssHooks["@:get"] + if (name === "background") { + name = "backgroundColor" + } + var val = fn(node, name) + return value === true ? parseFloat(val) || 0 : val + } else if (value === "") { //è¯·é™¤æ ·å¼ + node.style[name] = "" + } else { //è®¾ç½®æ ·å¼ + if (value == null || value !== value) { + return + } + if (isFinite(value) && !avalon.cssNumber[prop]) { + value += "px" + } + fn = cssHooks[prop + ":set"] || cssHooks["@:set"] + fn(node, name, value) + } + }, + /*é历数组与对象,回调的第一个å‚数为索引或键å,第二个或元素或键值*/ + each: function (obj, fn) { + if (obj) { //排除null, undefined + var i = 0 + if (isArrayLike(obj)) { + for (var n = obj.length; i < n; i++) { + if (fn(i, obj[i]) === false) + break + } + } else { + for (i in obj) { + if (obj.hasOwnProperty(i) && fn(i, obj[i]) === false) { + break + } + } + } + } + }, + //收集元素的data-{{prefix}}-*属性,并转æ¢ä¸ºå¯¹è±¡ + getWidgetData: function (elem, prefix) { + var raw = avalon(elem).data() + var result = {} + for (var i in raw) { + if (i.indexOf(prefix) === 0) { + result[i.replace(prefix, "").replace(/\w/, function (a) { + return a.toLowerCase() + })] = raw[i] + } + } + return result + }, + Array: { + /*åªæœ‰å½“å‰æ•°ç»„ä¸å­˜åœ¨æ­¤å…ƒç´ æ—¶åªæ·»åŠ å®ƒ*/ + ensure: function (target, item) { + if (target.indexOf(item) === -1) { + return target.push(item) + } + }, + /*移除数组中指定ä½ç½®çš„元素,返回布尔表示æˆåŠŸä¸Žå¦*/ + removeAt: function (target, index) { + return !!target.splice(index, 1).length + }, + /*移除数组中第一个匹é…ä¼ å‚的那个元素,返回布尔表示æˆåŠŸä¸Žå¦*/ + remove: function (target, item) { + var index = target.indexOf(item) + if (~index) + return avalon.Array.removeAt(target, index) + return false + } + } + }) + + var bindingHandlers = avalon.bindingHandlers = {} + var bindingExecutors = avalon.bindingExecutors = {} + + /*判定是å¦ç±»æ•°ç»„,如节点集åˆï¼Œçº¯æ•°ç»„,arguments与拥有éžè´Ÿæ•´æ•°çš„length属性的纯JS对象*/ + function isArrayLike(obj) { + if (obj && typeof obj === "object") { + var n = obj.length, + str = serialize.call(obj) + if (/(Array|List|Collection|Map|Arguments)\]$/.test(str)) { + return true + } else if (str === "[object Object]" && n === (n >>> 0)) { + return true //由于ecma262v5能修改对象属性的enumerable,因此ä¸èƒ½ç”¨propertyIsEnumerableæ¥åˆ¤å®šäº† + } + } + return false + } + + +// https://github.com/rsms/js-lru + var Cache = new function () {// jshint ignore:line + function LRU(maxLength) { + this.size = 0 + this.limit = maxLength + this.head = this.tail = void 0 + this._keymap = {} + } + + var p = LRU.prototype + + p.put = function (key, value) { + var entry = { + key: key, + value: value + } + this._keymap[key] = entry + if (this.tail) { + this.tail.newer = entry + entry.older = this.tail + } else { + this.head = entry + } + this.tail = entry + if (this.size === this.limit) { + this.shift() + } else { + this.size++ + } + return value + } + + p.shift = function () { + var entry = this.head + if (entry) { + this.head = this.head.newer + this.head.older = + entry.newer = + entry.older = + this._keymap[entry.key] = void 0 + } + } + p.get = function (key) { + var entry = this._keymap[key] + if (entry === void 0) + return + if (entry === this.tail) { + return entry.value + } + // HEAD--------------TAIL + // <.older .newer> + // <--- add direction -- + // A B C E + if (entry.newer) { + if (entry === this.head) { + this.head = entry.newer + } + entry.newer.older = entry.older // C <-- E. + } + if (entry.older) { + entry.older.newer = entry.newer // C. --> E + } + entry.newer = void 0 // D --x + entry.older = this.tail // D. --> E + if (this.tail) { + this.tail.newer = entry // E. <-- D + } + this.tail = entry + return entry.value + } + return LRU + }// jshint ignore:line + + /********************************************************************* + * DOM åº•å±‚è¡¥ä¸ * + **********************************************************************/ +//safari5+是把contains方法放在Element.prototype上而ä¸æ˜¯Node.prototype + if (!DOC.contains) { + Node.prototype.contains = function (arg) { + return !!(this.compareDocumentPosition(arg) & 16) + } + } + avalon.contains = function (root, el) { + try { + while ((el = el.parentNode)) + if (el === root) + return true + return false + } catch (e) { + return false + } + } + + if (window.SVGElement) { + var svgns = "http://www.w3.org/2000/svg" + var svg = DOC.createElementNS(svgns, "svg") + svg.innerHTML = '' + if (!rsvg.test(svg.firstChild)) {// #409 + /* jshint ignore:start */ + function enumerateNode(node, targetNode) { + if (node && node.childNodes) { + var nodes = node.childNodes + for (var i = 0, el; el = nodes[i++];) { + if (el.tagName) { + var svg = DOC.createElementNS(svgns, + el.tagName.toLowerCase()) + // copy attrs + ap.forEach.call(el.attributes, function (attr) { + svg.setAttribute(attr.name, attr.value) + }) + // 递归处ç†å­èŠ‚点 + enumerateNode(el, svg) + targetNode.appendChild(svg) + } + } + } + } + + /* jshint ignore:end */ + Object.defineProperties(SVGElement.prototype, { + "outerHTML": {//IE9-11,firefoxä¸æ”¯æŒSVG元素的innerHTML,outerHTML属性 + enumerable: true, + configurable: true, + get: function () { + return new XMLSerializer().serializeToString(this) + }, + set: function (html) { + var tagName = this.tagName.toLowerCase(), + par = this.parentNode, + frag = avalon.parseHTML(html) + // æ“作的svg,直接æ’å…¥ + if (tagName === "svg") { + par.insertBefore(frag, this) + // svg节点的å­èŠ‚点类似 + } else { + var newFrag = DOC.createDocumentFragment() + enumerateNode(frag, newFrag) + par.insertBefore(newFrag, this) + } + par.removeChild(this) + } + }, + "innerHTML": { + enumerable: true, + configurable: true, + get: function () { + var s = this.outerHTML + var ropen = new RegExp("<" + this.nodeName + '\\b(?:(["\'])[^"]*?(\\1)|[^>])*>', "i") + var rclose = new RegExp("<\/" + this.nodeName + ">$", "i") + return s.replace(ropen, "").replace(rclose, "") + }, + set: function (html) { + if (avalon.clearHTML) { + avalon.clearHTML(this) + var frag = avalon.parseHTML(html) + enumerateNode(frag, this) + } + } + } + }) + } + } +//========================= event binding ==================== + var eventHooks = avalon.eventHooks +//针对firefox, chrome修正mouseenter, mouseleave(chrome30+) + if (!("onmouseenter" in root)) { + avalon.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" + }, function (origType, fixType) { + eventHooks[origType] = { + type: fixType, + deel: function (elem, _, fn) { + return function (e) { + var t = e.relatedTarget + if (!t || (t !== elem && !(elem.compareDocumentPosition(t) & 16))) { + delete e.type + e.type = origType + return fn.call(elem, e) + } + } + } + } + }) + } +//针对IE9+, w3c修正animationend + avalon.each({ + AnimationEvent: "animationend", + WebKitAnimationEvent: "webkitAnimationEnd" + }, function (construct, fixType) { + if (window[construct] && !eventHooks.animationend) { + eventHooks.animationend = { + type: fixType + } + } + }) + + if (DOC.onmousewheel === void 0) { + /* IE6-11 chrome mousewheel wheelDetla 下 -120 上 120 + firefox DOMMouseScroll detail 下3 上-3 + firefox wheel detlaY 下3 上-3 + IE9-11 wheel deltaY 下40 上-40 + chrome wheel deltaY 下100 上-100 */ + eventHooks.mousewheel = { + type: "wheel", + deel: function (elem, _, fn) { + return function (e) { + e.wheelDeltaY = e.wheelDelta = e.deltaY > 0 ? -120 : 120 + e.wheelDeltaX = 0 + Object.defineProperty(e, "type", { + value: "mousewheel" + }) + fn.call(elem, e) + } + } + } + } + + /********************************************************************* + * é…置系统 * + **********************************************************************/ + + function kernel(settings) { + for (var p in settings) { + if (!ohasOwn.call(settings, p)) + continue + var val = settings[p] + if (typeof kernel.plugins[p] === "function") { + kernel.plugins[p](val) + } else if (typeof kernel[p] === "object") { + avalon.mix(kernel[p], val) + } else { + kernel[p] = val + } + } + return this + } + + var openTag, closeTag, rexpr, rexprg, rbind, rregexp = /[-.*+?^${}()|[\]\/\\]/g + + function escapeRegExp(target) { + //http://stevenlevithan.com/regex/xregexp/ + //将字符串安全格å¼åŒ–为正则表达å¼çš„æºç  + return (target + "").replace(rregexp, "\\$&") + } + + var plugins = { + loader: function (builtin) { + var flag = innerRequire && builtin + window.require = flag ? innerRequire : otherRequire + window.define = flag ? innerRequire.define : otherDefine + }, + interpolate: function (array) { + openTag = array[0] + closeTag = array[1] + if (openTag === closeTag) { + throw new SyntaxError("openTag!==closeTag") + } else if (array + "" === "") { + kernel.commentInterpolate = true + } else { + var test = openTag + "test" + closeTag + cinerator.innerHTML = test + if (cinerator.innerHTML !== test && cinerator.innerHTML.indexOf("<") > -1) { + throw new SyntaxError("此定界符ä¸åˆæ³•") + } + cinerator.innerHTML = "" + } + var o = escapeRegExp(openTag), + c = escapeRegExp(closeTag) + rexpr = new RegExp(o + "(.*?)" + c) + rexprg = new RegExp(o + "(.*?)" + c, "g") + rbind = new RegExp(o + ".*?" + c + "|\\sms-") + } + } + + kernel.debug = true + kernel.plugins = plugins + kernel.plugins['interpolate'](["{{", "}}"]) + kernel.paths = {} + kernel.shim = {} + kernel.maxRepeatSize = 100 + avalon.config = kernel + var ravalon = /(\w+)\[(avalonctrl)="(\S+)"\]/ + var findNodes = function (str) { + return DOC.querySelectorAll(str) + } + /********************************************************************* + * 事件总线 * + **********************************************************************/ + var EventBus = { + $watch: function (type, callback) { + if (typeof callback === "function") { + var callbacks = this.$events[type] + if (callbacks) { + callbacks.push(callback) + } else { + this.$events[type] = [callback] + } + } else { //é‡æ–°å¼€å§‹ç›‘å¬æ­¤VM的第一é‡ç®€å•å±žæ€§çš„å˜åŠ¨ + this.$events = this.$watch.backup + } + return this + }, + $unwatch: function (type, callback) { + var n = arguments.length + if (n === 0) { //让此VM的所有$watch回调无效化 + this.$watch.backup = this.$events + this.$events = {} + } else if (n === 1) { + this.$events[type] = [] + } else { + var callbacks = this.$events[type] || [] + var i = callbacks.length + while (~--i < 0) { + if (callbacks[i] === callback) { + return callbacks.splice(i, 1) + } + } + } + return this + }, + $fire: function (type) { + var special, i, v, callback + if (/^(\w+)!(\S+)$/.test(type)) { + special = RegExp.$1 + type = RegExp.$2 + } + var events = this.$events + if (!events) + return + var args = aslice.call(arguments, 1) + var detail = [type].concat(args) + if (special === "all") { + for (i in avalon.vmodels) { + v = avalon.vmodels[i] + if (v !== this) { + v.$fire.apply(v, detail) + } + } + } else if (special === "up" || special === "down") { + var elements = events.expr ? findNodes(events.expr) : [] + if (elements.length === 0) + return + for (i in avalon.vmodels) { + v = avalon.vmodels[i] + if (v !== this) { + if (v.$events.expr) { + var eventNodes = findNodes(v.$events.expr) + if (eventNodes.length === 0) { + continue + } + //循环两个vmodel中的节点,查找匹é…(å‘上匹é…或者å‘下匹é…)的节点并设置标识 + /* jshint ignore:start */ + Array.prototype.forEach.call(eventNodes, function (node) { + Array.prototype.forEach.call(elements, function (element) { + var ok = special === "down" ? element.contains(node) : //å‘下æ•èŽ· + node.contains(element) //å‘上冒泡 + if (ok) { + node._avalon = v //符åˆæ¡ä»¶çš„加一个标识 + } + }); + }) + /* jshint ignore:end */ + } + } + } + var nodes = DOC.getElementsByTagName("*") //å®žçŽ°èŠ‚ç‚¹æŽ’åº + var alls = [] + Array.prototype.forEach.call(nodes, function (el) { + if (el._avalon) { + alls.push(el._avalon) + el._avalon = "" + el.removeAttribute("_avalon") + } + }) + if (special === "up") { + alls.reverse() + } + for (i = 0; callback = alls[i++];) { + if (callback.$fire.apply(callback, detail) === false) { + break + } + } + } else { + var callbacks = events[type] || [] + var all = events.$all || [] + for (i = 0; callback = callbacks[i++];) { + if (isFunction(callback)) + callback.apply(this, args) + } + for (i = 0; callback = all[i++];) { + if (isFunction(callback)) + callback.apply(this, arguments) + } + } + } + } + + /********************************************************************* + * modelFactory * + **********************************************************************/ +//avalon最核心的方法的两个方法之一(å¦ä¸€ä¸ªæ˜¯avalon.scan),返回一个ViewModel(VM) + var VMODELS = avalon.vmodels = createMap() //所有vmodel都储存在这里 + avalon.define = function (id, factory) { + var $id = id.$id || id + if (!$id) { + log("warning: vm必须指定$id") + } + if (VMODELS[$id]) { + log("warning: " + $id + " å·²ç»å­˜åœ¨äºŽavalon.vmodels中") + } + if (typeof id === "object") { + var model = modelFactory(id) + } else { + var scope = { + $watch: noop + } + factory(scope) //得到所有定义 + model = modelFactory(scope) //å·å¤©æ¢æ—¥ï¼Œå°†scopeæ¢ä¸ºmodel + stopRepeatAssign = true + factory(model) + stopRepeatAssign = false + } + model.$id = $id + return VMODELS[$id] = model + } + +//一些ä¸éœ€è¦è¢«ç›‘å¬çš„属性 + var $$skipArray = String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray").match(rword) + + function isObservable(name, value, $skipArray) { + if (isFunction(value) || value && value.nodeType) { + return false + } + if ($skipArray.indexOf(name) !== -1) { + return false + } + if ($$skipArray.indexOf(name) !== -1) { + return false + } + var $special = $skipArray.$special + if (name && name.charAt(0) === "$" && !$special[name]) { + return false + } + return true + } + +//ms-with,ms-each, ms-repeat绑定生æˆçš„代ç†å¯¹è±¡å‚¨å­˜æ±  + var midway = createMap() + + function getNewValue(accessor, name, value, $vmodel) { + switch (accessor.type) { + case 0://计算属性 + var getter = accessor.get + var setter = accessor.set + if (isFunction(setter)) { + var $events = $vmodel.$events + var lock = $events[name] + $events[name] = [] //清空回调,防止内部冒泡而触å‘多次$fire + setter.call($vmodel, value) + $events[name] = lock + } + return getter.call($vmodel) //åŒæ­¥$model + case 1://监控属性 + return value + case 2://对象属性(包括数组与哈希) + if (value !== $vmodel.$model[name]) { + var svmodel = accessor.svmodel = objectFactory($vmodel, name, value, accessor.valueType) + value = svmodel.$model //åŒæ­¥$model + var fn = midway[svmodel.$id] + fn && fn() //åŒæ­¥è§†å›¾ + } + return value + } + } + + function modelFactory(source, $special, $model) { + if (Array.isArray(source)) { + var arr = source.concat() + source.length = 0 + var collection = Collection(source)// jshint ignore:line + collection.pushArray(arr) + return collection + } + //0 null undefined || Node || VModel + if (!source || source.nodeType > 0 || (source.$id && source.$events)) { + return source + } + if (!Array.isArray(source.$skipArray)) { + source.$skipArray = [] + } + source.$skipArray.$special = $special || createMap() //强制è¦ç›‘å¬çš„属性 + var $vmodel = {} //è¦è¿”回的对象, 它在IE6-8下å¯èƒ½è¢«å·é¾™è½¬å‡¤ + $model = $model || {} //vmodels.$model属性 + var $events = createMap() //vmodel.$events属性 + var watchedProperties = createMap() //监控属性 + var initCallbacks = [] //åˆå§‹åŒ–æ‰æ‰§è¡Œçš„函数 + for (var i in source) { + (function (name, val) { + $model[name] = val + if (!isObservable(name, val, source.$skipArray)) { + return //过滤所有éžç›‘控属性 + } + //总共产生三ç§accessor + $events[name] = [] + var valueType = avalon.type(val) + var accessor = function (newValue) { + var name = accessor._name + var $vmodel = this + var $model = $vmodel.$model + var oldValue = $model[name] + var $events = $vmodel.$events + + if (arguments.length) { + if (stopRepeatAssign) { + return + } + //计算属性与对象属性需è¦é‡æ–°è®¡ç®—newValue + if (accessor.type !== 1) { + newValue = getNewValue(accessor, name, newValue, $vmodel) + if (!accessor.type) + return + } + if (!isEqual(oldValue, newValue)) { + $model[name] = newValue + notifySubscribers($events[name]) //åŒæ­¥è§†å›¾ + safeFire($vmodel, name, newValue, oldValue) //触å‘$watch回调 + } + } else { + if (accessor.type === 0) { //type 0 计算属性 1 监控属性 2 对象属性 + //计算属性ä¸éœ€è¦æ”¶é›†è§†å›¾åˆ·æ–°å‡½æ•°,都是由其他监控属性代劳 + newValue = accessor.get.call($vmodel) + if (oldValue !== newValue) { + $model[name] = newValue + //这里ä¸ç”¨åŒæ­¥è§†å›¾ + safeFire($vmodel, name, newValue, oldValue) //触å‘$watch回调 + } + return newValue + } else { + collectSubscribers($events[name]) //收集视图函数 + return accessor.svmodel || oldValue + } + } + } + //总共产生三ç§accessor + if (valueType === "object" && isFunction(val.get) && Object.keys(val).length <= 2) { + //第1ç§ä¸ºè®¡ç®—属性, å› å˜é‡ï¼Œé€šè¿‡å…¶ä»–监控属性触å‘å…¶æ”¹å˜ + accessor.set = val.set + accessor.get = val.get + accessor.type = 0 + initCallbacks.push(function () { + var data = { + evaluator: function () { + data.type = Math.random(), + data.element = null + $model[name] = accessor.get.call($vmodel) + }, + element: head, + type: Math.random(), + handler: noop, + args: [] + } + Registry[expose] = data + accessor.call($vmodel) + delete Registry[expose] + }) + } else if (rcomplexType.test(valueType)) { + //第2ç§ä¸ºå¯¹è±¡å±žæ€§ï¼Œäº§ç”Ÿå­VM与监控数组 + accessor.type = 2 + accessor.valueType = valueType + initCallbacks.push(function () { + var svmodel = modelFactory(val, 0, $model[name]) + accessor.svmodel = svmodel + svmodel.$events[subscribers] = $events[name] + }) + } else { + accessor.type = 1 + //第3ç§ä¸ºç›‘控属性,对应简å•çš„æ•°æ®ç±»åž‹ï¼Œè‡ªå˜é‡ + } + accessor._name = name + watchedProperties[name] = accessor + })(i, source[i])// jshint ignore:line + } + + $$skipArray.forEach(function (name) { + delete source[name] + delete $model[name] //这些特殊属性ä¸åº”该在$model中出现 + }) + + $vmodel = Object.defineProperties($vmodel, descriptorFactory(watchedProperties), source) //生æˆä¸€ä¸ªç©ºçš„ViewModel + for (var name in source) { + if (!watchedProperties[name]) { + $vmodel[name] = source[name] + } + } + //添加$id, $model, $events, $watch, $unwatch, $fire + $vmodel.$id = generateID() + $vmodel.$model = $model + $vmodel.$events = $events + for (i in EventBus) { + $vmodel[i] = EventBus[i] + } + + Object.defineProperty($vmodel, "hasOwnProperty", { + value: function (name) { + return name in this.$model + }, + writable: false, + enumerable: false, + configurable: true + }) + + initCallbacks.forEach(function (cb) { //收集ä¾èµ– + cb() + }) + return $vmodel + } + +//比较两个值是å¦ç›¸ç­‰ + var isEqual = Object.is || function (v1, v2) { + if (v1 === 0 && v2 === 0) { + return 1 / v1 === 1 / v2 + } else if (v1 !== v1) { + return v2 !== v2 + } else { + return v1 === v2 + } + } + + function safeFire(a, b, c, d) { + if (a.$events) { + EventBus.$fire.call(a, b, c, d) + } + } + + var descriptorFactory = function (obj) { + var descriptors = createMap() + for (var i in obj) { + descriptors[i] = { + get: obj[i], + set: obj[i], + enumerable: true, + configurable: true + } + } + return descriptors + } + +//应用于第2ç§accessor + function objectFactory(parent, name, value, valueType) { + //a为原æ¥çš„VM, b为新数组或新对象 + var son = parent[name] + if (valueType === "array") { + if (!Array.isArray(value) || son === value) { + return son //fix https://github.com/RubyLouvre/avalon/issues/261 + } + son._.$unwatch() + son.clear() + son._.$watch() + son.pushArray(value.concat()) + return son + } else { + var iterators = parent.$events[name] + var ret = modelFactory(value) + ret.$events[subscribers] = iterators + midway[ret.$id] = function (data) { + while (data = iterators.shift()) { + (function (el) { + avalon.nextTick(function () { + var type = el.type + if (type && bindingHandlers[type]) { //#753 + el.rollback && el.rollback() //还原 ms-with ms-on + bindingHandlers[type](el, el.vmodels) + } + }) + })(data)// jshint ignore:line + } + delete midway[ret.$id] + } + return ret + } + } + + /********************************************************************* + * 监控数组(与ms-each, ms-repeaté…åˆä½¿ç”¨ï¼‰ * + **********************************************************************/ + + function Collection(model) { + var array = [] + array.$id = generateID() + array.$model = model //æ•°æ®æ¨¡åž‹ + array.$events = {} + array.$events[subscribers] = [] + array._ = modelFactory({ + length: model.length + }) + array._.$watch("length", function (a, b) { + array.$fire("length", a, b) + }) + for (var i in EventBus) { + array[i] = EventBus[i] + } + array.$map = { + el: 1 + } + array.$proxy = [] + avalon.mix(array, CollectionPrototype) + return array + } + + function mutateArray(method, pos, n, index, method2, pos2, n2) { + var oldLen = this.length, loop = 2 + while (--loop) { + switch (method) { + case "add": + /* jshint ignore:start */ + var m = pos + n + var array = this.$model.slice(pos, m).map(function (el) { + if (rcomplexType.test(avalon.type(el))) {//转æ¢ä¸ºVM + return el.$id ? el : modelFactory(el, 0, el) + } else { + return el + } + }) + /* jshint ignore:end */ + for (var i = pos; i < m; i++) {//生æˆä»£ç†VM + var proxy = eachProxyAgent(i, this) + this.$proxy.splice(i, 0, proxy) + } + _splice.apply(this, [pos, 0].concat(array)) + this._fire("add", pos, n) + break + case "del": + var ret = this._splice(pos, n) + var removed = this.$proxy.splice(pos, n) //回收代ç†VM + recycleProxies(removed, "each") + this._fire("del", pos, n) + break + } + if (method2) { + method = method2 + pos = pos2 + n = n2 + loop = 2 + method2 = 0 + } + } + resetIndex(this.$proxy, index) + if (this.length !== oldLen) { + this._.length = this.length + } + return ret + } + + var _splice = ap.splice + var CollectionPrototype = { + _splice: _splice, + _fire: function (method, a, b) { + notifySubscribers(this.$events[subscribers], method, a, b) + }, + size: function () { //å–得数组长度,这个函数å¯ä»¥åŒæ­¥è§†å›¾ï¼Œlengthä¸èƒ½ + return this._.length + }, + pushArray: function (array) { + var m = array.length, n = this.length + if (m) { + ap.push.apply(this.$model, array) + mutateArray.call(this, "add", n, m, Math.max(0, n - 1)) + } + return m + n + }, + push: function () { + //http://jsperf.com/closure-with-arguments + var array = [] + var i, n = arguments.length + for (i = 0; i < n; i++) { + array[i] = arguments[i] + } + return this.pushArray(array) + }, + unshift: function () { + var m = arguments.length, n = this.length + if (m) { + ap.unshift.apply(this.$model, arguments) + mutateArray.call(this, "add", 0, m, 0) + } + return m + n //IE67çš„unshiftä¸ä¼šè¿”回长度 + }, + shift: function () { + if (this.length) { + var el = this.$model.shift() + mutateArray.call(this, "del", 0, 1, 0) + return el //返回被移除的元素 + } + }, + pop: function () { + var n = this.length + if (n) { + var el = this.$model.pop() + mutateArray.call(this, "del", n - 1, 1, Math.max(0, n - 2)) + return el //返回被移除的元素 + } + }, + splice: function (start) { + var m = arguments.length, args = [], change + var removed = _splice.apply(this.$model, arguments) + if (removed.length) { //如果用户删掉了元素 + args.push("del", start, removed.length, 0) + change = true + } + if (m > 2) { //如果用户添加了元素 + if (change) { + args.splice(3, 1, 0, "add", start, m - 2) + } else { + args.push("add", start, m - 2, 0) + } + change = true + } + if (change) { //返回被移除的元素 + return mutateArray.apply(this, args) + } else { + return [] + } + }, + contains: function (el) { //判定是å¦åŒ…å« + return this.indexOf(el) !== -1 + }, + remove: function (el) { //移除第一个等于给定值的元素 + return this.removeAt(this.indexOf(el)) + }, + removeAt: function (index) { //移除指定索引上的元素 + if (index >= 0) { + this.$model.splice(index, 1) + return mutateArray.call(this, "del", index, 1, 0) + } + return [] + }, + clear: function () { + recycleProxies(this.$proxy, "each") + this.$model.length = this.$proxy.length = this.length = this._.length = 0 //清空数组 + this._fire("clear", 0) + return this + }, + removeAll: function (all) { //移除N个元素 + if (Array.isArray(all)) { + all.forEach(function (el) { + this.remove(el) + }, this) + } else if (typeof all === "function") { + for (var i = this.length - 1; i >= 0; i--) { + var el = this[i] + if (all(el, i)) { + this.removeAt(i) + } + } + } else { + this.clear() + } + }, + ensure: function (el) { + if (!this.contains(el)) { //åªæœ‰ä¸å­˜åœ¨æ‰push + this.push(el) + } + return this + }, + set: function (index, val) { + if (index >= 0) { + var valueType = avalon.type(val) + if (val && val.$model) { + val = val.$model + } + var target = this[index] + if (valueType === "object") { + for (var i in val) { + if (target.hasOwnProperty(i)) { + target[i] = val[i] + } + } + } else if (valueType === "array") { + target.clear().push.apply(target, val) + } else if (target !== val) { + this[index] = val + this.$model[index] = val + var proxy = this.$proxy[index] + if (proxy) { + notifySubscribers(proxy.$events.el) + } + // this._fire("set", index, val) + } + } + return this + } + } +//相当于原æ¥bindingExecutors.repeat çš„index分支 + function resetIndex(array, pos) { + var last = array.length - 1 + for (var el; el = array[pos]; pos++) { + el.$index = pos + el.$first = pos === 0 + el.$last = pos === last + } + } + + function sortByIndex(array, indexes) { + var map = {}; + for (var i = 0, n = indexes.length; i < n; i++) { + map[i] = array[i] // preserve + var j = indexes[i] + if (j in map) { + array[i] = map[j] + delete map[j] + } else { + array[i] = array[j] + } + } + } + + "sort,reverse".replace(rword, function (method) { + CollectionPrototype[method] = function () { + var newArray = this.$model//这是è¦æŽ’åºçš„新数组 + var oldArray = newArray.concat() //ä¿æŒåŽŸæ¥çŠ¶æ€çš„旧数组 + var mask = Math.random() + var indexes = [] + var hasSort + ap[method].apply(newArray, arguments) //æŽ’åº + for (var i = 0, n = oldArray.length; i < n; i++) { + var neo = newArray[i] + var old = oldArray[i] + if (isEqual(neo, old)) { + indexes.push(i) + } else { + var index = oldArray.indexOf(neo) + indexes.push(index)//得到新数组的æ¯ä¸ªå…ƒç´ åœ¨æ—§æ•°ç»„对应的ä½ç½® + oldArray[index] = mask //å±è”½å·²ç»æ‰¾è¿‡çš„元素 + hasSort = true + } + } + if (hasSort) { + sortByIndex(this, indexes) + sortByIndex(this.$proxy, indexes) + this._fire("move", indexes) + resetIndex(this.$proxy, 0) + } + return this + } + }) + + /********************************************************************* + * ä¾èµ–调度系统 * + **********************************************************************/ + var ronduplex = /^(duplex|on)$/ + + avalon.injectBinding = function (data) { + Registry[expose] = data //暴光此函数,方便collectSubscribers收集 + avalon.openComputedCollect = true + var fn = data.evaluator + if (fn) { //如果是求值函数 + try { + var c = ronduplex.test(data.type) ? data : fn.apply(0, data.args) + if (!data.noRefresh) + data.handler(c, data.element, data) + } catch (e) { + //log("warning:exception throwed in [avalon.injectBinding] " + e) + delete data.evaluator + var node = data.element + if (node.nodeType === 3) { + var parent = node.parentNode + if (kernel.commentInterpolate) { + parent.replaceChild(DOC.createComment(data.value), node) + } else { + node.data = openTag + data.value + closeTag + } + } + } + } + avalon.openComputedCollect = false + delete Registry[expose] + } + + function collectSubscribers(list) { //收集ä¾èµ–于这个访问器的订阅者 + var data = Registry[expose] + if (list && data && avalon.Array.ensure(list, data) && data.element) { //åªæœ‰æ•°ç»„ä¸å­˜åœ¨æ­¤å…ƒç´ æ‰push进去 + addSubscribers(data, list) + } + } + + + function addSubscribers(data, list) { + data.$uuid = data.$uuid || generateID() + list.$uuid = list.$uuid || generateID() + var obj = { + data: data, + list: list, + $$uuid: data.$uuid + list.$uuid + } + if (!$$subscribers[obj.$$uuid]) { + $$subscribers[obj.$$uuid] = 1 + $$subscribers.push(obj) + } + } + + function disposeData(data) { + data.element = null + data.rollback && data.rollback() + for (var key in data) { + data[key] = null + } + } + + function isRemove(el) { + try {//IE下,如果文本节点脱离DOM树,访问parentNode会报错 + if (!el.parentNode) { + return true + } + } catch (e) { + return true + } + return el.msRetain ? 0 : (el.nodeType === 1 ? typeof el.sourceIndex === "number" ? + el.sourceIndex === 0 : !root.contains(el) : !avalon.contains(root, el)) + } + + var $$subscribers = avalon.$$subscribers = [] + var beginTime = new Date() + var oldInfo = {} + + function removeSubscribers() { + var i = $$subscribers.length + var n = i + var k = 0 + var obj + var types = [] + var newInfo = {} + var needTest = {} + while (obj = $$subscribers[--i]) { + var data = obj.data + var type = data.type + if (newInfo[type]) { + newInfo[type]++ + } else { + newInfo[type] = 1 + types.push(type) + } + } + var diff = false + types.forEach(function (type) { + if (oldInfo[type] !== newInfo[type]) { + needTest[type] = 1 + diff = true + } + }) + i = n + //avalon.log("需è¦æ£€æµ‹çš„个数 " + i) + if (diff) { + //avalon.log("有需è¦ç§»é™¤çš„元素") + while (obj = $$subscribers[--i]) { + data = obj.data + if (data.element === void 0) + continue + if (needTest[data.type] && isRemove(data.element)) { //如果它没有在DOMæ ‘ + k++ + $$subscribers.splice(i, 1) + delete $$subscribers[obj.$$uuid] + avalon.Array.remove(obj.list, data) + //log("debug: remove " + data.type) + disposeData(data) + obj.data = obj.list = null + } + } + } + oldInfo = newInfo + // avalon.log("å·²ç»ç§»é™¤çš„个数 " + k) + beginTime = new Date() + } + + function notifySubscribers(list) { //通知ä¾èµ–于这个访问器的订阅者更新自身 + if (list && list.length) { + if (new Date() - beginTime > 444 && typeof list[0] === "object") { + removeSubscribers() + } + var args = aslice.call(arguments, 1) + for (var i = list.length, fn; fn = list[--i];) { + var el = fn.element + if (el && el.parentNode) { + if (fn.$repeat) { + fn.handler.apply(fn, args) //处ç†ç›‘控数组的方法 + } else if (fn.type !== "on") { //事件绑定åªèƒ½ç”±ç”¨æˆ·è§¦å‘,ä¸èƒ½ç”±ç¨‹åºè§¦å‘ + var fun = fn.evaluator || noop + fn.handler(fun.apply(0, fn.args || []), el, fn) + } + } + } + } + } + + /************************************************************************ + * HTML处ç†(parseHTML, innerHTML, clearHTML) * + **************************************************************************/ +//parseHTML的辅助å˜é‡ + var tagHooks = new function () {// jshint ignore:line + avalon.mix(this, { + option: DOC.createElement("select"), + thead: DOC.createElement("table"), + td: DOC.createElement("tr"), + area: DOC.createElement("map"), + tr: DOC.createElement("tbody"), + col: DOC.createElement("colgroup"), + legend: DOC.createElement("fieldset"), + _default: DOC.createElement("div"), + "g": DOC.createElementNS("http://www.w3.org/2000/svg", "svg") + }) + this.optgroup = this.option + this.tbody = this.tfoot = this.colgroup = this.caption = this.thead + this.th = this.td + }// jshint ignore:line + + String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(rword, function (tag) { + tagHooks[tag] = tagHooks.g //处ç†SVG + }) + var rtagName = /<([\w:]+)/ + var rxhtml = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig + var scriptTypes = oneObject(["", "text/javascript", "text/ecmascript", "application/ecmascript", "application/javascript"]) + var script = DOC.createElement("script") + var rhtml = /<|&#?\w+;/ + avalon.parseHTML = function (html) { + var fragment = hyperspace.cloneNode(false) + if (typeof html !== "string") { + return fragment + } + if (!rhtml.test(html)) { + fragment.appendChild(DOC.createTextNode(html)) + return fragment + } + html = html.replace(rxhtml, "<$1>").trim() + var tag = (rtagName.exec(html) || ["", ""])[1].toLowerCase(), + //å–得其标签å + wrapper = tagHooks[tag] || tagHooks._default, + firstChild + wrapper.innerHTML = html + var els = wrapper.getElementsByTagName("script") + if (els.length) { //使用innerHTML生æˆçš„script节点ä¸ä¼šå‘出请求与执行text属性 + for (var i = 0, el; el = els[i++];) { + if (scriptTypes[el.type]) { + var neo = script.cloneNode(false) //FFä¸èƒ½çœç•¥å‚æ•° + ap.forEach.call(el.attributes, function (attr) { + neo.setAttribute(attr.name, attr.value) + })// jshint ignore:line + neo.text = el.text + el.parentNode.replaceChild(neo, el) + } + } + } + + while (firstChild = wrapper.firstChild) { // å°†wrapperä¸Šçš„èŠ‚ç‚¹è½¬ç§»åˆ°æ–‡æ¡£ç¢Žç‰‡ä¸Šï¼ + fragment.appendChild(firstChild) + } + return fragment + } + + avalon.innerHTML = function (node, html) { + var a = this.parseHTML(html) + this.clearHTML(node).appendChild(a) + } + + avalon.clearHTML = function (node) { + node.textContent = "" + while (node.firstChild) { + node.removeChild(node.firstChild) + } + return node + } + + /********************************************************************* + * 扫æ系统 * + **********************************************************************/ + + avalon.scan = function (elem, vmodel) { + elem = elem || root + var vmodels = vmodel ? [].concat(vmodel) : [] + scanTag(elem, vmodels) + } + +//http://www.w3.org/TR/html5/syntax.html#void-elements + var stopScan = oneObject("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()) + + function checkScan(elem, callback, innerHTML) { + var id = setTimeout(function () { + var currHTML = elem.innerHTML + clearTimeout(id) + if (currHTML === innerHTML) { + callback() + } else { + checkScan(elem, callback, currHTML) + } + }) + } + + + function createSignalTower(elem, vmodel) { + var id = elem.getAttribute("avalonctrl") || vmodel.$id + elem.setAttribute("avalonctrl", id) + vmodel.$events.expr = elem.tagName + '[avalonctrl="' + id + '"]' + } + + var getBindingCallback = function (elem, name, vmodels) { + var callback = elem.getAttribute(name) + if (callback) { + for (var i = 0, vm; vm = vmodels[i++];) { + if (vm.hasOwnProperty(callback) && typeof vm[callback] === "function") { + return vm[callback] + } + } + } + } + + function executeBindings(bindings, vmodels) { + for (var i = 0, data; data = bindings[i++];) { + data.vmodels = vmodels + bindingHandlers[data.type](data, vmodels) + if (data.evaluator && data.element && data.element.nodeType === 1) { //移除数æ®ç»‘å®šï¼Œé˜²æ­¢è¢«äºŒæ¬¡è§£æž + //chrome使用removeAttributeNode移除ä¸å­˜åœ¨çš„特性节点时会报错 https://github.com/RubyLouvre/avalon/issues/99 + data.element.removeAttribute(data.name) + } + } + bindings.length = 0 + } + +//https://github.com/RubyLouvre/avalon/issues/636 + var mergeTextNodes = IEVersion && window.MutationObserver ? function (elem) { + var node = elem.firstChild, text + while (node) { + var aaa = node.nextSibling + if (node.nodeType === 3) { + if (text) { + text.nodeValue += node.nodeValue + elem.removeChild(node) + } else { + text = node + } + } else { + text = null + } + node = aaa + } + } : 0 + + var rmsAttr = /ms-(\w+)-?(.*)/ + var priorityMap = { + "if": 10, + "repeat": 90, + "data": 100, + "widget": 110, + "each": 1400, + "with": 1500, + "duplex": 2000, + "on": 3000 + } + + var events = oneObject("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit") + var obsoleteAttrs = oneObject("value,title,alt,checked,selected,disabled,readonly,enabled") + + function bindingSorter(a, b) { + return a.priority - b.priority + } + + function scanAttr(elem, vmodels) { + //防止setAttribute, removeAttributeæ—¶ attributes自动被åŒæ­¥,导致for循环出错 + var attributes = elem.hasAttributes() ? avalon.slice(elem.attributes) : [] + var bindings = [], + msData = createMap(), + match + for (var i = 0, attr; attr = attributes[i++];) { + if (attr.specified) { + if (match = attr.name.match(rmsAttr)) { + //如果是以指定å‰ç¼€å‘½åçš„ + var type = match[1] + var param = match[2] || "" + var value = attr.value + var name = attr.name + msData[name] = value + if (events[type]) { + param = type + type = "on" + } else if (obsoleteAttrs[type]) { + log("warning!请改用ms-attr-" + type + "代替ms-" + type + "ï¼") + if (type === "enabled") {//åƒæŽ‰ms-enabled绑定,用ms-disabled代替 + log("warning!ms-enabled或ms-attr-enabledå·²ç»è¢«åºŸå¼ƒ") + type = "disabled" + value = "!(" + value + ")" + } + param = type + type = "attr" + elem.removeAttribute(name) + name = "ms-attr-" + param + elem.setAttribute(name, value) + match = [name] + msData[name] = value + } + if (typeof bindingHandlers[type] === "function") { + var binding = { + type: type, + param: param, + element: elem, + name: match[0], + value: value, + priority: type in priorityMap ? priorityMap[type] : type.charCodeAt(0) * 10 + (Number(param) || 0) + } + if (type === "html" || type === "text") { + var token = getToken(value) + avalon.mix(binding, token) + binding.filters = binding.filters.replace(rhasHtml, function () { + binding.type = "html" + binding.group = 1 + return "" + })// jshint ignore:line + } + if (name === "ms-if-loop") { + binding.priority += 100 + } + if (vmodels.length) { + bindings.push(binding) + if (type === "widget") { + elem.msData = elem.msData || msData + } + } + } + } + } + } + var control = elem.type + if (control && msData["ms-duplex"]) { + if (msData["ms-attr-checked"] && /radio|checkbox/.test(control)) { + log("warning!" + control + "控件ä¸èƒ½åŒæ—¶å®šä¹‰ms-attr-checked与ms-duplex") + } + if (msData["ms-attr-value"] && /text|password/.test(control)) { + log("warning!" + control + "控件ä¸èƒ½åŒæ—¶å®šä¹‰ms-attr-value与ms-duplex") + } + } + bindings.sort(bindingSorter) + var scanNode = true + for (i = 0; binding = bindings[i]; i++) { + type = binding.type + if (rnoscanAttrBinding.test(type)) { + return executeBindings(bindings.slice(0, i + 1), vmodels) + } else if (scanNode) { + scanNode = !rnoscanNodeBinding.test(type) + } + } + executeBindings(bindings, vmodels) + if (scanNode && !stopScan[elem.tagName] && rbind.test(elem.innerHTML + elem.textContent)) { + mergeTextNodes && mergeTextNodes(elem) + scanNodeList(elem, vmodels) //扫æå­å­™å…ƒç´  + } + } + + var rnoscanAttrBinding = /^if|widget|repeat$/ + var rnoscanNodeBinding = /^each|with|html|include$/ + + function scanNodeList(parent, vmodels) { + var node = parent.firstChild + while (node) { + var nextNode = node.nextSibling + scanNode(node, node.nodeType, vmodels) + node = nextNode + } + } + + function scanNodeArray(nodes, vmodels) { + for (var i = 0, node; node = nodes[i++];) { + scanNode(node, node.nodeType, vmodels) + } + } + + function scanNode(node, nodeType, vmodels) { + if (nodeType === 1) { + scanTag(node, vmodels) //扫æ元素节点 + if (node.msCallback) { + node.msCallback() + node.msCallback = void 0 + } + } else if (nodeType === 3 && rexpr.test(node.data)) { + scanText(node, vmodels) //扫æ文本节点 + } else if (kernel.commentInterpolate && nodeType === 8 && !rexpr.test(node.nodeValue)) { + scanText(node, vmodels) //扫æ注释节点 + } + } + + function scanTag(elem, vmodels, node) { + //扫æé¡ºåº ms-skip(0) --> ms-important(1) --> ms-controller(2) --> ms-if(10) --> ms-repeat(100) + //--> ms-if-loop(110) --> ms-attr(970) ...--> ms-each(1400)-->ms-with(1500)--〉ms-duplex(2000)åž«åŽ + var a = elem.getAttribute("ms-skip") + var b = elem.getAttributeNode("ms-important") + var c = elem.getAttributeNode("ms-controller") + if (typeof a === "string") { + return + } else if (node = b || c) { + var newVmodel = avalon.vmodels[node.value] + if (!newVmodel) { + return + } + //ms-importantä¸åŒ…å«çˆ¶VM,ms-controller相å + vmodels = node === b ? [newVmodel] : [newVmodel].concat(vmodels) + elem.removeAttribute(node.name) //removeAttributeNodeä¸ä¼šåˆ·æ–°[ms-controller]æ ·å¼è§„则 + elem.classList.remove(node.name) + createSignalTower(elem, newVmodel) + } + scanAttr(elem, vmodels) //扫æ特性节点 + } + + var rhasHtml = /\|\s*html\s*/, + r11a = /\|\|/g, + rlt = /</g, + rgt = />/g, + rstringLiteral = /(['"])(\\\1|.)+?\1/g + + function getToken(value) { + if (value.indexOf("|") > 0) { + var scapegoat = value.replace(rstringLiteral, function (_) { + return Array(_.length + 1).join("1")// jshint ignore:line + }) + var index = scapegoat.replace(r11a, "\u1122\u3344").indexOf("|") //干掉所有短路或 + if (index > -1) { + return { + filters: value.slice(index), + value: value.slice(0, index), + expr: true + } + } + } + return { + value: value, + filters: "", + expr: true + } + } + + function scanExpr(str) { + var tokens = [], + value, start = 0, + stop + do { + stop = str.indexOf(openTag, start) + if (stop === -1) { + break + } + value = str.slice(start, stop) + if (value) { // {{ 左边的文本 + tokens.push({ + value: value, + filters: "", + expr: false + }) + } + start = stop + openTag.length + stop = str.indexOf(closeTag, start) + if (stop === -1) { + break + } + value = str.slice(start, stop) + if (value) { //处ç†{{ }}æ’å€¼è¡¨è¾¾å¼ + tokens.push(getToken(value)) + } + start = stop + closeTag.length + } while (1) + value = str.slice(start) + if (value) { //}} å³è¾¹çš„文本 + tokens.push({ + value: value, + expr: false, + filters: "" + }) + } + return tokens + } + + function scanText(textNode, vmodels) { + var bindings = [] + if (textNode.nodeType === 8) { + var token = getToken(textNode.nodeValue) + var tokens = [token] + } else { + tokens = scanExpr(textNode.data) + } + if (tokens.length) { + for (var i = 0; token = tokens[i++];) { + var node = DOC.createTextNode(token.value) //将文本转æ¢ä¸ºæ–‡æœ¬èŠ‚点,并替æ¢åŽŸæ¥çš„文本节点 + if (token.expr) { + token.type = "text" + token.element = node + token.filters = token.filters.replace(rhasHtml, function () { + token.type = "html" + token.group = 1 + return "" + })// jshint ignore:line + bindings.push(token) //收集带有æ’值表达å¼çš„文本 + } + hyperspace.appendChild(node) + } + textNode.parentNode.replaceChild(hyperspace, textNode) + if (bindings.length) + executeBindings(bindings, vmodels) + } + } + + /********************************************************************* + * avalon的原型方法定义区 * + **********************************************************************/ + + function hyphen(target) { + //转æ¢ä¸ºè¿žå­—符线风格 + return target.replace(/([a-z\d])([A-Z]+)/g, "$1-$2").toLowerCase() + } + + function camelize(target) { + //转æ¢ä¸ºé©¼å³°é£Žæ ¼ + if (target.indexOf("-") < 0 && target.indexOf("_") < 0) { + return target //æå‰åˆ¤æ–­ï¼Œæ高getStyle等的效率 + } + return target.replace(/[-_][^-_]/g, function (match) { + return match.charAt(1).toUpperCase() + }) + } + + "add,remove".replace(rword, function (method) { + avalon.fn[method + "Class"] = function (cls) { + var el = this[0] + //https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/26 + if (cls && typeof cls === "string" && el && el.nodeType === 1) { + cls.replace(/\S+/g, function (c) { + el.classList[method](c) + }) + } + return this + } + }) + + avalon.fn.mix({ + hasClass: function (cls) { + var el = this[0] || {} //IE10+, chrome8+, firefox3.6+, safari5.1+,opera11.5+支æŒclassList,chrome24+,firefox26+支æŒclassList2.0 + return el.nodeType === 1 && el.classList.contains(cls) + }, + toggleClass: function (value, stateVal) { + var className, i = 0 + var classNames = String(value).split(/\s+/) + var isBool = typeof stateVal === "boolean" + while ((className = classNames[i++])) { + var state = isBool ? stateVal : !this.hasClass(className) + this[state ? "addClass" : "removeClass"](className) + } + return this + }, + attr: function (name, value) { + if (arguments.length === 2) { + this[0].setAttribute(name, value) + return this + } else { + return this[0].getAttribute(name) + } + }, + data: function (name, value) { + name = "data-" + hyphen(name || "") + switch (arguments.length) { + case 2: + this.attr(name, value) + return this + case 1: + var val = this.attr(name) + return parseData(val) + case 0: + var ret = {} + ap.forEach.call(this[0].attributes, function (attr) { + if (attr) { + name = attr.name + if (!name.indexOf("data-")) { + name = camelize(name.slice(5)) + ret[name] = parseData(attr.value) + } + } + }) + return ret + } + }, + removeData: function (name) { + name = "data-" + hyphen(name) + this[0].removeAttribute(name) + return this + }, + css: function (name, value) { + if (avalon.isPlainObject(name)) { + for (var i in name) { + avalon.css(this, i, name[i]) + } + } else { + var ret = avalon.css(this, name, value) + } + return ret !== void 0 ? ret : this + }, + position: function () { + var offsetParent, offset, + elem = this[0], + parentOffset = { + top: 0, + left: 0 + }; + if (!elem) { + return + } + if (this.css("position") === "fixed") { + offset = elem.getBoundingClientRect() + } else { + offsetParent = this.offsetParent() //得到真正的offsetParent + offset = this.offset() // 得到正确的offsetParent + if (offsetParent[0].tagName !== "HTML") { + parentOffset = offsetParent.offset() + } + parentOffset.top += avalon.css(offsetParent[0], "borderTopWidth", true) + parentOffset.left += avalon.css(offsetParent[0], "borderLeftWidth", true) + // Subtract offsetParent scroll positions + parentOffset.top -= offsetParent.scrollTop() + parentOffset.left -= offsetParent.scrollLeft() + } + return { + top: offset.top - parentOffset.top - avalon.css(elem, "marginTop", true), + left: offset.left - parentOffset.left - avalon.css(elem, "marginLeft", true) + } + }, + offsetParent: function () { + var offsetParent = this[0].offsetParent + while (offsetParent && avalon.css(offsetParent, "position") === "static") { + offsetParent = offsetParent.offsetParent; + } + return avalon(offsetParent || root) + }, + bind: function (type, fn, phase) { + if (this[0]) { //此方法ä¸ä¼šé“¾ + return avalon.bind(this[0], type, fn, phase) + } + }, + unbind: function (type, fn, phase) { + if (this[0]) { + avalon.unbind(this[0], type, fn, phase) + } + return this + }, + val: function (value) { + var node = this[0] + if (node && node.nodeType === 1) { + var get = arguments.length === 0 + var access = get ? ":get" : ":set" + var fn = valHooks[getValType(node) + access] + if (fn) { + var val = fn(node, value) + } else if (get) { + return (node.value || "").replace(/\r/g, "") + } else { + node.value = value + } + } + return get ? val : this + } + }) + + if (root.dataset) { + avalon.fn.data = function (name, val) { + name = name && camelize(name) + var dataset = this[0].dataset + switch (arguments.length) { + case 2: + dataset[name] = val + return this + case 1: + val = dataset[name] + return parseData(val) + case 0: + var ret = createMap() + for (name in dataset) { + ret[name] = parseData(dataset[name]) + } + return ret + } + } + } + var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/ + avalon.parseJSON = JSON.parse + + function parseData(data) { + try { + if (typeof data === "object") + return data + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? JSON.parse(data) : data + } catch (e) { + } + return data + } + + avalon.each({ + scrollLeft: "pageXOffset", + scrollTop: "pageYOffset" + }, function (method, prop) { + avalon.fn[method] = function (val) { + var node = this[0] || {}, win = getWindow(node), + top = method === "scrollTop" + if (!arguments.length) { + return win ? win[prop] : node[method] + } else { + if (win) { + win.scrollTo(!top ? val : win[prop], top ? val : win[prop]) + } else { + node[method] = val + } + } + } + }) + + function getWindow(node) { + return node.window && node.document ? node : node.nodeType === 9 ? node.defaultView : false + } + +//=============================css相关================================== + var cssHooks = avalon.cssHooks = createMap() + var prefixes = ["", "-webkit-", "-moz-", "-ms-"] //去掉opera-15çš„æ”¯æŒ + var cssMap = { + "float": "cssFloat" + } + avalon.cssNumber = oneObject("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom") + + avalon.cssName = function (name, host, camelCase) { + if (cssMap[name]) { + return cssMap[name] + } + host = host || root.style + for (var i = 0, n = prefixes.length; i < n; i++) { + camelCase = camelize(prefixes[i] + name) + if (camelCase in host) { + return (cssMap[name] = camelCase) + } + } + return null + } + cssHooks["@:set"] = function (node, name, value) { + node.style[name] = value + } + + cssHooks["@:get"] = function (node, name) { + if (!node || !node.style) { + throw new Error("getComputedStyleè¦æ±‚传入一个节点 " + node) + } + var ret, computed = getComputedStyle(node) + if (computed) { + ret = name === "filter" ? computed.getPropertyValue(name) : computed[name] + if (ret === "") { + ret = node.style[name] //其他æµè§ˆå™¨éœ€è¦æˆ‘们手动å–内è”æ ·å¼ + } + } + return ret + } + cssHooks["opacity:get"] = function (node) { + var ret = cssHooks["@:get"](node, "opacity") + return ret === "" ? "1" : ret + } + + "top,left".replace(rword, function (name) { + cssHooks[name + ":get"] = function (node) { + var computed = cssHooks["@:get"](node, name) + return /px$/.test(computed) ? computed : + avalon(node).position()[name] + "px" + } + }) + var cssShow = { + position: "absolute", + visibility: "hidden", + display: "block" + } + var rdisplayswap = /^(none|table(?!-c[ea]).+)/ + + function showHidden(node, array) { + //http://www.cnblogs.com/rubylouvre/archive/2012/10/27/2742529.html + if (node.offsetWidth <= 0) { //opera.offsetWidthå¯èƒ½å°äºŽ0 + var styles = getComputedStyle(node, null) + if (rdisplayswap.test(styles["display"])) { + var obj = { + node: node + } + for (var name in cssShow) { + obj[name] = styles[name] + node.style[name] = cssShow[name] + } + array.push(obj) + } + var parent = node.parentNode + if (parent && parent.nodeType === 1) { + showHidden(parent, array) + } + } + } + + "Width,Height".replace(rword, function (name) { //fix 481 + var method = name.toLowerCase(), + clientProp = "client" + name, + scrollProp = "scroll" + name, + offsetProp = "offset" + name + cssHooks[method + ":get"] = function (node, which, override) { + var boxSizing = -4 + if (typeof override === "number") { + boxSizing = override + } + which = name === "Width" ? ["Left", "Right"] : ["Top", "Bottom"] + var ret = node[offsetProp] // border-box 0 + if (boxSizing === 2) { // margin-box 2 + return ret + avalon.css(node, "margin" + which[0], true) + avalon.css(node, "margin" + which[1], true) + } + if (boxSizing < 0) { // padding-box -2 + ret = ret - avalon.css(node, "border" + which[0] + "Width", true) - avalon.css(node, "border" + which[1] + "Width", true) + } + if (boxSizing === -4) { // content-box -4 + ret = ret - avalon.css(node, "padding" + which[0], true) - avalon.css(node, "padding" + which[1], true) + } + return ret + } + cssHooks[method + "&get"] = function (node) { + var hidden = []; + showHidden(node, hidden); + var val = cssHooks[method + ":get"](node) + for (var i = 0, obj; obj = hidden[i++];) { + node = obj.node + for (var n in obj) { + if (typeof obj[n] === "string") { + node.style[n] = obj[n] + } + } + } + return val; + } + avalon.fn[method] = function (value) { //会忽视其display + var node = this[0] + if (arguments.length === 0) { + if (node.setTimeout) { //å–得窗å£å°ºå¯¸,IE9åŽå¯ä»¥ç”¨node.innerWidth /innerHeight代替 + return node["inner" + name] + } + if (node.nodeType === 9) { //å–得页é¢å°ºå¯¸ + var doc = node.documentElement + //FF chrome html.scrollHeight< body.scrollHeight + //IE æ ‡å‡†æ¨¡å¼ : html.scrollHeight> body.scrollHeight + //IE æ€ªå¼‚æ¨¡å¼ : html.scrollHeight 最大等于å¯è§†çª—å£å¤šä¸€ç‚¹ï¼Ÿ + return Math.max(node.body[scrollProp], doc[scrollProp], node.body[offsetProp], doc[offsetProp], doc[clientProp]) + } + return cssHooks[method + "&get"](node) + } else { + return this.css(method, value) + } + } + avalon.fn["inner" + name] = function () { + return cssHooks[method + ":get"](this[0], void 0, -2) + } + avalon.fn["outer" + name] = function (includeMargin) { + return cssHooks[method + ":get"](this[0], void 0, includeMargin === true ? 2 : 0) + } + }) + avalon.fn.offset = function () { //å–å¾—è·ç¦»é¡µé¢å·¦å³è§’çš„åæ ‡ + var node = this[0] + try { + var rect = node.getBoundingClientRect() + // Make sure element is not hidden (display: none) or disconnected + // https://github.com/jquery/jquery/pull/2043/files#r23981494 + if (rect.width || rect.height || node.getClientRects().length) { + var doc = node.ownerDocument + var root = doc.documentElement + var win = doc.defaultView + return { + top: rect.top + win.pageYOffset - root.clientTop, + left: rect.left + win.pageXOffset - root.clientLeft + } + } + } catch (e) { + return { + left: 0, + top: 0 + } + } + } + //=============================val相关======================= + + function getValType(elem) { + var ret = elem.tagName.toLowerCase() + return ret === "input" && /checkbox|radio/.test(elem.type) ? "checked" : ret + } + + var valHooks = { + "select:get": function (node, value) { + var option, options = node.options, + index = node.selectedIndex, + one = node.type === "select-one" || index < 0, + values = one ? null : [], + max = one ? index + 1 : options.length, + i = index < 0 ? max : one ? index : 0 + for (; i < max; i++) { + option = options[i] + //æ—§å¼IE在resetåŽä¸ä¼šæ”¹å˜selected,需è¦æ”¹ç”¨i === index判定 + //我们过滤所有disabledçš„option元素,但在safari5下,如果设置select为disable,那么其所有孩å­éƒ½disable + //因此当一个元素为disable,需è¦æ£€æµ‹å…¶æ˜¯å¦æ˜¾å¼è®¾ç½®äº†disableåŠå…¶çˆ¶èŠ‚点的disable情况 + if ((option.selected || i === index) && !option.disabled) { + value = option.value + if (one) { + return value + } + //收集所有selected值组æˆæ•°ç»„返回 + values.push(value) + } + } + return values + }, + "select:set": function (node, values, optionSet) { + values = [].concat(values) //强制转æ¢ä¸ºæ•°ç»„ + for (var i = 0, el; el = node.options[i++];) { + if ((el.selected = values.indexOf(el.value) > -1)) { + optionSet = true + } + } + if (!optionSet) { + node.selectedIndex = -1 + } + } + } + /********************************************************************* + * 编译系统 * + **********************************************************************/ + var quote = JSON.stringify + + var keywords = [ + "break,case,catch,continue,debugger,default,delete,do,else,false", + "finally,for,function,if,in,instanceof,new,null,return,switch,this", + "throw,true,try,typeof,var,void,while,with", /* 关键字*/ + "abstract,boolean,byte,char,class,const,double,enum,export,extends", + "final,float,goto,implements,import,int,interface,long,native", + "package,private,protected,public,short,static,super,synchronized", + "throws,transient,volatile", /*ä¿ç•™å­—*/ + "arguments,let,yield,undefined" /* ECMA 5 - use strict*/].join(",") + var rrexpstr = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g + var rsplit = /[^\w$]+/g + var rkeywords = new RegExp(["\\b" + keywords.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g') + var rnumber = /\b\d[^,]*/g + var rcomma = /^,+|,+$/g + var cacheVars = new Cache(512) + var getVariables = function (code) { + var key = "," + code.trim() + var ret = cacheVars.get(key) + if (ret) { + return ret + } + var match = code + .replace(rrexpstr, "") + .replace(rsplit, ",") + .replace(rkeywords, "") + .replace(rnumber, "") + .replace(rcomma, "") + .split(/^$|,+/) + return cacheVars.put(key, uniqSet(match)) + } + /*添加赋值语å¥*/ + + function addAssign(vars, scope, name, data) { + var ret = [], + prefix = " = " + name + "." + var isProxy = /\$proxy\$each/.test(scope.$id) + for (var i = vars.length, prop; prop = vars[--i];) { + var el = isProxy && scope.$map[prop] ? "el" : prop + if (scope.hasOwnProperty(el)) { + ret.push(prop + prefix + el) + data.vars.push(prop) + if (data.type === "duplex") { + vars.get = name + "." + el + } + vars.splice(i, 1) + } + } + return ret + } + + function uniqSet(array) { + var ret = [], + unique = {} + for (var i = 0; i < array.length; i++) { + var el = array[i] + var id = el && typeof el.$id === "string" ? el.$id : el + if (!unique[id]) { + unique[id] = ret.push(el) + } + } + return ret + } + +//缓存求值函数,以便多次利用 + var cacheExprs = new Cache(128) +//å–得求值函数åŠå…¶ä¼ å‚ + var rduplex = /\w\[.*\]|\w\.\w/ + var rproxy = /(\$proxy\$[a-z]+)\d+$/ + var rthimRightParentheses = /\)\s*$/ + var rthimOtherParentheses = /\)\s*\|/g + var rquoteFilterName = /\|\s*([$\w]+)/g + var rpatchBracket = /"\s*\["/g + var rthimLeftParentheses = /"\s*\(/g + + function parseFilter(val, filters) { + filters = filters + .replace(rthimRightParentheses, "")//处ç†æœ€åŽçš„å°æ‹¬å· + .replace(rthimOtherParentheses, function () {//处ç†å…¶ä»–å°æ‹¬å· + return "],|" + }) + .replace(rquoteFilterName, function (a, b) { //处ç†|åŠå®ƒåŽé¢çš„过滤器的åå­— + return "[" + quote(b) + }) + .replace(rpatchBracket, function () { + return '"],["' + }) + .replace(rthimLeftParentheses, function () { + return '",' + }) + "]" + return "return avalon.filters.$filter(" + val + ", " + filters + ")" + } + + function parseExpr(code, scopes, data) { + var dataType = data.type + var filters = data.filters || "" + var exprId = scopes.map(function (el) { + return String(el.$id).replace(rproxy, "$1") + }) + code + dataType + filters + var vars = getVariables(code).concat(), + assigns = [], + names = [], + args = [], + prefix = "" + //args 是一个对象数组, names 是将è¦ç”Ÿæˆçš„求值函数的å‚æ•° + scopes = uniqSet(scopes) + data.vars = [] + for (var i = 0, sn = scopes.length; i < sn; i++) { + if (vars.length) { + var name = "vm" + expose + "_" + i + names.push(name) + args.push(scopes[i]) + assigns.push.apply(assigns, addAssign(vars, scopes[i], name, data)) + } + } + if (!assigns.length && dataType === "duplex") { + return + } + if (dataType !== "duplex" && (code.indexOf("||") > -1 || code.indexOf("&&") > -1)) { + //https://github.com/RubyLouvre/avalon/issues/583 + data.vars.forEach(function (v) { + var reg = new RegExp("\\b" + v + "(?:\\.\\w+|\\[\\w+\\])+", "ig") + code = code.replace(reg, function (_) { + var c = _.charAt(v.length) + var r = IEVersion ? code.slice(arguments[1] + _.length) : RegExp.rightContext + var method = /^\s*\(/.test(r) + if (c === "." || c === "[" || method) {//比如v为aa,我们åªåŒ¹é…aa.bb,aa[cc],ä¸åŒ¹é…aaa.xxx + var name = "var" + String(Math.random()).replace(/^0\./, "") + if (method) {//array.size() + var array = _.split(".") + if (array.length > 2) { + var last = array.pop() + assigns.push(name + " = " + array.join(".")) + return name + "." + last + } else { + return _ + } + } + assigns.push(name + " = " + _) + return name + } else { + return _ + } + }) + }) + } + //---------------args---------------- + data.args = args + //---------------cache---------------- + var fn = cacheExprs.get(exprId) //直接从缓存,å…å¾—é‡å¤ç”Ÿæˆ + if (fn) { + data.evaluator = fn + return + } + prefix = assigns.join(", ") + if (prefix) { + prefix = "var " + prefix + } + if (/\S/.test(filters)) { //文本绑定,åŒå·¥ç»‘定æ‰æœ‰è¿‡æ»¤å™¨ + if (!/text|html/.test(data.type)) { + throw Error("ms-" + data.type + "ä¸æ”¯æŒè¿‡æ»¤å™¨") + } + code = "\nvar ret" + expose + " = " + code + ";\r\n" + code += parseFilter("ret" + expose, filters) + } else if (dataType === "duplex") { //åŒå·¥ç»‘定 + var _body = "'use strict';\nreturn function(vvv){\n\t" + + prefix + + ";\n\tif(!arguments.length){\n\t\treturn " + + code + + "\n\t}\n\t" + (!rduplex.test(code) ? vars.get : code) + + "= vvv;\n} " + try { + fn = Function.apply(noop, names.concat(_body)) + data.evaluator = cacheExprs.put(exprId, fn) + } catch (e) { + log("debug: parse error," + e.message) + } + return + } else if (dataType === "on") { //事件绑定 + if (code.indexOf("(") === -1) { + code += ".call(this, $event)" + } else { + code = code.replace("(", ".call(this,") + } + names.push("$event") + code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需è¦Function("return ;") + var lastIndex = code.lastIndexOf("\nreturn") + var header = code.slice(0, lastIndex) + var footer = code.slice(lastIndex) + code = header + "\n" + footer + } else { //其他绑定 + code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需è¦Function("return ;") + } + try { + fn = Function.apply(noop, names.concat("'use strict';\n" + prefix + code)) + data.evaluator = cacheExprs.put(exprId, fn) + } catch (e) { + log("debug: parse error," + e.message) + } finally { + vars = assigns = names = null //释放内存 + } + } + + +//parseExprçš„æ™ºèƒ½å¼•ç”¨ä»£ç† + + function parseExprProxy(code, scopes, data, tokens, noRegister) { + if (Array.isArray(tokens)) { + code = tokens.map(function (el) { + return el.expr ? "(" + el.value + ")" : quote(el.value) + }).join(" + ") + } + parseExpr(code, scopes, data) + if (data.evaluator && !noRegister) { + data.handler = bindingExecutors[data.handlerName || data.type] + //方便调试 + //这里éžå¸¸é‡è¦,我们通过判定视图刷新函数的element是å¦åœ¨DOM树决定 + //将它移出订阅者列表 + avalon.injectBinding(data) + } + } + + avalon.parseExprProxy = parseExprProxy + var bools = ["autofocus,autoplay,async,allowTransparency,checked,controls", + "declare,disabled,defer,defaultChecked,defaultSelected", + "contentEditable,isMap,loop,multiple,noHref,noResize,noShade", + "open,readOnly,selected" + ].join(",") + var boolMap = {} + bools.replace(rword, function (name) { + boolMap[name.toLowerCase()] = name + }) + + var propMap = { //属性å映射 + "accept-charset": "acceptCharset", + "char": "ch", + "charoff": "chOff", + "class": "className", + "for": "htmlFor", + "http-equiv": "httpEquiv" + } + + var anomaly = ["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan", + "dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight", + "rowSpan,tabIndex,useMap,vSpace,valueType,vAlign" + ].join(",") + anomaly.replace(rword, function (name) { + propMap[name.toLowerCase()] = name + }) + + var rnoscripts = /(?:[\s\S]+?)<\/noscript>/img + var rnoscriptText = /([\s\S]+?)<\/noscript>/im + + var getXHR = function () { + return new (window.XMLHttpRequest || ActiveXObject)("Microsoft.XMLHTTP") // jshint ignore:line + } + + var cacheTmpls = avalon.templateCache = {} + + bindingHandlers.attr = function (data, vmodels) { + var text = data.value.trim(), + simple = true + if (text.indexOf(openTag) > -1 && text.indexOf(closeTag) > 2) { + simple = false + if (rexpr.test(text) && RegExp.rightContext === "" && RegExp.leftContext === "") { + simple = true + text = RegExp.$1 + } + } + if (data.type === "include") { + var elem = data.element + data.includeRendered = getBindingCallback(elem, "data-include-rendered", vmodels) + data.includeLoaded = getBindingCallback(elem, "data-include-loaded", vmodels) + var outer = data.includeReplace = !!avalon(elem).data("includeReplace") + if (avalon(elem).data("includeCache")) { + data.templateCache = {} + } + data.startInclude = DOC.createComment("ms-include") + data.endInclude = DOC.createComment("ms-include-end") + if (outer) { + data.element = data.startInclude + elem.parentNode.insertBefore(data.startInclude, elem) + elem.parentNode.insertBefore(data.endInclude, elem.nextSibling) + } else { + elem.insertBefore(data.startInclude, elem.firstChild) + elem.appendChild(data.endInclude) + } + } + data.handlerName = "attr" //handleName用于处ç†å¤šç§ç»‘定共用åŒä¸€ç§bindingExecutor的情况 + parseExprProxy(text, vmodels, data, (simple ? 0 : scanExpr(data.value))) + } + + bindingExecutors.attr = function (val, elem, data) { + var method = data.type, + attrName = data.param + if (method === "css") { + avalon(elem).css(attrName, val) + } else if (method === "attr") { + // ms-attr-class="xxx" vm.xxx="aaa bbb ccc"将元素的className设置为aaa bbb ccc + // ms-attr-class="xxx" vm.xxx=false 清空元素的所有类å + // ms-attr-name="yyy" vm.yyy="ooo" 为元素设置name属性 + var toRemove = (val === false) || (val === null) || (val === void 0) + + if (!W3C && propMap[attrName]) { //æ—§å¼IE下需è¦è¿›è¡Œå字映射 + attrName = propMap[attrName] + } + var bool = boolMap[attrName] + if (typeof elem[bool] === "boolean") { + elem[bool] = !!val //布尔属性必须使用el.xxx = true|falseæ–¹å¼è®¾å€¼ + if (!val) { //如果为false, IE全系列下相当于setAttribute(xxx,''),会影å“到样å¼,需è¦è¿›ä¸€æ­¥å¤„ç† + toRemove = true + } + } + if (toRemove) { + return elem.removeAttribute(attrName) + } + + //SVGåªèƒ½ä½¿ç”¨setAttribute(xxx, yyy), VMLåªèƒ½ä½¿ç”¨elem.xxx = yyy ,HTML的固有属性必须elem.xxx = yyy + var isInnate = rsvg.test(elem) ? false : (DOC.namespaces && isVML(elem)) ? true : attrName in elem.cloneNode(false) + if (isInnate) { + elem[attrName] = val + } else { + elem.setAttribute(attrName, val) + } + } else if (method === "include" && val) { + var vmodels = data.vmodels + var rendered = data.includeRendered + var loaded = data.includeLoaded + var replace = data.includeReplace + var target = replace ? elem.parentNode : elem + var scanTemplate = function (text) { + if (loaded) { + var newText = loaded.apply(target, [text].concat(vmodels)) + if (typeof newText === "string") + text = newText + } + if (rendered) { + checkScan(target, function () { + rendered.call(target) + }, NaN) + } + var lastID = data.includeLastID + if (data.templateCache && lastID && lastID !== val) { + var lastTemplate = data.templateCache[lastID] + if (!lastTemplate) { + lastTemplate = data.templateCache[lastID] = DOC.createElement("div") + ifGroup.appendChild(lastTemplate) + } + } + data.includeLastID = val + while (true) { + var node = data.startInclude.nextSibling + if (node && node !== data.endInclude) { + target.removeChild(node) + if (lastTemplate) + lastTemplate.appendChild(node) + } else { + break + } + } + var dom = getTemplateNodes(data, val, text) + var nodes = avalon.slice(dom.childNodes) + target.insertBefore(dom, data.endInclude) + scanNodeArray(nodes, vmodels) + } + + if (data.param === "src") { + if (typeof cacheTmpls[val] === "string") { + avalon.nextTick(function () { + scanTemplate(cacheTmpls[val]) + }) + } else if (Array.isArray(cacheTmpls[val])) { //#805 防止在循环绑定中å‘出许多相åŒçš„请求 + cacheTmpls[val].push(scanTemplate) + } else { + var xhr = getXHR() + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + var s = xhr.status + if (s >= 200 && s < 300 || s === 304 || s === 1223) { + var text = xhr.responseText + for (var f = 0, fn; fn = cacheTmpls[val][f++];) { + fn(text) + } + cacheTmpls[val] = text + } + } + } + cacheTmpls[val] = [scanTemplate] + xhr.open("GET", val, true) + if ("withCredentials" in xhr) { + xhr.withCredentials = true + } + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest") + xhr.send(null) + } + } else { + //IE系列与够新的标准æµè§ˆå™¨æ”¯æŒé€šè¿‡IDå–得元素(firefox14+) + //http://tjvantoll.com/2012/07/19/dom-element-references-as-global-variables/ + var el = val && val.nodeType === 1 ? val : DOC.getElementById(val) + if (el) { + if (el.tagName === "NOSCRIPT" && !(el.innerHTML || el.fixIE78)) { //IE7-8 innerText,innerHTML都无法å–得其内容,IE6能å–å¾—å…¶innerHTML + xhr = getXHR() //IE9-11与chromeçš„innerHTML会得到转义的内容,它们的innerTextå¯ä»¥ + xhr.open("GET", location, false) //谢谢Nodejs 乱炖群 深圳-纯属虚构 + xhr.send(null) + //http://bbs.csdn.net/topics/390349046?page=1#post-393492653 + var noscripts = DOC.getElementsByTagName("noscript") + var array = (xhr.responseText || "").match(rnoscripts) || [] + var n = array.length + for (var i = 0; i < n; i++) { + var tag = noscripts[i] + if (tag) { //IE6-8中noscript标签的innerHTML,innerText是åªè¯»çš„ + tag.style.display = "none" //http://haslayout.net/css/noscript-Ghost-Bug + tag.fixIE78 = (array[i].match(rnoscriptText) || ["", " "])[1] + } + } + } + avalon.nextTick(function () { + scanTemplate(el.fixIE78 || el.value || el.innerText || el.innerHTML) + }) + } + } + } else { + if (!root.hasAttribute && typeof val === "string" && (method === "src" || method === "href")) { + val = val.replace(/&/g, "&") //处ç†IE67自动转义的问题 + } + elem[method] = val + if (window.chrome && elem.tagName === "EMBED") { + var parent = elem.parentNode //#525 chrome1-37下embed标签动æ€è®¾ç½®srcä¸èƒ½å‘生请求 + var comment = document.createComment("ms-src") + parent.replaceChild(comment, elem) + parent.replaceChild(elem, comment) + } + } + } + + function getTemplateNodes(data, id, text) { + var div = data.templateCache && data.templateCache[id] + if (div) { + var dom = DOC.createDocumentFragment(), + firstChild + while (firstChild = div.firstChild) { + dom.appendChild(firstChild) + } + return dom + } + return avalon.parseHTML(text) + } + +//这几个指令都å¯ä»¥ä½¿ç”¨æ’值表达å¼ï¼Œå¦‚ms-src="aaa/{{b}}/{{c}}.html" + "title,alt,src,value,css,include,href".replace(rword, function (name) { + bindingHandlers[name] = bindingHandlers.attr + }) +//æ ¹æ®VM的属性值或表达å¼çš„值切æ¢ç±»å,ms-class="xxx yyy zzz:flag" +//http://www.cnblogs.com/rubylouvre/archive/2012/12/17/2818540.html + bindingHandlers["class"] = function (data, vmodels) { + var oldStyle = data.param, + text = data.value, + rightExpr + data.handlerName = "class" + if (!oldStyle || isFinite(oldStyle)) { + data.param = "" //去掉数字 + var noExpr = text.replace(rexprg, function (a) { + return a.replace(/./g, "0") + //return Math.pow(10, a.length - 1) //å°†æ’值表达å¼æ’å…¥10çš„N-1次方æ¥å ä½ + }) + var colonIndex = noExpr.indexOf(":") //å–得第一个冒å·çš„ä½ç½® + if (colonIndex === -1) { // 比如 ms-class="aaa bbb ccc" 的情况 + var className = text + } else { // 比如 ms-class-1="ui-state-active:checked" 的情况 + className = text.slice(0, colonIndex) + rightExpr = text.slice(colonIndex + 1) + parseExpr(rightExpr, vmodels, data) //决定是添加还是删除 + if (!data.evaluator) { + log("debug: ms-class '" + (rightExpr || "").trim() + "' ä¸å­˜åœ¨äºŽVM中") + return false + } else { + data._evaluator = data.evaluator + data._args = data.args + } + } + var hasExpr = rexpr.test(className) //比如ms-class="width{{w}}"的情况 + if (!hasExpr) { + data.immobileClass = className + } + parseExprProxy("", vmodels, data, (hasExpr ? scanExpr(className) : 0)) + } else { + data.immobileClass = data.oldStyle = data.param + parseExprProxy(text, vmodels, data) + } + } + + bindingExecutors["class"] = function (val, elem, data) { + var $elem = avalon(elem), + method = data.type + if (method === "class" && data.oldStyle) { //如果是旧风格 + $elem.toggleClass(data.oldStyle, !!val) + } else { + //如果存在冒å·å°±æœ‰æ±‚值函数 + data.toggleClass = data._evaluator ? !!data._evaluator.apply(elem, data._args) : true + data.newClass = data.immobileClass || val + if (data.oldClass && data.newClass !== data.oldClass) { + $elem.removeClass(data.oldClass) + } + data.oldClass = data.newClass + switch (method) { + case "class": + $elem.toggleClass(data.newClass, data.toggleClass) + break + case "hover": + case "active": + if (!data.hasBindEvent) { //ç¡®ä¿åªç»‘定一次 + var activate = "mouseenter" //在移出移入时切æ¢ç±»å + var abandon = "mouseleave" + if (method === "active") { //在èšç„¦å¤±ç„¦ä¸­åˆ‡æ¢ç±»å + elem.tabIndex = elem.tabIndex || -1 + activate = "mousedown" + abandon = "mouseup" + var fn0 = $elem.bind("mouseleave", function () { + data.toggleClass && $elem.removeClass(data.newClass) + }) + } + var fn1 = $elem.bind(activate, function () { + data.toggleClass && $elem.addClass(data.newClass) + }) + var fn2 = $elem.bind(abandon, function () { + data.toggleClass && $elem.removeClass(data.newClass) + }) + data.rollback = function () { + $elem.unbind("mouseleave", fn0) + $elem.unbind(activate, fn1) + $elem.unbind(abandon, fn2) + } + data.hasBindEvent = true + } + break; + } + } + } + + "hover,active".replace(rword, function (method) { + bindingHandlers[method] = bindingHandlers["class"] + }) +//ms-controller绑定已ç»åœ¨scanTag 方法中实现 +//ms-css绑定已由ms-attr绑定实现 + + +// bindingHandlers.data 定义在if.js + bindingExecutors.data = function (val, elem, data) { + var key = "data-" + data.param + if (val && typeof val === "object") { + elem[key] = val + } else { + elem.setAttribute(key, String(val)) + } + } +//åŒå·¥ç»‘定 + var duplexBinding = bindingHandlers.duplex = function (data, vmodels) { + var elem = data.element, + hasCast + parseExprProxy(data.value, vmodels, data, 0, 1) + + data.changed = getBindingCallback(elem, "data-duplex-changed", vmodels) || noop + if (data.evaluator && data.args) { + var params = [] + var casting = oneObject("string,number,boolean,checked") + if (elem.type === "radio" && data.param === "") { + data.param = "checked" + } + if (elem.msData) { + elem.msData["ms-duplex"] = data.value + } + data.param.replace(/\w+/g, function (name) { + if (/^(checkbox|radio)$/.test(elem.type) && /^(radio|checked)$/.test(name)) { + if (name === "radio") + log("ms-duplex-radioå·²ç»æ›´å为ms-duplex-checked") + name = "checked" + data.isChecked = true + } + if (name === "bool") { + name = "boolean" + log("ms-duplex-boolå·²ç»æ›´å为ms-duplex-boolean") + } else if (name === "text") { + name = "string" + log("ms-duplex-textå·²ç»æ›´å为ms-duplex-string") + } + if (casting[name]) { + hasCast = true + } + avalon.Array.ensure(params, name) + }) + if (!hasCast) { + params.push("string") + } + data.param = params.join("-") + data.bound = function (type, callback) { + if (elem.addEventListener) { + elem.addEventListener(type, callback, false) + } else { + elem.attachEvent("on" + type, callback) + } + var old = data.rollback + data.rollback = function () { + elem.avalonSetter = null + avalon.unbind(elem, type, callback) + old && old() + } + } + for (var i in avalon.vmodels) { + var v = avalon.vmodels[i] + v.$fire("avalon-ms-duplex-init", data) + } + var cpipe = data.pipe || (data.pipe = pipe) + cpipe(null, data, "init") + var tagName = elem.tagName + duplexBinding[tagName] && duplexBinding[tagName](elem, data.evaluator.apply(null, data.args), data) + } + } +//ä¸å­˜åœ¨ bindingExecutors.duplex + + function fixNull(val) { + return val == null ? "" : val + } + + avalon.duplexHooks = { + checked: { + get: function (val, data) { + return !data.element.oldValue + } + }, + string: { + get: function (val) { //åŒæ­¥åˆ°VM + return val + }, + set: fixNull + }, + "boolean": { + get: function (val) { + return val === "true" + }, + set: fixNull + }, + number: { + get: function (val, data) { + var number = parseFloat(val) + if (-val === -number) { + return number + } + var arr = /strong|medium|weak/.exec(data.element.getAttribute("data-duplex-number")) || ["medium"] + switch (arr[0]) { + case "strong": + return 0 + case "medium": + return val === "" ? "" : 0 + case "weak": + return val + } + }, + set: fixNull + } + } + + function pipe(val, data, action, e) { + data.param.replace(/\w+/g, function (name) { + var hook = avalon.duplexHooks[name] + if (hook && typeof hook[action] === "function") { + val = hook[action](val, data) + } + }) + return val + } + + var TimerID, ribbon = [] + + avalon.tick = function (fn) { + if (ribbon.push(fn) === 1) { + TimerID = setInterval(ticker, 60) + } + } + + function ticker() { + for (var n = ribbon.length - 1; n >= 0; n--) { + var el = ribbon[n] + if (el() === false) { + ribbon.splice(n, 1) + } + } + if (!ribbon.length) { + clearInterval(TimerID) + } + } + + var watchValueInTimer = noop + var rmsinput = /text|password|hidden/ + new function () { // jshint ignore:line + try { //#272 IE9-IE11, firefox + var setters = {} + var aproto = HTMLInputElement.prototype + var bproto = HTMLTextAreaElement.prototype + + function newSetter(value) { // jshint ignore:line + if (avalon.contains(root, this)) { + setters[this.tagName].call(this, value) + if (!rmsinput.test(this.type)) + return + if (!this.msFocus && this.avalonSetter) { + this.avalonSetter() + } + } + } + + var inputProto = HTMLInputElement.prototype + Object.getOwnPropertyNames(inputProto) //æ•…æ„引å‘IE6-8ç­‰æµè§ˆå™¨æŠ¥é”™ + setters["INPUT"] = Object.getOwnPropertyDescriptor(aproto, "value").set + Object.defineProperty(aproto, "value", { + set: newSetter + }) + setters["TEXTAREA"] = Object.getOwnPropertyDescriptor(bproto, "value").set + Object.defineProperty(bproto, "value", { + set: newSetter + }) + } catch (e) { + //在chrome 43中 ms-duplex终于ä¸éœ€è¦ä½¿ç”¨å®šæ—¶å™¨å®žçŽ°åŒå‘绑定了 + // http://updates.html5rocks.com/2015/04/DOM-attributes-now-on-the-prototype + // https://docs.google.com/document/d/1jwA8mtClwxI-QJuHT7872Z0pxpZz8PBkf2bGAbsUtqs/edit?pli=1 + watchValueInTimer = avalon.tick + } + } // jshint ignore:line +//处ç†radio, checkbox, text, textarea, password + duplexBinding.INPUT = function (element, evaluator, data) { + var $type = element.type, + bound = data.bound, + $elem = avalon(element), + composing = false + + function callback(value) { + data.changed.call(this, value, data) + } + + function compositionStart() { + composing = true + } + + function compositionEnd() { + composing = false + } + + //当valueå˜åŒ–时改å˜model的值 + + var updateVModel = function () { + if (composing) //处ç†ä¸­æ–‡è¾“入法在minlengh下引å‘çš„BUG + return + var val = element.oldValue = element.value //防止递归调用形æˆæ­»å¾ªçŽ¯ + var lastValue = data.pipe(val, data, "get") + if ($elem.data("duplexObserve") !== false) { + evaluator(lastValue) + callback.call(element, lastValue) + if ($elem.data("duplex-focus")) { + avalon.nextTick(function () { + element.focus() + }) + } + } + } + //当modelå˜åŒ–æ—¶,它就会改å˜value的值 + data.handler = function () { + var val = data.pipe(evaluator(), data, "set") + "" + if (val !== element.oldValue) { + element.value = val + } + } + if (data.isChecked || $type === "radio") { + updateVModel = function () { + if ($elem.data("duplexObserve") !== false) { + var lastValue = data.pipe(element.value, data, "get") + evaluator(lastValue) + callback.call(element, lastValue) + } + } + data.handler = function () { + var val = evaluator() + var checked = data.isChecked ? !!val : val + "" === element.value + element.checked = element.oldValue = checked + } + bound("click", updateVModel) + } else if ($type === "checkbox") { + updateVModel = function () { + if ($elem.data("duplexObserve") !== false) { + var method = element.checked ? "ensure" : "remove" + var array = evaluator() + if (!Array.isArray(array)) { + log("ms-duplex应用于checkbox上è¦å¯¹åº”一个数组") + array = [array] + } + avalon.Array[method](array, data.pipe(element.value, data, "get")) + callback.call(element, array) + } + } + data.handler = function () { + var array = [].concat(evaluator()) //强制转æ¢ä¸ºæ•°ç»„ + element.checked = array.indexOf(data.pipe(element.value, data, "get")) > -1 + } + bound("change", updateVModel) + } else { + var events = element.getAttribute("data-duplex-event") || "input" + if (element.attributes["data-event"]) { + log("data-event指令已ç»åºŸå¼ƒï¼Œè¯·æ”¹ç”¨data-duplex-event") + } + events.replace(rword, function (name) { + switch (name) { + case "input": + bound("input", updateVModel) + bound("DOMAutoComplete", updateVModel) + if (!IEVersion) { + bound("compositionstart", compositionStart) + bound("compositionend", compositionEnd) + } + break + default: + bound(name, updateVModel) + break + } + }) + bound("focus", function () { + element.msFocus = true + }) + bound("blur", function () { + element.msFocus = false + }) + if (rmsinput.test($type)) { + watchValueInTimer(function () { + if (root.contains(element)) { + if (!element.msFocus && element.oldValue !== element.value) { + updateVModel() + } + } else if (!element.msRetain) { + return false + } + }) + } + + element.avalonSetter = updateVModel + } + + element.oldValue = element.value + avalon.injectBinding(data) + callback.call(element, element.value) + } + duplexBinding.TEXTAREA = duplexBinding.INPUT + duplexBinding.SELECT = function (element, evaluator, data) { + var $elem = avalon(element) + + function updateVModel() { + if ($elem.data("duplexObserve") !== false) { + var val = $elem.val() //字符串或字符串数组 + if (Array.isArray(val)) { + val = val.map(function (v) { + return data.pipe(v, data, "get") + }) + } else { + val = data.pipe(val, data, "get") + } + if (val + "" !== element.oldValue) { + evaluator(val) + } + data.changed.call(element, val, data) + } + } + + data.handler = function () { + var val = evaluator() + val = val && val.$model || val + if (Array.isArray(val)) { + if (!element.multiple) { + log("ms-duplex在ä¸èƒ½å¯¹åº”一个数组") + } + } + //å¿…é¡»å˜æˆå­—符串åŽæ‰èƒ½æ¯”较 + val = Array.isArray(val) ? val.map(String) : val + "" + if (val + "" !== element.oldValue) { + $elem.val(val) + element.oldValue = val + "" + } + } + data.bound("change", updateVModel) + element.msCallback = function () { + avalon.injectBinding(data) + data.changed.call(element, evaluator(), data) + } + } +// bindingHandlers.html 定义在if.js + bindingExecutors.html = function (val, elem, data) { + val = val == null ? "" : val + var isHtmlFilter = "group" in data + var parent = isHtmlFilter ? elem.parentNode : elem + if (!parent) + return + if (typeof val === "string") { + var fragment = avalon.parseHTML(val) + } else if (val.nodeType === 11) { //å°†val转æ¢ä¸ºæ–‡æ¡£ç¢Žç‰‡ + fragment = val + } else if (val.nodeType === 1 || val.item) { + var nodes = val.nodeType === 1 ? val.childNodes : val.item + fragment = hyperspace.cloneNode(true) + while (nodes[0]) { + fragment.appendChild(nodes[0]) + } + } + if (!fragment.firstChild) { + fragment.appendChild(DOC.createComment("ms-html")) + } + nodes = avalon.slice(fragment.childNodes) + //æ’å…¥å ä½ç¬¦, 如果是过滤器,需è¦æœ‰èŠ‚制地移除指定的数é‡,如果是html指令,直接清空 + if (isHtmlFilter) { + var n = data.group, + i = 1 + + data.group = nodes.length + data.element = nodes[0] + + while (i < n) { + var node = elem.nextSibling + if (node) { + parent.removeChild(node) + i++ + } + } + parent.replaceChild(fragment, elem) + } else { + avalon.clearHTML(parent).appendChild(fragment) + } + scanNodeArray(nodes, data.vmodels) + } + bindingHandlers["if"] = + bindingHandlers.data = + bindingHandlers.text = + bindingHandlers.html = + function (data, vmodels) { + parseExprProxy(data.value, vmodels, data) + } + + bindingExecutors["if"] = function (val, elem, data) { + if (val) { //æ’回DOMæ ‘ + if (elem.nodeType === 8) { + elem.parentNode.replaceChild(data.template, elem) + elem = data.element = data.template //这时å¯èƒ½ä¸ºnull + } + if (elem.getAttribute(data.name)) { + elem.removeAttribute(data.name) + scanAttr(elem, data.vmodels) + } + data.rollback = null + } else { //移出DOM树,并用注释节点å æ®åŽŸä½ç½® + if (elem.nodeType === 1) { + var node = data.element = DOC.createComment("ms-if") + elem.parentNode.replaceChild(node, elem) + data.template = elem //元素节点 + ifGroup.appendChild(elem) + data.rollback = function () { + if (elem.parentNode === ifGroup) { + ifGroup.removeChild(elem) + } + } + } + } + } +//ms-important绑定已ç»åœ¨scanTag 方法中实现 +//ms-include绑定已由ms-attr绑定实现 + + var rdash = /\(([^)]*)\)/ + bindingHandlers.on = function (data, vmodels) { + var value = data.value + data.type = "on" + var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10 + if (typeof bindingHandlers.on[eventType + "Hook"] === "function") { + bindingHandlers.on[eventType + "Hook"](data) + } + if (value.indexOf("(") > 0 && value.indexOf(")") > -1) { + var matched = (value.match(rdash) || ["", ""])[1].trim() + if (matched === "" || matched === "$event") { // aaa() aaa($event)当æˆaaaå¤„ç† + value = value.replace(rdash, "") + } + } + parseExprProxy(value, vmodels, data) + } + + bindingExecutors.on = function (callback, elem, data) { + callback = function (e) { + var fn = data.evaluator || noop + return fn.apply(this, data.args.concat(e)) + } + var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10 + if (eventType === "scan") { + callback.call(elem, { + type: eventType + }) + } else if (typeof data.specialBind === "function") { + data.specialBind(elem, callback) + } else { + var removeFn = avalon.bind(elem, eventType, callback) + } + data.rollback = function () { + if (typeof data.specialUnbind === "function") { + data.specialUnbind() + } else { + avalon.unbind(elem, eventType, removeFn) + } + } + } + bindingHandlers.repeat = function (data, vmodels) { + var type = data.type + parseExprProxy(data.value, vmodels, data, 0, 1) + var freturn = false + try { + var $repeat = data.$repeat = data.evaluator.apply(0, data.args || []) + var xtype = avalon.type($repeat) + if (xtype !== "object" && xtype !== "array") { + freturn = true + avalon.log("warning:" + data.value + "åªèƒ½æ˜¯å¯¹è±¡æˆ–数组") + } + } catch (e) { + freturn = true + } + + var arr = data.value.split(".") || [] + if (arr.length > 1) { + arr.pop() + var n = arr[0] + for (var i = 0, v; v = vmodels[i++];) { + if (v && v.hasOwnProperty(n)) { + var events = v[n].$events || {} + events[subscribers] = events[subscribers] || [] + events[subscribers].push(data) + break + } + } + } + var elem = data.element + elem.removeAttribute(data.name) + + data.sortedCallback = getBindingCallback(elem, "data-with-sorted", vmodels) + data.renderedCallback = getBindingCallback(elem, "data-" + type + "-rendered", vmodels) + var signature = generateID(type) + var comment = data.element = DOC.createComment(signature + ":end") + data.clone = DOC.createComment(signature) + hyperspace.appendChild(comment) + + if (type === "each" || type === "with") { + data.template = elem.innerHTML.trim() + avalon.clearHTML(elem).appendChild(comment) + } else { + data.template = elem.outerHTML.trim() + elem.parentNode.replaceChild(comment, elem) + } + data.template = avalon.parseHTML(data.template) + data.rollback = function () { + var elem = data.element + if (!elem) + return + bindingExecutors.repeat.call(data, "clear") + var parentNode = elem.parentNode + var content = data.template + var target = content.firstChild + parentNode.replaceChild(content, elem) + var start = data.$with + start && start.parentNode && start.parentNode.removeChild(start) + target = data.element = data.type === "repeat" ? target : parentNode + } + if (freturn) { + return + } + data.handler = bindingExecutors.repeat + data.$outer = {} + var check0 = "$key" + var check1 = "$val" + if (Array.isArray($repeat)) { + $repeat.$map[data.param || "el"] = 1 + check0 = "$first" + check1 = "$last" + } + for (i = 0; v = vmodels[i++];) { + if (v.hasOwnProperty(check0) && v.hasOwnProperty(check1)) { + data.$outer = v + break + } + } + var $events = $repeat.$events + var $list = ($events || {})[subscribers] + if ($list && avalon.Array.ensure($list, data)) { + addSubscribers(data, $list) + } + if (xtype === "object") { + data.$with = true + var pool = !$events ? {} : $events.$withProxyPool || ($events.$withProxyPool = {}) + data.handler("append", $repeat, pool) + } else if ($repeat.length) { + data.handler("add", 0, $repeat.length) + } + } + + bindingExecutors.repeat = function (method, pos, el) { + if (method) { + var data = this, start, fragment + var end = data.element + var comments = getComments(data) + var parent = end.parentNode + var transation = hyperspace.cloneNode(false) + switch (method) { + case "add": //在posä½ç½®åŽæ·»åŠ el数组(pos为æ’å…¥ä½ç½®,el为è¦æ’入的个数) + var n = pos + el + var fragments = [] + var array = data.$repeat + for (var i = pos; i < n; i++) { + var proxy = array.$proxy[i] + proxy.$outer = data.$outer + shimController(data, transation, proxy, fragments) + } + parent.insertBefore(transation, comments[pos] || end) + for (i = 0; fragment = fragments[i++];) { + scanNodeArray(fragment.nodes, fragment.vmodels) + fragment.nodes = fragment.vmodels = null + } + break + case "del": //å°†posåŽçš„el个元素删掉(pos, el都是数字) + sweepNodes(comments[pos], comments[pos + el] || end) + break + case "clear": + start = comments[0] + if (start) { + sweepNodes(start, end) + } + break + case "move": + start = comments[0] + if (start) { + var signature = start.nodeValue + var rooms = [] + var room = [], + node + sweepNodes(start, end, function () { + room.unshift(this) + if (this.nodeValue === signature) { + rooms.unshift(room) + room = [] + } + }) + sortByIndex(rooms, pos) + while (room = rooms.shift()) { + while (node = room.shift()) { + transation.appendChild(node) + } + } + parent.insertBefore(transation, end) + } + break + case "append": //å°†pos的键值对从el中å–出(pos为一个普通对象,el为预先生æˆå¥½çš„代ç†VM对象池) + var pool = el + var keys = [] + fragments = [] + for (var key in pos) { //得到所有键å + if (pos.hasOwnProperty(key) && key !== "hasOwnProperty") { + keys.push(key) + } + } + if (data.sortedCallback) { //å¦‚æžœæœ‰å›žè°ƒï¼Œåˆ™è®©å®ƒä»¬æŽ’åº + var keys2 = data.sortedCallback.call(parent, keys) + if (keys2 && Array.isArray(keys2) && keys2.length) { + keys = keys2 + } + } + for (i = 0; key = keys[i++];) { + if (key !== "hasOwnProperty") { + if (!pool[key]) { + pool[key] = withProxyAgent(key, data) + } + shimController(data, transation, pool[key], fragments) + } + } + var comment = data.$with = data.clone + parent.insertBefore(comment, end) + parent.insertBefore(transation, end) + for (i = 0; fragment = fragments[i++];) { + scanNodeArray(fragment.nodes, fragment.vmodels) + fragment.nodes = fragment.vmodels = null + } + break + } + if (method === "clear") + method = "del" + var callback = data.renderedCallback || noop, + args = arguments + checkScan(parent, function () { + callback.apply(parent, args) + if (parent.oldValue && parent.tagName === "SELECT") { //fix #503 + avalon(parent).val(parent.oldValue.split(",")) + } + }, NaN) + } + } + + "with,each".replace(rword, function (name) { + bindingHandlers[name] = bindingHandlers.repeat + }) + + function shimController(data, transation, proxy, fragments) { + var content = data.template.cloneNode(true) + var nodes = avalon.slice(content.childNodes) + if (!data.$with) { + content.insertBefore(data.clone.cloneNode(false), content.firstChild) + } + transation.appendChild(content) + var nv = [proxy].concat(data.vmodels) + var fragment = { + nodes: nodes, + vmodels: nv + } + fragments.push(fragment) + } + + function getComments(data) { + var end = data.element + var signature = end.nodeValue.replace(":end", "") + var node = end.previousSibling + var array = [] + while (node) { + if (node.nodeValue === signature) { + array.unshift(node) + } + node = node.previousSibling + } + return array + } + + +//移除掉start与end之间的节点(ä¿ç•™end) + function sweepNodes(start, end, callback) { + while (true) { + var node = end.previousSibling + if (!node) + break + node.parentNode.removeChild(node) + callback && callback.call(node) + if (node === start) { + break + } + } + } + +// 为ms-each,ms-with, ms-repeat会创建一个代ç†VM, +// 通过它们ä¿æŒä¸€ä¸ªä¸‹ä¸Šæ–‡ï¼Œè®©ç”¨æˆ·èƒ½è°ƒç”¨$index,$first,$last,$remove,$key,$val,$outer等属性与方法 +// 所有代ç†VM的产生,消费,收集,存放通过xxxProxyFactory,xxxProxyAgent, recycleProxies,xxxProxyPool实现 + var eachProxyPool = [] + var withProxyPool = [] + + function eachProxyFactory() { + var source = { + $index: 0, + $first: false, + $last: false, + $map: {}, + $host: [], + $outer: {}, + $remove: avalon.noop, + el: { + get: function () { + var e = this.$events + var array = e.$index + e.$index = e.el //#817 通过$index为el收集ä¾èµ– + try { + return this.$host[this.$index] + } finally { + e.$index = array + } + }, + set: function (val) { + this.$host.set(this.$index, val) + } + } + } + + var second = { + $last: 1, + $first: 1, + $index: 1 + } + var proxy = modelFactory(source, second) + proxy.$id = generateID("$proxy$each") + return proxy + } + + function eachProxyAgent(index, host) { + var proxy = eachProxyPool.shift() + if (!proxy) { + proxy = eachProxyFactory() + } + var last = host.length - 1 + proxy.$index = index + proxy.$first = index === 0 + proxy.$last = index === last + proxy.$map = host.$map + proxy.$host = host + proxy.$remove = function () { + return host.removeAt(proxy.$index) + } + return proxy + } + + function withProxyFactory() { + var proxy = modelFactory({ + $key: "", + $outer: {}, + $host: {}, + $val: { + get: function () { + return this.$host[this.$key] + }, + set: function (val) { + this.$host[this.$key] = val + } + } + }, { + $val: 1 + }) + proxy.$id = generateID("$proxy$with") + return proxy + } + + function withProxyAgent(key, data) { + var proxy = withProxyPool.pop() + if (!proxy) { + proxy = withProxyFactory() + } + var host = data.$repeat + proxy.$key = key + proxy.$host = host + proxy.$outer = data.$outer + if (host.$events) { + proxy.$events.$val = host.$events[key] + } else { + proxy.$events = {} + } + return proxy + } + + function recycleProxies(proxies, type) { + var proxyPool = type === "each" ? eachProxyPool : withProxyPool + avalon.each(proxies, function (key, proxy) { + if (proxy.$events) { + for (var i in proxy.$events) { + if (Array.isArray(proxy.$events[i])) { + proxy.$events[i].forEach(function (data) { + if (typeof data === "object") + disposeData(data) + }) // jshint ignore:line + proxy.$events[i].length = 0 + } + } + proxy.$host = proxy.$outer = {} + if (proxyPool.unshift(proxy) > kernel.maxRepeatSize) { + proxyPool.pop() + } + } + }) + if (type === "each") + proxies.length = 0 + } + + /********************************************************************* + * å„ç§æŒ‡ä»¤ * + **********************************************************************/ +//ms-skip绑定已ç»åœ¨scanTag 方法中实现 +// bindingHandlers.text 定义在if.js + bindingExecutors.text = function (val, elem) { + val = val == null ? "" : val //ä¸åœ¨é¡µé¢ä¸Šæ˜¾ç¤ºundefined null + if (elem.nodeType === 3) { //绑定在文本节点上 + try { //IE对游离于DOM树外的节点赋值会报错 + elem.data = val + } catch (e) { + } + } else { //绑定在特性节点上 + elem.textContent = val + } + } + function parseDisplay(nodeName, val) { + //用于å–得此类标签的默认display值 + var key = "_" + nodeName + if (!parseDisplay[key]) { + var node = DOC.createElement(nodeName) + root.appendChild(node) + if (W3C) { + val = getComputedStyle(node, null).display + } else { + val = node.currentStyle.display + } + root.removeChild(node) + parseDisplay[key] = val + } + return parseDisplay[key] + } + + avalon.parseDisplay = parseDisplay + + bindingHandlers.visible = function (data, vmodels) { + var elem = avalon(data.element) + var display = elem.css("display") + if (display === "none") { + var style = elem[0].style + var has = /visibility/i.test(style.cssText) + var visible = elem.css("visibility") + style.display = "" + style.visibility = "hidden" + display = elem.css("display") + if (display === "none") { + display = parseDisplay(elem[0].nodeName) + } + style.visibility = has ? visible : "" + } + data.display = display + parseExprProxy(data.value, vmodels, data) + } + + bindingExecutors.visible = function (val, elem, data) { + elem.style.display = val ? data.display : "none" + } + bindingHandlers.widget = function (data, vmodels) { + var args = data.value.match(rword) + var elem = data.element + var widget = args[0] + var id = args[1] + if (!id || id === "$") { //没有定义或为$时,å–组件å+éšæœºæ•° + id = generateID(widget) + } + var optName = args[2] || widget //没有定义,å–组件å + var constructor = avalon.ui[widget] + if (typeof constructor === "function") { //ms-widget="tabs,tabsAAA,optname" + vmodels = elem.vmodels || vmodels + for (var i = 0, v; v = vmodels[i++];) { + if (v.hasOwnProperty(optName) && typeof v[optName] === "object") { + var vmOptions = v[optName] + vmOptions = vmOptions.$model || vmOptions + break + } + } + if (vmOptions) { + var wid = vmOptions[widget + "Id"] + if (typeof wid === "string") { + log("warning!ä¸å†æ”¯æŒ" + widget + "Id") + id = wid + } + } + //抽å–data-tooltip-textã€data-tooltip-attr属性,组æˆä¸€ä¸ªé…置对象 + var widgetData = avalon.getWidgetData(elem, widget) + data.value = [widget, id, optName].join(",") + data[widget + "Id"] = id + data.evaluator = noop + elem.msData["ms-widget-id"] = id + var options = data[widget + "Options"] = avalon.mix({}, constructor.defaults, vmOptions || {}, widgetData) + elem.removeAttribute("ms-widget") + var vmodel = constructor(elem, data, vmodels) || {} //防止组件ä¸è¿”回VM + if (vmodel.$id) { + avalon.vmodels[id] = vmodel + createSignalTower(elem, vmodel) + try { + vmodel.$init(function () { + avalon.scan(elem, [vmodel].concat(vmodels)) + if (typeof options.onInit === "function") { + options.onInit.call(elem, vmodel, options, vmodels) + } + }) + } catch (e) { + } + data.rollback = function () { + try { + vmodel.widgetElement = null + vmodel.$remove() + } catch (e) { + } + elem.msData = {} + delete avalon.vmodels[vmodel.$id] + } + addSubscribers(data, widgetList) + if (window.chrome) { + elem.addEventListener("DOMNodeRemovedFromDocument", function () { + setTimeout(removeSubscribers) + }) + } + } else { + avalon.scan(elem, vmodels) + } + } else if (vmodels.length) { //如果该组件还没有加载,那么ä¿å­˜å½“å‰çš„vmodels + elem.vmodels = vmodels + } + } + var widgetList = [] +//ä¸å­˜åœ¨ bindingExecutors.widget + /********************************************************************* + * 自带过滤器 * + **********************************************************************/ + var rscripts = /]*>([\S\s]*?)<\/script\s*>/gim + var ron = /\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g + var ropen = /<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/ig + var rsanitize = { + a: /\b(href)\=("javascript[^"]*"|'javascript[^']*')/ig, + img: /\b(src)\=("javascript[^"]*"|'javascript[^']*')/ig, + form: /\b(action)\=("javascript[^"]*"|'javascript[^']*')/ig + } + var rsurrogate = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g + var rnoalphanumeric = /([^\#-~| |!])/g; + + function numberFormat(number, decimals, point, thousands) { + //form http://phpjs.org/functions/number_format/ + //number 必需,è¦æ ¼å¼åŒ–çš„æ•°å­— + //decimals å¯é€‰ï¼Œè§„定多少个å°æ•°ä½ã€‚ + //point å¯é€‰ï¼Œè§„定用作å°æ•°ç‚¹çš„字符串(默认为 . )。 + //thousands å¯é€‰ï¼Œè§„定用作åƒä½åˆ†éš”符的字符串(默认为 , ),如果设置了该å‚数,那么所有其他å‚数都是必需的。 + number = (number + '') + .replace(/[^0-9+\-Ee.]/g, '') + var n = !isFinite(+number) ? 0 : +number, + prec = !isFinite(+decimals) ? 3 : Math.abs(decimals), + sep = thousands || ",", + dec = point || ".", + s = '', + toFixedFix = function (n, prec) { + var k = Math.pow(10, prec) + return '' + (Math.round(n * k) / k) + .toFixed(prec) + } + // Fix for IE parseFloat(0.55).toFixed(0) = 0; + s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)) + .split('.') + if (s[0].length > 3) { + s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep) + } + if ((s[1] || '') + .length < prec) { + s[1] = s[1] || '' + s[1] += new Array(prec - s[1].length + 1) + .join('0') + } + return s.join(dec) + } + + + var filters = avalon.filters = { + uppercase: function (str) { + return str.toUpperCase() + }, + lowercase: function (str) { + return str.toLowerCase() + }, + truncate: function (str, length, truncation) { + //length,新字符串长度,truncation,新字符串的结尾的字段,返回新字符串 + length = length || 30 + truncation = truncation === void(0) ? "..." : truncation + return str.length > length ? str.slice(0, length - truncation.length) + truncation : String(str) + }, + $filter: function (val) { + for (var i = 1, n = arguments.length; i < n; i++) { + var array = arguments[i] + var fn = avalon.filters[array.shift()] + if (typeof fn === "function") { + var arr = [val].concat(array) + val = fn.apply(null, arr) + } + } + return val + }, + camelize: camelize, + //https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet + // chrome + // chrome + // IE67chrome + // IE67chrome + // IE67chrome + sanitize: function (str) { + return str.replace(rscripts, "").replace(ropen, function (a, b) { + var match = a.toLowerCase().match(/<(\w+)\s/) + if (match) { //处ç†a标签的href属性,img标签的src属性,form标签的action属性 + var reg = rsanitize[match[1]] + if (reg) { + a = a.replace(reg, function (s, name, value) { + var quote = value.charAt(0) + return name + "=" + quote + "javascript:void(0)" + quote// jshint ignore:line + }) + } + } + return a.replace(ron, " ").replace(/\s+/g, " ") //移除onXXX事件 + }) + }, + escape: function (str) { + //将字符串ç»è¿‡ str 转义得到适åˆåœ¨é¡µé¢ä¸­æ˜¾ç¤ºçš„内容, ä¾‹å¦‚æ›¿æ¢ < 为 < + return String(str). + replace(/&/g, '&'). + replace(rsurrogate, function (value) { + var hi = value.charCodeAt(0) + var low = value.charCodeAt(1) + return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';' + }). + replace(rnoalphanumeric, function (value) { + return '&#' + value.charCodeAt(0) + ';' + }). + replace(//g, '>') + }, + currency: function (amount, symbol, fractionSize) { + return (symbol || "\uFFE5") + numberFormat(amount, isFinite(fractionSize) ? fractionSize : 2) + }, + number: numberFormat + } + /* + 'yyyy': 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) + 'yy': 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) + 'y': 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) + 'MMMM': Month in year (January-December) + 'MMM': Month in year (Jan-Dec) + 'MM': Month in year, padded (01-12) + 'M': Month in year (1-12) + 'dd': Day in month, padded (01-31) + 'd': Day in month (1-31) + 'EEEE': Day in Week,(Sunday-Saturday) + 'EEE': Day in Week, (Sun-Sat) + 'HH': Hour in day, padded (00-23) + 'H': Hour in day (0-23) + 'hh': Hour in am/pm, padded (01-12) + 'h': Hour in am/pm, (1-12) + 'mm': Minute in hour, padded (00-59) + 'm': Minute in hour (0-59) + 'ss': Second in minute, padded (00-59) + 's': Second in minute (0-59) + 'a': am/pm marker + 'Z': 4 digit (+sign) representation of the timezone offset (-1200-+1200) + format string can also be one of the following predefined localizable formats: + + 'medium': equivalent to 'MMM d, y h:mm:ss a' for en_US locale (e.g. Sep 3, 2010 12:05:08 pm) + 'short': equivalent to 'M/d/yy h:mm a' for en_US locale (e.g. 9/3/10 12:05 pm) + 'fullDate': equivalent to 'EEEE, MMMM d,y' for en_US locale (e.g. Friday, September 3, 2010) + 'longDate': equivalent to 'MMMM d, y' for en_US locale (e.g. September 3, 2010 + 'mediumDate': equivalent to 'MMM d, y' for en_US locale (e.g. Sep 3, 2010) + 'shortDate': equivalent to 'M/d/yy' for en_US locale (e.g. 9/3/10) + 'mediumTime': equivalent to 'h:mm:ss a' for en_US locale (e.g. 12:05:08 pm) + 'shortTime': equivalent to 'h:mm a' for en_US locale (e.g. 12:05 pm) + */ + new function () {// jshint ignore:line + function toInt(str) { + return parseInt(str, 10) || 0 + } + + function padNumber(num, digits, trim) { + var neg = "" + if (num < 0) { + neg = '-' + num = -num + } + num = "" + num + while (num.length < digits) + num = "0" + num + if (trim) + num = num.substr(num.length - digits) + return neg + num + } + + function dateGetter(name, size, offset, trim) { + return function (date) { + var value = date["get" + name]() + if (offset > 0 || value > -offset) + value += offset + if (value === 0 && offset === -12) { + value = 12 + } + return padNumber(value, size, trim) + } + } + + function dateStrGetter(name, shortForm) { + return function (date, formats) { + var value = date["get" + name]() + var get = (shortForm ? ("SHORT" + name) : name).toUpperCase() + return formats[get][value] + } + } + + function timeZoneGetter(date) { + var zone = -1 * date.getTimezoneOffset() + var paddedZone = (zone >= 0) ? "+" : "" + paddedZone += padNumber(Math[zone > 0 ? "floor" : "ceil"](zone / 60), 2) + padNumber(Math.abs(zone % 60), 2) + return paddedZone + } + + //å–得上åˆä¸‹åˆ + + function ampmGetter(date, formats) { + return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1] + } + + var DATE_FORMATS = { + yyyy: dateGetter("FullYear", 4), + yy: dateGetter("FullYear", 2, 0, true), + y: dateGetter("FullYear", 1), + MMMM: dateStrGetter("Month"), + MMM: dateStrGetter("Month", true), + MM: dateGetter("Month", 2, 1), + M: dateGetter("Month", 1, 1), + dd: dateGetter("Date", 2), + d: dateGetter("Date", 1), + HH: dateGetter("Hours", 2), + H: dateGetter("Hours", 1), + hh: dateGetter("Hours", 2, -12), + h: dateGetter("Hours", 1, -12), + mm: dateGetter("Minutes", 2), + m: dateGetter("Minutes", 1), + ss: dateGetter("Seconds", 2), + s: dateGetter("Seconds", 1), + sss: dateGetter("Milliseconds", 3), + EEEE: dateStrGetter("Day"), + EEE: dateStrGetter("Day", true), + a: ampmGetter, + Z: timeZoneGetter + } + var rdateFormat = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/ + var raspnetjson = /^\/Date\((\d+)\)\/$/ + filters.date = function (date, format) { + var locate = filters.date.locate, + text = "", + parts = [], + fn, match + format = format || "mediumDate" + format = locate[format] || format + if (typeof date === "string") { + if (/^\d+$/.test(date)) { + date = toInt(date) + } else if (raspnetjson.test(date)) { + date = +RegExp.$1 + } else { + var trimDate = date.trim() + var dateArray = [0, 0, 0, 0, 0, 0, 0] + var oDate = new Date(0) + //å–得年月日 + trimDate = trimDate.replace(/^(\d+)\D(\d+)\D(\d+)/, function (_, a, b, c) { + var array = c.length === 4 ? [c, a, b] : [a, b, c] + dateArray[0] = toInt(array[0]) //å¹´ + dateArray[1] = toInt(array[1]) - 1 //月 + dateArray[2] = toInt(array[2]) //æ—¥ + return "" + }) + var dateSetter = oDate.setFullYear + var timeSetter = oDate.setHours + trimDate = trimDate.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/, function (_, a, b, c, d) { + dateArray[3] = toInt(a) //å°æ—¶ + dateArray[4] = toInt(b) //分钟 + dateArray[5] = toInt(c) //秒 + if (d) { //毫秒 + dateArray[6] = Math.round(parseFloat("0." + d) * 1000) + } + return "" + }) + var tzHour = 0 + var tzMin = 0 + trimDate = trimDate.replace(/Z|([+-])(\d\d):?(\d\d)/, function (z, symbol, c, d) { + dateSetter = oDate.setUTCFullYear + timeSetter = oDate.setUTCHours + if (symbol) { + tzHour = toInt(symbol + c) + tzMin = toInt(symbol + d) + } + return "" + }) + + dateArray[3] -= tzHour + dateArray[4] -= tzMin + dateSetter.apply(oDate, dateArray.slice(0, 3)) + timeSetter.apply(oDate, dateArray.slice(3)) + date = oDate + } + } + if (typeof date === "number") { + date = new Date(date) + } + if (avalon.type(date) !== "date") { + return + } + while (format) { + match = rdateFormat.exec(format) + if (match) { + parts = parts.concat(match.slice(1)) + format = parts.pop() + } else { + parts.push(format) + format = null + } + } + parts.forEach(function (value) { + fn = DATE_FORMATS[value] + text += fn ? fn(date, locate) : value.replace(/(^'|'$)/g, "").replace(/''/g, "'") + }) + return text + } + var locate = { + AMPMS: { + 0: "上åˆ", + 1: "下åˆ" + }, + DAY: { + 0: "星期日", + 1: "星期一", + 2: "星期二", + 3: "星期三", + 4: "星期四", + 5: "星期五", + 6: "星期六" + }, + MONTH: { + 0: "1月", + 1: "2月", + 2: "3月", + 3: "4月", + 4: "5月", + 5: "6月", + 6: "7月", + 7: "8月", + 8: "9月", + 9: "10月", + 10: "11月", + 11: "12月" + }, + SHORTDAY: { + "0": "周日", + "1": "周一", + "2": "周二", + "3": "周三", + "4": "周四", + "5": "周五", + "6": "周六" + }, + fullDate: "yå¹´M月dæ—¥EEEE", + longDate: "yå¹´M月dæ—¥", + medium: "yyyy-M-d H:mm:ss", + mediumDate: "yyyy-M-d", + mediumTime: "H:mm:ss", + "short": "yy-M-d ah:mm", + shortDate: "yy-M-d", + shortTime: "ah:mm" + } + locate.SHORTMONTH = locate.MONTH + filters.date.locate = locate + }// jshint ignore:line + /********************************************************************* + * AMD加载器 * + **********************************************************************/ +//https://www.devbridge.com/articles/understanding-amd-requirejs/ +//http://maxogden.com/nested-dependencies.html + var modules = avalon.modules = { + "domReady!": { + exports: avalon, + state: 3 + }, + "avalon": { + exports: avalon, + state: 4 + } + } +//Object(modules[id]).state拥有如下值 +// undefined 没有定义 +// 1(send) å·²ç»å‘出请求 +// 2(loading) å·²ç»è¢«æ‰§è¡Œä½†è¿˜æ²¡æœ‰æ‰§è¡Œå®Œæˆï¼Œåœ¨è¿™ä¸ªé˜¶æ®µdefine方法会被执行 +// 3(loaded) 执行完毕,通过onload/onreadystatechange回调判定,在这个阶段checkDeps方法会执行 +// 4(execute) å…¶ä¾èµ–也执行完毕, 值放到exports对象上,在这个阶段fireFactory方法会执行 + modules.exports = modules.avalon + + new function () {// jshint ignore:line + var loadings = [] //正在加载中的模å—列表 + var factorys = [] //放置define方法的factory函数 + var rjsext = /\.js$/i + + function makeRequest(name, config) { +//1. 去掉资æºå‰ç¼€ + var res = "js" + name = name.replace(/^(\w+)\!/, function (a, b) { + res = b + return "" + }) + if (res === "ready") { + log("debug: ready!å·²ç»è¢«åºŸå¼ƒï¼Œè¯·ä½¿ç”¨domReady!") + res = "domReady" + } +//2. 去掉querystring, hash + var query = "" + name = name.replace(rquery, function (a) { + query = a + return "" + }) + //3. 去掉扩展å + var suffix = "." + res + var ext = /js|css/.test(suffix) ? suffix : "" + name = name.replace(/\.[a-z0-9]+$/g, function (a) { + if (a === suffix) { + ext = a + return "" + } else { + return a + } + }) + var req = avalon.mix({ + query: query, + ext: ext, + res: res, + name: name, + toUrl: toUrl + }, config) + req.toUrl(name) + return req + } + + function fireRequest(req) { + var name = req.name + var res = req.res + //1. 如果该模å—å·²ç»å‘出请求,直接返回 + var module = modules[name] + var urlNoQuery = name && req.urlNoQuery + if (module && module.state >= 1) { + return name + } + module = modules[urlNoQuery] + if (module && module.state >= 3) { + innerRequire(module.deps || [], module.factory, urlNoQuery) + return urlNoQuery + } + if (name && !module) { + module = modules[urlNoQuery] = { + id: urlNoQuery, + state: 1 //send + } + var wrap = function (obj) { + resources[res] = obj + obj.load(name, req, function (a) { + if (arguments.length && a !== void 0) { + module.exports = a + } + module.state = 4 + checkDeps() + }) + } + + if (!resources[res]) { + innerRequire([res], wrap) + } else { + wrap(resources[res]) + } + } + return name ? urlNoQuery : res + "!" + } + +//核心API之一 require + var requireQueue = [] + var isUserFirstRequire = false + innerRequire = avalon.require = function (array, factory, parentUrl, defineConfig) { + if (!isUserFirstRequire) { + requireQueue.push(avalon.slice(arguments)) + if (arguments.length <= 2) { + isUserFirstRequire = true + var queue = requireQueue.splice(0, requireQueue.length), args + while (args = queue.shift()) { + innerRequire.apply(null, args) + } + } + return + } + + if (!Array.isArray(array)) { + avalon.error("require方法的第一个å‚数应为数组 " + array) + } + var deps = [] // 放置所有ä¾èµ–项的完整路径 + var uniq = createMap() + var id = parentUrl || "callback" + setTimeout("1")// jshint ignore:line + defineConfig = defineConfig || createMap() + defineConfig.baseUrl = kernel.baseUrl + var isBuilt = !!defineConfig.built + if (parentUrl) { + defineConfig.parentUrl = parentUrl.substr(0, parentUrl.lastIndexOf("/")) + defineConfig.mapUrl = parentUrl.replace(rjsext, "") + } + if (isBuilt) { + var req = makeRequest(defineConfig.defineName, defineConfig) + id = req.urlNoQuery + } else { + array.forEach(function (name) { + var req = makeRequest(name, defineConfig) + var url = fireRequest(req) //加载资æºï¼Œå¹¶è¿”回该资æºçš„å®Œæ•´åœ°å€ + if (url) { + if (!uniq[url]) { + deps.push(url) + uniq[url] = "å¸å¾’正美" //åŽ»é‡ + } + } + }) + } + + var module = modules[id] + if (!module || module.state !== 4) { + modules[id] = { + id: id, + deps: isBuilt ? array.concat() : deps, + factory: factory || noop, + state: 3 + } + } + if (!module) { + //如果此模å—是定义在å¦ä¸€ä¸ªJS文件中, 那必须等该文件加载完毕, æ‰èƒ½æ”¾åˆ°æ£€æµ‹åˆ—队中 + loadings.push(id) + } + checkDeps() + } + +//核心API之二 require + innerRequire.define = function (name, deps, factory) { //模å—å,ä¾èµ–列表,模å—本身 + if (typeof name !== "string") { + factory = deps + deps = name + name = "anonymous" + } + if (!Array.isArray(deps)) { + factory = deps + deps = [] + } + var config = { + built: !isUserFirstRequire, //用r.js打包åŽ,所有define会放到requirejsä¹‹å‰ + defineName: name + } + var args = [deps, factory, config] + factory.require = function (url) { + args.splice(2, 0, url) + if (modules[url]) { + modules[url].state = 3 //loaded + var isCycle = false + try { + isCycle = checkCycle(modules[url].deps, url) + } catch (e) { + } + if (isCycle) { + avalon.error(url + "模å—与之å‰çš„模å—存在循环ä¾èµ–,请ä¸è¦ç›´æŽ¥ç”¨script标签引入" + url + "模å—") + } + } + delete factory.require //释放内存 + innerRequire.apply(null, args) //0,1,2 --> 1,2,0 + } +//æ ¹æ®æ ‡å‡†,所有éµå¾ªW3C标准的æµè§ˆå™¨,script标签会按标签的出现顺åºæ‰§è¡Œã€‚ +//è€çš„æµè§ˆå™¨ä¸­ï¼ŒåŠ è½½ä¹Ÿæ˜¯æŒ‰é¡ºåºçš„:一个文件下载完æˆåŽï¼Œæ‰å¼€å§‹ä¸‹è½½ä¸‹ä¸€ä¸ªæ–‡ä»¶ã€‚ +//较新的æµè§ˆå™¨ä¸­ï¼ˆIE8+ ã€FireFox3.5+ ã€Chrome4+ ã€Safari4+),为了å‡å°è¯·æ±‚时间以优化体验, +//下载å¯ä»¥æ˜¯å¹¶è¡Œçš„,但是执行顺åºè¿˜æ˜¯æŒ‰ç…§æ ‡ç­¾å‡ºçŽ°çš„顺åºã€‚ +//但如果script标签是动æ€æ’入的, 就未必按照先请求先执行的原则了,目测åªæœ‰firefoxéµå®ˆ +//唯一比较一致的是,IE10+åŠå…¶ä»–标准æµè§ˆå™¨,一旦开始解æžè„šæœ¬, 就会一直堵在那里,直接脚本解æžå®Œæ¯• +//亦å³ï¼Œå…ˆè¿›å…¥loading阶段的script标签(模å—)必然会先进入loaded阶段 + var url = config.built ? "unknown" : getCurrentScript() + if (url) { + var module = modules[url] + if (module) { + module.state = 2 + } + factory.require(url) + } else {//åˆå¹¶å‰åŽçš„safari,åˆå¹¶åŽçš„IE6-9走此分支 + factorys.push(factory) + } + } +//核心API之三 require.config(settings) + innerRequire.config = kernel + //核心API之四 define.amd 标识其符åˆAMD规范 + innerRequire.define.amd = modules + + //==========================对用户é…置项进行å†åŠ å·¥========================== + var allpaths = kernel["orig.paths"] = createMap() + var allmaps = kernel["orig.map"] = createMap() + var allpackages = kernel["packages"] = [] + var allargs = kernel["orig.args"] = createMap() + avalon.mix(plugins, { + paths: function (hash) { + avalon.mix(allpaths, hash) + kernel.paths = makeIndexArray(allpaths) + }, + map: function (hash) { + avalon.mix(allmaps, hash) + var list = makeIndexArray(allmaps, 1, 1) + avalon.each(list, function (_, item) { + item.val = makeIndexArray(item.val) + }) + kernel.map = list + }, + packages: function (array) { + array = array.concat(allpackages) + var uniq = createMap() + var ret = [] + for (var i = 0, pkg; pkg = array[i++];) { + pkg = typeof pkg === "string" ? {name: pkg} : pkg + var name = pkg.name + if (!uniq[name]) { + var url = joinPath(pkg.location || name, pkg.main || "main") + url = url.replace(rjsext, "") + ret.push(pkg) + uniq[name] = pkg.location = url + pkg.reg = makeMatcher(name) + } + } + kernel.packages = ret.sort() + }, + urlArgs: function (hash) { + if (typeof hash === "string") { + hash = {"*": hash} + } + avalon.mix(allargs, hash) + kernel.urlArgs = makeIndexArray(allargs, 1) + }, + baseUrl: function (url) { + if (!isAbsUrl(url)) { + var baseElement = head.getElementsByTagName("base")[0] + if (baseElement) { + head.removeChild(baseElement) + } + var node = DOC.createElement("a") + node.href = url + url = node.href + if (baseElement) { + head.insertBefore(baseElement, head.firstChild) + } + } + if (url.length > 3) + kernel.baseUrl = url + }, + shim: function (obj) { + for (var i in obj) { + var value = obj[i] + if (Array.isArray(value)) { + value = obj[i] = { + deps: value + } + } + if (!value.exportsFn && (value.exports || value.init)) { + value.exportsFn = makeExports(value) + } + } + kernel.shim = obj + } + + }) + + + //==============================内部方法================================= + function checkCycle(deps, nick) { + //检测是å¦å­˜åœ¨å¾ªçŽ¯ä¾èµ– + for (var i = 0, id; id = deps[i++];) { + if (modules[id].state !== 4 && + (id === nick || checkCycle(modules[id].deps, nick))) { + return true + } + } + } + + function checkFail(node, onError) { + var id = trimQuery(node.src) //检测是å¦æ­»é“¾ + node.onload = node.onerror = null + if (onError) { + setTimeout(function () { + head.removeChild(node) + node = null // 处ç†æ—§å¼IE下的循环引用问题 + }) + log("debug: 加载 " + id + " 失败" + onError + " " + (!modules[id].state)) + } else { + return true + } + } + + function checkDeps() { + //检测此JS模å—çš„ä¾èµ–是å¦éƒ½å·²å®‰è£…完毕,是则安装自身 + loop: for (var i = loadings.length, id; id = loadings[--i];) { + var obj = modules[id], + deps = obj.deps + if (!deps) + continue + for (var j = 0, key; key = deps[j]; j++) { + if (Object(modules[key]).state !== 4) { + continue loop + } + } + //如果deps是空对象或者其ä¾èµ–的模å—的状æ€éƒ½æ˜¯2 + if (obj.state !== 4) { + loadings.splice(i, 1) //必须先移除å†å®‰è£…,防止在IE下DOM树建完åŽæ‰‹åŠ¨åˆ·æ–°é¡µé¢ï¼Œä¼šå¤šæ¬¡æ‰§è¡Œå®ƒ + fireFactory(obj.id, obj.deps, obj.factory) + checkDeps() //如果æˆåŠŸ,则å†æ‰§è¡Œä¸€æ¬¡,以防有些模å—就差本模å—没有安装好 + } + } + } + + function loadJS(url, id, callback) { + //通过scriptèŠ‚ç‚¹åŠ è½½ç›®æ ‡æ¨¡å— + var node = DOC.createElement("script") + node.className = subscribers //让getCurrentScriptåªå¤„ç†ç±»å为subscribersçš„script节点 + node.onload = function () { + var factory = factorys.pop() + factory && factory.require(id) + if (callback) { + callback() + } + log("debug: å·²æˆåŠŸåŠ è½½ " + url) + id && loadings.push(id) + checkDeps() + } + node.onerror = function () { + checkFail(node, true) + } + + head.insertBefore(node, head.firstChild) //chrome下第二个å‚æ•°ä¸èƒ½ä¸ºnull + node.src = url //æ’入到head的第一个节点å‰ï¼Œé˜²æ­¢IE6下head标签没闭åˆå‰ä½¿ç”¨appendChild抛错 + log("debug: 正准备加载 " + url) //æ›´é‡è¦çš„是IE6下å¯ä»¥æ”¶çª„getCurrentScript的寻找范围 + } + + var resources = innerRequire.plugins = { + //三大常用资æºæ’件 js!, css!, text!, ready! + ready: { + load: noop + }, + js: { + load: function (name, req, onLoad) { + var url = req.url + var id = req.urlNoQuery + var shim = kernel.shim[name.replace(rjsext, "")] + if (shim) { //shim机制 + innerRequire(shim.deps || [], function () { + var args = avalon.slice(arguments) + loadJS(url, id, function () { + onLoad(shim.exportsFn ? shim.exportsFn.apply(0, args) : void 0) + }) + }) + } else { + loadJS(url, id) + } + } + }, + css: { + load: function (name, req, onLoad) { + var url = req.url + head.insertAdjacentHTML("afterBegin", '') + log("debug: å·²æˆåŠŸåŠ è½½ " + url) + onLoad() + } + }, + text: { + load: function (name, req, onLoad) { + var url = req.url + var xhr = getXHR() + xhr.onload = function () { + var status = xhr.status; + if (status > 399 && status < 600) { + avalon.error(url + " 对应资æºä¸å­˜åœ¨æˆ–æ²¡æœ‰å¼€å¯ CORS") + } else { + log("debug: å·²æˆåŠŸåŠ è½½ " + url) + onLoad(xhr.responseText) + } + } + xhr.open("GET", url, true) + if ("withCredentials" in xhr) {//这是处ç†è·¨åŸŸ + xhr.withCredentials = true + } + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")//告诉åŽç«¯è¿™æ˜¯AJAX请求 + xhr.send() + log("debug: 正准备加载 " + url) + } + } + } + innerRequire.checkDeps = checkDeps + + var rquery = /(\?[^#]*)$/ + + function trimQuery(url) { + return (url || "").replace(rquery, "") + } + + function isAbsUrl(path) { + //http://stackoverflow.com/questions/10687099/how-to-test-if-a-url-string-is-absolute-or-relative + return /^(?:[a-z]+:)?\/\//i.test(String(path)) + } + + + function getCurrentScript() { + // inspireb by https://github.com/samyk/jiagra/blob/master/jiagra.js + var stack + try { + a.b.c() //强制报错,以便æ•èŽ·e.stack + } catch (e) { //safari5çš„sourceURL,firefoxçš„fileName,它们的效果与e.stackä¸ä¸€æ · + stack = e.stack + } + if (stack) { + /**e.stack最åŽä¸€è¡Œåœ¨æ‰€æœ‰æ”¯æŒçš„æµè§ˆå™¨å¤§è‡´å¦‚下: + *chrome23: + * at http://113.93.50.63/data.js:4:1 + *firefox17: + *@http://113.93.50.63/query.js:4 + *opera12:http://www.oldapps.com/opera.php?system=Windows_XP + *@http://113.93.50.63/data.js:4 + *IE10: + * at Global code (http://113.93.50.63/data.js:4:1) + * //firefox4+ å¯ä»¥ç”¨document.currentScript + */ + stack = stack.split(/[@ ]/g).pop() //å–得最åŽä¸€è¡Œ,最åŽä¸€ä¸ªç©ºæ ¼æˆ–@之åŽçš„部分 + stack = stack[0] === "(" ? stack.slice(1, -1) : stack.replace(/\s/, "") //去掉æ¢è¡Œç¬¦ + return trimQuery(stack.replace(/(:\d+)?:\d+$/i, "")) //去掉行å·ä¸Žæˆ–许存在的出错字符起始ä½ç½® + } + var nodes = head.getElementsByTagName("script") //åªåœ¨head标签中寻找 + for (var i = nodes.length, node; node = nodes[--i];) { + if (node.className === subscribers && node.readyState === "interactive") { + var url = node.src + return node.className = trimQuery(url) + } + } + } + + var rcallback = /^callback\d+$/ + + function fireFactory(id, deps, factory) { + var module = Object(modules[id]) + module.state = 4 + for (var i = 0, array = [], d; d = deps[i++];) { + if (d === "exports") { + var obj = module.exports || (module.exports = createMap()) + array.push(obj) + } else { + array.push(modules[d].exports) + } + } + try { + var ret = factory.apply(window, array) + } catch (e) { + log("执行[" + id + "]模å—çš„factory抛错: " + e) + } + if (ret !== void 0) { + module.exports = ret + } + if (rcallback.test(id)) { + delete modules[id] + } + delete module.factory + return ret + } + + function toUrl(id) { + if (id.indexOf(this.res + "!") === 0) { + id = id.slice(this.res.length + 1) //处ç†define("css!style",[], function(){})的情况 + } + var url = id + //1. 是å¦å‘½ä¸­pathsé…置项 + var usePath = 0 + var baseUrl = this.baseUrl + var rootUrl = this.parentUrl || baseUrl + eachIndexArray(id, kernel.paths, function (value, key) { + url = url.replace(key, value) + usePath = 1 + }) + //2. 是å¦å‘½ä¸­packagesé…置项 + if (!usePath) { + eachIndexArray(id, kernel.packages, function (value, key, item) { + url = url.replace(item.name, item.location) + }) + } + //3. 是å¦å‘½ä¸­mapé…置项 + if (this.mapUrl) { + eachIndexArray(this.mapUrl, kernel.map, function (array) { + eachIndexArray(url, array, function (mdValue, mdKey) { + url = url.replace(mdKey, mdValue) + rootUrl = baseUrl + }) + }) + } + var ext = this.ext + if (ext && usePath && url.slice(-ext.length) === ext) { + url = url.slice(0, -ext.length) + } + //4. 转æ¢ä¸ºç»å¯¹è·¯å¾„ + if (!isAbsUrl(url)) { + rootUrl = this.built || /^\w/.test(url) ? baseUrl : rootUrl + url = joinPath(rootUrl, url) + } + //5. 还原扩展å,query + var urlNoQuery = url + ext + url = urlNoQuery + this.query + //6. 处ç†urlArgs + eachIndexArray(id, kernel.urlArgs, function (value) { + url += (url.indexOf("?") === -1 ? "?" : "&") + value; + }) + this.url = url + return this.urlNoQuery = urlNoQuery + } + + function makeIndexArray(hash, useStar, part) { + //创建一个ç»è¿‡ç‰¹æ®Šç®—法排好åºçš„数组 + var index = hash2array(hash, useStar, part) + index.sort(descSorterByName) + return index + } + + function makeMatcher(prefix) { + return new RegExp('^' + prefix + '(/|$)') + } + + function makeExports(value) { + return function () { + var ret + if (value.init) { + ret = value.init.apply(window, arguments) + } + return ret || (value.exports && getGlobal(value.exports)) + } + } + + + function hash2array(hash, useStar, part) { + var array = []; + for (var key in hash) { + // if (hash.hasOwnProperty(key)) {//hash是由createMap创建没有hasOwnProperty + var item = { + name: key, + val: hash[key] + } + array.push(item) + item.reg = key === "*" && useStar ? /^/ : makeMatcher(key) + if (part && key !== "*") { + item.reg = new RegExp('\/' + key.replace(/^\//, "") + '(/|$)') + } + // } + } + return array + } + + function eachIndexArray(moduleID, array, matcher) { + array = array || [] + for (var i = 0, el; el = array[i++];) { + if (el.reg.test(moduleID)) { + matcher(el.val, el.name, el) + return false + } + } + } + + // æ ¹æ®å…ƒç´ çš„name项进行数组字符数逆åºçš„排åºå‡½æ•° + function descSorterByName(a, b) { + var aaa = a.name + var bbb = b.name + if (bbb === "*") { + return -1 + } + if (aaa === "*") { + return 1 + } + return bbb.length - aaa.length + } + + var rdeuce = /\/\w+\/\.\./ + + function joinPath(a, b) { + if (a.charAt(a.length - 1) !== "/") { + a += "/" + } + if (b.slice(0, 2) === "./") { //相对于兄弟路径 + return a + b.slice(2) + } + if (b.slice(0, 2) === "..") { //相对于父路径 + a += b + while (rdeuce.test(a)) { + a = a.replace(rdeuce, "") + } + return a + } + if (b.slice(0, 1) === "/") { + return a + b.slice(1) + } + return a + b + } + + function getGlobal(value) { + if (!value) { + return value + } + var g = window + value.split(".").forEach(function (part) { + g = g[part] + }) + return g + } + + var mainNode = DOC.scripts[DOC.scripts.length - 1] + var dataMain = mainNode.getAttribute("data-main") + if (dataMain) { + plugins.baseUrl(dataMain) + var href = kernel.baseUrl + kernel.baseUrl = href.slice(0, href.lastIndexOf("/") + 1) + loadJS(href.replace(rjsext, "") + ".js") + } else { + var loaderUrl = trimQuery(mainNode.src) + kernel.baseUrl = loaderUrl.slice(0, loaderUrl.lastIndexOf("/") + 1) + } + }// jshint ignore:line + + /********************************************************************* + * DOMReady * + **********************************************************************/ + var readyList = [], isReady + var fireReady = function (fn) { + isReady = true + if (innerRequire) { + modules["domReady!"].state = 4 + innerRequire.checkDeps() + } + while (fn = readyList.shift()) { + fn(avalon) + } + } + + + if (DOC.readyState === "complete") { + setTimeout(fireReady) //如果在domReady之外加载 + } else { + DOC.addEventListener("DOMContentLoaded", fireReady) + } + window.addEventListener("load", fireReady) + avalon.ready = function (fn) { + if (!isReady) { + readyList.push(fn) + } else { + fn(avalon) + } + } + avalon.config({ + loader: true + }) + avalon.ready(function () { + avalon.scan(DOC.body) + }) + +// Register as a named AMD module, since avalon can be concatenated with other +// files that may use define, but not via a proper concatenation script that +// understands anonymous AMD modules. A named AMD is safest and most robust +// way to register. Lowercase avalon is used because AMD module names are +// derived from file names, and Avalon is normally delivered in a lowercase +// file name. Do this after creating the global so that if an AMD module wants +// to call noConflict to hide this version of avalon, it will work. + +// Note that for maximum portability, libraries that are not avalon should +// declare themselves as anonymous modules, and avoid setting a global if an +// AMD loader is present. avalon is a special case. For more information, see +// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon + if (typeof define === "function" && define.amd) { + define("avalon", [], function () { + return avalon + }) + } +// Map over avalon in case of overwrite + var _avalon = window.avalon + avalon.noConflict = function (deep) { + if (deep && window.avalon === avalon) { + window.avalon = _avalon + } + return avalon + } +// Expose avalon identifiers, even in AMD +// and CommonJS for browser emulators + if (noGlobal === void 0) { + window.avalon = avalon + } + + window._injectTer = function (code) { + return eval(code) + } + + return avalon + +})); \ No newline at end of file diff --git a/common/src/main/webapp/thirdparty/bootbox/LICENSE.md b/common/src/main/webapp/thirdparty/bootbox/LICENSE.md new file mode 100644 index 00000000..8219f598 --- /dev/null +++ b/common/src/main/webapp/thirdparty/bootbox/LICENSE.md @@ -0,0 +1,23 @@ +# License + +(The MIT License) + +Copyright (C) 2011-2014 by Nick Payne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE diff --git a/common/src/main/webapp/thirdparty/bootbox/README.md b/common/src/main/webapp/thirdparty/bootbox/README.md new file mode 100644 index 00000000..eedb7210 --- /dev/null +++ b/common/src/main/webapp/thirdparty/bootbox/README.md @@ -0,0 +1,91 @@ +# Bootbox - Bootstrap powered alert, confirm and flexible dialog boxes + +Please see http://bootboxjs.com for full usage instructions, or head over to http://paynedigital.com/bootbox for +the original writeup about the project. + +## Contact + +The easiest thing is to [find me on twitter @makeusabrew](http://twitter.com/makeusabrew). + +## Contributing + +Please see the [CONTRIBUTING](https://github.com/makeusabrew/bootbox/blob/master/CONTRIBUTING.md) file for guidelines. + +## Running Tests [![Build Status](https://api.travis-ci.org/makeusabrew/bootbox.svg)](http://travis-ci.org/makeusabrew/bootbox) + +Tests are run using [Karma](http://karma-runner.github.io/0.8/index.html) using the Mocha test adapter. +To run the tests yourself, simply run ```npm install``` within the project followed by ```npm test```. +Please note that this will require [PhantomJS](http://phantomjs.org/) being installed and in your path - if +it is not, you may run the tests and capture browsers manually by running ```karma start``` from the root +of the project. + +The project is also hosted on [Travis CI](https://travis-ci.org/makeusabrew/bootbox) - when submitting +pull requests **please** ensure your tests pass as failing requests will be rejected. See the +[CONTRIBUTING](https://github.com/makeusabrew/bootbox/blob/master/CONTRIBUTING.md) file for more information. + +## Building a minified release + +The repository no longer contains a minified bootbox.min.js file - this is now only generated +[for releases](https://github.com/makeusabrew/bootbox/releases). To build your own minified copy +for use in development simply run ```npm install``` if you haven't already, followed by ```grunt uglify```. +This will generate a bootbox.min.js file in your working directory. + +## A note on Bootstrap dependencies + +Bootbox **4.0.0** is the first release to support Bootstrap 3.0.0. + +Bootbox **3.3.0** is the *last* release to support Bootstrap 2.2.x. + +Much more dependency information can be found [on the Bootbox website](http://bootboxjs.com/#dependencies). + +### Roadmap + +The latest major release of Bootbox - 4.0.0 - involved a total rewrite of the +internal code and introduced an entirely new public API. It has not re-implemented +some functionality from the 3.x series as of yet; this will be addressed in the +coming weeks in the form of new minor releases; +[a task list for 4.3.0 is available](https://github.com/makeusabrew/bootbox/issues/220) - +please feel free to add feedback and requests. + +There is no new major (e.g. 5.x) release on the roadmap at present. + +## Latest Release: 4.2.0 + +* Add Swedish locale +* Add Latvian locale +* Add Turkish locale +* Add Hebrew locale +* Add password input type +* Add textarea input type +* Add date input type +* Add time input type +* Add number input type +* Support DOM selectors for container argument +* UMD support +* Better support on mobile devices + +For a full list of releases and changes please see [the changelog](https://github.com/makeusabrew/bootbox/blob/master/CHANGELOG.md). + +## License + +(The MIT License) + +Copyright (C) 2011-2014 by Nick Payne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE diff --git a/common/src/main/webapp/thirdparty/bootbox/bootbox.min.js b/common/src/main/webapp/thirdparty/bootbox/bootbox.min.js new file mode 100644 index 00000000..a7ea24fe --- /dev/null +++ b/common/src/main/webapp/thirdparty/bootbox/bootbox.min.js @@ -0,0 +1,6 @@ +/** + * bootbox.js v4.3.0 + * + * http://bootboxjs.com/license.txt + */ +!function(a,b){"use strict";"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.bootbox=b(a.jQuery)}(this,function a(b,c){"use strict";function d(a){var b=q[o.locale];return b?b[a]:q.en[a]}function e(a,c,d){a.stopPropagation(),a.preventDefault();var e=b.isFunction(d)&&d(a)===!1;e||c.modal("hide")}function f(a){var b,c=0;for(b in a)c++;return c}function g(a,c){var d=0;b.each(a,function(a,b){c(a,b,d++)})}function h(a){var c,d;if("object"!=typeof a)throw new Error("Please supply an object of options");if(!a.message)throw new Error("Please specify a message");return a=b.extend({},o,a),a.buttons||(a.buttons={}),a.backdrop=a.backdrop?"static":!1,c=a.buttons,d=f(c),g(c,function(a,e,f){if(b.isFunction(e)&&(e=c[a]={callback:e}),"object"!==b.type(e))throw new Error("button with key "+a+" must be an object");e.label||(e.label=a),e.className||(e.className=2>=d&&f===d-1?"btn-primary":"btn-default")}),a}function i(a,b){var c=a.length,d={};if(1>c||c>2)throw new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function j(a,c,d){return b.extend(!0,{},a,i(c,d))}function k(a,b,c,d){var e={className:"bootbox-"+a,buttons:l.apply(null,b)};return m(j(e,d,c),b)}function l(){for(var a={},b=0,c=arguments.length;c>b;b++){var e=arguments[b],f=e.toLowerCase(),g=e.toUpperCase();a[f]={label:d(g)}}return a}function m(a,b){var d={};return g(b,function(a,b){d[b]=!0}),g(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var n={dialog:"",header:"",footer:"",closeButton:"",form:"
",inputs:{text:"",textarea:"",email:"",select:"",checkbox:"
",date:"",time:"",number:"",password:""}},o={locale:"en",backdrop:!0,animate:!0,className:null,closeButton:!0,show:!0,container:"body"},p={};p.alert=function(){var a;if(a=k("alert",["ok"],["message","callback"],arguments),a.callback&&!b.isFunction(a.callback))throw new Error("alert requires callback property to be a function when provided");return a.buttons.ok.callback=a.onEscape=function(){return b.isFunction(a.callback)?a.callback():!0},p.dialog(a)},p.confirm=function(){var a;if(a=k("confirm",["cancel","confirm"],["message","callback"],arguments),a.buttons.cancel.callback=a.onEscape=function(){return a.callback(!1)},a.buttons.confirm.callback=function(){return a.callback(!0)},!b.isFunction(a.callback))throw new Error("confirm requires a callback");return p.dialog(a)},p.prompt=function(){var a,d,e,f,h,i,k;if(f=b(n.form),d={className:"bootbox-prompt",buttons:l("cancel","confirm"),value:"",inputType:"text"},a=m(j(d,arguments,["title","callback"]),["cancel","confirm"]),i=a.show===c?!0:a.show,a.message=f,a.buttons.cancel.callback=a.onEscape=function(){return a.callback(null)},a.buttons.confirm.callback=function(){var c;switch(a.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=h.val();break;case"checkbox":var d=h.find("input:checked");c=[],g(d,function(a,d){c.push(b(d).val())})}return a.callback(c)},a.show=!1,!a.title)throw new Error("prompt requires a title");if(!b.isFunction(a.callback))throw new Error("prompt requires a callback");if(!n.inputs[a.inputType])throw new Error("invalid prompt type");switch(h=b(n.inputs[a.inputType]),a.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":h.val(a.value);break;case"select":var o={};if(k=a.inputOptions||[],!k.length)throw new Error("prompt with select requires options");g(k,function(a,d){var e=h;if(d.value===c||d.text===c)throw new Error("given options in wrong format");d.group&&(o[d.group]||(o[d.group]=b("").attr("label",d.group)),e=o[d.group]),e.append("")}),g(o,function(a,b){h.append(b)}),h.val(a.value);break;case"checkbox":var q=b.isArray(a.value)?a.value:[a.value];if(k=a.inputOptions||[],!k.length)throw new Error("prompt with checkbox requires options");if(!k[0].value||!k[0].text)throw new Error("given options in wrong format");h=b("
"),g(k,function(c,d){var e=b(n.inputs[a.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),g(q,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),h.append(e)})}return a.placeholder&&h.attr("placeholder",a.placeholder),a.pattern&&h.attr("pattern",a.pattern),f.append(h),f.on("submit",function(a){a.preventDefault(),a.stopPropagation(),e.find(".btn-primary").click()}),e=p.dialog(a),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){h.focus()}),i===!0&&e.modal("show"),e},p.dialog=function(a){a=h(a);var c=b(n.dialog),d=c.find(".modal-dialog"),f=c.find(".modal-body"),i=a.buttons,j="",k={onEscape:a.onEscape};if(g(i,function(a,b){j+="",k[a]=b.callback}),f.find(".bootbox-body").html(a.message),a.animate===!0&&c.addClass("fade"),a.className&&c.addClass(a.className),"large"===a.size&&d.addClass("modal-lg"),"small"===a.size&&d.addClass("modal-sm"),a.title&&f.before(n.header),a.closeButton){var l=b(n.closeButton);a.title?c.find(".modal-header").prepend(l):l.css("margin-top","-10px").prependTo(f)}return a.title&&c.find(".modal-title").html(a.title),j.length&&(f.after(n.footer),c.find(".modal-footer").html(j)),c.on("hidden.bs.modal",function(a){a.target===this&&c.remove()}),c.on("shown.bs.modal",function(){c.find(".btn-primary:first").focus()}),c.on("escape.close.bb",function(a){k.onEscape&&e(a,c,k.onEscape)}),c.on("click",".modal-footer button",function(a){var d=b(this).data("bb-handler");e(a,c,k[d])}),c.on("click",".bootbox-close-button",function(a){e(a,c,k.onEscape)}),c.on("keyup",function(a){27===a.which&&c.trigger("escape.close.bb")}),b(a.container).append(c),c.modal({backdrop:a.backdrop,keyboard:!1,show:!1}),a.show&&c.modal("show"),c},p.setDefaults=function(){var a={};2===arguments.length?a[arguments[0]]=arguments[1]:a=arguments[0],b.extend(o,a)},p.hideAll=function(){return b(".bootbox").modal("hide"),p};var q={br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},cs:{OK:"OK",CANCEL:"ZruÅ¡it",CONFIRM:"Potvrdit"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},el:{OK:"Εντάξει",CANCEL:"ΑκÏÏωση",CONFIRM:"Επιβεβαίωση"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},et:{OK:"OK",CANCEL:"Katkesta",CONFIRM:"OK"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"×ישור",CANCEL:"ביטול",CONFIRM:"×ישור"},id:{OK:"OK",CANCEL:"Batal",CONFIRM:"OK"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},ja:{OK:"OK",CANCEL:"キャンセル",CONFIRM:"確èª"},lt:{OK:"Gerai",CANCEL:"AtÅ¡aukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"ApstiprinÄt"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},pt:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Confirmar"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},tr:{OK:"Tamam",CANCEL:"Ä°ptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"å–消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"å–消",CONFIRM:"確èª"}};return p.init=function(c){return a(c||b)},p}); \ No newline at end of file diff --git a/common/src/main/webapp/thirdparty/bootstrap-growl/bootstrap-growl.min.js b/common/src/main/webapp/thirdparty/bootstrap-growl/bootstrap-growl.min.js new file mode 100644 index 00000000..ce6deb10 --- /dev/null +++ b/common/src/main/webapp/thirdparty/bootstrap-growl/bootstrap-growl.min.js @@ -0,0 +1,2 @@ +/* Project: Bootstrap Growl - v2.0.0 | Author: Mouse0270 aka Robert McIntosh | License: MIT License | Website: https://github.com/mouse0270/bootstrap-growl */ +(function(e,t,n,r){var i="growl",s="plugin_"+i,o={element:"body",type:"info",allow_dismiss:true,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:false,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},icon_type:"class",template:''};var u=function(t,n){o=e.extend(true,{},o,n)},a=function(t,n,r){var n={content:{message:typeof n=="object"?n.message:n,title:n.title?n.title:null,icon:n.icon?n.icon:null,url:n.url?n.url:null}};r=e.extend(true,{},n,r);this.settings=e.extend(true,{},o,r);plugin=this;f(r,this.settings,plugin);this.$template=$template},f=function(t,n,r){var i={settings:n,$element:e(n.element),template:n.template};$template=l(i);c($template,i.settings);h($template,i.settings);p($template,i.settings,r)},l=function(t){var n=e(t.settings.template);n.addClass("alert-"+t.settings.type);n.attr("data-growl-position",t.settings.placement.from+"-"+t.settings.placement.align);n.find('[data-growl="dismiss"]').css("display","none");if(t.settings.allow_dismiss){n.find('[data-growl="dismiss"]').css("display","inline-block")}return n},c=function(e,t){e.find('[data-growl="dismiss"]').css({position:"absolute",top:"5px",right:"10px","z-index":t.z_index-1>=1?t.z_index-1:1});if(t.content.icon){if(t.icon_type.toLowerCase()=="class"){e.find('[data-growl="icon"]').addClass(t.content.icon)}else{if(e.find('[data-growl="icon"]').is("img")){e.find('[data-growl="icon"]').attr("src",t.content.icon)}else{e.find('[data-growl="icon"]').append('')}}}if(t.content.title){e.find('[data-growl="title"]').html(t.content.title)}if(t.content.message){e.find('[data-growl="message"]').html(t.content.message)}if(t.content.url){e.find('[data-growl="url"]').attr("href",t.content.url).attr("target",t.url_target);e.find('[data-growl="url"]').css({position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%","z-index":t.z_index-2>=1?t.z_index-2:1})}},h=function(t,n){var r=n.offset,i={position:n.element==="body"?"fixed":"absolute",margin:0,"z-index":n.z_index,display:"inline-block"};e('[data-growl-position="'+n.placement.from+"-"+n.placement.align+'"]').each(function(){return r=Math.max(r,parseInt(e(this).css(n.placement.from))+e(this).outerHeight()+n.spacing)});i[n.placement.from]=r+"px";t.css(i);e(n.element).append(t);switch(n.placement.align){case"center":t.css({left:"50%",marginLeft:-(t.outerWidth()/2)+"px"});break;case"left":t.css("left",n.offset+"px");break;case"right":t.css("right",n.offset+"px");break}t.addClass("growl-animated")},p=function(e,t,n){e.addClass(t.animate.enter);e.find('[data-growl="dismiss"]').on("click",function(){n.close()});e.on("mouseover",function(t){e.addClass("hovering")}).on("mouseout",function(){e.removeClass("hovering")});if(t.delay>=1){e.data("growl-delay",t.delay);var r=setInterval(function(){var i=parseInt(e.data("growl-delay"))-t.timer;console.log();if(!e.hasClass("hovering")&&t.mouse_over=="pause"||t.mouse_over!="pause"){e.data("growl-delay",i)}if(i<=0){clearInterval(r);n.close()}},t.timer)}};a.prototype={update:function(e,t){switch(e){case"icon":if(this.settings.icon_type.toLowerCase()=="class"){this.$template.find('[data-growl="icon"]').removeClass(this.settings.content.icon);this.$template.find('[data-growl="icon"]').addClass(t)}else{if(this.$template.find('[data-growl="icon"]').is("img")){this.$template.find('[data-growl="icon"]')}else{this.$template.find('[data-growl="icon"]').find("img").attr().attr("src",t)}}break;case"url":this.$template.find('[data-growl="url"]').attr("href",t);break;case"type":this.$template.removeClass("alert-"+this.settings.type);this.$template.addClass("alert-"+t);break;default:this.$template.find('[data-growl="'+e+'"]').html(t)}return this},close:function(){var t=this.$template,n=this.settings,r=t.css(n.placement.from),i=false;t.addClass(this.settings.animate.exit);t.nextAll('[data-growl-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]').each(function(){e(this).css(n.placement.from,r);r=parseInt(r)+n.spacing+e(this).outerHeight()});t.one("webkitAnimationStart oanimationstart MSAnimationStart animationstart",function(e){i=true});t.one("webkitAnimationEnd oanimationend MSAnimationEnd animationend",function(t){e(this).remove()});setTimeout(function(){console.log(i);if(!i){t.remove()}},100);return this}};e.growl=function(e,t){if(e==false){u(this,t);return false}var n=new a(this,e,t);return n}})(jQuery,window,document) \ No newline at end of file diff --git a/common/src/main/webapp/thirdparty/bootstrap/css/bootstrap-dt.css b/common/src/main/webapp/thirdparty/bootstrap/css/bootstrap-dt.css new file mode 100644 index 00000000..2828337d --- /dev/null +++ b/common/src/main/webapp/thirdparty/bootstrap/css/bootstrap-dt.css @@ -0,0 +1,5804 @@ +/*! + * Bootstrap v3.1.1 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + margin: .67em 0; + font-size: 2em; +} +mark { + color: #000; + background: #ff0; +} +small { + font-size: 80%; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -.5em; +} +sub { + bottom: -.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + height: 0; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + margin: 0; + font: inherit; + color: inherit; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + padding: .35em .625em .75em; + margin: 0 2px; + border: 1px solid #c0c0c0; +} +legend { + padding: 0; + border: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-spacing: 0; + border-collapse: collapse; +} +td, +th { +} +@media print { + * { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + select { + background: #fff !important; + } + .navbar { + display: none; + } + .table td, + .table th { + background-color: #fff !important; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +.dataTableWrapperDiv div { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 62.5%; + + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.42857143; + color: #333; + background-color: #fff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #428bca; + text-decoration: none; +} +a:hover, +a:focus { + color: #2a6496; + text-decoration: underline; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + display: inline-block; + max-width: 100%; + height: auto; + padding: 4px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #999; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 20px; + margin-bottom: 10px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 10px; + margin-bottom: 10px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 36px; +} +h2, +.h2 { + font-size: 30px; +} +h3, +.h3 { + font-size: 24px; +} +h4, +.h4 { + font-size: 18px; +} +h5, +.h5 { + font-size: 14px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 200; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} +small, +.small { + font-size: 85%; +} +cite { + font-style: normal; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-muted { + color: #999; +} +.text-primary { + color: #428bca; +} +a.text-primary:hover { + color: #3071a9; +} +.text-success { + color: #3c763d; +} +a.text-success:hover { + color: #2b542c; +} +.text-info { + color: #31708f; +} +a.text-info:hover { + color: #245269; +} +.text-warning { + color: #8a6d3b; +} +a.text-warning:hover { + color: #66512c; +} +.text-danger { + color: #a94442; +} +a.text-danger:hover { + color: #843534; +} +.bg-primary { + color: #fff; + background-color: #428bca; +} +a.bg-primary:hover { + background-color: #3071a9; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:hover { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:hover { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:hover { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:hover { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eee; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + margin-left: -5px; + list-style: none; +} +.list-inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} +dl { + margin-top: 0; + margin-bottom: 20px; +} +dt, +dd { + line-height: 1.42857143; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #999; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eee; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #999; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + text-align: right; + border-right: 5px solid #eee; + border-left: 0; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +blockquote:before, +blockquote:after { + content: ""; +} +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + white-space: nowrap; + background-color: #f9f2f4; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #fff; + background-color: #333; + border-radius: 3px; + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.42857143; + color: #333; + word-break: break-all; + word-wrap: break-word; + background-color: #f5f5f5; + border: 1px solid #ccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +.row { + margin-right: -15px; + margin-left: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: 0; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: 0; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: 0; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: 0; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: 0; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: 0; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: 0; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: 0; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0; + } +} +table { + max-width: 100%; + background-color: transparent; +} +th { + text-align: left; +} +.table { + width: 100%; + margin-bottom: 20px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #ddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #ddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #ddd; +} +.table .table { + background-color: #fff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-child(odd) > td, +.table-striped > tbody > tr:nth-child(odd) > th { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover > td, +.table-hover > tbody > tr:hover > th { + /*background-color: #f5f5f5;*/ + background-color:#dbedff; +} +.dataTableTdSelected{ + background-color:#dbedff !important; +} +table col[class*="col-"] { + position: static; + display: table-column; + float: none; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + display: table-cell; + float: none; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} +@media (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-x: scroll; + overflow-y: hidden; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #ddd; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + min-width: 0; + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: inherit; + color: #333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + /* IE8-9 */ + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.42857143; + color: #555; +} +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); +} +.form-control::-moz-placeholder { + color: #999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999; +} +.form-control::-webkit-input-placeholder { + color: #999; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + cursor: not-allowed; + background-color: #eee; + opacity: 1; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +input[type="date"] { + line-height: 34px; +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + display: block; + min-height: 20px; + padding-left: 20px; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + display: inline; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + float: left; + margin-left: -20px; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + vertical-align: middle; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +.radio[disabled], +.radio-inline[disabled], +.checkbox[disabled], +.checkbox-inline[disabled], +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"], +fieldset[disabled] .radio, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.input-lg { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-lg { + height: 46px; + line-height: 46px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 42.5px; +} +.has-feedback .form-control-feedback { + position: absolute; + top: 25px; + right: 0; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + background-color: #dff0d8; + border-color: #3c763d; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #8a6d3b; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + background-color: #f2dede; + border-color: #a94442; +} +.has-error .form-control-feedback { + color: #a94442; +} +.form-control-static { + margin-bottom: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + padding-left: 0; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + float: none; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .control-label, +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + padding-top: 7px; + margin-top: 0; + margin-bottom: 0; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-right: -15px; + margin-left: -15px; +} +.form-horizontal .form-control-static { + padding-top: 7px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + } +} +.form-horizontal .has-feedback .form-control-feedback { + top: 0; + right: 15px; +} +.btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: normal; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus { + color: #333; + text-decoration: none; +} +.btn:active, +.btn.active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + pointer-events: none; + cursor: not-allowed; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; + opacity: .65; +} +.btn.default { + color: #333333; + text-shadow: none; + background-color: #e5e5e5; + height:12px; +} +.btn.default:hover, +.btn.default:focus, +.btn.default:active, +.btn.default.active, +.btn.default[disabled], +.btn.default.disabled { + color: #333333; + background-color: #d8d8d8 !important; + outline: none !important; +} + +.btn-default:hover, +.btn-default:focus, +.btn-default:active, +.btn-default.active, +.open .dropdown-toggle.btn-default { + color: #333; + background-color: #ebebeb; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #fff; + border-color: #ccc; +} +.btn-default .badge { + color: #fff; + background-color: #333; +} +.btn-primary { + color: #fff; + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary:active, +.btn-primary.active, +.open .dropdown-toggle.btn-primary { + color: #fff; + background-color: #3276b1; + border-color: #285e8e; +} +.btn-primary:active, +.btn-primary.active, +.open .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary .badge { + color: #428bca; + background-color: #fff; +} +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:hover, +.btn-success:focus, +.btn-success:active, +.btn-success.active, +.open .dropdown-toggle.btn-success { + color: #fff; + background-color: #47a447; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #fff; +} +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:hover, +.btn-info:focus, +.btn-info:active, +.btn-info.active, +.open .dropdown-toggle.btn-info { + color: #fff; + background-color: #39b3d7; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #fff; +} +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning:active, +.btn-warning.active, +.open .dropdown-toggle.btn-warning { + color: #fff; + background-color: #ed9c28; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #fff; +} +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger:active, +.btn-danger.active, +.open .dropdown-toggle.btn-danger { + color: #fff; + background-color: #d2322d; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #fff; +} +.btn-link { + font-weight: normal; + color: #428bca; + cursor: pointer; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #2a6496; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #999; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-sm { + padding: 2px 10px 8px 10px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; + padding-right: 0; + padding-left: 0; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity .15s linear; + transition: opacity .15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height .35s ease; + transition: height .35s ease; +} +@font-face { + font-family: 'Glyphicons Halflings'; + + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + list-style: none; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + color: #262626; + text-decoration: none; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #fff; + text-decoration: none; + background-color: #428bca; + outline: 0; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #999; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + right: 0; + left: auto; +} +.dropdown-menu-left { + right: auto; + left: 0; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #999; +} +.dropdown-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + content: ""; + border-top: 0; + border-bottom: 4px solid; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + right: 0; + left: auto; + } + .navbar-right .dropdown-menu-left { + right: auto; + left: 0; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus { + outline: none; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child > .btn:last-child, +.btn-group > .btn-group:first-child > .dropdown-toggle { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn-group:last-child > .btn:first-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-right: 8px; + padding-left: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-right: 12px; + padding-left: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-left-radius: 4px; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + display: table-cell; + float: none; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +[data-toggle="buttons"] > .btn > input[type="radio"], +[data-toggle="buttons"] > .btn > input[type="checkbox"] { + display: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-right: 0; + padding-left: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555; + text-align: center; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + margin-left: -1px; +} +.nav { + padding-left: 0; + margin-bottom: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eee; +} +.nav > li.disabled > a { + color: #999; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #999; + text-decoration: none; + cursor: not-allowed; + background-color: transparent; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eee; + border-color: #428bca; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eee #eee #ddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #555; + cursor: default; + background-color: #fff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #fff; + background-color: #428bca; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + max-height: 340px; + padding-right: 15px; + padding-left: 15px; + overflow-x: visible; + -webkit-overflow-scrolling: touch; + border-top: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-right: 0; + padding-left: 0; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + height: 50px; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + padding: 9px 10px; + margin-top: 8px; + margin-right: 15px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: none; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } + .navbar-nav.navbar-right:last-child { + margin-right: -15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + } +} +.navbar-form { + padding: 10px 15px; + margin-top: 8px; + margin-right: -15px; + margin-bottom: 8px; + margin-left: -15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + padding-left: 0; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + float: none; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + padding-top: 0; + padding-bottom: 0; + margin-right: 0; + margin-left: 0; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-form.navbar-right:last-child { + margin-right: -15px; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-right: 15px; + margin-left: 15px; + } + .navbar-text.navbar-right:last-child { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777; +} +.navbar-default .navbar-nav > li > a { + color: #777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #ccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #ddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #ddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #888; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + color: #555; + background-color: #e7e7e7; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #ccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777; +} +.navbar-default .navbar-link:hover { + color: #333; +} +.navbar-inverse { + background-color: #222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #999; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #999; +} +.navbar-inverse .navbar-nav > li > a { + color: #999; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #fff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #fff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + color: #fff; + background-color: #080808; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #999; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #fff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #fff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #999; +} +.navbar-inverse .navbar-link:hover { + color: #fff; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + padding: 0 5px; + color: #ccc; + content: "/\00a0"; +} +.breadcrumb > .active { + color: #999; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #428bca; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + color: #2a6496; + background-color: #eee; + border-color: #ddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: #428bca; + border-color: #428bca; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #999; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + text-align: center; + list-style: none; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #999; + cursor: not-allowed; + background-color: #fff; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +.label[href]:hover, +.label[href]:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #999; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #808080; +} +.label-primary { + background-color: #428bca; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #3071a9; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #999; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +a.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #428bca; + background-color: #fff; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #eee; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; +} +.container .jumbotron { + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron { + padding-right: 60px; + padding-left: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-right: auto; + margin-left: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #428bca; +} +.thumbnail .caption { + padding: 9px; + color: #333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable { + padding-right: 35px; +} +.alert-dismissable .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); +} +.progress-bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #fff; + text-align: center; + background-color: #428bca; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + -webkit-transition: width .6s ease; + transition: width .6s ease; +} +.progress-striped .progress-bar { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-size: 40px 40px; +} +.progress.active .progress-bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.media, +.media-body { + overflow: hidden; + zoom: 1; +} +.media, +.media .media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media-object { + display: block; +} +.media-heading { + margin: 0 0 5px; +} +.media > .pull-left { + margin-right: 10px; +} +.media > .pull-right { + margin-left: 10px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + padding-left: 0; + margin-bottom: 20px; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid #ddd; +} +.list-group-item:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +a.list-group-item { + color: #555; +} +a.list-group-item .list-group-item-heading { + color: #333; +} +a.list-group-item:hover, +a.list-group-item:focus { + text-decoration: none; + background-color: #f5f5f5; +} +a.list-group-item.active, +a.list-group-item.active:hover, +a.list-group-item.active:focus { + z-index: 2; + color: #fff; + background-color: #428bca; + border-color: #428bca; +} +a.list-group-item.active .list-group-item-heading, +a.list-group-item.active:hover .list-group-item-heading, +a.list-group-item.active:focus .list-group-item-heading { + color: inherit; +} +a.list-group-item.active .list-group-item-text, +a.list-group-item.active:hover .list-group-item-text, +a.list-group-item.active:focus .list-group-item-text { + color: #e1edf7; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +a.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +a.list-group-item-success.active:hover, +a.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +a.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +a.list-group-item-info.active:hover, +a.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +a.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +a.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: 0 1px 1px rgba(0, 0, 0, .05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table { + margin-bottom: 0; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive { + border-top: 1px solid #ddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + margin-bottom: 0; + border: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + overflow: hidden; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse .panel-body { + border-top: 1px solid #ddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #ddd; +} +.panel-default { + border-color: #ddd; +} +.panel-default > .panel-heading { + color: #333; + background-color: #f5f5f5; + border-color: #ddd; +} +.panel-default > .panel-heading + .panel-collapse .panel-body { + border-top-color: #ddd; +} +.panel-default > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #ddd; +} +.panel-primary { + border-color: #428bca; +} +.panel-primary > .panel-heading { + color: #fff; + background-color: #428bca; + border-color: #428bca; +} +.panel-primary > .panel-heading + .panel-collapse .panel-body { + border-top-color: #428bca; +} +.panel-primary > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #428bca; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #ebccd1; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, .15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + filter: alpha(opacity=20); + opacity: .2; +} +.close:hover, +.close:focus { + color: #000; + text-decoration: none; + cursor: pointer; + filter: alpha(opacity=50); + opacity: .5; +} +button.close { + -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; +} +.modal-open { + overflow: hidden; +} +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + display: none; + overflow: auto; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transition: -webkit-transform .3s ease-out; + -moz-transition: -moz-transform .3s ease-out; + -o-transition: -o-transform .3s ease-out; + transition: transform .3s ease-out; + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + transform: translate(0, -25%); +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + outline: none; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + /*background-color: #000;*/ + background-color: #fff; +} +.modal-backdrop.fade { + filter: alpha(opacity=0); + opacity: 0; +} +.modal-backdrop.in { + filter: alpha(opacity=50); + opacity: .5; +} +.modal-header { + min-height: 16.42857143px; + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 20px; +} +.modal-footer { + padding: 19px 20px 20px; + margin-top: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1030; + display: block; + font-size: 12px; + line-height: 1.4; + visibility: visible; + filter: alpha(opacity=0); + opacity: 0; +} +.tooltip.in { + filter: alpha(opacity=90); + opacity: .9; +} +.tooltip.top { + padding: 5px 0; + margin-top: -3px; +} +.tooltip.right { + padding: 0 5px; + margin-left: 3px; +} +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; +} +.tooltip.left { + padding: 0 5px; + margin-left: -3px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #fff; + text-align: center; + text-decoration: none; + background-color: #000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + left: 5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-right .tooltip-arrow { + right: 5px; + bottom: 0; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + left: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + right: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + max-width: 276px; + padding: 1px; + text-align: left; + white-space: normal; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + box-shadow: 0 5px 10px rgba(0, 0, 0, .2); +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + content: ""; + border-width: 10px; +} +.popover.top > .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, .25); + border-bottom-width: 0; +} +.popover.top > .arrow:after { + bottom: 1px; + margin-left: -10px; + content: " "; + border-top-color: #fff; + border-bottom-width: 0; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, .25); + border-left-width: 0; +} +.popover.right > .arrow:after { + bottom: -10px; + left: 1px; + content: " "; + border-right-color: #fff; + border-left-width: 0; +} +.popover.bottom > .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, .25); +} +.popover.bottom > .arrow:after { + top: 1px; + margin-left: -10px; + content: " "; + border-top-width: 0; + border-bottom-color: #fff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, .25); +} +.popover.left > .arrow:after { + right: 1px; + bottom: -10px; + content: " "; + border-right-width: 0; + border-left-color: #fff; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: .6s ease-in-out left; + transition: .6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 15%; + font-size: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, .6); + filter: alpha(opacity=50); + opacity: .5; +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, .5) 0%), color-stop(rgba(0, 0, 0, .0001) 100%)); + background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control.right { + right: 0; + left: auto; + background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, .0001) 0%), color-stop(rgba(0, 0, 0, .5) 100%)); + background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control:hover, +.carousel-control:focus { + color: #fff; + text-decoration: none; + filter: alpha(opacity=90); + outline: none; + opacity: .9; +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + margin-top: -10px; + margin-left: -10px; + font-family: serif; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + padding-left: 0; + margin-left: -30%; + text-align: center; + list-style: none; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); + border: 1px solid #fff; + border-radius: 10px; +} +.carousel-indicators .active { + width: 12px; + height: 12px; + margin: 0; + background-color: #fff; +} +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, .6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + margin-left: -15px; + font-size: 30px; + } + .carousel-caption { + right: 20%; + left: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + display: table; + content: " "; +} +.clearfix:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-right: auto; + margin-left: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; + visibility: hidden !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +/*# sourceMappingURL=bootstrap.css.map */ diff --git a/common/src/main/webapp/thirdparty/bootstrap/css/bootstrap.min.css b/common/src/main/webapp/thirdparty/bootstrap/css/bootstrap.min.css new file mode 100644 index 00000000..679272d2 --- /dev/null +++ b/common/src/main/webapp/thirdparty/bootstrap/css/bootstrap.min.css @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.1.1 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#999}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-muted{color:#999}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#999}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:0}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:0}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*=col-]{position:static;float:none;display:table-column}table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date]{line-height:34px}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;margin-top:10px;margin-bottom:10px;padding-left:20px}.radio label,.checkbox label{display:inline;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.has-feedback .form-control-feedback{position:absolute;top:25px;right:0;display:block;width:34px;height:34px;line-height:34px;text-align:center}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.form-control-static{margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{float:none;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-control-static{padding-top:7px}@media (min-width:768px){.form-horizontal .control-label{text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#428bca;font-weight:400;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:4px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}[data-toggle=buttons]>.btn>input[type=radio],[data-toggle=buttons]>.btn>input[type=checkbox]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px;font-size:18px;line-height:20px;height:50px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{float:none;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#428bca;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:gray}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;color:#fff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px;overflow:hidden}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#faebcc}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ebccd1}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ebccd1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.42857143px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;right:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-control.left{background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.5) 0),color-stop(rgba(0,0,0,.0001) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.0001) 0),color-stop(rgba(0,0,0,.5) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}@media print{.hidden-print{display:none!important}} \ No newline at end of file diff --git a/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.eot b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 00000000..b93a4953 Binary files /dev/null and b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.eot differ diff --git a/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.svg b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 00000000..94fb5490 --- /dev/null +++ b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.ttf b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 00000000..1413fc60 Binary files /dev/null and b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.ttf differ diff --git a/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.woff b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 00000000..9e612858 Binary files /dev/null and b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.woff differ diff --git a/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.woff2 b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 00000000..64539b54 Binary files /dev/null and b/common/src/main/webapp/thirdparty/bootstrap/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/common/src/main/webapp/thirdparty/bootstrap/js/bootstrap.js b/common/src/main/webapp/thirdparty/bootstrap/js/bootstrap.js new file mode 100644 index 00000000..8ae571b6 --- /dev/null +++ b/common/src/main/webapp/thirdparty/bootstrap/js/bootstrap.js @@ -0,0 +1,1951 @@ +/*! + * Bootstrap v3.1.1 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } + +/* ======================================================================== + * Bootstrap: transition.js v3.1.1 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd', + 'MozTransition' : 'transitionend', + 'OTransition' : 'oTransitionEnd otransitionend', + 'transition' : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + + return false // explicit for ie8 ( ._.) + } + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false, $el = this + $(this).one($.support.transition.end, function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: alert.js v3.1.1 + * http://getbootstrap.com/javascript/#alerts + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // ALERT CLASS DEFINITION + // ====================== + + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = $(selector) + + if (e) e.preventDefault() + + if (!$parent.length) { + $parent = $this.hasClass('alert') ? $this : $this.parent() + } + + $parent.trigger(e = $.Event('close.bs.alert')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent.trigger('closed.bs.alert').remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent + .one($.support.transition.end, removeElement) + .emulateTransitionEnd(150) : + removeElement() + } + + + // ALERT PLUGIN DEFINITION + // ======================= + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + // ALERT NO CONFLICT + // ================= + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + // ALERT DATA-API + // ============== + + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: button.js v3.1.1 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false + } + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state = state + 'Text' + + if (!data.resetText) $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout($.proxy(function () { + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) + } + + Button.prototype.toggle = function () { + var changed = true + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked') && this.$element.hasClass('active')) changed = false + else $parent.find('.active').removeClass('active') + } + if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + } + + if (changed) this.$element.toggleClass('active') + } + + + // BUTTON PLUGIN DEFINITION + // ======================== + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + // BUTTON DATA-API + // =============== + + $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + e.preventDefault() + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: carousel.js v3.1.1 + * http://getbootstrap.com/javascript/#carousel + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CAROUSEL CLASS DEFINITION + // ========================= + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = + this.sliding = + this.interval = + this.$active = + this.$items = null + + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.DEFAULTS = { + interval: 5000, + pause: 'hover', + wrap: true + } + + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) + + this.interval && clearInterval(this.interval) + + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + + return this + } + + Carousel.prototype.getActiveIndex = function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + + return this.$items.index(this.$active) + } + + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getActiveIndex() + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) + if (activeIndex == pos) return this.pause().cycle() + + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + } + + Carousel.prototype.pause = function (e) { + e || (this.paused = true) + + if (this.$element.find('.next, .prev').length && $.support.transition) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + + this.interval = clearInterval(this.interval) + + return this + } + + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') + } + + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } + + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || $active[type]() + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var fallback = type == 'next' ? 'first' : 'last' + var that = this + + if (!$next.length) { + if (!this.options.wrap) return + $next = this.$element.find('.item')[fallback]() + } + + if ($next.hasClass('active')) return this.sliding = false + + var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + + this.sliding = true + + isCycling && this.pause() + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid.bs.carousel', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) + }) + .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) + } else { + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid.bs.carousel') + } + + isCycling && this.cycle() + + return this + } + + + // CAROUSEL PLUGIN DEFINITION + // ========================== + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide + + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + $.fn.carousel.Constructor = Carousel + + + // CAROUSEL NO CONFLICT + // ==================== + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + + // CAROUSEL DATA-API + // ================= + + $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false + + $target.carousel(options) + + if (slideIndex = $this.attr('data-slide-to')) { + $target.data('bs.carousel').to(slideIndex) + } + + e.preventDefault() + }) + + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + $carousel.carousel($carousel.data()) + }) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: collapse.js v3.1.1 + * http://getbootstrap.com/javascript/#collapse + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // COLLAPSE PUBLIC CLASS DEFINITION + // ================================ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Collapse.DEFAULTS, options) + this.transitioning = null + + if (this.options.parent) this.$parent = $(this.options.parent) + if (this.options.toggle) this.toggle() + } + + Collapse.DEFAULTS = { + toggle: true + } + + Collapse.prototype.dimension = function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + Collapse.prototype.show = function () { + if (this.transitioning || this.$element.hasClass('in')) return + + var startEvent = $.Event('show.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var actives = this.$parent && this.$parent.find('> .panel > .in') + + if (actives && actives.length) { + var hasData = actives.data('bs.collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('bs.collapse', null) + } + + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + .addClass('collapsing') + [dimension](0) + + this.transitioning = 1 + + var complete = function () { + this.$element + .removeClass('collapsing') + .addClass('collapse in') + [dimension]('auto') + this.transitioning = 0 + this.$element.trigger('shown.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + var scrollSize = $.camelCase(['scroll', dimension].join('-')) + + this.$element + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + [dimension](this.$element[0][scrollSize]) + } + + Collapse.prototype.hide = function () { + if (this.transitioning || !this.$element.hasClass('in')) return + + var startEvent = $.Event('hide.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var dimension = this.dimension() + + this.$element + [dimension](this.$element[dimension]()) + [0].offsetHeight + + this.$element + .addClass('collapsing') + .removeClass('collapse') + .removeClass('in') + + this.transitioning = 1 + + var complete = function () { + this.transitioning = 0 + this.$element + .trigger('hidden.bs.collapse') + .removeClass('collapsing') + .addClass('collapse') + } + + if (!$.support.transition) return complete.call(this) + + this.$element + [dimension](0) + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + } + + Collapse.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + + // COLLAPSE PLUGIN DEFINITION + // ========================== + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.collapse') + var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data && options.toggle && option == 'show') option = !option + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.Constructor = Collapse + + + // COLLAPSE NO CONFLICT + // ==================== + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + // COLLAPSE DATA-API + // ================= + + $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + var target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + var $target = $(target) + var data = $target.data('bs.collapse') + var option = data ? 'toggle' : $this.data() + var parent = $this.attr('data-parent') + var $parent = parent && $(parent) + + if (!data || !data.transitioning) { + if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') + $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + } + + $target.collapse(option) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.1.1 + * http://getbootstrap.com/javascript/#dropdowns + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle=dropdown]' + var Dropdown = function (element) { + $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we use a backdrop because click events don't delegate + $(''); + $(tds.eq(j)).height('0px'); + $(tds.eq(j)).css('padding-top','0px'); + $(tds.eq(j)).css('padding-bottom','0px'); + $(tds.eq(j)).css('border-top-width','0px'); + $(tds.eq(j)).css('border-bottom-width','0px'); + } + $(rowClone).height('0px'); + $tableHead.append($(rowClone).prop("outerHTML")); + } + + $('div.dataTables_scrollBody', tableWrapper).css('width','100%'); + $('div.dataTables_scrollHead', tableWrapper).css('width','98.5%'); + $('div.dataTables_scrollHeadInner', tableWrapper).css('padding-right', 0); + + //添加浮动确认å确认按钮 + if(rowOverFlag){ + addRowOverlap(); + } + + //设置表格本体高度 + $('div.dataTables_scrollBody', tableWrapper).css('height', tableHeight); + } + } + }, options); + + tableOptions = options; + + columns = columnsDefined; + xsHiddenColumns = xsHiddenColumnsDefined; + smHiddenColumns = smHiddenColumnsDefined; + // create table's jquery object + table = $(options.src); + tableContainer = table.parents("div#table-container" + contextData.curentDatableId); + // apply the special class that used to restyle the default datatable + + $.fn.dataTableExt.oStdClasses.sWrapper = $.fn.dataTableExt.oStdClasses.sWrapper + " dataTables_extended_wrapper"; + + // initialize a datatable + dataTable = table.dataTable(options.dataTable); + + tableWrapper = table.parents('div.dataTables_wrapper', tableContainer); + + // modify table per page dropdown input by appliying some classes + $('.dataTables_length select', tableWrapper).addClass("form-control input-xsmall input-sm"); + + // handle group checkboxes check/uncheck + $('.group-checkable', tableContainer).change(function () { + var set = $('tbody > tr > td:nth-child(1) input[type="checkbox"]', table); + var checked = $(this).is(":checked"); + $(set).each(function () { + $(this).attr("checked", checked); + }); + $.uniform.update(set); + countSelectedRecords(); + }); + + // handle row's checkbox click + table.on('change', 'tbody > tr > td:nth-child(1) input[type="checkbox"]', function(){ + countSelectedRecords(); + }); + + //if ($.browser.safari) { + // $('.table-container').css('width','100%'); + //} + //填充表头å³è¾¹ç•Œ + $('div.dataTables_scrollHead', tableContainer).css('display','inline-block'); + //var dataTables_scrollHead_height = $('.dataTables_scrollHead').css( "height" ); + $("div.dataTables_scrollHead", tableContainer).after("
"); + if($.browser.mozilla){ + $('div#divRightPadding', tableContainer).css('height', '40'); + } + + //éšè—掉æŸäº›åˆ— + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable', tableWrapper); + var $tableBody = $('table#datatable_ajax' + contextData.curentDatableId, tableWrapper); + + for(var i=0;i tr > th#' + columns[j].columnId, $tableHead).addClass('hidden-xs'); + $('thead > tr > th#' + columns[j].columnId, $tableBody).addClass('hidden-xs'); + break; + } + } + } + + for(var i=0;i tr > th#' + columns[j].columnId, $tableHead).addClass('hidden-sm'); + $('thead > tr > th#' + columns[j].columnId, $tableBody).addClass('hidden-sm'); + break; + } + } + } + },//end init------------------------------------------------------------------------------------ + + getSelectedRowsCount: function() { + return $('tbody > tr > td:nth-child(1) input[type="checkbox"]:checked', table).size(); + }, + + getSelectedRows: function() { + var rows = []; + $('tbody > tr > td:nth-child(1) input[type="checkbox"]:checked', table).each(function(){ + rows.push({rowDataNo: $(this).attr("rowDataNo"), name: $(this).attr("name"), value: $(this).val()}); + }); + + return rows; + }, + + addAjaxParam: function(name, value) { + ajaxParams.push({"name": name, "value": value}); + }, + + clearAjaxParams: function(name, value) { + ajaxParams = []; + }, + + getDataTable: function() { + return dataTable; + }, + + getTableWrapper: function() { + return tableWrapper; + }, + + gettableContainer: function() { + return tableContainer; + }, + + getTable: function() { + return table; + }, + + setOpenRowFlag: function(openRowFlagInput) { + openRowFlag = openRowFlagInput; + }, + + setRowOverFlag: function(rowOverFlagInput) { + rowOverFlag = rowOverFlagInput; + }, + + setRowCheckable: function(rowCheckableInput) { + rowCheckable = rowCheckableInput; + }, + + setColumnsTooLong: function(columnsTooLongInput) { + columnsTooLong = columnsTooLongInput; + }, + + setSTotalRecordsSource: function(sTotalRecordsSourceInput){ + sTotalRecordsSource = sTotalRecordsSourceInput; + }, + + setTotalRecords: function(totalRecordsInput){ + totalRecords = totalRecordsInput; + }, + + setTableHeight: function(tableHeightInput){ + tableHeight = tableHeightInput; + }, + + setCallbackList: function(list){ + if($.isArray(list)){ + callbackList = list; + } + }, + + getCheckedRowDatas:function(){ + checkedRowDatas = []; + $('tbody > tr > td:nth-child(1) input[type="checkbox"]:checked', table).each(function(){ + var rowNoId = $(this).attr("rowDataNo"); + var rowNoIndex = rowNoId.slice(rowNoId.indexOf("_") + 1); + checkedRowDatas.push(currentPageData[parseInt(rowNoIndex)]); + }); + return checkedRowDatas; + }, + + setRequestType: function(requestTypeInput){ + requestType = requestTypeInput; + }, + + setContextData: function(newContextData){ + contextData = newContextData; + }, + + setTotalPage: function(newTotalPage){ + $("#datatable_ajax" + contextData.curentDatableId + "_info").html(tableOptions.dataTable.oLanguage.sInfo.replace("_TOTAL_", newTotalPage + "")); + } + + }; + +}; + +var TableAjaxICT = function () { + + var contextData; + + var initPickers = function () { + //init date pickers + $('.date-picker').datepicker({ + //rtl: App.isRTL(), + autoclose: true + }); + } + + //判断a数组是å¦åŒ…å«b数组 + function isContained(largeArray, smallArray){ + if(!(largeArray instanceof Array) || !(smallArray instanceof Array)) + return false; + if(largeArray.length < smallArray.length) + return false; + for(var i = 0; i < smallArray.length; i++){ + var flag = false; + for(j=0;j' + alarmId + ''; + sOut += '' + columns[4].columnTitle + '' + perceivedSeverity + ''; + sOut += '' + columns[9].columnTitle + '' + alarmType + ''; + sOut += '' + columns[3].columnTitle + '' + alarmRaisedTime + ''; + + sOut += '' + columns[5].columnTitle + '' + probableCauseDesc + ''; + sOut += '' + columns[15].columnTitle + '' + alarmChangedTime + ''; + sOut += '' + columns[11].columnTitle + '' + ackState + ''; + + sOut += '' + columns[12].columnTitle + '' + ackTime + ''; + sOut += '' + columns[13].columnTitle + '' + ackUserId + ''; + sOut += '' + columns[14].columnTitle + '' + ackSystemId + ''; + sOut += '' + columns[7].columnTitle + '' + neip + ''; + + sOut += '' + columns[2].columnTitle + '' + moc + ''; + sOut += '' + columns[1].columnTitle + '' + resDisplayName + ''; + + sOut += '' + columns[8].columnTitle + '' + componentname + ''; + sOut += '' + columns[16].columnTitle + '' + position1 + ''; + + sOut += '' + columns[10].columnTitle + '' + specificproblem + ''; + + sOut += '' + columns[6].columnTitle + '' + additionalText + ''; + + sOut += '' + $.i18n.prop('aos_fm_SuggestionSetting_view_DefaultSuggestionGroupTitle').replace(';', '').replace(/\"/g,'') + '' + ''; + + sOut += '' + $.i18n.prop('aos_fm_SuggestionSetting_view_SettingSuggestionGroupTitle').replace(';', '').replace(/\"/g,'') + ''; + + sOut += ''; + + /* + var systemType = 0; + var code = 0; + for (var i = 0; i < oTable.datas.length; i++) { + var temp = oTable.datas[i]; + if (temp.alarmId == oTr['alarmId'].value) { + systemType = temp.systemType; + code = temp.probableCauseCode; + } + }*/ + var data = { + "systemType" : systemType, + "code" : code + }; + var sendData = JSON.stringify(data); + $.ajax({ + "dataType" : 'json', + "type" : "GET", + "url" : "/web/rest/web/fm/Maintenance" + "?" + "data=" + sendData, + "contentType" : 'application/json; charset=utf-8', + "data" : null, + "success" : function (json) { + $('tr').find('td#defaulInfo' + id).text(json.defaulInfo); + $('tr').find('td#customInfo' + id).text(json.customInfo); + var modify = $('#customInfoModify' + id); + modify.on('click', function () { + var span = $('#modifyBtnSpan' + id); + var customInfo = $('tr').find('td#customInfo' + id); + var cancel = $('#cancelDiv' + id); + if (span['0'].className === 'fa fa-pencil-square-o') { + var value = customInfo['0'].textContent; + customInfo['0'].textContent = ''; + customInfo['0'].innerHTML = ''; + span['0'].className = 'fa fa-floppy-o'; + cancel['0'].innerHTML = ''; + $('#cancelBtn' + id).on('click', function () { + customInfo['0'].innerHTML = ''; + customInfo['0'].textContent = value; + cancel['0'].innerHTML = ''; + span['0'].className = 'fa fa-pencil-square-o'; + }); + } else { + var inputValue = $('#customInfoInput' + id)['0'].value; + customInfo['0'].innerHTML = ''; + customInfo['0'].textContent = inputValue; + span['0'].className = 'fa fa-pencil-square-o'; + cancel['0'].innerHTML = ''; + var modifyData = { + "systemType" : systemType, + "code" : code, + "defaulInfo" : json.defaulInfo, + "customInfo" : inputValue + }; + $.ajax({ + "dataType" : 'json', + "type" : "PUT", + "url" : "/web/rest/web/fm/Maintenance", + "contentType" : 'application/json; charset=utf-8', + "data" : JSON.stringify(modifyData), + "error" : function () { + alert('Modify Error!'); + } + }); + } + }); + }, + "error" : function () { + alert('Communication Error!'); + } + }); + + return sOut; + } + + var generateColumns = function(columns, openRowFlag, rowCheckable){ + var $tableData = $('table#datatable_ajax' + contextData.curentDatableId); + var theadTR = $('thead > tr', $tableData); + if(rowCheckable){ + theadTR.append(''); + } + if(openRowFlag){ + theadTR.append('  '); + } + for(var i=0;i' + columns[i].columnTitle + ''); + } + } + + var sortHandling = function(oTable, openRowFlag, rowCheckable){ + var indexSkip = -1; + if(openRowFlag&&rowCheckable){ + indexSkip = 1; + }else if(openRowFlag&&!rowCheckable||!openRowFlag&&rowCheckable){ + indexSkip = 0; + } + var $sortOrder = 0; //排åºç±»åž‹ 1表示å‡åºï¼Œ0表示é™åº + var tableWrapper = $('div.dataTables_wrapper', contextData.wrapperDivContext); + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable', tableWrapper); + var $tableData = $('table#datatable_ajax' + contextData.curentDatableId); + var clearSort = function(currentTh){ + var ths = $tableHead.find('th').get(); + var tableDataHeadTHs = $tableData.find('th').get(); + $.each( ths, function( index, th ){ + if(index > indexSkip){ + if($(th).text() != currentTh.text()){ + if($(th).is('.sorting_disabled')){ + //do nothing; + }else if($(th).is('.sorting_asc')){ + $(th).removeClass('sorting_asc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_asc').addClass('sorting_disabled'); + }else if($(th).is('.sorting_desc')){ + $(th).removeClass('sorting_desc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_desc').addClass('sorting_disabled'); + } + } + } + }); + } + + $('th', $tableHead).each(function( column ) + { + if(column>indexSkip){ + //处ç†ä¸‰ç§æœ‰å¯èƒ½å­˜åœ¨çš„排åºå­—段,比较方法 + var findSortKey; + if( $(this).is('.sort-title') || $(this).is('.sorting_disabled') ) + { + findSortKey = function( $cell ) + { + var cellText = $cell.text(); + if(isNaN(cellText)){ + return $cell.text().toUpperCase(); + }else{ + return parseFloat(cellText); + } + //return $cell.text().toUpperCase(); + } + } + else if( $(this).is('.sort-date') ) + { + findSortKey = function( $cell ) + { + return Date.parse('1' + $cell.text()); + } + } + else if( $(this).is('.sort-price') ) + { + findSortKey = function( $cell ) + { + var key = parseFloat($cell.text().replace(/^[^\d.]*/, '')) + return isNaN(key) ? 0 : key; + } + } + + //æŽ’åº + if( findSortKey ) + { + $(this).click(function() + { + $sortOrder = $sortOrder == 0 ? 1 : 0; + var tableDataHeadTHs = $tableData.find('th').get(); + + if($sortOrder == 1){ + if($(this).is('.sorting_disabled')){ + $(this).removeClass('sorting_disabled').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_disabled').addClass('sorting_asc'); + }else if($(this).is('.sorting_asc')){ + $(this).removeClass('sorting_asc').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_asc').addClass('sorting_desc'); + }else if($(this).is('.sorting_desc')){ + $(this).removeClass('sorting_desc').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_desc').addClass('sorting_asc'); + } + }else{ + if($(this).is('.sorting_disabled')){ + $(this).removeClass('sorting_disabled').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_disabled').addClass('sorting_desc'); + }else if($(this).is('.sorting_asc')){ + $(this).removeClass('sorting_asc').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_asc').addClass('sorting_desc'); + }else if($(this).is('.sorting_desc')){ + $(this).removeClass('sorting_desc').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_desc').addClass('sorting_asc'); + } + } + clearSort($(this)); + + var rows = $tableData.find('tbody > tr').get(); + + $.each( rows, function( index, row ) + { + //先关掉所有行 + if ( oTable.fnIsOpen(row) ) + { + $(row).find('.row-details').click(); + } + }); + + //é‡æ–°å–得所有行,å¦åˆ™æŽ’åºåŽè¡¨æ ¼æ˜¾ç¤ºå¼‚常 + rows = $tableData.find('tbody > tr').get(); + + $.each( rows, function( index, row ) + { + row.sortKey = findSortKey($(row).children('td').eq(column)); + }); + //排åºæ–¹æ³• + rows.sort(function( a, b ) + { + if( $sortOrder == 1 ) + { + //å‡åº + if(a.sortKey < b.sortKey) return -1; + if(a.sortKey > b.sortKey) return 1; + return 0; + } + else + { + //é™åº + if(a.sortKey < b.sortKey) return 1; + if(a.sortKey > b.sortKey) return -1; + return 0; + } + }); + //排åºåŽçš„对象添加给$table + $.each( rows, function( index, row ) + { + $tableData.children('tbody').append(row); + row.sortKey = null; + }); + }); + } + } + }); + } + + var handleRecords = function(requestDatas, columns, xsHiddenColumns, smHiddenColumns, oLanguage, openRowFlag, rowCheckable, rowOverFlag, requestURL, requestParameters, tableHeight, columnsTooLong, sTotalRecordsSource, callbackList, totalRecords, requestType) { + + /* + jQuery.getJSON('/web/newict/framework/thirdparty/data-tables/app-universal-i18n-datatable-' + lang + '.json', + function(data) { + oLanguage = data; + }); + */ + grid = DatatableICT(); + grid.setCallbackList(callbackList); + grid.setContextData(contextData); + grid.setOpenRowFlag(openRowFlag); + grid.setRowCheckable(rowCheckable); + grid.setRowOverFlag(rowOverFlag); + grid.setColumnsTooLong(columnsTooLong); + grid.setSTotalRecordsSource(sTotalRecordsSource); + grid.setTotalRecords(totalRecords); + grid.setTableHeight(tableHeight); + grid.setRequestType(requestType); + //å–得查询æ¡ä»¶ +// if(!requestStr || requestStr.length == 0){ +// requestStr = JSON.stringify(requestAllData); +// } + grid.clearAjaxParams(); + if(requestType == "GET"){ + grid.addAjaxParam('data', JSON.stringify(requestDatas)); + }else{ + grid.addAjaxParam('data', requestDatas); + } + //å–得其他å‚æ•° + for(var i=0;i table.dataTable', tableWrapper); + var ths = $tableHead.find('th').get(); + var $tableData = $('table#datatable_ajax' + contextData.curentDatableId); + var tableDataHeadTHs = $tableData.find('th').get(); + $.each( ths, function( index, th ){ + //clear all sort direction + if($(th).is('.sorting_disabled')){ + //do nothing; + }else if($(th).is('.sorting_asc')){ + $(th).removeClass('sorting_asc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_asc').addClass('sorting_disabled'); + }else if($(th).is('.sorting_desc')){ + $(th).removeClass('sorting_desc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_desc').addClass('sorting_disabled'); + } + }); + + }, + onError: function(grid) { + // execute some code on network or other general error + }, + dataTable: { + "sDom" : "tr<'row'<'col-md-6 col-sm-12'><'col-md-6 col-sm-12'pli>>", // datatable layout + "oLanguage": oLanguage, + //"bAutoWidth": true, + "sScrollY": tableHeight, + "bScrollCollapse": true, + "sScrollX": "100%", + //"sScrollXInner": "110%", + "aLengthMenu": [ + [20, 50, 100], + [20, 50, 100] // change per page values here + ], + "iDisplayLength": 100, // default record count per page + "bServerSide": true, // server side processing + "sAjaxSource": requestURL // ajax source + } + }, columns, xsHiddenColumns, smHiddenColumns, openRowFlag, rowCheckable); + } + + /* + * Insert a 'details' column to the table + */ + var insertDetails = function (oTable, columns, rowCheckable) { + + var $tableData = $('table#datatable_ajax' + contextData.curentDatableId); + + $tableData.on('click', ' tbody td .row-details', function () { + var nTr = $(this).parents('tr')[0]; + if (oTable.fnIsOpen(nTr)) { + /* This row is already open - close it */ + $(this).addClass("row-details-close").removeClass("row-details-open"); + oTable.fnClose(nTr); + } else { + /* Open this row */ + $(this).addClass("row-details-open").removeClass("row-details-close"); + oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr, columns, rowCheckable), 'details'); + } + }); + } + + return { + + //main function to initiate the module + init: function (requestDatas, lang, configPathPrefix, callbackList, newColumns, totalPage) { + + var oLanguage; + var columns; + var xsHiddenColumns; + var smHiddenColumns; + var columnsAll; + + var openRowFlag = false; + var rowOverFlag = false; + var rowCheckable = false; + var requestURL=""; + var requestAllData; + var requestParameters; + + var tableHeight; + var tableWidth; + + var columnsTooLong; + var sTotalRecordsSource=""; + var totalRecords = 0; + + var requestType = "GET"; + + //å–得当å‰é…ç½®åŠå›½é™…åŒ–ä¿¡æ¯ + $.ajax({ + dataType: 'json', + url: configPathPrefix + '-' + lang + '.json', + async: false, + contentType:'application/json; charset=utf-8', + "success": function(data) { + oLanguage = data.language; + columns = data.columns; + if(newColumns){ + columns = newColumns; + } + xsHiddenColumns = data.xsHiddenColumns; + smHiddenColumns = data.smHiddenColumns; + columnsAll = data.columnsAll; + if(newColumns){ + columnsAll = newColumns; + } + openRowFlag = data.openRowFlag == 'true'? true: false; + rowOverFlag = data.rowOverFlag == 'true'? true: false; + rowCheckable = data.rowCheckable == 'true'? true: false; + requestURL = data.requestURL; + //requestAllData = data.requestAllData; + requestParameters = data.requestParameters; + tableHeight = data.tableHeight; + tableWidth = data.tableWidth; + columnsTooLong = data.columnsTooLong; + sTotalRecordsSource = data.sTotalRecordsSource; + if(data.sTotalRecords){ //性能的情况直接指定总行数 + totalRecords = parseInt(data.sTotalRecords); + } + if(totalPage){ //å¯ä»¥ä»Žå‚数指定总行数,适用于å•ç‹¬å‘请求获得总行数的场景 + totalRecords = totalPage; + } + if(data.requestType){ + requestType = data.requestType; + } + }, + "error" : function (xhr, info) { + alert('Communication Error! Error reason:' + info); + } + }); + + $('div#dataTableWrapperDiv' + contextData.curentDatableId).css('width', tableWidth); + + if(!isContained(xsHiddenColumns, smHiddenColumns) || !isContained(columns, xsHiddenColumns) || !isContained(columnsAll, columns)){ + alert('Columns claim error: (smHiddenColumns <= xsHiddenColumns <= columns <= columnsAll) Please!'); + return; + } + + generateColumns(columns, openRowFlag, rowCheckable); + //initPickers(); + handleRecords(requestDatas, columns, xsHiddenColumns, smHiddenColumns, oLanguage, openRowFlag, rowCheckable, rowOverFlag, requestURL, requestParameters, tableHeight, columnsTooLong, sTotalRecordsSource, callbackList, totalRecords, requestType); + //获得åˆå§‹åŒ–完毕的DataTable对象 + var oTable = grid.getDataTable(); + if(openRowFlag){ + insertDetails(oTable, columnsAll, rowCheckable); + } + sortHandling(oTable, openRowFlag, rowCheckable); + //oTable.fnAdjustColumnSizing(true); + return oTable; + }, + + getDataGrid: function(){ + return grid; + }, + + setContextData: function(newContextData){ + contextData = newContextData; + } + + }; + +}(); + +var addTableElementsId = function(){ + + var outterDivs = $('div.dataTableWrapperDiv'); + var currentId; + + if(outterDivs && outterDivs.length > 0) { + var maxId = -1; + var divIdNo; + $.each(outterDivs, function (index, div) { + var divId = $(div).attr("id"); + divIdNo = divId.substring(20); + if (divIdNo || divIdNo.length > 0){ + if (parseInt(divIdNo) > maxId) { + maxId = parseInt(divIdNo); + } + } + }); + currentId = maxId + 1; + } + + var curentDatableId = "_" + currentId; + + var dataTableWrapperDiv = $('div#dataTableWrapperDiv');//新添加的outterDiv + $(dataTableWrapperDiv).attr("id", "dataTableWrapperDiv" + curentDatableId); + var dataTableWrapperDivContext = dataTableWrapperDiv; + $('div.table-container', dataTableWrapperDiv).attr("id", "table-container" + curentDatableId); + $('table#datatable_ajax', dataTableWrapperDiv).attr("id", "datatable_ajax" + curentDatableId); + $('div#divOverlay', dataTableWrapperDiv).attr("id", "divOverlay" + curentDatableId); + //$('div#buttonConfirm', dataTableWrapperDiv).attr("id", "buttonConfirm" + curentDatableId); + //$('div#buttonUnConfirm', dataTableWrapperDiv).attr("id", "buttonUnConfirm" + curentDatableId); + $('div#myModal', dataTableWrapperDiv).attr("id", "myModal" + curentDatableId); + $('div#myModalConfirm', dataTableWrapperDiv).attr("id", "myModalConfirm" + curentDatableId); + $('span#alarm_number', dataTableWrapperDiv).attr("id", "alarm_number" + curentDatableId); + + return { + "curentDatableId": curentDatableId, + "wrapperDivContext":dataTableWrapperDivContext + } +} + +var DataTableICT = function(requestDatas, tableDivId, tableDivPath, configPathPrefix, callbackList, newColumns, totalPage){ + + /* var requestStr = ""; + if(datas){ + requestStr = JSON.stringify(datas); + } */ + + var lang = getLanguage(); + //lang = 'en-US'; + + /**å–得表格组件所需html片段 **/ + /*jQuery('div#' + tableDivId).load(tableDivPath, function() { + var contextData = addTableElementsId(); + TableAjaxICT.setContextData(contextData); + + var lang = getLanguage(); + //lang = 'en-US'; + var oTable = TableAjaxICT.init(requestStr, lang, configPathPrefix); + + //é‡æ–°è°ƒèŠ‚列宽以适应window resize + $(window).bind('resize', function () { + //oTable.DataTable.models.oSettings.bAjaxDataGet = false; + oTable.fnAdjustColumnSizing(); + } ); + });*/ + + /**åŒæ­¥å–得表格组件所需html片段 **/ + $.ajax({ + async : false, + "dataType" : "html", + "type" : "GET", + "url" : tableDivPath, + "data" : null, + "success" : function (html, textStatus, jqXHR) { + $('div#' + tableDivId).html(html); + }, + "error" : function () { + alert("Communication error!"); + } + }); + + var contextData = addTableElementsId(); + TableAjaxICT.setContextData(contextData); + + var oTable = TableAjaxICT.init(requestDatas, lang, configPathPrefix, callbackList, newColumns, totalPage); + + //é‡æ–°è°ƒèŠ‚列宽以适应window resize + $(window).bind('resize', function () { + //oTable.DataTable.models.oSettings.bAjaxDataGet = false; + oTable.fnAdjustColumnSizing(); + } ); + + return TableAjaxICT.getDataGrid(); +} diff --git a/common/src/main/webapp/thirdparty/data-tables/DataTableSmartClient.js b/common/src/main/webapp/thirdparty/data-tables/DataTableSmartClient.js new file mode 100644 index 00000000..4cb8cb58 --- /dev/null +++ b/common/src/main/webapp/thirdparty/data-tables/DataTableSmartClient.js @@ -0,0 +1,1215 @@ +/*** + Wrapper/Helper Class for datagrid based on jQuery Datatable Plugin + ***/ +var DatatableICT = function () { + + var tableOptions; // main options + var dataTable; // datatable object + var table; // actual table jquery object + var tableContainer; // actual table container object + var tableWrapper; // actual table wrapper jquery object + var tableInitialized = false; + var ajaxParams = []; // set filter mode + var columns; + var xsHiddenColumns; + var smHiddenColumns; + var columnMaxLength = 30; + var columnsTooLong; + var hidden_xs_maxWidth = 768; + var hidden_sm_maxWidth = 991; + + var openRowFlag = false; + var rowOverFlag = false; + var rowCheckable = false; + + var aTargetsAll; + var sTotalRecordsSource; + var tableHeight; + + var includedInXsHiddenColumns = function(columnId){ + for(var i=0;i tr > td:nth-child(1) input[type="checkbox"]:checked', table).size(); + var text = tableOptions.dataTable.oLanguage.sGroupActions; + if (selected > 0) { + $('.table-group-actions > span', tableWrapper).text(text.replace("_TOTAL_", selected)); + } else { + $('.table-group-actions > span', tableWrapper).text(""); + } + } + + var jsonObjectToArray = function(json, columns, iDraw){ + var jsonToDatatable = {aaData:[], sEcho:iDraw, iTotalRecords:0, iTotalDisplayRecords:0 }; + for(var i=0; i"); + } + if(openRowFlag){ + jsonToDatatable.aaData[i].push(""); + } + for(var j=0; j= hidden_xs_maxWidth && $(window).width() < hidden_sm_maxWidth && includedInSmHiddenColumns(columns[j].columnId )){ + /*éšè—pad尺寸需è¦éšè—的列*/ + }else if($(window).width() < hidden_xs_maxWidth && includedInXsHiddenColumns(columns[j].columnId )){ + /*éšè—手机尺寸需è¦éšè—的列*/ + }else{ + var currentColumnId = columns[j].columnId; + if(jQuery.inArray(currentColumnId, columnsTooLong) > -1){ + var rawText = ""; + for(var k=0;k columnMaxLength){ + jsonToDatatable.aaData[i].push(rawText.slice(0, columnMaxLength) + '...'); + }else{ + jsonToDatatable.aaData[i].push(resRowObject[currentColumnId]); + } + } else { + jsonToDatatable.aaData[i].push(resRowObject[currentColumnId]); + } + + } + } + } + jsonToDatatable.sEcho++; + var totalRow = 0; + var totalRecordsSource = eval('json.' + sTotalRecordsSource); + if(totalRecordsSource && totalRecordsSource.length >0){ + totalRow = parseInt(totalRecordsSource); + } + if(isNaN(totalRow)){ + alert('All rows counting number got fail!'); + }else{ + jsonToDatatable.iTotalRecords = totalRow; + jsonToDatatable.iTotalDisplayRecords = totalRow; + } + return jsonToDatatable; + } + + var singleAlarmDel = function(divOverlay){ + + //æ ¹æ®æµ®åŠ¨æ¡†çš„当å‰id获å–需è¦åˆ é™¤çš„è¡Œ + var trId = divOverlay.attr('id_tr'); + tr=$('tr#' + trId); + var tds = $(tr).children(); + var tdAlarmId = $(tds.eq(2)).text(); + + var data= { + "alarmId":[parseInt(tdAlarmId)] + }; + + var sSource = "/web/rest/web/fm/curalarms?data=" + JSON.stringify(data) + "&_operationType=remove&_dataSource=isc_PageRestDataSource_0&isc_metaDataPrefix=_&isc_dataFormat=json"; + + $.ajax( { + "dataType": 'json', + "type": "DELETE", + "url": sSource, + "data" : null, + "contentType" : 'application/json; charset=utf-8', + "success": function(json) { + if(json.response.status == 0){ + var resRowObject = json.response.data[0]; + //alert('删除æˆåŠŸ'); + } + if(json.response.status == -1){ + //alert('删除失败'); + } + }, + "error": function() { + alert('Communication Error!'); + } + } ); + } + + var singleAlarmAckUnAck = function(divOverlay, ackType){ + + //æ ¹æ®æµ®åŠ¨æ¡†çš„当å‰id获å–需è¦ç¡®è®¤çš„è¡Œ + var trId = divOverlay.attr('id_tr'); + var tr = $('tr#' + trId); + + //å–å¾—éšè—的头部表格的相应行 + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable'); + //var trHead = $('tbody > tr:nth-child(' + trId + ')', $tableHead); + var trHead = $('tr#' + trId.replace('body', 'head'), $tableHead); + var tdDivs = $('td > div', trHead); + + var tds = $(tr).children(); + var tdAlarmId = ""; + if(rowCheckable){ + tdAlarmId = $(tds.eq(2)).text(); + }else{ + tdAlarmId = $(tds.eq(1)).text(); + } + + var aoData = + { + "dataSource":"isc_PageRestDataSource_0", + "operationType":"update", + "componentId":"isc_com_zte_ums_aos_fm_view_eventview_table_AlarmTable_0", + "data":{ + "viewType":1, + "state":ackType, + "alarmId":[ + parseInt(tdAlarmId) + ] + }, + "oldValues":null + }; + + var sSource = "/web/rest/web/fm/curalarms?isc_dataFormat=json"; + + $.ajax( { + "dataType": 'json', + "type": "PUT", + "url": sSource, + "contentType": 'application/json; charset=utf-8', + "data": JSON.stringify(aoData), + "success": function(json) { + json = AlarmLabels.transformFieldNames(json); + if(json.response.status == 0){ + var resRowObject = json.response.data[0]; + var columnsCopy = $.extend(true, [], columns); + //éšè—列的情况下需è¦ç‰¹æ®Šå¤„ç† + if($(window).width()>=hidden_xs_maxWidth && $(window).width() -1) { + var rawText = ""; + for(var k=0;k columnMaxLength){ + $(tds.eq(i)).html(rawText.slice(0, columnMaxLength) + '...'); + $(tdDivs.eq(i)).html(rawText.slice(0, columnMaxLength) + '...'); + }else{ + $(tds.eq(i)).html(resRowObject[currentColumnId]); + $(tdDivs.eq(i)).html(resRowObject[currentColumnId]); + } + } else { + $(tds.eq(i)).html(resRowObject[currentColumnId]); + $(tdDivs.eq(i)).html(resRowObject[currentColumnId]); + } + } + //更新缓存中的当å‰è¡Œæ•°æ® + for (var t = 0; t < dataTable.datas.length; t++) { + var temp = dataTable.datas[t]; + if (temp.alarmId == resRowObject['alarmId']) { + dataTable.datas[t] = resRowObject; + break; + } + } + } + if(json.response.status == -1){ + $('div#myModalConfirm').modal({ + keyboard: false, + backdrop: 'static' + }); + $('span#alarm_number').html(tdAlarmId); + //å›½é™…åŒ–ä¿¡æ¯ + if(ackType==1){ + $('span#aos_fm_alarm_opeater_ack_already').html($.i18n.prop('aos_fm_alarm_opeater_ack_already_ok')); + }else{ + $('span#aos_fm_alarm_opeater_ack_already').html($.i18n.prop('aos_fm_alarm_opeater_ack_already_un')); + } + } + }, + "error": function() { + alert('Communication Error!'); + } + } ); + } + + var addRowOverlap = function(){ + var $tableData = $('table#datatable_ajax'); + //å–å¾—éšè—的头部表格的相应行 + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable'); + var trHeads = $tableHead.find('tr').get(); + $.each( trHeads, function( index, trHead ){ + $(trHead).attr('id', 'headTableTR' + index); + }); + //å–得浮动div + var $divOverlay = $('div#divOverlay'); + var divScrollHead = $('div.dataTables_scrollHead'); + var divRightPadding = $('div#divRightPadding'); + //å–表头下边沿ä½ç½® + var tableHeadBottomHeight = $(divScrollHead).position().top + $(divScrollHead).height(); + var tableBottom = $tableData.position().top + $tableData.height(); + //å–表格å³è¾¹æ²¿ä½ç½® + var tableRightEdgePosition = $(divRightPadding).position().left; + var trs = $tableData.find('tr').get(); + $.each( trs, function( index, tr ){ + var tdEmpty = $('td.dataTables_empty',tr); + if(!tdEmpty || tdEmpty.length ==0 ){ + $(tr).attr('id', 'bodyTableTR' + index); + //$divOverlay.attr('id_tr', 'bodyTableTR' + index); + $(tr).one('hover', function(){ + var rowPos = $(tr).position(); + var currentTrTop = rowPos.top; + //var bottomLeft = rowPos.left; + $divOverlay.attr('id_tr', 'bodyTableTR' + index); + $divOverlay.css({ + display: 'block', + position: 'absolute', + 'background-color': '#e5e5e5', + //opacity: 0.7, + border: 'solid 0px', + top: currentTrTop + 6, + left: tableRightEdgePosition - 308, + width: 300, + height: 30 + }); + //防止浮动框跳出表格内容区域 + if( $divOverlay.position().top < tableHeadBottomHeight || $divOverlay.position().top + $divOverlay.height() > tableBottom){ + $divOverlay.css('display', 'none'); + } + var buttonConfirm = $('div#buttonConfirm', $divOverlay); + var buttonUnConfirm = $('div#buttonUnConfirm', $divOverlay); + $(buttonConfirm).one('click', function(){ + var buttonRoundedTDsConfirm = $(buttonConfirm).find('td.buttonRounded'); + var buttonRoundedTDsUnConfirm = $(buttonUnConfirm).find('td.buttonRoundedDisabled'); + if(buttonRoundedTDsConfirm && buttonRoundedTDsConfirm.length > 0){ + $.each(buttonRoundedTDsConfirm, function(index, td){ + $(td).removeClass('buttonRounded').addClass('buttonRoundedDisabled'); + }); + $.each(buttonRoundedTDsUnConfirm, function(index, td){ + $(td).removeClass('buttonRoundedDisabled').addClass('buttonRounded'); + }); + $divOverlay.css('display', 'none'); + singleAlarmAckUnAck($divOverlay, 1); + } + }); + $(buttonUnConfirm).one('click', function(){ + var buttonRoundedTDsUnConfirm = $(buttonUnConfirm).find('td.buttonRounded'); + var buttonRoundedTDsConfirm = $(buttonConfirm).find('td.buttonRoundedDisabled'); + if(buttonRoundedTDsUnConfirm && buttonRoundedTDsUnConfirm.length > 0){ + $.each(buttonRoundedTDsUnConfirm, function(index, td){ + $(td).removeClass('buttonRounded').addClass('buttonRoundedDisabled'); + }); + $.each(buttonRoundedTDsConfirm, function(index, td){ + $(td).removeClass('buttonRoundedDisabled').addClass('buttonRounded'); + }); + $divOverlay.css('display', 'none'); + singleAlarmAckUnAck($divOverlay, 2); + } + }); + var buttonDelete = $('div#buttonDelete', $divOverlay); + $(buttonDelete).die().live('click', function(){ + //弹出删除确认对è¯æ¡† + $('div#myModal').modal({ + keyboard: false, + backdrop: 'static' + }); + $('#delConfirm').die().live('click', function(){ + $divOverlay.css('display', 'none'); + dataTable.fnClose(tr); + $(tr).remove(); + //删除表头表格的相应行 + $('tr#' + $(tr).attr('id').replace('body', 'head'), $tableHead).remove(); + //删除åŽç«¯æ•°æ® + singleAlarmDel($divOverlay); + //刷新表格 + dataTable.fnAdjustColumnSizing(); + }); + }); + //展开行的情况éšè— + $('td.details > table.detailTable').on('hover', function(){ + $divOverlay.css('display', 'none'); + }); + }); + } + }); + } + + return { + + //main function to initiate the module + init: function (options, columnsDefined, xsHiddenColumnsDefined, smHiddenColumnsDefined) { + + if (!$().dataTable) { + return; + } + + var the = this; + + //记录需è¦ç¦æŽ‰é»˜è®¤æŽ’åºçš„列 + var aTargets = []; + var targetsLength = columnsDefined.length; + if(rowCheckable)targetsLength++; + if(openRowFlag)targetsLength++; + for(var i=0;i<'col-md-4 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>", // datatable layout + + "aoColumnDefs" : [{ // define columns sorting options(by default all columns are sortable extept the first checkbox column) + 'bSortable' : false, + 'aTargets' : aTargets + }], + + "bAutoWidth": false, // disable fixed width and enable fluid table + //"bSortCellsTop": true, // make sortable only the first row in thead + "sPaginationType": "bootstrap_extended", // pagination type(bootstrap, bootstrap_full_number or bootstrap_extended) + "bProcessing": true, // enable/disable display message box on record load + "bServerSide": true, // enable/disable server side ajax loading + "sAjaxSource": "", // define ajax source URL + //"sServerMethod": "GET", + + // handle ajax request + "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) { + //for ICT Paging + //var startIndex = aoData[3].value;//"iDisplayStart" + //var pageLength = aoData[4].value;//"iDisplayLength" + var oPaging = oSettings.oInstance.fnPagingInfo(); + //var startIndex = oPaging.iStart; + var pageLength = oPaging.iLength; + var curPageNo = oPaging.iPage + 1; + + for(var k=aoData.length-1;k>=0;k--){ + var flag = -1; + if(aoData[k].name=='pageSize'){ + aoData[k].value=pageLength; + flag++; + } + if(aoData[k].name=='pageNo'){ + aoData[k].value=curPageNo; + flag++ + } + if(flag == 1)break; + } + + oSettings.jqXHR = $.ajax( { + "dataType": 'json', + "type": "GET", + "url": sSource, + "data": aoData, + "success": function(res, textStatus, jqXHR) { + if (res.sMessage) { + openoFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); + } + if ($('.group-checkable', tableContainer).size() === 1) { + $('.group-checkable', tableContainer).attr("checked", false); + $.uniform.update($('.group-checkable', tableContainer)); + } + if (tableOptions.onSuccess) { + tableOptions.onSuccess.call(the); + } + //ä¿å­˜æ•°æ®åœ¨dataTable对象中给行详细信æ¯é¢æ¿ç”¨ + dataTable.datas = res.response.data; + if(res.response.status < 0){ + alert(res.response.data); + return; + } + + //å‘Šè­¦å­—æ®µå€¼è½¬æ¢ + res = AlarmLabels.transformFieldNames(res); + + res = jsonObjectToArray(res, columns, oSettings.iDraw); + + //é‡ç»˜è¡¨æ ¼ + fnCallback(res, textStatus, jqXHR); + }, + "error": function() { + if (tableOptions.onError) { + tableOptions.onError.call(the); + } + openoFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); + $('.dataTables_processing', tableWrapper).remove(); + } + } ); + + }, + + // pass additional parameter + "fnServerParams": function ( aoData ) { + //here can be added an external ajax request parameters. + //for(var i in ajaxParams) { + for(var i=0; i table.dataTable', tableWrapper); + var tbodyHead = $('tbody', $tableHead); + if(tbodyHead && tbodyHead.length >0){ + $(tbodyHead).remove(); + } + + var $tableBody = $('table#datatable_ajax', tableWrapper); + var trIn = $('thead > tr:nth-child(1)', $tableHead); + var trBodyHead = $('thead > tr:nth-child(1)', $tableBody); + var tds = $(trIn).children(); + var ths = $(trBodyHead).children(); + for(var k=0;k' + tds.eq(k).html() + '
'); + } + var bodyRows = $('tbody > tr', $tableBody); + for(var i=0;i' + tds.eq(j).html() + '
'); + $(tds.eq(j)).height('0px'); + $(tds.eq(j)).css('padding-top','0px'); + $(tds.eq(j)).css('padding-bottom','0px'); + $(tds.eq(j)).css('border-top-width','0px'); + $(tds.eq(j)).css('border-bottom-width','0px'); + } + $(rowClone).height('0px'); + $tableHead.append($(rowClone).prop("outerHTML")); + } + + $('.dataTables_scrollBody').css('width','100%'); + $('.dataTables_scrollHead').css('width','98.5%'); + $('.dataTables_scrollHeadInner').css('padding-right', 0); + + //添加浮动确认å确认按钮 + if(rowOverFlag){ + addRowOverlap(); + } + + //设置表格本体高度 + $('div.dataTables_scrollBody').css('height', tableHeight); + } + } + }, options); + + tableOptions = options; + + columns = columnsDefined; + xsHiddenColumns = xsHiddenColumnsDefined; + smHiddenColumns = smHiddenColumnsDefined; + // create table's jquery object + table = $(options.src); + tableContainer = table.parents(".table-container"); + // apply the special class that used to restyle the default datatable + + $.fn.dataTableExt.oStdClasses.sWrapper = $.fn.dataTableExt.oStdClasses.sWrapper + " dataTables_extended_wrapper"; + + // initialize a datatable + dataTable = table.dataTable(options.dataTable); + + tableWrapper = table.parents('.dataTables_wrapper'); + + // modify table per page dropdown input by appliying some classes + $('.dataTables_length select', tableWrapper).addClass("form-control input-xsmall input-sm"); + + // handle group checkboxes check/uncheck + $('.group-checkable', tableContainer).change(function () { + var set = $('tbody > tr > td:nth-child(1) input[type="checkbox"]', table); + var checked = $(this).is(":checked"); + $(set).each(function () { + $(this).attr("checked", checked); + }); + $.uniform.update(set); + countSelectedRecords(); + }); + + // handle row's checkbox click + table.on('change', 'tbody > tr > td:nth-child(1) input[type="checkbox"]', function(){ + countSelectedRecords(); + }); + + //填充表头å³è¾¹ç•Œ + $('.dataTables_scrollHead').css('display','inline-block'); + //var dataTables_scrollHead_height = $('.dataTables_scrollHead').css( "height" ); + $(".dataTables_scrollHead").after("
"); + if($.browser.mozilla){ + $('#divRightPadding').css('height', '40'); + } + + //éšè—掉æŸäº›åˆ— + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable', tableWrapper); + var $tableBody = $('table#datatable_ajax', tableWrapper); + + for(var i=0;i tr > th#' + columns[j].columnId, $tableHead).addClass('hidden-xs'); + $('thead > tr > th#' + columns[j].columnId, $tableBody).addClass('hidden-xs'); + break; + } + } + } + + for(var i=0;i tr > th#' + columns[j].columnId, $tableHead).addClass('hidden-sm'); + $('thead > tr > th#' + columns[j].columnId, $tableBody).addClass('hidden-sm'); + break; + } + } + } + },//end init------------------------------------------------------------------------------------ + + getSelectedRowsCount: function() { + return $('tbody > tr > td:nth-child(1) input[type="checkbox"]:checked', table).size(); + }, + + getSelectedRows: function() { + var rows = []; + $('tbody > tr > td:nth-child(1) input[type="checkbox"]:checked', table).each(function(){ + rows.push({name: $(this).attr("name"), value: $(this).val()}); + }); + + return rows; + }, + + addAjaxParam: function(name, value) { + ajaxParams.push({"name": name, "value": value}); + }, + + clearAjaxParams: function(name, value) { + ajaxParams = []; + }, + + getDataTable: function() { + return dataTable; + }, + + getTableWrapper: function() { + return tableWrapper; + }, + + gettableContainer: function() { + return tableContainer; + }, + + getTable: function() { + return table; + }, + + setOpenRowFlag: function(openRowFlagInput) { + openRowFlag = openRowFlagInput; + }, + + setRowOverFlag: function(rowOverFlagInput) { + rowOverFlag = rowOverFlagInput; + }, + + setRowCheckable: function(rowCheckableInput) { + rowCheckable = rowCheckableInput; + }, + + setColumnsTooLong: function(columnsTooLongInput) { + columnsTooLong = columnsTooLongInput; + }, + + setSTotalRecordsSource: function(sTotalRecordsSourceInput){ + sTotalRecordsSource = sTotalRecordsSourceInput; + }, + + setTableHeight: function(tableHeightInput){ + tableHeight = tableHeightInput; + } + + }; + +}; + +var TableAjaxICT = function () { + + var initPickers = function () { + //init date pickers + $('.date-picker').datepicker({ + //rtl: App.isRTL(), + autoclose: true + }); + } + + //判断a数组是å¦åŒ…å«b数组 + function isContained(largeArray, smallArray){ + if(!(largeArray instanceof Array) || !(smallArray instanceof Array)) + return false; + if(largeArray.length < smallArray.length) + return false; + for(var i = 0; i < smallArray.length; i++){ + var flag = false; + for(j=0;j' + alarmId + ''; + sOut += '' + columns[4].columnTitle + '' + perceivedSeverity + ''; + sOut += '' + columns[9].columnTitle + '' + alarmType + ''; + sOut += '' + columns[3].columnTitle + '' + alarmRaisedTime + ''; + + sOut += '' + columns[5].columnTitle + '' + probableCauseDesc + ''; + sOut += '' + columns[15].columnTitle + '' + alarmChangedTime + ''; + sOut += '' + columns[11].columnTitle + '' + ackState + ''; + + sOut += '' + columns[12].columnTitle + '' + ackTime + ''; + sOut += '' + columns[13].columnTitle + '' + ackUserId + ''; + sOut += '' + columns[14].columnTitle + '' + ackSystemId + ''; + sOut += '' + columns[7].columnTitle + '' + neip + ''; + + sOut += '' + columns[2].columnTitle + '' + moc + ''; + sOut += '' + columns[1].columnTitle + '' + resDisplayName + ''; + + sOut += '' + columns[8].columnTitle + '' + componentname + ''; + sOut += '' + columns[16].columnTitle + '' + position1 + ''; + + sOut += '' + columns[10].columnTitle + '' + specificproblem + ''; + + sOut += '' + columns[6].columnTitle + '' + additionalText + ''; + + sOut += '' + $.i18n.prop('aos_fm_SuggestionSetting_view_DefaultSuggestionGroupTitle').replace(';', '').replace(/\"/g,'') + '' + ''; + + sOut += '' + $.i18n.prop('aos_fm_SuggestionSetting_view_SettingSuggestionGroupTitle').replace(';', '').replace(/\"/g,'') + ''; + + sOut += ''; + + /* + var systemType = 0; + var code = 0; + for (var i = 0; i < oTable.datas.length; i++) { + var temp = oTable.datas[i]; + if (temp.alarmId == oTr['alarmId'].value) { + systemType = temp.systemType; + code = temp.probableCauseCode; + } + }*/ + var data = { + "systemType" : systemType, + "code" : code + }; + var sendData = JSON.stringify(data); + $.ajax({ + "dataType" : 'json', + "type" : "GET", + "url" : "/web/rest/web/fm/Maintenance" + "?" + "data=" + sendData, + "contentType" : 'application/json; charset=utf-8', + "data" : null, + "success" : function (json) { + $('tr').find('td#defaulInfo' + id).text(json.defaulInfo); + $('tr').find('td#customInfo' + id).text(json.customInfo); + var modify = $('#customInfoModify' + id); + modify.on('click', function () { + var span = $('#modifyBtnSpan' + id); + var customInfo = $('tr').find('td#customInfo' + id); + var cancel = $('#cancelDiv' + id); + if (span['0'].className === 'fa fa-pencil-square-o') { + var value = customInfo['0'].textContent; + customInfo['0'].textContent = ''; + customInfo['0'].innerHTML = ''; + span['0'].className = 'fa fa-floppy-o'; + cancel['0'].innerHTML = ''; + $('#cancelBtn' + id).on('click', function () { + customInfo['0'].innerHTML = ''; + customInfo['0'].textContent = value; + cancel['0'].innerHTML = ''; + span['0'].className = 'fa fa-pencil-square-o'; + }); + } else { + var inputValue = $('#customInfoInput' + id)['0'].value; + customInfo['0'].innerHTML = ''; + customInfo['0'].textContent = inputValue; + span['0'].className = 'fa fa-pencil-square-o'; + cancel['0'].innerHTML = ''; + var modifyData = { + "systemType" : systemType, + "code" : code, + "defaulInfo" : json.defaulInfo, + "customInfo" : inputValue + }; + $.ajax({ + "dataType" : 'json', + "type" : "PUT", + "url" : "/web/rest/web/fm/Maintenance", + "contentType" : 'application/json; charset=utf-8', + "data" : JSON.stringify(modifyData), + "error" : function () { + alert('Modify Error!'); + } + }); + } + }); + }, + "error" : function () { + alert('Communication Error!'); + } + }); + + return sOut; + } + + var generateColumns = function(columns, openRowFlag, rowCheckable){ + var $tableData = $('table#datatable_ajax'); + var theadTR = $('thead > tr', $tableData); + if(rowCheckable){ + theadTR.append(''); + } + if(openRowFlag){ + theadTR.append('  '); + } + for(var i=0;i' + columns[i].columnTitle + ''); + } + } + + var sortHandling = function(oTable, openRowFlag, rowCheckable){ + var indexSkip = -1; + if(openRowFlag&&rowCheckable){ + indexSkip = 1; + }else if(openRowFlag&&!rowCheckable||!openRowFlag&&rowCheckable){ + indexSkip = 0; + } + var $sortOrder = 0; //排åºç±»åž‹ 1表示å‡åºï¼Œ0表示é™åº + var tableWrapper = $('div#datatable_ajax_wrapper'); + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable', tableWrapper); + var $tableData = $('table#datatable_ajax'); + var clearSort = function(currentTh){ + var ths = $tableHead.find('th').get(); + var tableDataHeadTHs = $tableData.find('th').get(); + $.each( ths, function( index, th ){ + if(index > indexSkip){ + if($(th).text() != currentTh.text()){ + if($(th).is('.sorting_disabled')){ + //do nothing; + }else if($(th).is('.sorting_asc')){ + $(th).removeClass('sorting_asc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_asc').addClass('sorting_disabled'); + }else if($(th).is('.sorting_desc')){ + $(th).removeClass('sorting_desc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_desc').addClass('sorting_disabled'); + } + } + } + }); + } + + $('th', $tableHead).each(function( column ) + { + if(column>indexSkip){ + //处ç†ä¸‰ç§æœ‰å¯èƒ½å­˜åœ¨çš„排åºå­—段,比较方法 + var findSortKey; + if( $(this).is('.sort-title') || $(this).is('.sorting_disabled') ) + { + findSortKey = function( $cell ) + { + var cellText = $cell.text(); + if(isNaN(cellText)){ + return $cell.text().toUpperCase(); + }else{ + return parseFloat(cellText); + } + //return $cell.text().toUpperCase(); + } + } + else if( $(this).is('.sort-date') ) + { + findSortKey = function( $cell ) + { + return Date.parse('1' + $cell.text()); + } + } + else if( $(this).is('.sort-price') ) + { + findSortKey = function( $cell ) + { + var key = parseFloat($cell.text().replace(/^[^\d.]*/, '')) + return isNaN(key) ? 0 : key; + } + } + + //æŽ’åº + if( findSortKey ) + { + $(this).click(function() + { + $sortOrder = $sortOrder == 0 ? 1 : 0; + var tableDataHeadTHs = $tableData.find('th').get(); + + if($sortOrder == 1){ + if($(this).is('.sorting_disabled')){ + $(this).removeClass('sorting_disabled').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_disabled').addClass('sorting_asc'); + }else if($(this).is('.sorting_asc')){ + $(this).removeClass('sorting_asc').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_asc').addClass('sorting_desc'); + }else if($(this).is('.sorting_desc')){ + $(this).removeClass('sorting_desc').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_desc').addClass('sorting_asc'); + } + }else{ + if($(this).is('.sorting_disabled')){ + $(this).removeClass('sorting_disabled').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_disabled').addClass('sorting_desc'); + }else if($(this).is('.sorting_asc')){ + $(this).removeClass('sorting_asc').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_asc').addClass('sorting_desc'); + }else if($(this).is('.sorting_desc')){ + $(this).removeClass('sorting_desc').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_desc').addClass('sorting_asc'); + } + } + clearSort($(this)); + + var rows = $tableData.find('tbody > tr').get(); + + $.each( rows, function( index, row ) + { + //先关掉所有行 + if ( oTable.fnIsOpen(row) ) + { + $(row).find('.row-details').click(); + } + }); + + //é‡æ–°å–得所有行,å¦åˆ™æŽ’åºåŽè¡¨æ ¼æ˜¾ç¤ºå¼‚常 + rows = $tableData.find('tbody > tr').get(); + + $.each( rows, function( index, row ) + { + row.sortKey = findSortKey($(row).children('td').eq(column)); + }); + //排åºæ–¹æ³• + rows.sort(function( a, b ) + { + if( $sortOrder == 1 ) + { + //å‡åº + if(a.sortKey < b.sortKey) return -1; + if(a.sortKey > b.sortKey) return 1; + return 0; + } + else + { + //é™åº + if(a.sortKey < b.sortKey) return 1; + if(a.sortKey > b.sortKey) return -1; + return 0; + } + }); + //排åºåŽçš„对象添加给$table + $.each( rows, function( index, row ) + { + $tableData.children('tbody').append(row); + row.sortKey = null; + }); + }); + } + } + }); + } + + var handleRecords = function(requestStr, columns, xsHiddenColumns, smHiddenColumns, oLanguage, openRowFlag, rowCheckable, rowOverFlag, requestURL, requestParameters, tableHeight, columnsTooLong, sTotalRecordsSource) { + + /* + jQuery.getJSON('/web/newict/framework/thirdparty/data-tables/app-universal-i18n-datatable-' + lang + '.json', + function(data) { + oLanguage = data; + }); + */ + grid.setOpenRowFlag(openRowFlag); + grid.setRowCheckable(rowCheckable); + grid.setRowOverFlag(rowOverFlag); + grid.setColumnsTooLong(columnsTooLong); + grid.setSTotalRecordsSource(sTotalRecordsSource); + grid.setTableHeight(tableHeight); + //å–得查询æ¡ä»¶ +// if(!requestStr || requestStr.length == 0){ +// requestStr = JSON.stringify(requestAllData); +// } + grid.clearAjaxParams(); + grid.addAjaxParam('data', requestStr); + //å–得其他å‚æ•° + for(var i=0;i table.dataTable', tableWrapper); + var ths = $tableHead.find('th').get(); + var $tableData = $('table#datatable_ajax'); + var tableDataHeadTHs = $tableData.find('th').get(); + $.each( ths, function( index, th ){ + //clear all sort direction + if($(th).is('.sorting_disabled')){ + //do nothing; + }else if($(th).is('.sorting_asc')){ + $(th).removeClass('sorting_asc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_asc').addClass('sorting_disabled'); + }else if($(th).is('.sorting_desc')){ + $(th).removeClass('sorting_desc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_desc').addClass('sorting_disabled'); + } + }); + + }, + onError: function(grid) { + // execute some code on network or other general error + }, + dataTable: { + "sDom" : "tr<'row'<'col-md-6 col-sm-12'><'col-md-6 col-sm-12'pli>>", // datatable layout + "oLanguage": oLanguage, + //"bAutoWidth": true, + "sScrollY": tableHeight, + "bScrollCollapse": true, + "sScrollX": "100%", + //"sScrollXInner": "110%", + "aLengthMenu": [ + [20, 50, 100], + [20, 50, 100] // change per page values here + ], + "iDisplayLength": 20, // default record count per page + "bServerSide": true, // server side processing + "sAjaxSource": requestURL // ajax source + } + }, columns, xsHiddenColumns, smHiddenColumns, openRowFlag, rowCheckable); + } + + /* + * Insert a 'details' column to the table + */ + var insertDetails = function (oTable, columns, rowCheckable) { + + var $tableData = $('table#datatable_ajax'); + + $tableData.on('click', ' tbody td .row-details', function () { + var nTr = $(this).parents('tr')[0]; + if (oTable.fnIsOpen(nTr)) { + /* This row is already open - close it */ + $(this).addClass("row-details-close").removeClass("row-details-open"); + oTable.fnClose(nTr); + } else { + /* Open this row */ + $(this).addClass("row-details-open").removeClass("row-details-close"); + oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr, columns, rowCheckable), 'details'); + } + }); + } + + return { + + //main function to initiate the module + init: function (requestStr, lang, configPathPrefix) { + + var oLanguage; + var columns; + var xsHiddenColumns; + var smHiddenColumns; + var columnsAll; + + var openRowFlag = false; + var rowOverFlag = false; + var rowCheckable = false; + var requestURL=""; + var requestAllData; + var requestParameters; + + var tableHeight; + var tableWidth; + + var columnsTooLong; + var sTotalRecordsSource=""; + + //å–得当å‰é…ç½®åŠå›½é™…åŒ–ä¿¡æ¯ + $.ajax({ + dataType: 'json', + url: configPathPrefix + '-' + lang + '.json', + async: false, + contentType:'application/json; charset=utf-8', + "success": function(data) { + oLanguage = data.language; + columns = data.columns; + xsHiddenColumns = data.xsHiddenColumns; + smHiddenColumns = data.smHiddenColumns; + columnsAll = data.columnsAll; + openRowFlag = data.openRowFlag == 'true'? true: false; + rowOverFlag = data.rowOverFlag == 'true'? true: false; + rowCheckable = data.rowCheckable == 'true'? true: false; + requestURL = data.requestURL; + //requestAllData = data.requestAllData; + requestParameters = data.requestParameters; + tableHeight = data.tableHeight; + tableWidth = data.tableWidth; + columnsTooLong = data.columnsTooLong; + sTotalRecordsSource = data.sTotalRecordsSource; + }, + "error" : function (xhr, info) { + alert('Communication Error! Error reason:' + info); + } + }); + + $('#dataTableWrapperDiv').css('width', tableWidth); + + if(!isContained(xsHiddenColumns, smHiddenColumns) || !isContained(columns, xsHiddenColumns) || !isContained(columnsAll, columns)){ + alert('Columns claim error: (smHiddenColumns <= xsHiddenColumns <= columns <= columnsAll) Please!'); + return; + } + + generateColumns(columns, openRowFlag, rowCheckable); + //initPickers(); + handleRecords(requestStr, columns, xsHiddenColumns, smHiddenColumns, oLanguage, openRowFlag, rowCheckable, rowOverFlag, requestURL, requestParameters, tableHeight, columnsTooLong, sTotalRecordsSource); + //获得åˆå§‹åŒ–完毕的DataTable对象 + var oTable = grid.getDataTable(); + if(openRowFlag){ + insertDetails(oTable, columnsAll, rowCheckable); + } + sortHandling(oTable, openRowFlag, rowCheckable); + //oTable.fnAdjustColumnSizing(true); + return oTable; + } + + }; + +}(); + +var DataTableSmartClient = function(datas, configPathPrefix){ + + var requestStr = ""; + if(datas){ + requestStr = JSON.stringify(datas); + } + + var lang = getLanguage(); + //lang = 'en-US'; + loadi18n_FM(lang); + //requestStr = ""; + var oTable = TableAjaxICT.init(requestStr, lang, configPathPrefix); + + //é‡æ–°è°ƒèŠ‚列宽以适应window resize + $(window).one('resize', function () { + //oTable.DataTable.models.oSettings.bAjaxDataGet = false; + oTable.fnAdjustColumnSizing(false); + } ); +} diff --git a/common/src/main/webapp/thirdparty/data-tables/DataTableSmartClientApp.js b/common/src/main/webapp/thirdparty/data-tables/DataTableSmartClientApp.js new file mode 100644 index 00000000..8584aae3 --- /dev/null +++ b/common/src/main/webapp/thirdparty/data-tables/DataTableSmartClientApp.js @@ -0,0 +1,1312 @@ +/*** + Wrapper/Helper Class for datagrid based on jQuery Datatable Plugin + ***/ +var DatatableICT = function () { + + var tableOptions; // main options + var dataTable; // datatable object + var table; // actual table jquery object + var tableContainer; // actual table container object + var tableWrapper; // actual table wrapper jquery object + var tableInitialized = false; + var ajaxParams = []; // set filter mode + var columns; + var xsHiddenColumns; + var smHiddenColumns; + var columnMaxLength = 30; + var columnsTooLong; + var hidden_xs_maxWidth = 768; + var hidden_sm_maxWidth = 991; + + var openRowFlag = false; + var rowOverFlag = false; + var rowCheckable = false; + + var aTargetsAll; + var sTotalRecordsSource; + var tableHeight; + + var callbackList = []; + + var includedInXsHiddenColumns = function(columnId){ + for(var i=0;i tr > td:nth-child(1) input[type="checkbox"]:checked', table).size(); + var text = tableOptions.dataTable.oLanguage.sGroupActions; + if (selected > 0) { + $('.table-group-actions > span', tableWrapper).text(text.replace("_TOTAL_", selected)); + } else { + $('.table-group-actions > span', tableWrapper).text(""); + } + } + + var jsonObjectToArray = function(json, columns, iDraw){ + var jsonToDatatable = {aaData:[], sEcho:iDraw, iTotalRecords:0, iTotalDisplayRecords:0 }; + for(var i=0; i"); + } + if(openRowFlag){ + jsonToDatatable.aaData[i].push(""); + } + for(var j=0; j= hidden_xs_maxWidth && $(window).width() < hidden_sm_maxWidth && includedInSmHiddenColumns(columns[j].columnId )){ + /*éšè—pad尺寸需è¦éšè—的列*/ + }else if($(window).width() < hidden_xs_maxWidth && includedInXsHiddenColumns(columns[j].columnId )){ + /*éšè—手机尺寸需è¦éšè—的列*/ + }else{ + var currentColumnId = columns[j].columnId; + if(jQuery.inArray(currentColumnId, columnsTooLong) > -1){ + var rawText = ""; + for(var k=0;k columnMaxLength){ + jsonToDatatable.aaData[i].push(rawText.slice(0, columnMaxLength) + '...'); + }else{ + jsonToDatatable.aaData[i].push(resRowObject[currentColumnId]); + } + } else { + jsonToDatatable.aaData[i].push(resRowObject[currentColumnId]); + } + + } + } + } + jsonToDatatable.sEcho++; + var totalRow = 0; + var totalRecordsSource = eval('json.' + sTotalRecordsSource); + if(totalRecordsSource && totalRecordsSource.length >0){ + totalRow = parseInt(totalRecordsSource); + } + if(isNaN(totalRow)){ + alert('All rows counting number got fail!'); + }else{ + jsonToDatatable.iTotalRecords = totalRow; + jsonToDatatable.iTotalDisplayRecords = totalRow; + } + return jsonToDatatable; + } + + var singleAlarmDel = function(divOverlay){ + + //æ ¹æ®æµ®åŠ¨æ¡†çš„当å‰id获å–需è¦åˆ é™¤çš„è¡Œ + var trId = divOverlay.attr('id_tr'); + tr=$('tr#' + trId); + var tds = $(tr).children(); + var tdAlarmId = ""; + if(rowCheckable){ + tdAlarmId = $(tds.eq(2)).text(); + }else{ + tdAlarmId = $(tds.eq(1)).text(); + } + + var data= { + "alarmId":[parseInt(tdAlarmId)] + }; + + var sSource = "/web/rest/web/fm/curalarms?data=" + JSON.stringify(data) + "&_operationType=remove&_dataSource=isc_PageRestDataSource_0&isc_metaDataPrefix=_&isc_dataFormat=json"; + + $.ajax( { + "dataType": 'json', + "type": "DELETE", + "url": sSource, + "data" : null, + "contentType" : 'application/json; charset=utf-8', + "success": function(json) { + if(json.response.status == 0){ + var resRowObject = json.response.data[0]; + //alert('删除æˆåŠŸ'); + } + if(json.response.status == -1){ + //alert('删除失败'); + } + }, + "error": function() { + alert('Communication Error!'); + } + } ); + } + + var singleAlarmAckUnAck = function(divOverlay, ackType){ + + //æ ¹æ®æµ®åŠ¨æ¡†çš„当å‰id获å–需è¦ç¡®è®¤çš„è¡Œ + var trId = divOverlay.attr('id_tr'); + var tr = $('tr#' + trId); + + //å–å¾—éšè—的头部表格的相应行 + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable'); + //var trHead = $('tbody > tr:nth-child(' + trId + ')', $tableHead); + var trHead = $('tr#' + trId.replace('body', 'head'), $tableHead); + var tdDivs = $('td > div', trHead); + + var tds = $(tr).children(); + var tdAlarmId = ""; + if(rowCheckable){ + tdAlarmId = $(tds.eq(2)).text(); + }else{ + tdAlarmId = $(tds.eq(1)).text(); + } + + var aoData = + { + "dataSource":"isc_PageRestDataSource_0", + "operationType":"update", + "componentId":"isc_com_zte_ums_aos_fm_view_eventview_table_AlarmTable_0", + "data":{ + "viewType":1, + "state":ackType, + "alarmId":[ + parseInt(tdAlarmId) + ] + }, + "oldValues":null + }; + + var sSource = "/web/rest/web/fm/curalarms?isc_dataFormat=json"; + + $.ajax( { + "dataType": 'json', + "type": "PUT", + "url": sSource, + "contentType": 'application/json; charset=utf-8', + "data": JSON.stringify(aoData), + "success": function(json) { + /*for(var i=0;i0){ + json = callbackList[i](json); + break; + } + }*/ + //json = AlarmLabels.transformFieldNames(json); + if(callbackList[1]){ + json = callbackList[1](json); + } + if(json.response.status == 0){ + var resRowObject = json.response.data[0]; + var columnsCopy = $.extend(true, [], columns); + //éšè—列的情况下需è¦ç‰¹æ®Šå¤„ç† + if($(window).width()>=hidden_xs_maxWidth && $(window).width() -1) { + var rawText = ""; + for(var k=0;k columnMaxLength){ + $(tds.eq(i)).html(rawText.slice(0, columnMaxLength) + '...'); + $(tdDivs.eq(i)).html(rawText.slice(0, columnMaxLength) + '...'); + }else{ + $(tds.eq(i)).html(resRowObject[currentColumnId]); + $(tdDivs.eq(i)).html(resRowObject[currentColumnId]); + } + } else { + $(tds.eq(i)).html(resRowObject[currentColumnId]); + $(tdDivs.eq(i)).html(resRowObject[currentColumnId]); + } + } + //更新缓存中的当å‰è¡Œæ•°æ® + for (var t = 0; t < dataTable.datas.length; t++) { + var temp = dataTable.datas[t]; + if (temp.alarmId == resRowObject['alarmId']) { + dataTable.datas[t] = resRowObject; + break; + } + } + } + if(json.response.status == -1){ + $('div#myModalConfirm').modal({ + keyboard: false, + backdrop: 'static' + }); + $('span#alarm_number').html(tdAlarmId); + //å›½é™…åŒ–ä¿¡æ¯ + if(ackType==1){ + $('span#aos_fm_alarm_opeater_ack_already').html($.i18n.prop('aos_fm_alarm_opeater_ack_already_ok')); + }else{ + $('span#aos_fm_alarm_opeater_ack_already').html($.i18n.prop('aos_fm_alarm_opeater_ack_already_un')); + } + } + //å¡«å……å•å…ƒæ ¼é¢œè‰² + var divColor = $("div.cellBackgroundColor", tr); + $(divColor).parent().css("background", $(divColor).css("background-color")); + }, + "error": function() { + alert('Communication Error!'); + } + } ); + } + + var addRowOverlap = function(){ + var $tableData = $('table#datatable_ajax'); + //å–å¾—éšè—的头部表格的相应行 + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable'); + var trHeads = $tableHead.find('tr').get(); + $.each( trHeads, function( index, trHead ){ + $(trHead).attr('id', 'headTableTR' + index); + }); + //å–得浮动div + var $divOverlay = $('div#divOverlay'); + var divScrollHead = $('div.dataTables_scrollHead'); + var divRightPadding = $('div#divRightPadding'); + //å–表头下边沿ä½ç½® + var tableHeadBottomHeight = $(divScrollHead).position().top + $(divScrollHead).height(); + var tableBottom = $tableData.position().top + $tableData.height() + 3; + //å–表格å³è¾¹æ²¿ä½ç½® + var tableRightEdgePosition = $(divRightPadding).position().left; + var trs = $tableData.find('tr').get(); + $.each( trs, function( index, tr ){ + var tdEmpty = $('td.dataTables_empty',tr); + if(!tdEmpty || tdEmpty.length ==0 ){ + $(tr).attr('id', 'bodyTableTR' + index); + //$divOverlay.attr('id_tr', 'bodyTableTR' + index); + $(tr).one('hover', function(){ + var rowPos = $(tr).position(); + var currentTrTop = rowPos.top; + //var bottomLeft = rowPos.left; + $divOverlay.attr('id_tr', 'bodyTableTR' + index); + $divOverlay.css({ + display: 'block', + position: 'absolute', + 'background-color': '#e5e5e5', + //opacity: 0.7, + border: 'solid 0px', + top: currentTrTop + 6, + left: tableRightEdgePosition - 308, + width: 300, + height: 30 + }); + //防止浮动框跳出表格内容区域 + if( $divOverlay.position().top < tableHeadBottomHeight || $divOverlay.position().top + $divOverlay.height() > tableBottom){ + $divOverlay.css('display', 'none'); + } + var buttonConfirm = $('div#buttonConfirm', $divOverlay); + var buttonUnConfirm = $('div#buttonUnConfirm', $divOverlay); + //åˆå§‹åŒ–悬浮按钮当å‰è¡Œçš„确认åç¡®è®¤çŠ¶æ€ + if($(tr).find('span.alarmAck') && $(tr).find('span.alarmAck').length >0){ + var spanAck = $(tr).find('span.alarmAck'); + var ackState = $(spanAck).attr('ack_id'); + var buttonTDsConfirm = $(buttonConfirm).find('td'); + var buttonTDsUnConfirm = $(buttonUnConfirm).find('td'); + if(ackState=="2"){ + if(buttonTDsConfirm && buttonTDsConfirm.length > 0 && buttonTDsUnConfirm && buttonTDsUnConfirm.length > 0){ + $.each(buttonTDsConfirm, function(index, td){ + $(td).removeClass('buttonRoundedDisabled').addClass('buttonRounded'); + }); + $.each(buttonTDsUnConfirm, function(index, td){ + $(td).removeClass('buttonRounded').addClass('buttonRoundedDisabled'); + }); + } + }else{ + if(buttonTDsConfirm && buttonTDsConfirm.length > 0 && buttonTDsUnConfirm && buttonTDsUnConfirm.length > 0){ + $.each(buttonTDsConfirm, function(index, td){ + $(td).removeClass('buttonRounded').addClass('buttonRoundedDisabled'); + }); + $.each(buttonTDsUnConfirm, function(index, td){ + $(td).removeClass('buttonRoundedDisabled').addClass('buttonRounded'); + }); + } + } + } + //添加确认å确认点击事件 + $(buttonConfirm).one('click', function(){ + var buttonRoundedTDsConfirm = $(buttonConfirm).find('td.buttonRounded'); + var buttonRoundedTDsUnConfirm = $(buttonUnConfirm).find('td.buttonRoundedDisabled'); + if(buttonRoundedTDsConfirm && buttonRoundedTDsConfirm.length > 0){ + $.each(buttonRoundedTDsConfirm, function(index, td){ + $(td).removeClass('buttonRounded').addClass('buttonRoundedDisabled'); + }); + $.each(buttonRoundedTDsUnConfirm, function(index, td){ + $(td).removeClass('buttonRoundedDisabled').addClass('buttonRounded'); + }); + $divOverlay.css('display', 'none'); + singleAlarmAckUnAck($divOverlay, 1); + } + }); + $(buttonUnConfirm).one('click', function(){ + var buttonRoundedTDsUnConfirm = $(buttonUnConfirm).find('td.buttonRounded'); + var buttonRoundedTDsConfirm = $(buttonConfirm).find('td.buttonRoundedDisabled'); + if(buttonRoundedTDsUnConfirm && buttonRoundedTDsUnConfirm.length > 0){ + $.each(buttonRoundedTDsUnConfirm, function(index, td){ + $(td).removeClass('buttonRounded').addClass('buttonRoundedDisabled'); + }); + $.each(buttonRoundedTDsConfirm, function(index, td){ + $(td).removeClass('buttonRoundedDisabled').addClass('buttonRounded'); + }); + $divOverlay.css('display', 'none'); + singleAlarmAckUnAck($divOverlay, 2); + } + }); + var buttonDelete = $('div#buttonDelete', $divOverlay); + $(buttonDelete).die().live('click', function(){ + $divOverlay.css('display', 'none'); + var trIdToDelete = $divOverlay.attr('id_tr'); + var toDeleteTr=$('tr#' + trIdToDelete); + $("td", toDeleteTr).addClass('dataTableTdSelected'); + //弹出删除确认对è¯æ¡† + $('div#myModal').modal({ + keyboard: false, + backdrop: 'static' + }); + $('#delConfirm').die().live('click', function(){ + //$divOverlay.css('display', 'none'); + dataTable.fnClose(tr); + //删除åŽç«¯æ•°æ® + singleAlarmDel($divOverlay); + //删除当å‰è¡Œ + $(tr).remove(); + //删除表头表格的相应行 + $('tr#' + $(tr).attr('id').replace('body', 'head'), $tableHead).remove(); + //刷新表格 + //dataTable.fnAdjustColumnSizing(); + }); + $('#myModal').on('hidden.bs.modal', function (e) { + $("td", toDeleteTr).removeClass('dataTableTdSelected'); + }) + }); + //展开行的情况éšè— + $('td.details > table.detailTable').on('hover', function(){ + $divOverlay.css('display', 'none'); + }); + $('div#myModal').on('hover', function(){ + $divOverlay.css('display', 'none'); + }); + }); + } + }); + } + + return { + + //main function to initiate the module + init: function (options, columnsDefined, xsHiddenColumnsDefined, smHiddenColumnsDefined) { + + if (!$().dataTable) { + return; + } + + var the = this; + + //记录需è¦ç¦æŽ‰é»˜è®¤æŽ’åºçš„列 + var aTargets = []; + var targetsLength = columnsDefined.length; + if(rowCheckable)targetsLength++; + if(openRowFlag)targetsLength++; + for(var i=0;i<'col-md-4 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>", // datatable layout + + "aoColumnDefs" : [{ // define columns sorting options(by default all columns are sortable extept the first checkbox column) + 'bSortable' : false, + 'aTargets' : aTargets + }], + + "bAutoWidth": false, // disable fixed width and enable fluid table + //"bSortCellsTop": true, // make sortable only the first row in thead + "sPaginationType": "bootstrap_extended", // pagination type(bootstrap, bootstrap_full_number or bootstrap_extended) + "bProcessing": true, // enable/disable display message box on record load + "bServerSide": true, // enable/disable server side ajax loading + "sAjaxSource": "", // define ajax source URL + //"sServerMethod": "GET", + + // handle ajax request + "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) { + //for ICT Paging + //var startIndex = aoData[3].value;//"iDisplayStart" + //var pageLength = aoData[4].value;//"iDisplayLength" + var oPaging = oSettings.oInstance.fnPagingInfo(); + //var startIndex = oPaging.iStart; + var pageLength = oPaging.iLength; + var curPageNo = oPaging.iPage + 1; + + for(var k=aoData.length-1;k>=0;k--){ + var flag = -1; + if(aoData[k].name=='pageSize'){ + aoData[k].value=pageLength; + flag++; + } + if(aoData[k].name=='pageNo'){ + aoData[k].value=curPageNo; + flag++ + } + if(flag == 1)break; + } + + oSettings.jqXHR = $.ajax( { + "dataType": 'json', + "type": "GET", + "url": sSource, + "data": aoData, + "success": function(res, textStatus, jqXHR) { + if (res.sMessage) { + openoFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); + } + if ($('.group-checkable', tableContainer).size() === 1) { + $('.group-checkable', tableContainer).attr("checked", false); + $.uniform.update($('.group-checkable', tableContainer)); + } + if (tableOptions.onSuccess) { + tableOptions.onSuccess.call(the); + } + //ä¿å­˜æ•°æ®åœ¨dataTable对象中给行详细信æ¯é¢æ¿ç”¨ + dataTable.datas = res.response.data; + if(res.response.status < 0){ + alert(res.response.data); + return; + } + + //å‘Šè­¦å­—æ®µå€¼è½¬æ¢ + //res = AlarmLabels.transformFieldNames(res); + /*for(var i=0;i0){ + res = callbackList[i](res); + break; + } + }*/ + if(callbackList[1]){ + res = callbackList[1](res); + } + + res = jsonObjectToArray(res, columns, oSettings.iDraw); + + //é‡ç»˜è¡¨æ ¼ + fnCallback(res, textStatus, jqXHR); + }, + "error": function() { + if (tableOptions.onError) { + tableOptions.onError.call(the); + } + openoFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); + $('.dataTables_processing', tableWrapper).remove(); + } + } ); + + }, + + // pass additional parameter + "fnServerParams": function ( aoData ) { + //here can be added an external ajax request parameters. + //for(var i in ajaxParams) { + for(var i=0; i table.dataTable', tableWrapper); + var tbodyHead = $('tbody', $tableHead); + if(tbodyHead && tbodyHead.length >0){ + $(tbodyHead).remove(); + } + + var $tableBody = $('table#datatable_ajax', tableWrapper); + var trIn = $('thead > tr:nth-child(1)', $tableHead); + var trBodyHead = $('thead > tr:nth-child(1)', $tableBody); + var tds = $(trIn).children(); + var ths = $(trBodyHead).children(); + for(var k=0;k' + tds.eq(k).html() + ''); + } + var bodyRows = $('tbody > tr', $tableBody); + for(var i=0;i' + tds.eq(j).html() + ''); + $(tds.eq(j)).height('0px'); + $(tds.eq(j)).css('padding-top','0px'); + $(tds.eq(j)).css('padding-bottom','0px'); + $(tds.eq(j)).css('border-top-width','0px'); + $(tds.eq(j)).css('border-bottom-width','0px'); + } + $(rowClone).height('0px'); + $tableHead.append($(rowClone).prop("outerHTML")); + } + + $('.dataTables_scrollBody').css('width','100%'); + $('.dataTables_scrollHead').css('width','98.5%'); + $('.dataTables_scrollHeadInner').css('padding-right', 0); + + //添加浮动确认å确认按钮 + if(rowOverFlag){ + addRowOverlap(); + } + + //å¡«å……å•å…ƒæ ¼é¢œè‰² + var divColors = $("div.cellBackgroundColor", $tableBody); + $.each( divColors, function( index, divColor ){ + $(divColor).parent().css("background", $(divColor).css("background-color")); + }); + + //设置表格本体高度 + $('div.dataTables_scrollBody').css('height', tableHeight); + } + } + }, options); + + tableOptions = options; + + columns = columnsDefined; + xsHiddenColumns = xsHiddenColumnsDefined; + smHiddenColumns = smHiddenColumnsDefined; + // create table's jquery object + table = $(options.src); + tableContainer = table.parents(".table-container"); + // apply the special class that used to restyle the default datatable + + $.fn.dataTableExt.oStdClasses.sWrapper = $.fn.dataTableExt.oStdClasses.sWrapper + " dataTables_extended_wrapper"; + + // initialize a datatable + dataTable = table.dataTable(options.dataTable); + + tableWrapper = table.parents('.dataTables_wrapper'); + + // modify table per page dropdown input by appliying some classes + $('.dataTables_length select', tableWrapper).addClass("form-control input-xsmall input-sm"); + + // handle group checkboxes check/uncheck + $('.group-checkable', tableContainer).change(function () { + var set = $('tbody > tr > td:nth-child(1) input[type="checkbox"]', table); + var checked = $(this).is(":checked"); + $(set).each(function () { + $(this).attr("checked", checked); + }); + $.uniform.update(set); + countSelectedRecords(); + }); + + // handle row's checkbox click + table.on('change', 'tbody > tr > td:nth-child(1) input[type="checkbox"]', function(){ + countSelectedRecords(); + }); + + //填充表头å³è¾¹ç•Œ + $('.dataTables_scrollHead').css('display','inline-block'); + //var dataTables_scrollHead_height = $('.dataTables_scrollHead').css( "height" ); + $(".dataTables_scrollHead").after("
"); + if($.browser.mozilla){ + $('#divRightPadding').css('height', '40'); + } + + //éšè—掉æŸäº›åˆ— + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable', tableWrapper); + var $tableBody = $('table#datatable_ajax', tableWrapper); + + for(var i=0;i tr > th#' + columns[j].columnId, $tableHead).addClass('hidden-xs'); + $('thead > tr > th#' + columns[j].columnId, $tableBody).addClass('hidden-xs'); + break; + } + } + } + + for(var i=0;i tr > th#' + columns[j].columnId, $tableHead).addClass('hidden-sm'); + $('thead > tr > th#' + columns[j].columnId, $tableBody).addClass('hidden-sm'); + break; + } + } + } + },//end init------------------------------------------------------------------------------------ + + getSelectedRowsCount: function() { + return $('tbody > tr > td:nth-child(1) input[type="checkbox"]:checked', table).size(); + }, + + getSelectedRows: function() { + var rows = []; + $('tbody > tr > td:nth-child(1) input[type="checkbox"]:checked', table).each(function(){ + rows.push({name: $(this).attr("name"), value: $(this).val()}); + }); + + return rows; + }, + + addAjaxParam: function(name, value) { + ajaxParams.push({"name": name, "value": value}); + }, + + clearAjaxParams: function(name, value) { + ajaxParams = []; + }, + + getDataTable: function() { + return dataTable; + }, + + getTableWrapper: function() { + return tableWrapper; + }, + + gettableContainer: function() { + return tableContainer; + }, + + getTable: function() { + return table; + }, + + setOpenRowFlag: function(openRowFlagInput) { + openRowFlag = openRowFlagInput; + }, + + setRowOverFlag: function(rowOverFlagInput) { + rowOverFlag = rowOverFlagInput; + }, + + setRowCheckable: function(rowCheckableInput) { + rowCheckable = rowCheckableInput; + }, + + setColumnsTooLong: function(columnsTooLongInput) { + columnsTooLong = columnsTooLongInput; + }, + + setSTotalRecordsSource: function(sTotalRecordsSourceInput){ + sTotalRecordsSource = sTotalRecordsSourceInput; + }, + + setTableHeight: function(tableHeightInput){ + tableHeight = tableHeightInput; + }, + + setCallbackList: function(list){ + if($.isArray(list)){ + callbackList = list; + } + } + + }; + +}; + +var TableAjaxICT = function () { + + var initPickers = function () { + //init date pickers + $('.date-picker').datepicker({ + //rtl: App.isRTL(), + autoclose: true + }); + } + + //判断a数组是å¦åŒ…å«b数组 + function isContained(largeArray, smallArray){ + if(!(largeArray instanceof Array) || !(smallArray instanceof Array)) + return false; + if(largeArray.length < smallArray.length) + return false; + for(var i = 0; i < smallArray.length; i++){ + var flag = false; + for(j=0;j 0){ + detailTableId = "alarmDetailInfo" + detailTables.length; + } + var sOut = ''; + sOut += ''; + sOut += ''; + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + + sOut += ''; + + sOut += ''; + + sOut += ''; + + sOut += ''; + + sOut += '
' + columns[0].columnTitle + '' + alarmId + '' + columns[4].columnTitle + '' + perceivedSeverity + '' + columns[9].columnTitle + '' + alarmType + '' + columns[3].columnTitle + '' + alarmRaisedTime + '
' + columns[5].columnTitle + '' + probableCauseDesc + '' + columns[15].columnTitle + '' + alarmChangedTime + '' + columns[11].columnTitle + '' + ackState + '
' + columns[12].columnTitle + '' + ackTime + '' + columns[13].columnTitle + '' + ackUserId + '' + columns[14].columnTitle + '' + ackSystemId + '' + columns[7].columnTitle + '' + neip + '
' + columns[2].columnTitle + '' + moc + '' + columns[1].columnTitle + '' + resDisplayName + '
' + columns[8].columnTitle + '' + componentname + '' + columns[16].columnTitle + '' + position1 + '
' + columns[10].columnTitle + '' + specificproblem + '
' + columns[6].columnTitle + '' + additionalText + '
' + $.i18n.prop('aos_fm_SuggestionSetting_view_DefaultSuggestionGroupTitle').replace(';', '').replace(/\"/g,'') + '' + '
' + $.i18n.prop('aos_fm_SuggestionSetting_view_SettingSuggestionGroupTitle').replace(';', '').replace(/\"/g,'') + '
'; + + /* + var systemType = 0; + var code = 0; + for (var i = 0; i < oTable.datas.length; i++) { + var temp = oTable.datas[i]; + if (temp.alarmId == oTr['alarmId'].value) { + systemType = temp.systemType; + code = temp.probableCauseCode; + } + }*/ + var data = { + "systemType" : systemType, + "code" : code + }; + var sendData = JSON.stringify(data); + $.ajax({ + "dataType" : 'json', + "type" : "GET", + "url" : "/web/rest/web/fm/Maintenance" + "?" + "data=" + sendData, + "contentType" : 'application/json; charset=utf-8', + "data" : null, + "success" : function (json) { + $('tr').find('td#defaulInfo' + id).text(json.defaulInfo); + $('tr').find('td#customInfo' + id).text(json.customInfo); + var modify = $('#customInfoModify' + id); + modify.on('click', function () { + var span = $('#modifyBtnSpan' + id); + var customInfo = $('tr').find('td#customInfo' + id); + var cancel = $('#cancelDiv' + id); + if (span['0'].className === 'fa fa-pencil-square-o') { + var value = customInfo['0'].textContent; + customInfo['0'].textContent = ''; + customInfo['0'].innerHTML = ''; + span['0'].className = 'fa fa-floppy-o'; + cancel['0'].innerHTML = ''; + $('#cancelBtn' + id).on('click', function () { + customInfo['0'].innerHTML = ''; + customInfo['0'].textContent = value; + cancel['0'].innerHTML = ''; + span['0'].className = 'fa fa-pencil-square-o'; + }); + } else { + var inputValue = $('#customInfoInput' + id)['0'].value; + customInfo['0'].innerHTML = ''; + customInfo['0'].textContent = inputValue; + span['0'].className = 'fa fa-pencil-square-o'; + cancel['0'].innerHTML = ''; + var modifyData = { + "systemType" : systemType, + "code" : code, + "defaulInfo" : json.defaulInfo, + "customInfo" : inputValue + }; + $.ajax({ + "dataType" : 'json', + "type" : "PUT", + "url" : "/web/rest/web/fm/Maintenance", + "contentType" : 'application/json; charset=utf-8', + "data" : JSON.stringify(modifyData), + "error" : function () { + alert('Modify Error!'); + } + }); + } + }); + }, + "error" : function () { + alert('Communication Error!'); + } + }); + + return sOut; + } + + var generateColumns = function(columns, openRowFlag, rowCheckable){ + var $tableData = $('table#datatable_ajax'); + var theadTR = $('thead > tr', $tableData); + if(rowCheckable){ + theadTR.append(''); + } + if(openRowFlag){ + theadTR.append('  '); + } + for(var i=0;i' + columns[i].columnTitle + ''); + } + } + + var sortHandling = function(oTable, openRowFlag, rowCheckable){ + var indexSkip = -1; + if(openRowFlag&&rowCheckable){ + indexSkip = 1; + }else if(openRowFlag&&!rowCheckable||!openRowFlag&&rowCheckable){ + indexSkip = 0; + } + var $sortOrder = 0; //排åºç±»åž‹ 1表示å‡åºï¼Œ0表示é™åº + var tableWrapper = $('div#datatable_ajax_wrapper'); + var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable', tableWrapper); + var $tableData = $('table#datatable_ajax'); + var clearSort = function(currentTh){ + var ths = $tableHead.find('th').get(); + var tableDataHeadTHs = $tableData.find('th').get(); + $.each( ths, function( index, th ){ + if(index > indexSkip){ + if($(th).text() != currentTh.text()){ + if($(th).is('.sorting_disabled')){ + //do nothing; + }else if($(th).is('.sorting_asc')){ + $(th).removeClass('sorting_asc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_asc').addClass('sorting_disabled'); + }else if($(th).is('.sorting_desc')){ + $(th).removeClass('sorting_desc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_desc').addClass('sorting_disabled'); + } + } + } + }); + } + + $('th', $tableHead).each(function( column ) + { + if(column>indexSkip){ + //处ç†ä¸‰ç§æœ‰å¯èƒ½å­˜åœ¨çš„排åºå­—段,比较方法 + var findSortKey; + if( $(this).is('.sort-title') || $(this).is('.sorting_disabled') ) + { + findSortKey = function( $cell ) + { + var cellText = $cell.text(); + if(isNaN(cellText)){ + return $cell.text().toUpperCase(); + }else{ + return parseFloat(cellText); + } + //return $cell.text().toUpperCase(); + } + } + else if( $(this).is('.sort-date') ) + { + findSortKey = function( $cell ) + { + return Date.parse('1' + $cell.text()); + } + } + else if( $(this).is('.sort-price') ) + { + findSortKey = function( $cell ) + { + var key = parseFloat($cell.text().replace(/^[^\d.]*/, '')) + return isNaN(key) ? 0 : key; + } + } + + //æŽ’åº + if( findSortKey ) + { + $(this).click(function() + { + $sortOrder = $sortOrder == 0 ? 1 : 0; + var tableDataHeadTHs = $tableData.find('th').get(); + + if($sortOrder == 1){ + if($(this).is('.sorting_disabled')){ + $(this).removeClass('sorting_disabled').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_disabled').addClass('sorting_asc'); + }else if($(this).is('.sorting_asc')){ + $(this).removeClass('sorting_asc').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_asc').addClass('sorting_desc'); + }else if($(this).is('.sorting_desc')){ + $(this).removeClass('sorting_desc').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_desc').addClass('sorting_asc'); + } + }else{ + if($(this).is('.sorting_disabled')){ + $(this).removeClass('sorting_disabled').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_disabled').addClass('sorting_desc'); + }else if($(this).is('.sorting_asc')){ + $(this).removeClass('sorting_asc').addClass('sorting_desc'); + $(tableDataHeadTHs[column]).removeClass('sorting_asc').addClass('sorting_desc'); + }else if($(this).is('.sorting_desc')){ + $(this).removeClass('sorting_desc').addClass('sorting_asc'); + $(tableDataHeadTHs[column]).removeClass('sorting_desc').addClass('sorting_asc'); + } + } + clearSort($(this)); + + var rows = $tableData.find('tbody > tr').get(); + + $.each( rows, function( index, row ) + { + //先关掉所有行 + if ( oTable.fnIsOpen(row) ) + { + $(row).find('.row-details').click(); + } + }); + + //é‡æ–°å–得所有行,å¦åˆ™æŽ’åºåŽè¡¨æ ¼æ˜¾ç¤ºå¼‚常 + rows = $tableData.find('tbody > tr').get(); + + $.each( rows, function( index, row ) + { + row.sortKey = findSortKey($(row).children('td').eq(column)); + }); + //排åºæ–¹æ³• + rows.sort(function( a, b ) + { + if( $sortOrder == 1 ) + { + //å‡åº + if(a.sortKey < b.sortKey) return -1; + if(a.sortKey > b.sortKey) return 1; + return 0; + } + else + { + //é™åº + if(a.sortKey < b.sortKey) return 1; + if(a.sortKey > b.sortKey) return -1; + return 0; + } + }); + //排åºåŽçš„对象添加给$table + $.each( rows, function( index, row ) + { + $tableData.children('tbody').append(row); + row.sortKey = null; + }); + }); + } + } + }); + } + + var handleRecords = function(requestStr, columns, xsHiddenColumns, smHiddenColumns, oLanguage, openRowFlag, rowCheckable, rowOverFlag, requestURL, requestParameters, tableHeight, columnsTooLong, sTotalRecordsSource, callbackList) { + + /* + jQuery.getJSON('/web/newict/framework/thirdparty/data-tables/app-universal-i18n-datatable-' + lang + '.json', + function(data) { + oLanguage = data; + }); + */ + grid.setCallbackList(callbackList); + grid.setOpenRowFlag(openRowFlag); + grid.setRowCheckable(rowCheckable); + grid.setRowOverFlag(rowOverFlag); + grid.setColumnsTooLong(columnsTooLong); + grid.setSTotalRecordsSource(sTotalRecordsSource); + grid.setTableHeight(tableHeight); + //å–得查询æ¡ä»¶ +// if(!requestStr || requestStr.length == 0){ +// requestStr = JSON.stringify(requestAllData); +// } + grid.clearAjaxParams(); + grid.addAjaxParam('data', requestStr); + //å–得其他å‚æ•° + for(var i=0;i table.dataTable', tableWrapper); + var ths = $tableHead.find('th').get(); + var $tableData = $('table#datatable_ajax'); + var tableDataHeadTHs = $tableData.find('th').get(); + $.each( ths, function( index, th ){ + //clear all sort direction + if($(th).is('.sorting_disabled')){ + //do nothing; + }else if($(th).is('.sorting_asc')){ + $(th).removeClass('sorting_asc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_asc').addClass('sorting_disabled'); + }else if($(th).is('.sorting_desc')){ + $(th).removeClass('sorting_desc').addClass('sorting_disabled'); + $(tableDataHeadTHs[index]).removeClass('sorting_desc').addClass('sorting_disabled'); + } + }); + + }, + onError: function(grid) { + // execute some code on network or other general error + }, + dataTable: { + "sDom" : "tr<'row'<'col-md-6 col-sm-12'><'col-md-6 col-sm-12'pli>>", // datatable layout + "oLanguage": oLanguage, + //"bAutoWidth": true, + "sScrollY": tableHeight, + "bScrollCollapse": true, + "sScrollX": "100%", + //"sScrollXInner": "110%", + "aLengthMenu": [ + [20, 50, 100], + [20, 50, 100] // change per page values here + ], + "iDisplayLength": 20, // default record count per page + "bServerSide": true, // server side processing + "sAjaxSource": requestURL // ajax source + } + }, columns, xsHiddenColumns, smHiddenColumns, openRowFlag, rowCheckable); + } + + /* + * Insert a 'details' column to the table + */ + var insertDetails = function (oTable, columns, rowCheckable) { + + var $tableData = $('table#datatable_ajax'); + + $tableData.on('click', ' tbody td .row-details', function () { + var nTr = $(this).parents('tr')[0]; + if (oTable.fnIsOpen(nTr)) { + /* This row is already open - close it */ + $(this).addClass("row-details-close").removeClass("row-details-open"); + oTable.fnClose(nTr); + } else { + /* Open this row */ + $(this).addClass("row-details-open").removeClass("row-details-close"); + oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr, columns, rowCheckable), 'details'); + //å¡«å……å•å…ƒæ ¼é¢œè‰² + var divColor = $("div.cellBackgroundColor", $("table#" + detailTableId)); + $(divColor).parent().css("background", $(divColor).css("background-color")); + } + }); + } + + return { + + //main function to initiate the module + init: function (requestStr, lang, configPathPrefix, callbackList) { + + var oLanguage; + var columns; + var xsHiddenColumns; + var smHiddenColumns; + var columnsAll; + + var openRowFlag = false; + var rowOverFlag = false; + var rowCheckable = false; + var requestURL=""; + var requestAllData; + var requestParameters; + + var tableHeight; + var tableWidth; + + var columnsTooLong; + var sTotalRecordsSource=""; + + //å–得当å‰é…ç½®åŠå›½é™…åŒ–ä¿¡æ¯ + $.ajax({ + dataType: 'json', + url: configPathPrefix + '-' + lang + '.json', + async: false, + contentType:'application/json; charset=utf-8', + "success": function(data) { + oLanguage = data.language; + columns = data.columns; + xsHiddenColumns = data.xsHiddenColumns; + smHiddenColumns = data.smHiddenColumns; + columnsAll = data.columnsAll; + openRowFlag = data.openRowFlag == 'true'? true: false; + rowOverFlag = data.rowOverFlag == 'true'? true: false; + rowCheckable = data.rowCheckable == 'true'? true: false; + requestURL = data.requestURL; + //requestAllData = data.requestAllData; + requestParameters = data.requestParameters; + tableHeight = data.tableHeight; + tableWidth = data.tableWidth; + columnsTooLong = data.columnsTooLong; + sTotalRecordsSource = data.sTotalRecordsSource; + }, + "error" : function (xhr, info) { + alert('Communication Error! Error reason:' + info); + } + }); + + $('#dataTableWrapperDiv').css('width', tableWidth); + + if(!isContained(xsHiddenColumns, smHiddenColumns) || !isContained(columns, xsHiddenColumns) || !isContained(columnsAll, columns)){ + alert('Columns claim error: (smHiddenColumns <= xsHiddenColumns <= columns <= columnsAll) Please!'); + return; + } + + generateColumns(columns, openRowFlag, rowCheckable); + //initPickers(); + handleRecords(requestStr, columns, xsHiddenColumns, smHiddenColumns, oLanguage, openRowFlag, rowCheckable, rowOverFlag, requestURL, requestParameters, tableHeight, columnsTooLong, sTotalRecordsSource, callbackList); + //获得åˆå§‹åŒ–完毕的DataTable对象 + var oTable = grid.getDataTable(); + if(openRowFlag){ + insertDetails(oTable, columnsAll, rowCheckable); + } + sortHandling(oTable, openRowFlag, rowCheckable); + //oTable.fnAdjustColumnSizing(true); + return oTable; + } + + }; + +}(); + +var DataTableSmartClientApp = function(datas, configPathPrefix, callbackList){ + + var requestStr = ""; + if(datas){ + requestStr = JSON.stringify(datas); + } + + var lang = getLanguage(); + //lang = 'en-US'; + /*for(var i=0;i0){ + callbackList[i](lang); + break; + } + }*/ + if(callbackList && callbackList[0]){ + callbackList[0](lang); + } + //requestStr = ""; + var oTable = TableAjaxICT.init(requestStr, lang, configPathPrefix, callbackList); + + //é‡æ–°è°ƒèŠ‚列宽以适应window resize + $(window).one('resize', function () { + //oTable.DataTable.models.oSettings.bAjaxDataGet = false; + oTable.fnAdjustColumnSizing(false); + } ); +} diff --git a/common/src/main/webapp/thirdparty/data-tables/app-test-i18n-datatable-zh-CN.json b/common/src/main/webapp/thirdparty/data-tables/app-test-i18n-datatable-zh-CN.json new file mode 100644 index 00000000..fa209022 --- /dev/null +++ b/common/src/main/webapp/thirdparty/data-tables/app-test-i18n-datatable-zh-CN.json @@ -0,0 +1,51 @@ +{ + "language":{ + "sProcessing": "  å¤„ç†ä¸­...", + "sLengthMenu": "|æ¯é¡µ _MENU_ æ¡ç»“æžœ", + "sZeroRecords": "没有匹é…结果", + "sInfo": "|总共找到 _TOTAL_ æ¡ç»“æžœ", + "sInfoEmpty": "å…± 0 项", + "sGroupActions": "_TOTAL_ æ¡ç»“果被选择: ", + "sAjaxRequestGeneralError": "ä¸èƒ½å®Œæˆè¯·æ±‚,请检查您的网络连接情况。", + "sEmptyTable": "表中数æ®ä¸ºç©º", + "oPaginate": { + "sPrevious": "å‰é¡µ", + "sNext": "下页", + "sPage": "第", + "sPageOf": "页,总页数:" + } + }, + "columnsAll":[ + {"columnId":"0", "columnTitle":"开始时间"}, + {"columnId":"1", "columnTitle":"结æŸæ—¶é—´"}, + {"columnId":"2", "columnTitle":"查询粒度"}, + {"columnId":"3", "columnTitle":"网元ä½ç½®"}, + {"columnId":"4", "columnTitle":"CPU使用率(百分比)"} + ], + "columns":[ + {"columnId":"0", "columnTitle":"开始时间"}, + {"columnId":"1", "columnTitle":"结æŸæ—¶é—´"}, + {"columnId":"2", "columnTitle":"查询粒度"}, + {"columnId":"3", "columnTitle":"网元ä½ç½®"}, + {"columnId":"4", "columnTitle":"CPU使用率(百分比)"} + ], + "xsHiddenColumns":[ + ], + "smHiddenColumns":[ + ], + "columnsTooLong":["3"], + + "rowCheckable": "true", + "openRowFlag" : "false", + "rowOverFlag" : "false", + + "tableHeight":"250px", + "tableWidth":"100%", + + "requestType": "POST", + "requestURL": "/web/rest/web-pm/queryPmPageData", + "requestParameters":[ + ], + "sTotalRecordsSource":"response.extData", + "sTotalRecords":"108" +} \ No newline at end of file diff --git a/common/src/main/webapp/thirdparty/data-tables/app-universal-i18n-datatable-en-US.json b/common/src/main/webapp/thirdparty/data-tables/app-universal-i18n-datatable-en-US.json new file mode 100644 index 00000000..809daa32 --- /dev/null +++ b/common/src/main/webapp/thirdparty/data-tables/app-universal-i18n-datatable-en-US.json @@ -0,0 +1,89 @@ +{ + "language":{ + "sProcessing": "  Loading...", + "sLengthMenu": "|View _MENU_ records", + "sInfo": "|Found total _TOTAL_ records", + "sInfoEmpty": "No records found to show", + "sGroupActions": "_TOTAL_ records selected: ", + "sAjaxRequestGeneralError": "Could not complete request. Please check your internet connection", + "sEmptyTable": "No data available in table", + "sZeroRecords": "No matching records found", + "oPaginate": { + "sPrevious": "Prev", + "sNext": "Next", + "sPage": "Page", + "sPageOf": "of" + } + }, + "columnsAll":[ + {"columnId":"alarmId", "columnTitle":"Alarm Id"}, + {"columnId":"resDisplayName", "columnTitle":"NE"}, + {"columnId":"moc", "columnTitle":"NE Type"}, + {"columnId":"alarmRaisedTime", "columnTitle":"Raised Time"}, + {"columnId":"perceivedSeverity", "columnTitle":"Severity"}, + {"columnId":"probableCauseDesc", "columnTitle":"Alarm Code"}, + {"columnId":"additionalText", "columnTitle":"Appendix Text"}, + {"columnId":"neip", "columnTitle":"NE IP"}, + {"columnId":"componentname", "columnTitle":"Location"}, + {"columnId":"alarmType", "columnTitle":"Alarm Type"}, + {"columnId":"specificproblem", "columnTitle":"Specific Problem"}, + {"columnId":"ackState", "columnTitle":"Acknowledged State"}, + {"columnId":"ackTime", "columnTitle":"Acknowledge Time"}, + {"columnId":"ackUserId", "columnTitle":"Acknowledge User"}, + {"columnId":"ackSystemId", "columnTitle":"Acknowledge System"}, + {"columnId":"alarmChangedTime", "columnTitle":"Changed Time"}, + {"columnId":"position1", "columnTitle":"Resource ID"} + ], + "columns":[ + {"columnId":"alarmId", "columnTitle":"Alarm Id"}, + {"columnId":"resDisplayName", "columnTitle":"NE"}, + {"columnId":"moc", "columnTitle":"NE Type"}, + {"columnId":"alarmRaisedTime", "columnTitle":"Raised Time"}, + {"columnId":"perceivedSeverity", "columnTitle":"Severity"}, + {"columnId":"probableCauseDesc", "columnTitle":"Alarm Code"}, + {"columnId":"additionalText", "columnTitle":"Appendix Text"}, + {"columnId":"neip", "columnTitle":"NE IP"}, + {"columnId":"componentname", "columnTitle":"Location"}, + {"columnId":"alarmType", "columnTitle":"Alarm Type"}, + {"columnId":"specificproblem", "columnTitle":"Specific Problem"}, + {"columnId":"ackState", "columnTitle":"Acknowledged State"}, + {"columnId":"ackTime", "columnTitle":"Acknowledge Time"}, + {"columnId":"ackUserId", "columnTitle":"Acknowledge User"}, + {"columnId":"ackSystemId", "columnTitle":"Acknowledge System"}, + {"columnId":"alarmChangedTime", "columnTitle":"Changed Time"}, + {"columnId":"position1", "columnTitle":"Resource ID"} + ], + "xsHiddenColumns":[ + {"columnId":"additionalText", "columnTitle":"Appendix Text"}, + {"columnId":"neip", "columnTitle":"NE IP"}, + {"columnId":"componentname", "columnTitle":"Location"}, + {"columnId":"position1", "columnTitle":"Resource ID"} + ], + "smHiddenColumns":[ + {"columnId":"position1", "columnTitle":"Resource ID"} + ], + "columnsTooLong":["additionalText", "moc", "componentname", "specificproblem", "position1"], + "sTotalRecordsSource":"response.extData", + + "rowCheckable": "true", + "openRowFlag" : "true", + "rowOverFlag" : "true", + + "tableHeight":"520px", + "tableWidth":"100%", + + "requestURL": "/web/rest/web/fm/curalarms", + "requestParameters":[ + {"paraId":"pageSize", "paraValue":"20"}, + {"paraId":"pageNo", "paraValue":"1"}, + {"paraId":"_operationType", "paraValue":"fetch"}, + {"paraId":"_startRow", "paraValue":"0"}, + {"paraId":"_endRow", "paraValue":"75"}, + {"paraId":"_textMatchStyle", "paraValue":"exact"}, + {"paraId":"_componentId", "paraValue":"isc_com_zte_ums_aos_fm_view_eventview_table_AlarmTable_0"}, + {"paraId":"_dataSource", "paraValue":"isc_PageRestDataSource_0"}, + {"paraId":"isc_metaDataPrefix", "paraValue":"_"}, + {"paraId":"isc_dataFormat", "paraValue":"json"} + ], + "sTotalRecordsSource":"response.extData" +} \ No newline at end of file diff --git a/common/src/main/webapp/thirdparty/data-tables/app-universal-i18n-datatable-zh-CN.json b/common/src/main/webapp/thirdparty/data-tables/app-universal-i18n-datatable-zh-CN.json new file mode 100644 index 00000000..8a270a43 --- /dev/null +++ b/common/src/main/webapp/thirdparty/data-tables/app-universal-i18n-datatable-zh-CN.json @@ -0,0 +1,90 @@ +{ + "language":{ + "sProcessing": "  å¤„ç†ä¸­...", + "sLengthMenu": "|æ¯é¡µ _MENU_ æ¡ç»“æžœ", + "sZeroRecords": "没有匹é…结果", + "sInfo": "|总共找到 _TOTAL_ æ¡ç»“æžœ", + "sInfoEmpty": "å…± 0 项", + "sGroupActions": "_TOTAL_ æ¡ç»“果被选择: ", + "sAjaxRequestGeneralError": "ä¸èƒ½å®Œæˆè¯·æ±‚,请检查您的网络连接情况。", + "sEmptyTable": "表中数æ®ä¸ºç©º", + "oPaginate": { + "sPrevious": "å‰é¡µ", + "sNext": "下页", + "sPage": "第", + "sPageOf": "页,总页数:" + } + }, + "columnsAll":[ + {"columnId":"alarmId", "columnTitle":"告警编å·"}, + {"columnId":"resDisplayName", "columnTitle":"网元"}, + {"columnId":"moc", "columnTitle":"网元类型"}, + {"columnId":"alarmRaisedTime", "columnTitle":"å‘生时间"}, + {"columnId":"perceivedSeverity", "columnTitle":"级别"}, + {"columnId":"probableCauseDesc", "columnTitle":"å‘Šè­¦ç "}, + {"columnId":"additionalText", "columnTitle":"附加文本"}, + {"columnId":"neip", "columnTitle":"网元IP"}, + {"columnId":"componentname", "columnTitle":"网元内定ä½"}, + {"columnId":"alarmType", "columnTitle":"告警类型"}, + {"columnId":"specificproblem", "columnTitle":"告警原因"}, + {"columnId":"ackState", "columnTitle":"确认状æ€"}, + {"columnId":"ackTime", "columnTitle":"确认时间"}, + {"columnId":"ackUserId", "columnTitle":"确认用户"}, + {"columnId":"ackSystemId", "columnTitle":"确认系统"}, + {"columnId":"alarmChangedTime", "columnTitle":"修改时间"}, + {"columnId":"position1", "columnTitle":"资æºID"} + ], + "columns":[ + {"columnId":"alarmId", "columnTitle":"告警编å·"}, + {"columnId":"resDisplayName", "columnTitle":"网元"}, + {"columnId":"moc", "columnTitle":"网元类型"}, + {"columnId":"alarmRaisedTime", "columnTitle":"å‘生时间"}, + {"columnId":"perceivedSeverity", "columnTitle":"级别"}, + {"columnId":"probableCauseDesc", "columnTitle":"å‘Šè­¦ç "}, + {"columnId":"additionalText", "columnTitle":"附加文本"}, + {"columnId":"neip", "columnTitle":"网元IP"}, + {"columnId":"componentname", "columnTitle":"网元内定ä½"}, + {"columnId":"alarmType", "columnTitle":"告警类型"}, + {"columnId":"specificproblem", "columnTitle":"告警原因"}, + {"columnId":"ackState", "columnTitle":"确认状æ€"}, + {"columnId":"ackTime", "columnTitle":"确认时间"}, + {"columnId":"ackUserId", "columnTitle":"确认用户"}, + {"columnId":"ackSystemId", "columnTitle":"确认系统"}, + {"columnId":"alarmChangedTime", "columnTitle":"修改时间"}, + {"columnId":"position1", "columnTitle":"资æºID"} + ], + "xsHiddenColumns":[ + {"columnId":"additionalText", "columnTitle":"附加文本"}, + {"columnId":"neip", "columnTitle":"网元IP"}, + {"columnId":"componentname", "columnTitle":"网元内定ä½"}, + {"columnId":"position1", "columnTitle":"资æºID"} + ], + "smHiddenColumns":[ + {"columnId":"position1", "columnTitle":"资æºID"} + ], + "columnsTooLong":["additionalText", "moc", "componentname", "specificproblem", "position1"], + + "rowCheckable": "true", + "openRowFlag" : "true", + "rowOverFlag" : "true", + + "tableHeight":"520px", + "tableWidth":"100%", + + "requestURL": "/web/rest/web/fm/curalarms", + "requestAllData": {"rule":{"ruleId":-1,"name":"当å‰å‘Šè­¦","creator":"admin","createTime":1397439767310,"modifier":"","modifyTime":0,"description":"","state":true,"ruleType":1,"ruleSort":1,"owner":"","attrs":"","ruleData":""}}, + "requestParameters":[ + {"paraId":"pageSize", "paraValue":"20"}, + {"paraId":"pageNo", "paraValue":"1"}, + {"paraId":"_operationType", "paraValue":"fetch"}, + {"paraId":"_startRow", "paraValue":"0"}, + {"paraId":"_endRow", "paraValue":"75"}, + {"paraId":"_textMatchStyle", "paraValue":"exact"}, + {"paraId":"_componentId", "paraValue":"isc_com_zte_ums_aos_fm_view_eventview_table_AlarmTable_0"}, + {"paraId":"_dataSource", "paraValue":"isc_PageRestDataSource_0"}, + {"paraId":"isc_metaDataPrefix", "paraValue":"_"}, + {"paraId":"isc_dataFormat", "paraValue":"json"} + ], + "sTotalRecordsSource":"response.extData" +} + diff --git a/common/src/main/webapp/thirdparty/data-tables/dataTable.html b/common/src/main/webapp/thirdparty/data-tables/dataTable.html new file mode 100644 index 00000000..afae5e3c --- /dev/null +++ b/common/src/main/webapp/thirdparty/data-tables/dataTable.html @@ -0,0 +1,155 @@ + + + + + + + + + +
+
+
+
+
+ + + + + + +
+ + + + + +
+
+
+ +
+
+ + + + + + + + + + diff --git a/common/src/main/webapp/thirdparty/data-tables/dataTables.bootstrap.css b/common/src/main/webapp/thirdparty/data-tables/dataTables.bootstrap.css new file mode 100644 index 00000000..ada85f7a --- /dev/null +++ b/common/src/main/webapp/thirdparty/data-tables/dataTables.bootstrap.css @@ -0,0 +1,331 @@ +div.dataTables_length label { + font-weight: normal; + text-align: left; + white-space: nowrap; +} + +div.dataTables_length select { + height: 28px; + display: inline-block; +} + +div.dataTables_filter { + text-align: right; +} + +div.dataTables_filter label { + font-weight: normal; + white-space: nowrap; + text-align: left; +} + +div.dataTables_filter input { + margin-left: 0.5em; + display: inline-block; +} + +div.dataTables_info { + padding-top: 8px; + white-space: nowrap; +} + +div.dataTables_paginate { + margin: 0; + white-space: nowrap; + text-align: right; +} + +div.dataTables_paginate ul.pagination { + margin: 2px 0; + white-space: nowrap; +} + +@media screen and (max-width: 767px) { + div.dataTables_length, + div.dataTables_filter, + div.dataTables_info, + div.dataTables_paginate { + text-align: center; + } +} + + +table.dataTable td, +table.dataTable th { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + + +table.dataTable { + clear: both; + margin-top: 6px !important; + margin-bottom: 6px !important; + max-width: none !important; +} + +table.dataTable thead .sorting, +table.dataTable thead .sorting_asc, +table.dataTable thead .sorting_desc, +table.dataTable thead .sorting_asc_disabled, +table.dataTable thead .sorting_desc_disabled { + cursor: pointer; +} + +table.dataTable thead .sorting { background: url('../images/sort_both.png') no-repeat center right; } +table.dataTable thead .sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; } +table.dataTable thead .sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; } + +table.dataTable thead .sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; } +table.dataTable thead .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } + +table.dataTable thead > tr > th { + padding-left: 18px; + padding-right: 18px; +} + +table.dataTable th:active { + outline: none; +} + +/* Scrolling */ +div.dataTables_scrollHead table { + margin-bottom: 0 !important; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +div.dataTables_scrollHead table thead tr:last-child th:first-child, +div.dataTables_scrollHead table thead tr:last-child td:first-child { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.dataTables_scrollBody table { + border-top: none; + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +div.dataTables_scrollBody tbody tr:first-child th, +div.dataTables_scrollBody tbody tr:first-child td { + border-top: none; +} + +div.dataTables_scrollFoot table { + margin-top: 0 !important; + border-top: none; +} + +/* Frustratingly the border-collapse:collapse used by Bootstrap makes the column + width calculations when using scrolling impossible to align columns. We have + to use separate + */ +table.table-bordered.dataTable { + border-collapse: separate !important; +} +table.table-bordered thead th, +table.table-bordered thead td { + border-left-width: 0; + border-top-width: 0; +} +table.table-bordered tbody th, +table.table-bordered tbody td { + border-left-width: 0; + border-bottom-width: 0; +} +table.table-bordered th:last-child, +table.table-bordered td:last-child { + border-right-width: 0; +} +div.dataTables_scrollHead table.table-bordered { + border-bottom-width: 0; +} + + + + +/* + * TableTools styles + */ +.table.dataTable tbody tr.active td, +.table.dataTable tbody tr.active th { + background-color: #08C; + color: white; +} + +.table.dataTable tbody tr.active:hover td, +.table.dataTable tbody tr.active:hover th { + background-color: #0075b0 !important; +} + +.table.dataTable tbody tr.active th > a, +.table.dataTable tbody tr.active td > a { + color: white; +} + +.table-striped.dataTable tbody tr.active:nth-child(odd) td, +.table-striped.dataTable tbody tr.active:nth-child(odd) th { + background-color: #017ebc; +} + +table.DTTT_selectable tbody tr { + cursor: pointer; +} + +div.DTTT .btn:hover { + text-decoration: none !important; +} + +ul.DTTT_dropdown.dropdown-menu { + z-index: 2003; +} + +ul.DTTT_dropdown.dropdown-menu a { + color: #333 !important; /* needed only when demo_page.css is included */ +} + +ul.DTTT_dropdown.dropdown-menu li { + position: relative; +} + +ul.DTTT_dropdown.dropdown-menu li:hover a { + background-color: #0088cc; + color: white !important; +} + +div.DTTT_collection_background { + z-index: 2002; +} + +/* TableTools information display */ +div.DTTT_print_info { + position: fixed; + top: 50%; + left: 50%; + width: 400px; + height: 150px; + margin-left: -200px; + margin-top: -75px; + text-align: center; + color: #333; + padding: 10px 30px; + opacity: 0.95; + + background-color: white; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5); +} + +div.DTTT_print_info h6 { + font-weight: normal; + font-size: 28px; + line-height: 28px; + margin: 1em; +} + +div.DTTT_print_info p { + font-size: 14px; + line-height: 20px; +} + +div.dataTables_processing { + position: absolute; + top: 50%; + left: 50%; + width: 100%; + height: 60px; + margin-left: -50%; + margin-top: -25px; + padding-top: 20px; + padding-bottom: 20px; + text-align: center; + font-size: 1.2em; + background-color: white; + background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0))); + background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); + background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); + background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); + background: -o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); + background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); +} + + + +/* + * FixedColumns styles + */ +div.DTFC_LeftHeadWrapper table, +div.DTFC_LeftFootWrapper table, +div.DTFC_RightHeadWrapper table, +div.DTFC_RightFootWrapper table, +table.DTFC_Cloned tr.even { + background-color: white; + margin-bottom: 0; +} + +div.DTFC_RightHeadWrapper table , +div.DTFC_LeftHeadWrapper table { + border-bottom: none !important; + margin-bottom: 0 !important; + border-top-right-radius: 0 !important; + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child, +div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child, +div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child, +div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.DTFC_RightBodyWrapper table, +div.DTFC_LeftBodyWrapper table { + border-top: none; + margin: 0 !important; +} + +div.DTFC_RightBodyWrapper tbody tr:first-child th, +div.DTFC_RightBodyWrapper tbody tr:first-child td, +div.DTFC_LeftBodyWrapper tbody tr:first-child th, +div.DTFC_LeftBodyWrapper tbody tr:first-child td { + border-top: none; +} + +div.DTFC_RightFootWrapper table, +div.DTFC_LeftFootWrapper table { + border-top: none; + margin-top: 0 !important; +} + + +/* + * FixedHeader styles + */ +div.FixedHeader_Cloned table { + margin: 0 !important +} + + + + +div.dataTables_length, div.dataTables_info { + display: inline; +} + +div.dataTables_paginate { + display: inline; + float: right !important; +} + +input.pagination-panel-input { + width: 50px; +} + + diff --git a/common/src/main/webapp/thirdparty/data-tables/images/loading-spinner-grey.gif b/common/src/main/webapp/thirdparty/data-tables/images/loading-spinner-grey.gif new file mode 100644 index 00000000..6d614d3d Binary files /dev/null and b/common/src/main/webapp/thirdparty/data-tables/images/loading-spinner-grey.gif differ diff --git a/common/src/main/webapp/thirdparty/data-tables/images/sort_asc.png b/common/src/main/webapp/thirdparty/data-tables/images/sort_asc.png new file mode 100644 index 00000000..a88d7975 Binary files /dev/null and b/common/src/main/webapp/thirdparty/data-tables/images/sort_asc.png differ diff --git a/common/src/main/webapp/thirdparty/data-tables/images/sort_both.png b/common/src/main/webapp/thirdparty/data-tables/images/sort_both.png new file mode 100644 index 00000000..18670406 Binary files /dev/null and b/common/src/main/webapp/thirdparty/data-tables/images/sort_both.png differ diff --git a/common/src/main/webapp/thirdparty/data-tables/images/sort_desc.png b/common/src/main/webapp/thirdparty/data-tables/images/sort_desc.png new file mode 100644 index 00000000..def071ed Binary files /dev/null and b/common/src/main/webapp/thirdparty/data-tables/images/sort_desc.png differ diff --git a/common/src/main/webapp/thirdparty/data-tables/jquery.dataTables-1.9.4.js b/common/src/main/webapp/thirdparty/data-tables/jquery.dataTables-1.9.4.js new file mode 100644 index 00000000..367680da --- /dev/null +++ b/common/src/main/webapp/thirdparty/data-tables/jquery.dataTables-1.9.4.js @@ -0,0 +1,12101 @@ +/** + * @summary DataTables + * @description Paginate, search and sort HTML tables + * @version 1.9.4 + * @file jquery.dataTables.js + * @author Allan Jardine (www.sprymedia.co.uk) + * @contact www.sprymedia.co.uk/contact + * + * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD style license, available at: + * http://datatables.net/license_gpl2 + * http://datatables.net/license_bsd + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + * + * For details please refer to: http://www.datatables.net + */ + +/*jslint evil: true, undef: true, browser: true */ +/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/ + +(/** @lends */function( window, document, undefined ) { + +(function( factory ) { + "use strict"; + + // Define as an AMD module if possible + if ( typeof define === 'function' && define.amd ) + { + define( ['jquery'], factory ); + } + /* Define using browser globals otherwise + * Prevent multiple instantiations if the script is loaded twice + */ + else if ( jQuery && !jQuery.fn.dataTable ) + { + factory( jQuery ); + } +} +(/** @lends */function( $ ) { + "use strict"; + /** + * DataTables is a plug-in for the jQuery Javascript library. It is a + * highly flexible tool, based upon the foundations of progressive + * enhancement, which will add advanced interaction controls to any + * HTML table. For a full list of features please refer to + * DataTables.net. + * + * Note that the DataTable object is not a global variable but is + * aliased to jQuery.fn.DataTable and jQuery.fn.dataTable through which + * it may be accessed. + * + * @class + * @param {object} [oInit={}] Configuration object for DataTables. Options + * are defined by {@link DataTable.defaults} + * @requires jQuery 1.3+ + * + * @example + * // Basic initialisation + * $(document).ready( function { + * $('#example').dataTable(); + * } ); + * + * @example + * // Initialisation with configuration options - in this case, disable + * // pagination and sorting. + * $(document).ready( function { + * $('#example').dataTable( { + * "bPaginate": false, + * "bSort": false + * } ); + * } ); + */ + var DataTable = function( oInit ) + { + + + /** + * Add a column to the list used for the table with default values + * @param {object} oSettings dataTables settings object + * @param {node} nTh The th element for this column + * @memberof DataTable#oApi + */ + function _fnAddColumn( oSettings, nTh ) + { + var oDefaults = DataTable.defaults.columns; + var iCol = oSettings.aoColumns.length; + var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, { + "sSortingClass": oSettings.oClasses.sSortable, + "sSortingClassJUI": oSettings.oClasses.sSortJUI, + "nTh": nTh ? nTh : document.createElement('th'), + "sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '', + "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol], + "mData": oDefaults.mData ? oDefaults.oDefaults : iCol + } ); + oSettings.aoColumns.push( oCol ); + + /* Add a column specific filter */ + if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null ) + { + oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch ); + } + else + { + var oPre = oSettings.aoPreSearchCols[ iCol ]; + + /* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */ + if ( oPre.bRegex === undefined ) + { + oPre.bRegex = true; + } + + if ( oPre.bSmart === undefined ) + { + oPre.bSmart = true; + } + + if ( oPre.bCaseInsensitive === undefined ) + { + oPre.bCaseInsensitive = true; + } + } + + /* Use the column options function to initialise classes etc */ + _fnColumnOptions( oSettings, iCol, null ); + } + + + /** + * Apply options for a column + * @param {object} oSettings dataTables settings object + * @param {int} iCol column index to consider + * @param {object} oOptions object with sType, bVisible and bSearchable etc + * @memberof DataTable#oApi + */ + function _fnColumnOptions( oSettings, iCol, oOptions ) + { + var oCol = oSettings.aoColumns[ iCol ]; + + /* User specified column options */ + if ( oOptions !== undefined && oOptions !== null ) + { + /* Backwards compatibility for mDataProp */ + if ( oOptions.mDataProp && !oOptions.mData ) + { + oOptions.mData = oOptions.mDataProp; + } + + if ( oOptions.sType !== undefined ) + { + oCol.sType = oOptions.sType; + oCol._bAutoType = false; + } + + $.extend( oCol, oOptions ); + _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" ); + + /* iDataSort to be applied (backwards compatibility), but aDataSort will take + * priority if defined + */ + if ( oOptions.iDataSort !== undefined ) + { + oCol.aDataSort = [ oOptions.iDataSort ]; + } + _fnMap( oCol, oOptions, "aDataSort" ); + } + + /* Cache the data get and set functions for speed */ + var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null; + var mData = _fnGetObjectDataFn( oCol.mData ); + + oCol.fnGetData = function (oData, sSpecific) { + var innerData = mData( oData, sSpecific ); + + if ( oCol.mRender && (sSpecific && sSpecific !== '') ) + { + return mRender( innerData, sSpecific, oData ); + } + return innerData; + }; + oCol.fnSetData = _fnSetObjectDataFn( oCol.mData ); + + /* Feature sorting overrides column specific when off */ + if ( !oSettings.oFeatures.bSort ) + { + oCol.bSortable = false; + } + + /* Check that the class assignment is correct for sorting */ + if ( !oCol.bSortable || + ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) ) + { + oCol.sSortingClass = oSettings.oClasses.sSortableNone; + oCol.sSortingClassJUI = ""; + } + else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1 ) + { + oCol.sSortingClass = oSettings.oClasses.sSortable; + oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI; + } + else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 ) + { + oCol.sSortingClass = oSettings.oClasses.sSortableAsc; + oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed; + } + else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 ) + { + oCol.sSortingClass = oSettings.oClasses.sSortableDesc; + oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed; + } + } + + + /** + * Adjust the table column widths for new data. Note: you would probably want to + * do a redraw after calling this function! + * @param {object} oSettings dataTables settings object + * @memberof DataTable#oApi + */ + function _fnAdjustColumnSizing ( oSettings ) + { + /* Not interested in doing column width calculation if auto-width is disabled */ + if ( oSettings.oFeatures.bAutoWidth === false ) + { + return false; + } + + _fnCalculateColumnWidths( oSettings ); + for ( var i=0 , iLen=oSettings.aoColumns.length ; i