b2adminui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +45 -0
- package/app-config-prod.json +6 -0
- package/app-config.json +10 -0
- package/b2@1.0.0 +0 -0
- package/bs-config.json +8 -0
- package/config/helpers.js +10 -0
- package/config/karma-test-shim.js +21 -0
- package/config/karma.conf.js +37 -0
- package/config/webpack.common.js +96 -0
- package/config/webpack.dev.js +24 -0
- package/config/webpack.eks.js +72 -0
- package/config/webpack.prod.js +72 -0
- package/config/webpack.test.js +53 -0
- package/default.nginx.config +60 -0
- package/docker-entrypoint.sh +6 -0
- package/e2e-spec.ts +21 -0
- package/favicon.ico +0 -0
- package/karma.webpack.conf.js +1 -0
- package/npm +0 -0
- package/package.json +144 -0
- package/rimraf +0 -0
- package/src/app/app-config.ts +21 -0
- package/src/app/app-routing.module.ts +165 -0
- package/src/app/app.component.ts +30 -0
- package/src/app/app.module.ts +72 -0
- package/src/app/auth/auth.guard.ts +192 -0
- package/src/app/customer-management/customer-management.module.ts +52 -0
- package/src/app/customer-management/customer-personal-details/components/customer-personal-details.component.ts +766 -0
- package/src/app/customer-management/customer-personal-details/customer-personal-details.component.css +4 -0
- package/src/app/customer-management/customer-personal-details/customer-personal-details.component.html +812 -0
- package/src/app/customer-management/customer-personal-details/models/companyrisksetting.model.ts +65 -0
- package/src/app/customer-management/customer-profile-history-list/components/customer-profile-history-list.component.ts +149 -0
- package/src/app/customer-management/customer-profile-history-list/customer-profile-history-list.component.html +104 -0
- package/src/app/customer-management/customer-profile-history-list/models/customer-profile-history-list.model.ts +33 -0
- package/src/app/customer-management/customer-profile-history-list/models/index.ts +1 -0
- package/src/app/customer-management/customer-registration/components/customer-registration.component.ts +1567 -0
- package/src/app/customer-management/customer-registration/customer-registration.component.css +6 -0
- package/src/app/customer-management/customer-registration/customer-registration.component.html +1140 -0
- package/src/app/customer-management/customer-registration/models/approve-customer.model.ts +5 -0
- package/src/app/customer-management/customer-registration/models/index.ts +1 -0
- package/src/app/customer-management/customer-registration/models/wallet-registration.model.ts +191 -0
- package/src/app/customer-management/customer-registration-list/components/customer-registration-list.component.ts +444 -0
- package/src/app/customer-management/customer-registration-list/customer-registration-list.component.html +350 -0
- package/src/app/customer-management/customer-registration-list/models/index.ts +2 -0
- package/src/app/customer-management/customer-registration-list/models/wallet-list.model.ts +41 -0
- package/src/app/customer-management/customer-registration-list/models/wallet.model.ts +13 -0
- package/src/app/customer-management/manual-topup/components/manual-topup.component.ts +299 -0
- package/src/app/customer-management/manual-topup/manual-topup.component.html +173 -0
- package/src/app/customer-management/manual-topup/models/index.ts +1 -0
- package/src/app/customer-management/manual-topup/models/manual-topup.model.ts +17 -0
- package/src/app/customer-management/wallet-balance-history/components/wallet-balance-history.component.ts +243 -0
- package/src/app/customer-management/wallet-balance-history/models/balance-history-list.model.ts +25 -0
- package/src/app/customer-management/wallet-balance-history/models/balance-history.model.ts +13 -0
- package/src/app/customer-management/wallet-balance-history/models/index.ts +3 -0
- package/src/app/customer-management/wallet-balance-history/models/wallet.model.ts +13 -0
- package/src/app/customer-management/wallet-balance-history/wallet-balance-history.component.html +182 -0
- package/src/app/customer-management/wallet-history/components/wallet-history.component.ts +239 -0
- package/src/app/customer-management/wallet-history/models/index.ts +2 -0
- package/src/app/customer-management/wallet-history/models/wallet-history-list.model.ts +11 -0
- package/src/app/customer-management/wallet-history/models/wallet-history.model.ts +10 -0
- package/src/app/customer-management/wallet-history/wallet-history.component.html +85 -0
- package/src/app/external-change-password/components/external-change-password.component.ts +71 -0
- package/src/app/external-change-password/external-change-password.component.html +57 -0
- package/src/app/external-change-password/models/external-change-password.model.ts +6 -0
- package/src/app/fee-management/company/company.component.html +491 -0
- package/src/app/fee-management/company/components/company.component.ts +472 -0
- package/src/app/fee-management/company/models/company.model.ts +55 -0
- package/src/app/fee-management/company/models/index.ts +1 -0
- package/src/app/fee-management/company-wallet-profile/company-wallet-profile.component.html +161 -0
- package/src/app/fee-management/company-wallet-profile/components/company-wallet-profile.component.ts +194 -0
- package/src/app/fee-management/fee-management.module.ts +51 -0
- package/src/app/fee-management/menu-setup/models/menu-setup.model.ts +75 -0
- package/src/app/fee-management/wallet-fee-setting/components/wallet-fee-setting.component.ts +337 -0
- package/src/app/fee-management/wallet-fee-setting/models/index.ts +7 -0
- package/src/app/fee-management/wallet-fee-setting/models/transfer-fee.model.ts +32 -0
- package/src/app/fee-management/wallet-fee-setting/models/verify-risk-level.model.ts +7 -0
- package/src/app/fee-management/wallet-fee-setting/models/wallet-fee-setting.model.ts +32 -0
- package/src/app/fee-management/wallet-fee-setting/models/wallet-setting.model.ts +17 -0
- package/src/app/fee-management/wallet-fee-setting/models/wallet.model.ts +28 -0
- package/src/app/fee-management/wallet-fee-setting/wallet-fee-setting.component.html +1226 -0
- package/src/app/fee-management/wallet-profile-limit-setting/components/wallet-profile-limit-setting.component.ts +284 -0
- package/src/app/fee-management/wallet-profile-limit-setting/models/index.ts +1 -0
- package/src/app/fee-management/wallet-profile-limit-setting/models/wallet-profile-limit-setting.model.ts +79 -0
- package/src/app/fee-management/wallet-profile-limit-setting/wallet-profile-limit-setting.component.html +1285 -0
- package/src/app/fee-management/wallet-profile-setting-list/components/wallet-profile-setting-list.component.ts +350 -0
- package/src/app/fee-management/wallet-profile-setting-list/models/index.ts +2 -0
- package/src/app/fee-management/wallet-profile-setting-list/models/wallet-profile-setting-list.model.ts +36 -0
- package/src/app/fee-management/wallet-profile-setting-list/models/wallet-profile-setting.model.ts +12 -0
- package/src/app/fee-management/wallet-profile-setting-list/wallet-profile-setting-list.component.html +220 -0
- package/src/app/fee-management/wallet-topup/components/wallet-topup.component.ts +209 -0
- package/src/app/fee-management/wallet-topup/models/index.ts +3 -0
- package/src/app/fee-management/wallet-topup/models/wallet-topup.model.ts +11 -0
- package/src/app/fee-management/wallet-topup/wallet-topup.component.html +97 -0
- package/src/app/forgot-password/components/forgot-password.component.ts +87 -0
- package/src/app/forgot-password/forgot-password.component.html +40 -0
- package/src/app/forgot-password/models/forgot-password.model.ts +5 -0
- package/src/app/forgot-password/models/index.ts +2 -0
- package/src/app/login/components/login.component.ts +199 -0
- package/src/app/login/login.component.html +49 -0
- package/src/app/login/models/common.model.ts +21 -0
- package/src/app/login/models/login.model.ts +5 -0
- package/src/app/models/audit-log-insert.model.ts +11 -0
- package/src/app/models/common.model.ts +56 -0
- package/src/app/models/index.ts +4 -0
- package/src/app/models/navigation-data.model.ts +24 -0
- package/src/app/models/page-info-model.ts +4 -0
- package/src/app/models/response-model.ts +5 -0
- package/src/app/models/search-model.ts +21 -0
- package/src/app/navbar/components/navbar.component.ts +288 -0
- package/src/app/navbar/navbar.component.html +200 -0
- package/src/app/profile-setting/change-password/change-password.component.html +85 -0
- package/src/app/profile-setting/change-password/components/change-password.component.ts +76 -0
- package/src/app/profile-setting/change-password/models/change-password.model.ts +5 -0
- package/src/app/profile-setting/change-password/models/index.ts +1 -0
- package/src/app/profile-setting/profile-setting/components/profile-setting.component.ts +234 -0
- package/src/app/profile-setting/profile-setting/models/profile-setting.model.ts +21 -0
- package/src/app/profile-setting/profile-setting/profile-setting.component.html +228 -0
- package/src/app/profile-setting/profile-setting.module.ts +22 -0
- package/src/app/shared/alerts/alertOptions.ts +14 -0
- package/src/app/shared/alerts/alerts.ts +57 -0
- package/src/app/shared/common/common.ts +1342 -0
- package/src/app/shared/constants/constants.ts +550 -0
- package/src/app/shared/interceptor/https-interceptor.ts +69 -0
- package/src/app/shared/service/shared.service.ts +287 -0
- package/src/app/shared/source-of-fund/source-of-fund.ts +4 -0
- package/src/app/shared/transaction/transaction-type-status.ts +32 -0
- package/src/app/transaction-history/transaction-history.module.ts +83 -0
- package/src/app/transaction-history/wallet-transaction-list/components/wallet-transaction-list.component.ts +500 -0
- package/src/app/transaction-history/wallet-transaction-list/models/wallet-transaction-list.model.ts +75 -0
- package/src/app/transaction-history/wallet-transaction-list/wallet-transaction-list.component.html +530 -0
- package/src/app/transaction-history/wallet-transaction-list-details/components/wallet-transaction-list-details.component.ts +154 -0
- package/src/app/transaction-history/wallet-transaction-list-details/models/index.ts +3 -0
- package/src/app/transaction-history/wallet-transaction-list-details/models/wallet-transaction-list-details.model.ts +39 -0
- package/src/app/transaction-history/wallet-transaction-list-details/models/wallet-transaction-refund.model.ts +5 -0
- package/src/app/transaction-history/wallet-transaction-list-details/wallet-transaction-list-details.component.html +452 -0
- package/src/app/user-management/audit-log-list/audit-log-list.component.html +198 -0
- package/src/app/user-management/audit-log-list/components/audit-log-list.component.ts +415 -0
- package/src/app/user-management/audit-log-list/models/audit-log-list.model.ts +38 -0
- package/src/app/user-management/audit-log-list/models/audit-log.model.ts +11 -0
- package/src/app/user-management/audit-log-list/models/index.ts +2 -0
- package/src/app/user-management/system-user/components/system-user.component.ts +466 -0
- package/src/app/user-management/system-user/models/system-user.model.ts +23 -0
- package/src/app/user-management/system-user/system-user.component.html +349 -0
- package/src/app/user-management/system-user-list/components/system-user-list.component.ts +399 -0
- package/src/app/user-management/system-user-list/models/index.ts +2 -0
- package/src/app/user-management/system-user-list/models/system-user-list.model.ts +40 -0
- package/src/app/user-management/system-user-list/models/system-user.model.ts +11 -0
- package/src/app/user-management/system-user-list/system-user-list.component.html +266 -0
- package/src/app/user-management/user-group-permission/components/user-group-permission.component.ts +1819 -0
- package/src/app/user-management/user-group-permission/models/user-group-permission.model.ts +288 -0
- package/src/app/user-management/user-group-permission/user-group-permission.component.html +100 -0
- package/src/app/user-management/user-group-permission-list/components/user-group-permission-list.component.ts +379 -0
- package/src/app/user-management/user-group-permission-list/models/index.ts +2 -0
- package/src/app/user-management/user-group-permission-list/models/user-group-permission-list.model.ts +28 -0
- package/src/app/user-management/user-group-permission-list/models/user-group-permission.model.ts +8 -0
- package/src/app/user-management/user-group-permission-list/user-group-permission-list.component.html +184 -0
- package/src/app/user-management/user-management.module.ts +38 -0
- package/src/app/validate-change-password/components/validate-change-password.component.ts +66 -0
- package/src/app/validate-change-password/validate-change-password.component.html +8 -0
- package/src/assets/css/animate.css +2848 -0
- package/src/assets/css/bootstrap.css +6760 -0
- package/src/assets/css/bootstrap.css.map +1 -0
- package/src/assets/css/bootstrap.min.css +6 -0
- package/src/assets/css/bootstrap.min.css.map +1 -0
- package/src/assets/css/font.css +10 -0
- package/src/assets/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css +251 -0
- package/src/assets/css/plugins/blueimp/css/blueimp-gallery-indicator.css +71 -0
- package/src/assets/css/plugins/blueimp/css/blueimp-gallery-video.css +87 -0
- package/src/assets/css/plugins/blueimp/css/blueimp-gallery.css +226 -0
- package/src/assets/css/plugins/blueimp/css/blueimp-gallery.min.css +1 -0
- package/src/assets/css/plugins/blueimp/css/demo.css +51 -0
- package/src/assets/css/plugins/blueimp/img/error.png +0 -0
- package/src/assets/css/plugins/blueimp/img/error.svg +5 -0
- package/src/assets/css/plugins/blueimp/img/loading.gif +0 -0
- package/src/assets/css/plugins/blueimp/img/play-pause.png +0 -0
- package/src/assets/css/plugins/blueimp/img/play-pause.svg +6 -0
- package/src/assets/css/plugins/blueimp/img/video-play.png +0 -0
- package/src/assets/css/plugins/blueimp/img/video-play.svg +5 -0
- package/src/assets/css/plugins/bootstrap-datepicker/bootstrap-datepicker3.min.css +9 -0
- package/src/assets/css/plugins/bootstrap-markdown/bootstrap-markdown.min.css +1 -0
- package/src/assets/css/plugins/bootstrap-rtl/bootstrap-rtl.css +1468 -0
- package/src/assets/css/plugins/bootstrap-rtl/bootstrap-rtl.css.map +1 -0
- package/src/assets/css/plugins/bootstrap-rtl/bootstrap-rtl.min.css +9 -0
- package/src/assets/css/plugins/bootstrap-timepicker/bootstrap-timepicker.min.css +10 -0
- package/src/assets/css/plugins/bootstrapTour/bootstrap-tour.min.css +22 -0
- package/src/assets/css/plugins/c3/c3.min.css +1 -0
- package/src/assets/css/plugins/chartist/chartist.min.css +773 -0
- package/src/assets/css/plugins/chosen/chosen-sprite.png +0 -0
- package/src/assets/css/plugins/chosen/chosen-sprite@2x.png +0 -0
- package/src/assets/css/plugins/chosen/chosen.css +429 -0
- package/src/assets/css/plugins/clockpicker/clockpicker.css +168 -0
- package/src/assets/css/plugins/codemirror/ambiance.css +77 -0
- package/src/assets/css/plugins/codemirror/codemirror.css +309 -0
- package/src/assets/css/plugins/colorpicker/bootstrap-colorpicker.min.css +9 -0
- package/src/assets/css/plugins/cropper/cropper.min.css +9 -0
- package/src/assets/css/plugins/dataTables/datatables.min.css +21 -0
- package/src/assets/css/plugins/datapicker/datepicker3.css +789 -0
- package/src/assets/css/plugins/datatables.net/css/jquery.dataTables.css +455 -0
- package/src/assets/css/plugins/datatables.net/images/sort_asc.png +0 -0
- package/src/assets/css/plugins/datatables.net/images/sort_asc_disabled.png +0 -0
- package/src/assets/css/plugins/datatables.net/images/sort_both.png +0 -0
- package/src/assets/css/plugins/datatables.net/images/sort_desc.png +0 -0
- package/src/assets/css/plugins/datatables.net/images/sort_desc_disabled.png +0 -0
- package/src/assets/css/plugins/daterangepicker/daterangepicker-bs3.css +335 -0
- package/src/assets/css/plugins/dropzone/basic.css +155 -0
- package/src/assets/css/plugins/dropzone/dropzone.css +410 -0
- package/src/assets/css/plugins/footable/fonts/footable.eot +0 -0
- package/src/assets/css/plugins/footable/fonts/footable.svg +78 -0
- package/src/assets/css/plugins/footable/fonts/footable.ttf +0 -0
- package/src/assets/css/plugins/footable/fonts/footable.woff +0 -0
- package/src/assets/css/plugins/footable/footable.core.css +178 -0
- package/src/assets/css/plugins/fullcalendar/fullcalendar.css +977 -0
- package/src/assets/css/plugins/fullcalendar/fullcalendar.print.css +202 -0
- package/src/assets/css/plugins/iCheck/custom.css +59 -0
- package/src/assets/css/plugins/iCheck/green.png +0 -0
- package/src/assets/css/plugins/iCheck/green@2x.png +0 -0
- package/src/assets/css/plugins/images/bootstrap-colorpicker/alpha-horizontal.png +0 -0
- package/src/assets/css/plugins/images/bootstrap-colorpicker/alpha.png +0 -0
- package/src/assets/css/plugins/images/bootstrap-colorpicker/hue-horizontal.png +0 -0
- package/src/assets/css/plugins/images/bootstrap-colorpicker/hue.png +0 -0
- package/src/assets/css/plugins/images/bootstrap-colorpicker/saturation.png +0 -0
- package/src/assets/css/plugins/images/sort.png +0 -0
- package/src/assets/css/plugins/images/sort_asc.png +0 -0
- package/src/assets/css/plugins/images/sort_desc.png +0 -0
- package/src/assets/css/plugins/images/sprite-skin-flat.png +0 -0
- package/src/assets/css/plugins/images/sprite-skin-flat2.png +0 -0
- package/src/assets/css/plugins/images/sprite-skin-nice.png +0 -0
- package/src/assets/css/plugins/images/sprite-skin-simple.png +0 -0
- package/src/assets/css/plugins/images/spritemap.png +0 -0
- package/src/assets/css/plugins/images/spritemap@2x.png +0 -0
- package/src/assets/css/plugins/ionRangeSlider/ion.rangeSlider.css +126 -0
- package/src/assets/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css +89 -0
- package/src/assets/css/plugins/ionRangeSlider/ion.rangeSlider.skinNice.css +85 -0
- package/src/assets/css/plugins/ionRangeSlider/ion.rangeSlider.skinSimple.css +85 -0
- package/src/assets/css/plugins/jQueryUI/images/animated-overlay.gif +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-icons_222222_256x240.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-icons_2e83ff_256x240.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-icons_454545_256x240.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-icons_888888_256x240.png +0 -0
- package/src/assets/css/plugins/jQueryUI/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/src/assets/css/plugins/jQueryUI/jquery-ui-1.10.4.custom.min.css +7 -0
- package/src/assets/css/plugins/jQueryUI/jquery-ui.css +1177 -0
- package/src/assets/css/plugins/jasny/jasny-bootstrap.min.css +7 -0
- package/src/assets/css/plugins/jqGrid/ui.jqgrid.css +171 -0
- package/src/assets/css/plugins/jsTree/32px.png +0 -0
- package/src/assets/css/plugins/jsTree/39px.png +0 -0
- package/src/assets/css/plugins/jsTree/40px.png +0 -0
- package/src/assets/css/plugins/jsTree/style.css +1050 -0
- package/src/assets/css/plugins/jsTree/style.min.css +1 -0
- package/src/assets/css/plugins/jsTree/throbber.gif +0 -0
- package/src/assets/css/plugins/ladda/ladda-themeless.min.css +7 -0
- package/src/assets/css/plugins/ladda/ladda.min.css +9 -0
- package/src/assets/css/plugins/morris/morris-0.4.3.min.css +2 -0
- package/src/assets/css/plugins/nouslider/jquery.nouislider.css +165 -0
- package/src/assets/css/plugins/select2/select2.min.css +1 -0
- package/src/assets/css/plugins/slick/ajax-loader.gif +0 -0
- package/src/assets/css/plugins/slick/fonts/slick.eot +0 -0
- package/src/assets/css/plugins/slick/fonts/slick.svg +14 -0
- package/src/assets/css/plugins/slick/fonts/slick.ttf +0 -0
- package/src/assets/css/plugins/slick/fonts/slick.woff +0 -0
- package/src/assets/css/plugins/slick/slick-theme.css +201 -0
- package/src/assets/css/plugins/slick/slick.css +119 -0
- package/src/assets/css/plugins/social-buttons/social-buttons.css +68 -0
- package/src/assets/css/plugins/steps/jquery.steps.css +380 -0
- package/src/assets/css/plugins/summernote/summernote-bs3.css +5970 -0
- package/src/assets/css/plugins/summernote/summernote.css +446 -0
- package/src/assets/css/plugins/sweetalert/sweetalert.css +715 -0
- package/src/assets/css/plugins/switchery/switchery.css +32 -0
- package/src/assets/css/plugins/toastr/ng2-toastr.min.css +1 -0
- package/src/assets/css/plugins/toastr/toastr.min.css +222 -0
- package/src/assets/css/plugins/touchspin/jquery.bootstrap-touchspin.min.css +10 -0
- package/src/assets/css/style.css +9725 -0
- package/src/assets/css/style.scss +1 -0
- package/src/assets/font-awesome/css/font-awesome.css +2337 -0
- package/src/assets/font-awesome/css/font-awesome.min.css +4 -0
- package/src/assets/font-awesome/fonts/FontAwesome.otf +0 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/src/assets/font-awesome/less/animated.less +34 -0
- package/src/assets/font-awesome/less/bordered-pulled.less +25 -0
- package/src/assets/font-awesome/less/core.less +12 -0
- package/src/assets/font-awesome/less/fixed-width.less +6 -0
- package/src/assets/font-awesome/less/font-awesome.less +18 -0
- package/src/assets/font-awesome/less/icons.less +789 -0
- package/src/assets/font-awesome/less/larger.less +13 -0
- package/src/assets/font-awesome/less/list.less +19 -0
- package/src/assets/font-awesome/less/mixins.less +60 -0
- package/src/assets/font-awesome/less/path.less +15 -0
- package/src/assets/font-awesome/less/rotated-flipped.less +20 -0
- package/src/assets/font-awesome/less/screen-reader.less +5 -0
- package/src/assets/font-awesome/less/stacked.less +20 -0
- package/src/assets/font-awesome/less/variables.less +800 -0
- package/src/assets/font-awesome/scss/_animated.scss +34 -0
- package/src/assets/font-awesome/scss/_bordered-pulled.scss +25 -0
- package/src/assets/font-awesome/scss/_core.scss +12 -0
- package/src/assets/font-awesome/scss/_fixed-width.scss +6 -0
- package/src/assets/font-awesome/scss/_icons.scss +789 -0
- package/src/assets/font-awesome/scss/_larger.scss +13 -0
- package/src/assets/font-awesome/scss/_list.scss +19 -0
- package/src/assets/font-awesome/scss/_mixins.scss +60 -0
- package/src/assets/font-awesome/scss/_path.scss +15 -0
- package/src/assets/font-awesome/scss/_rotated-flipped.scss +20 -0
- package/src/assets/font-awesome/scss/_screen-reader.scss +5 -0
- package/src/assets/font-awesome/scss/_stacked.scss +20 -0
- package/src/assets/font-awesome/scss/_variables.scss +800 -0
- package/src/assets/font-awesome/scss/font-awesome.scss +18 -0
- package/src/assets/fonts/DejaVuSans-Bold.ttf +0 -0
- package/src/assets/fonts/DejaVuSans-Oblique.ttf +0 -0
- package/src/assets/fonts/DejaVuSans.ttf +0 -0
- package/src/assets/fonts/Garuda.ttf +0 -0
- package/src/assets/fonts/NotoSansThaiUI-Regular.ttf +0 -0
- package/src/assets/fonts/TH-Charmonman-Regular.ttf +0 -0
- package/src/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- package/src/assets/fonts/glyphicons-halflings-regular.svg +288 -0
- package/src/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/src/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- package/src/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/src/assets/fonts/kanit-v3-latin_latin-ext_thai-regular.ttf +0 -0
- package/src/assets/img/2c2p_169x60.png +0 -0
- package/src/assets/img/2c2p_169x60_black_header.png +0 -0
- package/src/assets/img/calendar_gray.png +0 -0
- package/src/assets/img/success.png +0 -0
- package/src/assets/img/user.png +0 -0
- package/src/assets/img/warning.png +0 -0
- package/src/assets/js/bootstrap.js +2363 -0
- package/src/assets/js/bootstrap.min.js +7 -0
- package/src/assets/js/demo/chartjs-demo.js +217 -0
- package/src/assets/js/demo/dashboard-demo.js +117 -0
- package/src/assets/js/demo/flot-demo.js +308 -0
- package/src/assets/js/demo/flot-demo2.js +377 -0
- package/src/assets/js/demo/morris-demo.js +89 -0
- package/src/assets/js/demo/peity-demo.js +33 -0
- package/src/assets/js/demo/rickshaw-demo.js +103 -0
- package/src/assets/js/demo/sparkline-demo.js +51 -0
- package/src/assets/js/inspinia.js +301 -0
- package/src/assets/js/jquery-2.1.1.js +4 -0
- package/src/assets/js/jquery-3.3.1.min.js +2 -0
- package/src/assets/js/jquery-ui-1.10.4.min.js +7 -0
- package/src/assets/js/jquery-ui.custom.min.js +16 -0
- package/src/assets/js/plugins/blueimp/jquery.blueimp-gallery.min.js +1 -0
- package/src/assets/js/plugins/bootstrap-datepicker/bootstrap-datepicker.min.js +9 -0
- package/src/assets/js/plugins/bootstrap-markdown/bootstrap-markdown.js +1386 -0
- package/src/assets/js/plugins/bootstrap-markdown/markdown.js +1616 -0
- package/src/assets/js/plugins/bootstrap-timepicker/bootstrap-timepicker.min.js +5 -0
- package/src/assets/js/plugins/bootstrapTour/bootstrap-tour.min.js +22 -0
- package/src/assets/js/plugins/c3/c3.min.js +5 -0
- package/src/assets/js/plugins/chartJs/Chart.min.js +14 -0
- package/src/assets/js/plugins/chartist/chartist.min.js +9 -0
- package/src/assets/js/plugins/chartist/chartist.min.js.map +1 -0
- package/src/assets/js/plugins/chosen/chosen.jquery.js +1211 -0
- package/src/assets/js/plugins/clipboard/clipboard.min.js +7 -0
- package/src/assets/js/plugins/clockpicker/clockpicker.js +729 -0
- package/src/assets/js/plugins/codemirror/codemirror.js +7830 -0
- package/src/assets/js/plugins/codemirror/mode/apl/apl.js +175 -0
- package/src/assets/js/plugins/codemirror/mode/apl/index.html +72 -0
- package/src/assets/js/plugins/codemirror/mode/asterisk/asterisk.js +198 -0
- package/src/assets/js/plugins/codemirror/mode/asterisk/index.html +154 -0
- package/src/assets/js/plugins/codemirror/mode/clike/clike.js +474 -0
- package/src/assets/js/plugins/codemirror/mode/clike/index.html +225 -0
- package/src/assets/js/plugins/codemirror/mode/clike/scala.html +767 -0
- package/src/assets/js/plugins/codemirror/mode/clojure/clojure.js +243 -0
- package/src/assets/js/plugins/codemirror/mode/clojure/index.html +88 -0
- package/src/assets/js/plugins/codemirror/mode/cobol/cobol.js +255 -0
- package/src/assets/js/plugins/codemirror/mode/cobol/index.html +210 -0
- package/src/assets/js/plugins/codemirror/mode/coffeescript/coffeescript.js +369 -0
- package/src/assets/js/plugins/codemirror/mode/coffeescript/index.html +740 -0
- package/src/assets/js/plugins/codemirror/mode/commonlisp/commonlisp.js +120 -0
- package/src/assets/js/plugins/codemirror/mode/commonlisp/index.html +177 -0
- package/src/assets/js/plugins/codemirror/mode/css/css.js +717 -0
- package/src/assets/js/plugins/codemirror/mode/css/index.html +70 -0
- package/src/assets/js/plugins/codemirror/mode/css/less.html +152 -0
- package/src/assets/js/plugins/codemirror/mode/css/less_test.js +51 -0
- package/src/assets/js/plugins/codemirror/mode/css/scss.html +157 -0
- package/src/assets/js/plugins/codemirror/mode/css/scss_test.js +110 -0
- package/src/assets/js/plugins/codemirror/mode/css/test.js +135 -0
- package/src/assets/js/plugins/codemirror/mode/cypher/cypher.js +146 -0
- package/src/assets/js/plugins/codemirror/mode/cypher/index.html +63 -0
- package/src/assets/js/plugins/codemirror/mode/d/d.js +218 -0
- package/src/assets/js/plugins/codemirror/mode/d/index.html +273 -0
- package/src/assets/js/plugins/codemirror/mode/diff/diff.js +47 -0
- package/src/assets/js/plugins/codemirror/mode/diff/index.html +117 -0
- package/src/assets/js/plugins/codemirror/mode/django/django.js +67 -0
- package/src/assets/js/plugins/codemirror/mode/django/index.html +63 -0
- package/src/assets/js/plugins/codemirror/mode/dtd/dtd.js +142 -0
- package/src/assets/js/plugins/codemirror/mode/dtd/index.html +89 -0
- package/src/assets/js/plugins/codemirror/mode/dylan/dylan.js +299 -0
- package/src/assets/js/plugins/codemirror/mode/dylan/index.html +407 -0
- package/src/assets/js/plugins/codemirror/mode/ecl/ecl.js +207 -0
- package/src/assets/js/plugins/codemirror/mode/ecl/index.html +52 -0
- package/src/assets/js/plugins/codemirror/mode/eiffel/eiffel.js +162 -0
- package/src/assets/js/plugins/codemirror/mode/eiffel/index.html +429 -0
- package/src/assets/js/plugins/codemirror/mode/erlang/erlang.js +622 -0
- package/src/assets/js/plugins/codemirror/mode/erlang/index.html +76 -0
- package/src/assets/js/plugins/codemirror/mode/fortran/fortran.js +188 -0
- package/src/assets/js/plugins/codemirror/mode/fortran/index.html +81 -0
- package/src/assets/js/plugins/codemirror/mode/gas/gas.js +345 -0
- package/src/assets/js/plugins/codemirror/mode/gas/index.html +68 -0
- package/src/assets/js/plugins/codemirror/mode/gfm/gfm.js +122 -0
- package/src/assets/js/plugins/codemirror/mode/gfm/index.html +82 -0
- package/src/assets/js/plugins/codemirror/mode/gfm/test.js +164 -0
- package/src/assets/js/plugins/codemirror/mode/gherkin/gherkin.js +178 -0
- package/src/assets/js/plugins/codemirror/mode/gherkin/index.html +48 -0
- package/src/assets/js/plugins/codemirror/mode/go/go.js +184 -0
- package/src/assets/js/plugins/codemirror/mode/go/index.html +85 -0
- package/src/assets/js/plugins/codemirror/mode/groovy/groovy.js +226 -0
- package/src/assets/js/plugins/codemirror/mode/groovy/index.html +84 -0
- package/src/assets/js/plugins/codemirror/mode/haml/haml.js +159 -0
- package/src/assets/js/plugins/codemirror/mode/haml/index.html +79 -0
- package/src/assets/js/plugins/codemirror/mode/haml/test.js +97 -0
- package/src/assets/js/plugins/codemirror/mode/haskell/haskell.js +267 -0
- package/src/assets/js/plugins/codemirror/mode/haskell/index.html +73 -0
- package/src/assets/js/plugins/codemirror/mode/haxe/haxe.js +518 -0
- package/src/assets/js/plugins/codemirror/mode/haxe/index.html +124 -0
- package/src/assets/js/plugins/codemirror/mode/htmlembedded/htmlembedded.js +86 -0
- package/src/assets/js/plugins/codemirror/mode/htmlembedded/index.html +58 -0
- package/src/assets/js/plugins/codemirror/mode/htmlmixed/htmlmixed.js +121 -0
- package/src/assets/js/plugins/codemirror/mode/htmlmixed/index.html +85 -0
- package/src/assets/js/plugins/codemirror/mode/http/http.js +113 -0
- package/src/assets/js/plugins/codemirror/mode/http/index.html +45 -0
- package/src/assets/js/plugins/codemirror/mode/index.html +125 -0
- package/src/assets/js/plugins/codemirror/mode/jade/index.html +70 -0
- package/src/assets/js/plugins/codemirror/mode/jade/jade.js +590 -0
- package/src/assets/js/plugins/codemirror/mode/javascript/index.html +114 -0
- package/src/assets/js/plugins/codemirror/mode/javascript/javascript.js +684 -0
- package/src/assets/js/plugins/codemirror/mode/javascript/json-ld.html +72 -0
- package/src/assets/js/plugins/codemirror/mode/javascript/test.js +194 -0
- package/src/assets/js/plugins/codemirror/mode/javascript/typescript.html +61 -0
- package/src/assets/js/plugins/codemirror/mode/jinja2/index.html +54 -0
- package/src/assets/js/plugins/codemirror/mode/jinja2/jinja2.js +142 -0
- package/src/assets/js/plugins/codemirror/mode/julia/index.html +195 -0
- package/src/assets/js/plugins/codemirror/mode/julia/julia.js +301 -0
- package/src/assets/js/plugins/codemirror/mode/kotlin/index.html +89 -0
- package/src/assets/js/plugins/codemirror/mode/kotlin/kotlin.js +280 -0
- package/src/assets/js/plugins/codemirror/mode/livescript/index.html +459 -0
- package/src/assets/js/plugins/codemirror/mode/livescript/livescript.js +280 -0
- package/src/assets/js/plugins/codemirror/mode/lua/index.html +85 -0
- package/src/assets/js/plugins/codemirror/mode/lua/lua.js +159 -0
- package/src/assets/js/plugins/codemirror/mode/markdown/index.html +359 -0
- package/src/assets/js/plugins/codemirror/mode/markdown/markdown.js +758 -0
- package/src/assets/js/plugins/codemirror/mode/markdown/test.js +754 -0
- package/src/assets/js/plugins/codemirror/mode/meta.js +144 -0
- package/src/assets/js/plugins/codemirror/mode/mirc/index.html +160 -0
- package/src/assets/js/plugins/codemirror/mode/mirc/mirc.js +193 -0
- package/src/assets/js/plugins/codemirror/mode/mllike/index.html +179 -0
- package/src/assets/js/plugins/codemirror/mode/mllike/mllike.js +205 -0
- package/src/assets/js/plugins/codemirror/mode/modelica/index.html +67 -0
- package/src/assets/js/plugins/codemirror/mode/modelica/modelica.js +245 -0
- package/src/assets/js/plugins/codemirror/mode/nginx/index.html +181 -0
- package/src/assets/js/plugins/codemirror/mode/nginx/nginx.js +178 -0
- package/src/assets/js/plugins/codemirror/mode/ntriples/index.html +45 -0
- package/src/assets/js/plugins/codemirror/mode/ntriples/ntriples.js +186 -0
- package/src/assets/js/plugins/codemirror/mode/octave/index.html +83 -0
- package/src/assets/js/plugins/codemirror/mode/octave/octave.js +135 -0
- package/src/assets/js/plugins/codemirror/mode/pascal/index.html +61 -0
- package/src/assets/js/plugins/codemirror/mode/pascal/pascal.js +109 -0
- package/src/assets/js/plugins/codemirror/mode/pegjs/index.html +66 -0
- package/src/assets/js/plugins/codemirror/mode/pegjs/pegjs.js +114 -0
- package/src/assets/js/plugins/codemirror/mode/perl/index.html +75 -0
- package/src/assets/js/plugins/codemirror/mode/perl/perl.js +832 -0
- package/src/assets/js/plugins/codemirror/mode/php/index.html +64 -0
- package/src/assets/js/plugins/codemirror/mode/php/php.js +226 -0
- package/src/assets/js/plugins/codemirror/mode/php/test.js +154 -0
- package/src/assets/js/plugins/codemirror/mode/pig/index.html +55 -0
- package/src/assets/js/plugins/codemirror/mode/pig/pig.js +188 -0
- package/src/assets/js/plugins/codemirror/mode/properties/index.html +53 -0
- package/src/assets/js/plugins/codemirror/mode/properties/properties.js +78 -0
- package/src/assets/js/plugins/codemirror/mode/puppet/index.html +121 -0
- package/src/assets/js/plugins/codemirror/mode/puppet/puppet.js +220 -0
- package/src/assets/js/plugins/codemirror/mode/python/index.html +198 -0
- package/src/assets/js/plugins/codemirror/mode/python/python.js +359 -0
- package/src/assets/js/plugins/codemirror/mode/q/index.html +144 -0
- package/src/assets/js/plugins/codemirror/mode/q/q.js +139 -0
- package/src/assets/js/plugins/codemirror/mode/r/index.html +85 -0
- package/src/assets/js/plugins/codemirror/mode/r/r.js +162 -0
- package/src/assets/js/plugins/codemirror/mode/rpm/changes/index.html +66 -0
- package/src/assets/js/plugins/codemirror/mode/rpm/index.html +149 -0
- package/src/assets/js/plugins/codemirror/mode/rpm/rpm.js +101 -0
- package/src/assets/js/plugins/codemirror/mode/rst/index.html +535 -0
- package/src/assets/js/plugins/codemirror/mode/rst/rst.js +557 -0
- package/src/assets/js/plugins/codemirror/mode/ruby/index.html +184 -0
- package/src/assets/js/plugins/codemirror/mode/ruby/ruby.js +285 -0
- package/src/assets/js/plugins/codemirror/mode/ruby/test.js +14 -0
- package/src/assets/js/plugins/codemirror/mode/rust/index.html +60 -0
- package/src/assets/js/plugins/codemirror/mode/rust/rust.js +451 -0
- package/src/assets/js/plugins/codemirror/mode/sass/index.html +66 -0
- package/src/assets/js/plugins/codemirror/mode/sass/sass.js +327 -0
- package/src/assets/js/plugins/codemirror/mode/scheme/index.html +77 -0
- package/src/assets/js/plugins/codemirror/mode/scheme/scheme.js +248 -0
- package/src/assets/js/plugins/codemirror/mode/shell/index.html +66 -0
- package/src/assets/js/plugins/codemirror/mode/shell/shell.js +138 -0
- package/src/assets/js/plugins/codemirror/mode/shell/test.js +58 -0
- package/src/assets/js/plugins/codemirror/mode/sieve/index.html +93 -0
- package/src/assets/js/plugins/codemirror/mode/sieve/sieve.js +193 -0
- package/src/assets/js/plugins/codemirror/mode/slim/index.html +96 -0
- package/src/assets/js/plugins/codemirror/mode/slim/slim.js +575 -0
- package/src/assets/js/plugins/codemirror/mode/slim/test.js +96 -0
- package/src/assets/js/plugins/codemirror/mode/smalltalk/index.html +68 -0
- package/src/assets/js/plugins/codemirror/mode/smalltalk/smalltalk.js +168 -0
- package/src/assets/js/plugins/codemirror/mode/smarty/index.html +136 -0
- package/src/assets/js/plugins/codemirror/mode/smarty/smarty.js +221 -0
- package/src/assets/js/plugins/codemirror/mode/smartymixed/index.html +114 -0
- package/src/assets/js/plugins/codemirror/mode/smartymixed/smartymixed.js +197 -0
- package/src/assets/js/plugins/codemirror/mode/solr/index.html +57 -0
- package/src/assets/js/plugins/codemirror/mode/solr/solr.js +104 -0
- package/src/assets/js/plugins/codemirror/mode/sparql/index.html +53 -0
- package/src/assets/js/plugins/codemirror/mode/sparql/sparql.js +160 -0
- package/src/assets/js/plugins/codemirror/mode/sql/index.html +84 -0
- package/src/assets/js/plugins/codemirror/mode/sql/sql.js +393 -0
- package/src/assets/js/plugins/codemirror/mode/stex/index.html +110 -0
- package/src/assets/js/plugins/codemirror/mode/stex/stex.js +262 -0
- package/src/assets/js/plugins/codemirror/mode/stex/test.js +123 -0
- package/src/assets/js/plugins/codemirror/mode/tcl/index.html +142 -0
- package/src/assets/js/plugins/codemirror/mode/tcl/tcl.js +147 -0
- package/src/assets/js/plugins/codemirror/mode/textile/index.html +191 -0
- package/src/assets/js/plugins/codemirror/mode/textile/test.js +406 -0
- package/src/assets/js/plugins/codemirror/mode/textile/textile.js +553 -0
- package/src/assets/js/plugins/codemirror/mode/tiddlywiki/index.html +154 -0
- package/src/assets/js/plugins/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- package/src/assets/js/plugins/codemirror/mode/tiddlywiki/tiddlywiki.js +369 -0
- package/src/assets/js/plugins/codemirror/mode/tiki/index.html +95 -0
- package/src/assets/js/plugins/codemirror/mode/tiki/tiki.css +26 -0
- package/src/assets/js/plugins/codemirror/mode/tiki/tiki.js +323 -0
- package/src/assets/js/plugins/codemirror/mode/toml/index.html +73 -0
- package/src/assets/js/plugins/codemirror/mode/toml/toml.js +88 -0
- package/src/assets/js/plugins/codemirror/mode/tornado/index.html +63 -0
- package/src/assets/js/plugins/codemirror/mode/tornado/tornado.js +68 -0
- package/src/assets/js/plugins/codemirror/mode/turtle/index.html +50 -0
- package/src/assets/js/plugins/codemirror/mode/turtle/turtle.js +160 -0
- package/src/assets/js/plugins/codemirror/mode/vb/index.html +102 -0
- package/src/assets/js/plugins/codemirror/mode/vb/vb.js +274 -0
- package/src/assets/js/plugins/codemirror/mode/vbscript/index.html +55 -0
- package/src/assets/js/plugins/codemirror/mode/vbscript/vbscript.js +350 -0
- package/src/assets/js/plugins/codemirror/mode/velocity/index.html +118 -0
- package/src/assets/js/plugins/codemirror/mode/velocity/velocity.js +201 -0
- package/src/assets/js/plugins/codemirror/mode/verilog/index.html +120 -0
- package/src/assets/js/plugins/codemirror/mode/verilog/test.js +273 -0
- package/src/assets/js/plugins/codemirror/mode/verilog/verilog.js +364 -0
- package/src/assets/js/plugins/codemirror/mode/xml/index.html +57 -0
- package/src/assets/js/plugins/codemirror/mode/xml/test.js +51 -0
- package/src/assets/js/plugins/codemirror/mode/xml/xml.js +384 -0
- package/src/assets/js/plugins/codemirror/mode/xquery/index.html +210 -0
- package/src/assets/js/plugins/codemirror/mode/xquery/test.js +67 -0
- package/src/assets/js/plugins/codemirror/mode/xquery/xquery.js +447 -0
- package/src/assets/js/plugins/codemirror/mode/yaml/index.html +80 -0
- package/src/assets/js/plugins/codemirror/mode/yaml/yaml.js +112 -0
- package/src/assets/js/plugins/codemirror/mode/z80/index.html +52 -0
- package/src/assets/js/plugins/codemirror/mode/z80/z80.js +100 -0
- package/src/assets/js/plugins/colorpicker/bootstrap-colorpicker.min.js +1 -0
- package/src/assets/js/plugins/cropper/cropper.min.js +9 -0
- package/src/assets/js/plugins/d3/d3.min.js +5 -0
- package/src/assets/js/plugins/dataTables/datatables.min.js +336 -0
- package/src/assets/js/plugins/datapicker/bootstrap-datepicker.js +1671 -0
- package/src/assets/js/plugins/datatables.net/jquery.dataTables.js +15344 -0
- package/src/assets/js/plugins/daterangepicker/daterangepicker.js +1304 -0
- package/src/assets/js/plugins/diff_match_patch/COPYING +177 -0
- package/src/assets/js/plugins/diff_match_patch/README.txt +43 -0
- package/src/assets/js/plugins/diff_match_patch/javascript/diff_match_patch.js +49 -0
- package/src/assets/js/plugins/dotdotdot/jquery.dotdotdot.min.js +13 -0
- package/src/assets/js/plugins/dropzone/dropzone.js +1841 -0
- package/src/assets/js/plugins/easypiechart/easypiechart.js +350 -0
- package/src/assets/js/plugins/easypiechart/jquery.easypiechart.js +359 -0
- package/src/assets/js/plugins/flot/curvedLines.js +315 -0
- package/src/assets/js/plugins/flot/excanvas.min.js +1 -0
- package/src/assets/js/plugins/flot/jquery.flot.js +3168 -0
- package/src/assets/js/plugins/flot/jquery.flot.pie.js +820 -0
- package/src/assets/js/plugins/flot/jquery.flot.resize.js +59 -0
- package/src/assets/js/plugins/flot/jquery.flot.spline.js +212 -0
- package/src/assets/js/plugins/flot/jquery.flot.symbol.js +71 -0
- package/src/assets/js/plugins/flot/jquery.flot.time.js +432 -0
- package/src/assets/js/plugins/flot/jquery.flot.tooltip.min.js +12 -0
- package/src/assets/js/plugins/footable/footable.all.min.js +14 -0
- package/src/assets/js/plugins/fullcalendar/fullcalendar.min.js +8 -0
- package/src/assets/js/plugins/fullcalendar/moment.min.js +7 -0
- package/src/assets/js/plugins/gritter/images/gritter-light.png +0 -0
- package/src/assets/js/plugins/gritter/images/gritter-long.png +0 -0
- package/src/assets/js/plugins/gritter/images/gritter.png +0 -0
- package/src/assets/js/plugins/gritter/images/ie-spacer.gif +0 -0
- package/src/assets/js/plugins/gritter/jquery.gritter.css +137 -0
- package/src/assets/js/plugins/gritter/jquery.gritter.min.js +1 -0
- package/src/assets/js/plugins/i18next/i18next.min.js +7 -0
- package/src/assets/js/plugins/iCheck/icheck.min.js +11 -0
- package/src/assets/js/plugins/idle-timer/idle-timer.min.js +2 -0
- package/src/assets/js/plugins/ionRangeSlider/ion.rangeSlider.min.js +26 -0
- package/src/assets/js/plugins/jasny/jasny-bootstrap.min.js +6 -0
- package/src/assets/js/plugins/jeditable/jquery.jeditable.js +543 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-ar.js +128 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-bg.js +134 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-bg1251.js +132 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-cat.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-cn.js +169 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-cs.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-da.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-de.js +173 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-dk.js +129 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-el.js +128 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-en.js +170 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-es.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-fa.js +147 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-fi.js +131 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-fr.js +128 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-gl.js +128 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-he.js +129 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-hr.js +164 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-hr1250.js +164 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-hu.js +131 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-id.js +170 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-is.js +128 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-it.js +1 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-ja.js +158 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-kr.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-lt.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-mne.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-nl.js +150 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-no.js +1 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-pl.js +134 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-pt-br.js +137 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-pt.js +127 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-ro.js +141 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-ru.js +129 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-sk.js +129 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-sr-latin.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-sr.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-sv.js +129 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-th.js +130 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-tr.js +128 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-tw.js +131 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-ua.js +129 -0
- package/src/assets/js/plugins/jqGrid/i18n/grid.locale-vi.js +170 -0
- package/src/assets/js/plugins/jqGrid/jquery.jqGrid.min.js +545 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery-ui-i18n.min.js +6 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-af.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ar-DZ.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ar.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-az.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-be.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-bg.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-bs.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ca.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-cs.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-cy-GB.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-da.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-de.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-el.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-en-AU.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-en-GB.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-en-NZ.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-eo.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-es.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-et.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-eu.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-fa.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-fi.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-fo.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-fr-CA.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-fr-CH.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-fr.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-gl.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-he.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-hi.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-hr.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-hu.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-hy.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-id.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-is.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-it.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ja.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ka.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-kk.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-km.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ko.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ky.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-lb.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-lt.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-lv.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-mk.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ml.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ms.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-nb.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-nl-BE.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-nl.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-nn.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-no.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-pl.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-pt-BR.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-pt.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-rm.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ro.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ru.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-sk.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-sl.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-sq.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-sr-SR.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-sr.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-sv.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-ta.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-th.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-tj.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-tr.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-uk.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-vi.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-zh-CN.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-zh-HK.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/i18n/jquery.ui.datepicker-zh-TW.min.js +4 -0
- package/src/assets/js/plugins/jquery-ui/images/animated-overlay.gif +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-icons_2e83ff_256x240.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-icons_888888_256x240.png +0 -0
- package/src/assets/js/plugins/jquery-ui/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/src/assets/js/plugins/jquery-ui/jquery-ui.css +1189 -0
- package/src/assets/js/plugins/jquery-ui/jquery-ui.js +15040 -0
- package/src/assets/js/plugins/jquery-ui/jquery-ui.min.css +4 -0
- package/src/assets/js/plugins/jquery-ui/jquery-ui.min.js +12 -0
- package/src/assets/js/plugins/jsKnob/jquery.knob.js +791 -0
- package/src/assets/js/plugins/jsTree/jstree.min.js +5 -0
- package/src/assets/js/plugins/justified-gallery/README.md +14 -0
- package/src/assets/js/plugins/justified-gallery/jquery.justifiedgallery.css +73 -0
- package/src/assets/js/plugins/justified-gallery/jquery.justifiedgallery.js +258 -0
- package/src/assets/js/plugins/justified-gallery/jquery.justifiedgallery.min.css +17 -0
- package/src/assets/js/plugins/justified-gallery/jquery.justifiedgallery.min.js +24 -0
- package/src/assets/js/plugins/justified-gallery/loading.gif +0 -0
- package/src/assets/js/plugins/jvectormap/jquery-jvectormap-2.0.2.css +130 -0
- package/src/assets/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js +3328 -0
- package/src/assets/js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js +1 -0
- package/src/assets/js/plugins/ladda/ladda.jquery.min.js +8 -0
- package/src/assets/js/plugins/ladda/ladda.min.js +8 -0
- package/src/assets/js/plugins/ladda/spin.min.js +1 -0
- package/src/assets/js/plugins/masonary/masonry.pkgd.min.js +9 -0
- package/src/assets/js/plugins/metisMenu/jquery.metisMenu.js +10 -0
- package/src/assets/js/plugins/morris/morris.js +1892 -0
- package/src/assets/js/plugins/morris/raphael-2.1.0.min.js +10 -0
- package/src/assets/js/plugins/nestable/jquery.nestable.js +484 -0
- package/src/assets/js/plugins/nouslider/jquery.nouislider.min.js +34 -0
- package/src/assets/js/plugins/pace/pace.min.js +2 -0
- package/src/assets/js/plugins/peity/jquery.peity.min.js +13 -0
- package/src/assets/js/plugins/preetyTextDiff/jquery.pretty-text-diff.min.js +76 -0
- package/src/assets/js/plugins/rickshaw/rickshaw.min.js +3 -0
- package/src/assets/js/plugins/rickshaw/vendor/d3.v3.js +5 -0
- package/src/assets/js/plugins/select2/select2.full.min.js +3 -0
- package/src/assets/js/plugins/slick/slick.min.js +18 -0
- package/src/assets/js/plugins/slimscroll/jquery.slimscroll.js +474 -0
- package/src/assets/js/plugins/slimscroll/jquery.slimscroll.min.js +16 -0
- package/src/assets/js/plugins/sparkline/jquery.sparkline.min.js +5 -0
- package/src/assets/js/plugins/staps/jquery.steps.min.js +6 -0
- package/src/assets/js/plugins/summernote/summernote.min.js +2 -0
- package/src/assets/js/plugins/sweetalert/sweetalert.min.js +1 -0
- package/src/assets/js/plugins/switchery/switchery.js +1 -0
- package/src/assets/js/plugins/tinycon/tinycon.min.js +8 -0
- package/src/assets/js/plugins/toastr/toastr.min.js +2 -0
- package/src/assets/js/plugins/touchspin/jquery.bootstrap-touchspin.min.js +9 -0
- package/src/assets/js/plugins/validate/jquery.validate.min.js +4 -0
- package/src/assets/js/plugins/video/responsible-video.js +21 -0
- package/src/assets/js/plugins/wow/wow.min.js +2 -0
- package/src/environment.ts +24 -0
- package/src/index.html +23 -0
- package/src/main.ts +10 -0
- package/src/polyfills.ts +3 -0
- package/src/tsconfig.json +21 -0
- package/src/vendor.ts +32 -0
- package/tslint.json +93 -0
- package/types.d.ts +0 -0
- package/web.config +34 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,1386 @@
|
|
|
1
|
+
/* ===================================================
|
|
2
|
+
* bootstrap-markdown.js v2.9.0
|
|
3
|
+
* http://github.com/toopay/bootstrap-markdown
|
|
4
|
+
* ===================================================
|
|
5
|
+
* Copyright 2013-2015 Taufan Aditya
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
* ========================================================== */
|
|
19
|
+
|
|
20
|
+
(function(factory){
|
|
21
|
+
if (typeof define === "function" && define.amd) {
|
|
22
|
+
//RequireJS
|
|
23
|
+
define(["jquery"], factory);
|
|
24
|
+
} else if (typeof exports === 'object') {
|
|
25
|
+
//Backbone.js
|
|
26
|
+
factory(require('jquery'));
|
|
27
|
+
} else {
|
|
28
|
+
//Jquery plugin
|
|
29
|
+
factory(jQuery);
|
|
30
|
+
}
|
|
31
|
+
}(function($){
|
|
32
|
+
"use strict"; // jshint ;_;
|
|
33
|
+
|
|
34
|
+
/* MARKDOWN CLASS DEFINITION
|
|
35
|
+
* ========================== */
|
|
36
|
+
|
|
37
|
+
var Markdown = function (element, options) {
|
|
38
|
+
// @TODO : remove this BC on next major release
|
|
39
|
+
// @see : https://github.com/toopay/bootstrap-markdown/issues/109
|
|
40
|
+
var opts = ['autofocus', 'savable', 'hideable', 'width',
|
|
41
|
+
'height', 'resize', 'iconlibrary', 'language',
|
|
42
|
+
'footer', 'fullscreen', 'hiddenButtons', 'disabledButtons'];
|
|
43
|
+
$.each(opts,function(_, opt){
|
|
44
|
+
if (typeof $(element).data(opt) !== 'undefined') {
|
|
45
|
+
options = typeof options == 'object' ? options : {}
|
|
46
|
+
options[opt] = $(element).data(opt)
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
// End BC
|
|
50
|
+
|
|
51
|
+
// Class Properties
|
|
52
|
+
this.$ns = 'bootstrap-markdown';
|
|
53
|
+
this.$element = $(element);
|
|
54
|
+
this.$editable = {el:null, type:null,attrKeys:[], attrValues:[], content:null};
|
|
55
|
+
this.$options = $.extend(true, {}, $.fn.markdown.defaults, options, this.$element.data('options'));
|
|
56
|
+
this.$oldContent = null;
|
|
57
|
+
this.$isPreview = false;
|
|
58
|
+
this.$isFullscreen = false;
|
|
59
|
+
this.$editor = null;
|
|
60
|
+
this.$textarea = null;
|
|
61
|
+
this.$handler = [];
|
|
62
|
+
this.$callback = [];
|
|
63
|
+
this.$nextTab = [];
|
|
64
|
+
|
|
65
|
+
this.showEditor();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
Markdown.prototype = {
|
|
69
|
+
|
|
70
|
+
constructor: Markdown
|
|
71
|
+
|
|
72
|
+
, __alterButtons: function(name,alter) {
|
|
73
|
+
var handler = this.$handler, isAll = (name == 'all'),that = this;
|
|
74
|
+
|
|
75
|
+
$.each(handler,function(k,v) {
|
|
76
|
+
var halt = true;
|
|
77
|
+
if (isAll) {
|
|
78
|
+
halt = false;
|
|
79
|
+
} else {
|
|
80
|
+
halt = v.indexOf(name) < 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (halt === false) {
|
|
84
|
+
alter(that.$editor.find('button[data-handler="'+v+'"]'));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
, __buildButtons: function(buttonsArray, container) {
|
|
90
|
+
var i,
|
|
91
|
+
ns = this.$ns,
|
|
92
|
+
handler = this.$handler,
|
|
93
|
+
callback = this.$callback;
|
|
94
|
+
|
|
95
|
+
for (i=0;i<buttonsArray.length;i++) {
|
|
96
|
+
// Build each group container
|
|
97
|
+
var y, btnGroups = buttonsArray[i];
|
|
98
|
+
for (y=0;y<btnGroups.length;y++) {
|
|
99
|
+
// Build each button group
|
|
100
|
+
var z,
|
|
101
|
+
buttons = btnGroups[y].data,
|
|
102
|
+
btnGroupContainer = $('<div/>', {
|
|
103
|
+
'class': 'btn-group'
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
for (z=0;z<buttons.length;z++) {
|
|
107
|
+
var button = buttons[z],
|
|
108
|
+
buttonContainer, buttonIconContainer,
|
|
109
|
+
buttonHandler = ns+'-'+button.name,
|
|
110
|
+
buttonIcon = this.__getIcon(button.icon),
|
|
111
|
+
btnText = button.btnText ? button.btnText : '',
|
|
112
|
+
btnClass = button.btnClass ? button.btnClass : 'btn',
|
|
113
|
+
tabIndex = button.tabIndex ? button.tabIndex : '-1',
|
|
114
|
+
hotkey = typeof button.hotkey !== 'undefined' ? button.hotkey : '',
|
|
115
|
+
hotkeyCaption = typeof jQuery.hotkeys !== 'undefined' && hotkey !== '' ? ' ('+hotkey+')' : '';
|
|
116
|
+
|
|
117
|
+
// Construct the button object
|
|
118
|
+
buttonContainer = $('<button></button>');
|
|
119
|
+
buttonContainer.text(' ' + this.__localize(btnText)).addClass('btn-default btn-sm').addClass(btnClass);
|
|
120
|
+
if(btnClass.match(/btn\-(primary|success|info|warning|danger|link)/)){
|
|
121
|
+
buttonContainer.removeClass('btn-default');
|
|
122
|
+
}
|
|
123
|
+
buttonContainer.attr({
|
|
124
|
+
'type': 'button',
|
|
125
|
+
'title': this.__localize(button.title) + hotkeyCaption,
|
|
126
|
+
'tabindex': tabIndex,
|
|
127
|
+
'data-provider': ns,
|
|
128
|
+
'data-handler': buttonHandler,
|
|
129
|
+
'data-hotkey': hotkey
|
|
130
|
+
});
|
|
131
|
+
if (button.toggle === true){
|
|
132
|
+
buttonContainer.attr('data-toggle', 'button');
|
|
133
|
+
}
|
|
134
|
+
buttonIconContainer = $('<span/>');
|
|
135
|
+
buttonIconContainer.addClass(buttonIcon);
|
|
136
|
+
buttonIconContainer.prependTo(buttonContainer);
|
|
137
|
+
|
|
138
|
+
// Attach the button object
|
|
139
|
+
btnGroupContainer.append(buttonContainer);
|
|
140
|
+
|
|
141
|
+
// Register handler and callback
|
|
142
|
+
handler.push(buttonHandler);
|
|
143
|
+
callback.push(button.callback);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Attach the button group into container dom
|
|
147
|
+
container.append(btnGroupContainer);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return container;
|
|
152
|
+
}
|
|
153
|
+
, __setListener: function() {
|
|
154
|
+
// Set size and resizable Properties
|
|
155
|
+
var hasRows = typeof this.$textarea.attr('rows') !== 'undefined',
|
|
156
|
+
maxRows = this.$textarea.val().split("\n").length > 5 ? this.$textarea.val().split("\n").length : '5',
|
|
157
|
+
rowsVal = hasRows ? this.$textarea.attr('rows') : maxRows;
|
|
158
|
+
|
|
159
|
+
this.$textarea.attr('rows',rowsVal);
|
|
160
|
+
if (this.$options.resize) {
|
|
161
|
+
this.$textarea.css('resize',this.$options.resize);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
this.$textarea
|
|
165
|
+
.on('focus', $.proxy(this.focus, this))
|
|
166
|
+
.on('keypress', $.proxy(this.keypress, this))
|
|
167
|
+
.on('keyup', $.proxy(this.keyup, this))
|
|
168
|
+
.on('change', $.proxy(this.change, this))
|
|
169
|
+
.on('select', $.proxy(this.select, this));
|
|
170
|
+
|
|
171
|
+
if (this.eventSupported('keydown')) {
|
|
172
|
+
this.$textarea.on('keydown', $.proxy(this.keydown, this));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Re-attach markdown data
|
|
176
|
+
this.$textarea.data('markdown',this);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
, __handle: function(e) {
|
|
180
|
+
var target = $(e.currentTarget),
|
|
181
|
+
handler = this.$handler,
|
|
182
|
+
callback = this.$callback,
|
|
183
|
+
handlerName = target.attr('data-handler'),
|
|
184
|
+
callbackIndex = handler.indexOf(handlerName),
|
|
185
|
+
callbackHandler = callback[callbackIndex];
|
|
186
|
+
|
|
187
|
+
// Trigger the focusin
|
|
188
|
+
$(e.currentTarget).focus();
|
|
189
|
+
|
|
190
|
+
callbackHandler(this);
|
|
191
|
+
|
|
192
|
+
// Trigger onChange for each button handle
|
|
193
|
+
this.change(this);
|
|
194
|
+
|
|
195
|
+
// Unless it was the save handler,
|
|
196
|
+
// focusin the textarea
|
|
197
|
+
if (handlerName.indexOf('cmdSave') < 0) {
|
|
198
|
+
this.$textarea.focus();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
, __localize: function(string) {
|
|
205
|
+
var messages = $.fn.markdown.messages,
|
|
206
|
+
language = this.$options.language;
|
|
207
|
+
if (
|
|
208
|
+
typeof messages !== 'undefined' &&
|
|
209
|
+
typeof messages[language] !== 'undefined' &&
|
|
210
|
+
typeof messages[language][string] !== 'undefined'
|
|
211
|
+
) {
|
|
212
|
+
return messages[language][string];
|
|
213
|
+
}
|
|
214
|
+
return string;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
, __getIcon: function(src) {
|
|
218
|
+
return typeof src == 'object' ? src[this.$options.iconlibrary] : src;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
, setFullscreen: function(mode) {
|
|
222
|
+
var $editor = this.$editor,
|
|
223
|
+
$textarea = this.$textarea;
|
|
224
|
+
|
|
225
|
+
if (mode === true) {
|
|
226
|
+
$editor.addClass('md-fullscreen-mode');
|
|
227
|
+
$('body').addClass('md-nooverflow');
|
|
228
|
+
this.$options.onFullscreen(this);
|
|
229
|
+
} else {
|
|
230
|
+
$editor.removeClass('md-fullscreen-mode');
|
|
231
|
+
$('body').removeClass('md-nooverflow');
|
|
232
|
+
|
|
233
|
+
if (this.$isPreview == true) this.hidePreview().showPreview()
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
this.$isFullscreen = mode;
|
|
237
|
+
$textarea.focus();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
, showEditor: function() {
|
|
241
|
+
var instance = this,
|
|
242
|
+
textarea,
|
|
243
|
+
ns = this.$ns,
|
|
244
|
+
container = this.$element,
|
|
245
|
+
originalHeigth = container.css('height'),
|
|
246
|
+
originalWidth = container.css('width'),
|
|
247
|
+
editable = this.$editable,
|
|
248
|
+
handler = this.$handler,
|
|
249
|
+
callback = this.$callback,
|
|
250
|
+
options = this.$options,
|
|
251
|
+
editor = $( '<div/>', {
|
|
252
|
+
'class': 'md-editor',
|
|
253
|
+
click: function() {
|
|
254
|
+
instance.focus();
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// Prepare the editor
|
|
259
|
+
if (this.$editor === null) {
|
|
260
|
+
// Create the panel
|
|
261
|
+
var editorHeader = $('<div/>', {
|
|
262
|
+
'class': 'md-header btn-toolbar'
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// Merge the main & additional button groups together
|
|
266
|
+
var allBtnGroups = [];
|
|
267
|
+
if (options.buttons.length > 0) allBtnGroups = allBtnGroups.concat(options.buttons[0]);
|
|
268
|
+
if (options.additionalButtons.length > 0) {
|
|
269
|
+
// iterate the additional button groups
|
|
270
|
+
$.each(options.additionalButtons[0], function(idx, buttonGroup){
|
|
271
|
+
|
|
272
|
+
// see if the group name of the addional group matches an existing group
|
|
273
|
+
var matchingGroups = $.grep(allBtnGroups, function(allButtonGroup, allIdx){
|
|
274
|
+
return allButtonGroup.name === buttonGroup.name;
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
// if it matches add the addional buttons to that group, if not just add it to the all buttons group
|
|
278
|
+
if(matchingGroups.length > 0) {
|
|
279
|
+
matchingGroups[0].data = matchingGroups[0].data.concat(buttonGroup.data);
|
|
280
|
+
} else {
|
|
281
|
+
allBtnGroups.push(options.additionalButtons[0][idx]);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Reduce and/or reorder the button groups
|
|
288
|
+
if (options.reorderButtonGroups.length > 0) {
|
|
289
|
+
allBtnGroups = allBtnGroups
|
|
290
|
+
.filter(function(btnGroup) {
|
|
291
|
+
return options.reorderButtonGroups.indexOf(btnGroup.name) > -1;
|
|
292
|
+
})
|
|
293
|
+
.sort(function(a, b) {
|
|
294
|
+
if (options.reorderButtonGroups.indexOf(a.name) < options.reorderButtonGroups.indexOf(b.name)) return -1;
|
|
295
|
+
if (options.reorderButtonGroups.indexOf(a.name) > options.reorderButtonGroups.indexOf(b.name)) return 1;
|
|
296
|
+
return 0;
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Build the buttons
|
|
301
|
+
if (allBtnGroups.length > 0) {
|
|
302
|
+
editorHeader = this.__buildButtons([allBtnGroups], editorHeader);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (options.fullscreen.enable) {
|
|
306
|
+
editorHeader.append('<div class="md-controls"><a class="md-control md-control-fullscreen" href="#"><span class="'+this.__getIcon(options.fullscreen.icons.fullscreenOn)+'"></span></a></div>').on('click', '.md-control-fullscreen', function(e) {
|
|
307
|
+
e.preventDefault();
|
|
308
|
+
instance.setFullscreen(true);
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
editor.append(editorHeader);
|
|
313
|
+
|
|
314
|
+
// Wrap the textarea
|
|
315
|
+
if (container.is('textarea')) {
|
|
316
|
+
container.before(editor);
|
|
317
|
+
textarea = container;
|
|
318
|
+
textarea.addClass('md-input');
|
|
319
|
+
editor.append(textarea);
|
|
320
|
+
} else {
|
|
321
|
+
var rawContent = (typeof toMarkdown == 'function') ? toMarkdown(container.html()) : container.html(),
|
|
322
|
+
currentContent = $.trim(rawContent);
|
|
323
|
+
|
|
324
|
+
// This is some arbitrary content that could be edited
|
|
325
|
+
textarea = $('<textarea/>', {
|
|
326
|
+
'class': 'md-input',
|
|
327
|
+
'val' : currentContent
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
editor.append(textarea);
|
|
331
|
+
|
|
332
|
+
// Save the editable
|
|
333
|
+
editable.el = container;
|
|
334
|
+
editable.type = container.prop('tagName').toLowerCase();
|
|
335
|
+
editable.content = container.html();
|
|
336
|
+
|
|
337
|
+
$(container[0].attributes).each(function(){
|
|
338
|
+
editable.attrKeys.push(this.nodeName);
|
|
339
|
+
editable.attrValues.push(this.nodeValue);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
// Set editor to blocked the original container
|
|
343
|
+
container.replaceWith(editor);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
var editorFooter = $('<div/>', {
|
|
347
|
+
'class': 'md-footer'
|
|
348
|
+
}),
|
|
349
|
+
createFooter = false,
|
|
350
|
+
footer = '';
|
|
351
|
+
// Create the footer if savable
|
|
352
|
+
if (options.savable) {
|
|
353
|
+
createFooter = true;
|
|
354
|
+
var saveHandler = 'cmdSave';
|
|
355
|
+
|
|
356
|
+
// Register handler and callback
|
|
357
|
+
handler.push(saveHandler);
|
|
358
|
+
callback.push(options.onSave);
|
|
359
|
+
|
|
360
|
+
editorFooter.append('<button class="btn btn-success" data-provider="'
|
|
361
|
+
+ ns
|
|
362
|
+
+ '" data-handler="'
|
|
363
|
+
+ saveHandler
|
|
364
|
+
+ '"><i class="icon icon-white icon-ok"></i> '
|
|
365
|
+
+ this.__localize('Save')
|
|
366
|
+
+ '</button>');
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
footer = typeof options.footer === 'function' ? options.footer(this) : options.footer;
|
|
372
|
+
|
|
373
|
+
if ($.trim(footer) !== '') {
|
|
374
|
+
createFooter = true;
|
|
375
|
+
editorFooter.append(footer);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (createFooter) editor.append(editorFooter);
|
|
379
|
+
|
|
380
|
+
// Set width
|
|
381
|
+
if (options.width && options.width !== 'inherit') {
|
|
382
|
+
if (jQuery.isNumeric(options.width)) {
|
|
383
|
+
editor.css('display', 'table');
|
|
384
|
+
textarea.css('width', options.width + 'px');
|
|
385
|
+
} else {
|
|
386
|
+
editor.addClass(options.width);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Set height
|
|
391
|
+
if (options.height && options.height !== 'inherit') {
|
|
392
|
+
if (jQuery.isNumeric(options.height)) {
|
|
393
|
+
var height = options.height;
|
|
394
|
+
if (editorHeader) height = Math.max(0, height - editorHeader.outerHeight());
|
|
395
|
+
if (editorFooter) height = Math.max(0, height - editorFooter.outerHeight());
|
|
396
|
+
textarea.css('height', height + 'px');
|
|
397
|
+
} else {
|
|
398
|
+
editor.addClass(options.height);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Reference
|
|
403
|
+
this.$editor = editor;
|
|
404
|
+
this.$textarea = textarea;
|
|
405
|
+
this.$editable = editable;
|
|
406
|
+
this.$oldContent = this.getContent();
|
|
407
|
+
|
|
408
|
+
this.__setListener();
|
|
409
|
+
|
|
410
|
+
// Set editor attributes, data short-hand API and listener
|
|
411
|
+
this.$editor.attr('id',(new Date()).getTime());
|
|
412
|
+
this.$editor.on('click', '[data-provider="bootstrap-markdown"]', $.proxy(this.__handle, this));
|
|
413
|
+
|
|
414
|
+
if (this.$element.is(':disabled') || this.$element.is('[readonly]')) {
|
|
415
|
+
this.$editor.addClass('md-editor-disabled');
|
|
416
|
+
this.disableButtons('all');
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
if (this.eventSupported('keydown') && typeof jQuery.hotkeys === 'object') {
|
|
420
|
+
editorHeader.find('[data-provider="bootstrap-markdown"]').each(function() {
|
|
421
|
+
var $button = $(this),
|
|
422
|
+
hotkey = $button.attr('data-hotkey');
|
|
423
|
+
if (hotkey.toLowerCase() !== '') {
|
|
424
|
+
textarea.bind('keydown', hotkey, function() {
|
|
425
|
+
$button.trigger('click');
|
|
426
|
+
return false;
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
if (options.initialstate === 'preview') {
|
|
433
|
+
this.showPreview();
|
|
434
|
+
} else if (options.initialstate === 'fullscreen' && options.fullscreen.enable) {
|
|
435
|
+
this.setFullscreen(true);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
} else {
|
|
439
|
+
this.$editor.show();
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
if (options.autofocus) {
|
|
443
|
+
this.$textarea.focus();
|
|
444
|
+
this.$editor.addClass('active');
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (options.fullscreen.enable && options.fullscreen !== false) {
|
|
448
|
+
this.$editor.append('<div class="md-fullscreen-controls">'
|
|
449
|
+
+ '<a href="#" class="exit-fullscreen" title="Exit fullscreen"><span class="' + this.__getIcon(options.fullscreen.icons.fullscreenOff) + '">'
|
|
450
|
+
+ '</span></a>'
|
|
451
|
+
+ '</div>');
|
|
452
|
+
this.$editor.on('click', '.exit-fullscreen', function(e) {
|
|
453
|
+
e.preventDefault();
|
|
454
|
+
instance.setFullscreen(false);
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// hide hidden buttons from options
|
|
459
|
+
this.hideButtons(options.hiddenButtons);
|
|
460
|
+
|
|
461
|
+
// disable disabled buttons from options
|
|
462
|
+
this.disableButtons(options.disabledButtons);
|
|
463
|
+
|
|
464
|
+
// Trigger the onShow hook
|
|
465
|
+
options.onShow(this);
|
|
466
|
+
|
|
467
|
+
return this;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
, parseContent: function(val) {
|
|
471
|
+
var content;
|
|
472
|
+
|
|
473
|
+
// parse with supported markdown parser
|
|
474
|
+
var val = val || this.$textarea.val();
|
|
475
|
+
|
|
476
|
+
if (this.$options.parser) {
|
|
477
|
+
content = this.$options.parser(val);
|
|
478
|
+
} else if (typeof markdown == 'object') {
|
|
479
|
+
content = markdown.toHTML(val);
|
|
480
|
+
} else if (typeof marked == 'function') {
|
|
481
|
+
content = marked(val);
|
|
482
|
+
} else {
|
|
483
|
+
content = val;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return content;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
, showPreview: function() {
|
|
490
|
+
var options = this.$options,
|
|
491
|
+
container = this.$textarea,
|
|
492
|
+
afterContainer = container.next(),
|
|
493
|
+
replacementContainer = $('<div/>',{'class':'md-preview','data-provider':'markdown-preview'}),
|
|
494
|
+
content,
|
|
495
|
+
callbackContent;
|
|
496
|
+
|
|
497
|
+
if (this.$isPreview == true) {
|
|
498
|
+
// Avoid sequenced element creation on missused scenario
|
|
499
|
+
// @see https://github.com/toopay/bootstrap-markdown/issues/170
|
|
500
|
+
return this;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// Give flag that tell the editor enter preview mode
|
|
504
|
+
this.$isPreview = true;
|
|
505
|
+
// Disable all buttons
|
|
506
|
+
this.disableButtons('all').enableButtons('cmdPreview');
|
|
507
|
+
|
|
508
|
+
// Try to get the content from callback
|
|
509
|
+
callbackContent = options.onPreview(this);
|
|
510
|
+
// Set the content based from the callback content if string otherwise parse value from textarea
|
|
511
|
+
content = typeof callbackContent == 'string' ? callbackContent : this.parseContent();
|
|
512
|
+
|
|
513
|
+
// Build preview element
|
|
514
|
+
replacementContainer.html(content);
|
|
515
|
+
|
|
516
|
+
if (afterContainer && afterContainer.attr('class') == 'md-footer') {
|
|
517
|
+
// If there is footer element, insert the preview container before it
|
|
518
|
+
replacementContainer.insertBefore(afterContainer);
|
|
519
|
+
} else {
|
|
520
|
+
// Otherwise, just append it after textarea
|
|
521
|
+
container.parent().append(replacementContainer);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// Set the preview element dimensions
|
|
525
|
+
replacementContainer.css({
|
|
526
|
+
width: container.outerWidth() + 'px',
|
|
527
|
+
height: container.outerHeight() + 'px'
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
if (this.$options.resize) {
|
|
531
|
+
replacementContainer.css('resize',this.$options.resize);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// Hide the last-active textarea
|
|
535
|
+
container.hide();
|
|
536
|
+
|
|
537
|
+
// Attach the editor instances
|
|
538
|
+
replacementContainer.data('markdown',this);
|
|
539
|
+
|
|
540
|
+
if (this.$element.is(':disabled') || this.$element.is('[readonly]')) {
|
|
541
|
+
this.$editor.addClass('md-editor-disabled');
|
|
542
|
+
this.disableButtons('all');
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return this;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
, hidePreview: function() {
|
|
549
|
+
// Give flag that tell the editor quit preview mode
|
|
550
|
+
this.$isPreview = false;
|
|
551
|
+
|
|
552
|
+
// Obtain the preview container
|
|
553
|
+
var container = this.$editor.find('div[data-provider="markdown-preview"]');
|
|
554
|
+
|
|
555
|
+
// Remove the preview container
|
|
556
|
+
container.remove();
|
|
557
|
+
|
|
558
|
+
// Enable all buttons
|
|
559
|
+
this.enableButtons('all');
|
|
560
|
+
// Disable configured disabled buttons
|
|
561
|
+
this.disableButtons(this.$options.disabledButtons);
|
|
562
|
+
|
|
563
|
+
// Back to the editor
|
|
564
|
+
this.$textarea.show();
|
|
565
|
+
this.__setListener();
|
|
566
|
+
|
|
567
|
+
return this;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
, isDirty: function() {
|
|
571
|
+
return this.$oldContent != this.getContent();
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
, getContent: function() {
|
|
575
|
+
return this.$textarea.val();
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
, setContent: function(content) {
|
|
579
|
+
this.$textarea.val(content);
|
|
580
|
+
|
|
581
|
+
return this;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
, findSelection: function(chunk) {
|
|
585
|
+
var content = this.getContent(), startChunkPosition;
|
|
586
|
+
|
|
587
|
+
if (startChunkPosition = content.indexOf(chunk), startChunkPosition >= 0 && chunk.length > 0) {
|
|
588
|
+
var oldSelection = this.getSelection(), selection;
|
|
589
|
+
|
|
590
|
+
this.setSelection(startChunkPosition,startChunkPosition+chunk.length);
|
|
591
|
+
selection = this.getSelection();
|
|
592
|
+
|
|
593
|
+
this.setSelection(oldSelection.start,oldSelection.end);
|
|
594
|
+
|
|
595
|
+
return selection;
|
|
596
|
+
} else {
|
|
597
|
+
return null;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
, getSelection: function() {
|
|
602
|
+
|
|
603
|
+
var e = this.$textarea[0];
|
|
604
|
+
|
|
605
|
+
return (
|
|
606
|
+
|
|
607
|
+
('selectionStart' in e && function() {
|
|
608
|
+
var l = e.selectionEnd - e.selectionStart;
|
|
609
|
+
return { start: e.selectionStart, end: e.selectionEnd, length: l, text: e.value.substr(e.selectionStart, l) };
|
|
610
|
+
}) ||
|
|
611
|
+
|
|
612
|
+
/* browser not supported */
|
|
613
|
+
function() {
|
|
614
|
+
return null;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
)();
|
|
618
|
+
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
, setSelection: function(start,end) {
|
|
622
|
+
|
|
623
|
+
var e = this.$textarea[0];
|
|
624
|
+
|
|
625
|
+
return (
|
|
626
|
+
|
|
627
|
+
('selectionStart' in e && function() {
|
|
628
|
+
e.selectionStart = start;
|
|
629
|
+
e.selectionEnd = end;
|
|
630
|
+
return;
|
|
631
|
+
}) ||
|
|
632
|
+
|
|
633
|
+
/* browser not supported */
|
|
634
|
+
function() {
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
)();
|
|
639
|
+
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
, replaceSelection: function(text) {
|
|
643
|
+
|
|
644
|
+
var e = this.$textarea[0];
|
|
645
|
+
|
|
646
|
+
return (
|
|
647
|
+
|
|
648
|
+
('selectionStart' in e && function() {
|
|
649
|
+
e.value = e.value.substr(0, e.selectionStart) + text + e.value.substr(e.selectionEnd, e.value.length);
|
|
650
|
+
// Set cursor to the last replacement end
|
|
651
|
+
e.selectionStart = e.value.length;
|
|
652
|
+
return this;
|
|
653
|
+
}) ||
|
|
654
|
+
|
|
655
|
+
/* browser not supported */
|
|
656
|
+
function() {
|
|
657
|
+
e.value += text;
|
|
658
|
+
return jQuery(e);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
)();
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
, getNextTab: function() {
|
|
665
|
+
// Shift the nextTab
|
|
666
|
+
if (this.$nextTab.length === 0) {
|
|
667
|
+
return null;
|
|
668
|
+
} else {
|
|
669
|
+
var nextTab, tab = this.$nextTab.shift();
|
|
670
|
+
|
|
671
|
+
if (typeof tab == 'function') {
|
|
672
|
+
nextTab = tab();
|
|
673
|
+
} else if (typeof tab == 'object' && tab.length > 0) {
|
|
674
|
+
nextTab = tab;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
return nextTab;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
, setNextTab: function(start,end) {
|
|
682
|
+
// Push new selection into nextTab collections
|
|
683
|
+
if (typeof start == 'string') {
|
|
684
|
+
var that = this;
|
|
685
|
+
this.$nextTab.push(function(){
|
|
686
|
+
return that.findSelection(start);
|
|
687
|
+
});
|
|
688
|
+
} else if (typeof start == 'number' && typeof end == 'number') {
|
|
689
|
+
var oldSelection = this.getSelection();
|
|
690
|
+
|
|
691
|
+
this.setSelection(start,end);
|
|
692
|
+
this.$nextTab.push(this.getSelection());
|
|
693
|
+
|
|
694
|
+
this.setSelection(oldSelection.start,oldSelection.end);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
, __parseButtonNameParam: function (names) {
|
|
701
|
+
return typeof names == 'string' ?
|
|
702
|
+
names.split(' ') :
|
|
703
|
+
names;
|
|
704
|
+
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
, enableButtons: function(name) {
|
|
708
|
+
var buttons = this.__parseButtonNameParam(name),
|
|
709
|
+
that = this;
|
|
710
|
+
|
|
711
|
+
$.each(buttons, function(i, v) {
|
|
712
|
+
that.__alterButtons(buttons[i], function (el) {
|
|
713
|
+
el.removeAttr('disabled');
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
return this;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
, disableButtons: function(name) {
|
|
721
|
+
var buttons = this.__parseButtonNameParam(name),
|
|
722
|
+
that = this;
|
|
723
|
+
|
|
724
|
+
$.each(buttons, function(i, v) {
|
|
725
|
+
that.__alterButtons(buttons[i], function (el) {
|
|
726
|
+
el.attr('disabled','disabled');
|
|
727
|
+
});
|
|
728
|
+
});
|
|
729
|
+
|
|
730
|
+
return this;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
, hideButtons: function(name) {
|
|
734
|
+
var buttons = this.__parseButtonNameParam(name),
|
|
735
|
+
that = this;
|
|
736
|
+
|
|
737
|
+
$.each(buttons, function(i, v) {
|
|
738
|
+
that.__alterButtons(buttons[i], function (el) {
|
|
739
|
+
el.addClass('hidden');
|
|
740
|
+
});
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
return this;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
, showButtons: function(name) {
|
|
747
|
+
var buttons = this.__parseButtonNameParam(name),
|
|
748
|
+
that = this;
|
|
749
|
+
|
|
750
|
+
$.each(buttons, function(i, v) {
|
|
751
|
+
that.__alterButtons(buttons[i], function (el) {
|
|
752
|
+
el.removeClass('hidden');
|
|
753
|
+
});
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
return this;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
, eventSupported: function(eventName) {
|
|
760
|
+
var isSupported = eventName in this.$element;
|
|
761
|
+
if (!isSupported) {
|
|
762
|
+
this.$element.setAttribute(eventName, 'return;');
|
|
763
|
+
isSupported = typeof this.$element[eventName] === 'function';
|
|
764
|
+
}
|
|
765
|
+
return isSupported;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
, keyup: function (e) {
|
|
769
|
+
var blocked = false;
|
|
770
|
+
switch(e.keyCode) {
|
|
771
|
+
case 40: // down arrow
|
|
772
|
+
case 38: // up arrow
|
|
773
|
+
case 16: // shift
|
|
774
|
+
case 17: // ctrl
|
|
775
|
+
case 18: // alt
|
|
776
|
+
break;
|
|
777
|
+
|
|
778
|
+
case 9: // tab
|
|
779
|
+
var nextTab;
|
|
780
|
+
if (nextTab = this.getNextTab(),nextTab !== null) {
|
|
781
|
+
// Get the nextTab if exists
|
|
782
|
+
var that = this;
|
|
783
|
+
setTimeout(function(){
|
|
784
|
+
that.setSelection(nextTab.start,nextTab.end);
|
|
785
|
+
},500);
|
|
786
|
+
|
|
787
|
+
blocked = true;
|
|
788
|
+
} else {
|
|
789
|
+
// The next tab memory contains nothing...
|
|
790
|
+
// check the cursor position to determine tab action
|
|
791
|
+
var cursor = this.getSelection();
|
|
792
|
+
|
|
793
|
+
if (cursor.start == cursor.end && cursor.end == this.getContent().length) {
|
|
794
|
+
// The cursor already reach the end of the content
|
|
795
|
+
blocked = false;
|
|
796
|
+
} else {
|
|
797
|
+
// Put the cursor to the end
|
|
798
|
+
this.setSelection(this.getContent().length,this.getContent().length);
|
|
799
|
+
|
|
800
|
+
blocked = true;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
break;
|
|
805
|
+
|
|
806
|
+
case 13: // enter
|
|
807
|
+
blocked = false;
|
|
808
|
+
break;
|
|
809
|
+
case 27: // escape
|
|
810
|
+
if (this.$isFullscreen) this.setFullscreen(false);
|
|
811
|
+
blocked = false;
|
|
812
|
+
break;
|
|
813
|
+
|
|
814
|
+
default:
|
|
815
|
+
blocked = false;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
if (blocked) {
|
|
819
|
+
e.stopPropagation();
|
|
820
|
+
e.preventDefault();
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
this.$options.onChange(this);
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
, change: function(e) {
|
|
827
|
+
this.$options.onChange(this);
|
|
828
|
+
return this;
|
|
829
|
+
}
|
|
830
|
+
, select: function (e) {
|
|
831
|
+
this.$options.onSelect(this);
|
|
832
|
+
return this;
|
|
833
|
+
}
|
|
834
|
+
, focus: function (e) {
|
|
835
|
+
var options = this.$options,
|
|
836
|
+
isHideable = options.hideable,
|
|
837
|
+
editor = this.$editor;
|
|
838
|
+
|
|
839
|
+
editor.addClass('active');
|
|
840
|
+
|
|
841
|
+
// Blur other markdown(s)
|
|
842
|
+
$(document).find('.md-editor').each(function(){
|
|
843
|
+
if ($(this).attr('id') !== editor.attr('id')) {
|
|
844
|
+
var attachedMarkdown;
|
|
845
|
+
|
|
846
|
+
if (attachedMarkdown = $(this).find('textarea').data('markdown'),
|
|
847
|
+
attachedMarkdown === null) {
|
|
848
|
+
attachedMarkdown = $(this).find('div[data-provider="markdown-preview"]').data('markdown');
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
if (attachedMarkdown) {
|
|
852
|
+
attachedMarkdown.blur();
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
|
|
857
|
+
// Trigger the onFocus hook
|
|
858
|
+
options.onFocus(this);
|
|
859
|
+
|
|
860
|
+
return this;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
, blur: function (e) {
|
|
864
|
+
var options = this.$options,
|
|
865
|
+
isHideable = options.hideable,
|
|
866
|
+
editor = this.$editor,
|
|
867
|
+
editable = this.$editable;
|
|
868
|
+
|
|
869
|
+
if (editor.hasClass('active') || this.$element.parent().length === 0) {
|
|
870
|
+
editor.removeClass('active');
|
|
871
|
+
|
|
872
|
+
if (isHideable) {
|
|
873
|
+
// Check for editable elements
|
|
874
|
+
if (editable.el !== null) {
|
|
875
|
+
// Build the original element
|
|
876
|
+
var oldElement = $('<'+editable.type+'/>'),
|
|
877
|
+
content = this.getContent(),
|
|
878
|
+
currentContent = this.parseContent(content);
|
|
879
|
+
|
|
880
|
+
$(editable.attrKeys).each(function(k,v) {
|
|
881
|
+
oldElement.attr(editable.attrKeys[k],editable.attrValues[k]);
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
// Get the editor content
|
|
885
|
+
oldElement.html(currentContent);
|
|
886
|
+
|
|
887
|
+
editor.replaceWith(oldElement);
|
|
888
|
+
} else {
|
|
889
|
+
editor.hide();
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// Trigger the onBlur hook
|
|
894
|
+
options.onBlur(this);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
return this;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
/* MARKDOWN PLUGIN DEFINITION
|
|
903
|
+
* ========================== */
|
|
904
|
+
|
|
905
|
+
var old = $.fn.markdown;
|
|
906
|
+
|
|
907
|
+
$.fn.markdown = function (option) {
|
|
908
|
+
return this.each(function () {
|
|
909
|
+
var $this = $(this)
|
|
910
|
+
, data = $this.data('markdown')
|
|
911
|
+
, options = typeof option == 'object' && option;
|
|
912
|
+
if (!data) $this.data('markdown', (data = new Markdown(this, options)))
|
|
913
|
+
})
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
$.fn.markdown.messages = {};
|
|
917
|
+
|
|
918
|
+
$.fn.markdown.defaults = {
|
|
919
|
+
/* Editor Properties */
|
|
920
|
+
autofocus: false,
|
|
921
|
+
hideable: false,
|
|
922
|
+
savable: false,
|
|
923
|
+
width: 'inherit',
|
|
924
|
+
height: 'inherit',
|
|
925
|
+
resize: 'none',
|
|
926
|
+
iconlibrary: 'glyph',
|
|
927
|
+
language: 'en',
|
|
928
|
+
initialstate: 'editor',
|
|
929
|
+
parser: null,
|
|
930
|
+
|
|
931
|
+
/* Buttons Properties */
|
|
932
|
+
buttons: [
|
|
933
|
+
[{
|
|
934
|
+
name: 'groupFont',
|
|
935
|
+
data: [{
|
|
936
|
+
name: 'cmdBold',
|
|
937
|
+
hotkey: 'Ctrl+B',
|
|
938
|
+
title: 'Bold',
|
|
939
|
+
icon: { glyph: 'glyphicon glyphicon-bold', fa: 'fa fa-bold', 'fa-3': 'icon-bold' },
|
|
940
|
+
callback: function(e){
|
|
941
|
+
// Give/remove ** surround the selection
|
|
942
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent();
|
|
943
|
+
|
|
944
|
+
if (selected.length === 0) {
|
|
945
|
+
// Give extra word
|
|
946
|
+
chunk = e.__localize('strong text');
|
|
947
|
+
} else {
|
|
948
|
+
chunk = selected.text;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// transform selection and set the cursor into chunked text
|
|
952
|
+
if (content.substr(selected.start-2,2) === '**'
|
|
953
|
+
&& content.substr(selected.end,2) === '**' ) {
|
|
954
|
+
e.setSelection(selected.start-2,selected.end+2);
|
|
955
|
+
e.replaceSelection(chunk);
|
|
956
|
+
cursor = selected.start-2;
|
|
957
|
+
} else {
|
|
958
|
+
e.replaceSelection('**'+chunk+'**');
|
|
959
|
+
cursor = selected.start+2;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
// Set the cursor
|
|
963
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
964
|
+
}
|
|
965
|
+
},{
|
|
966
|
+
name: 'cmdItalic',
|
|
967
|
+
title: 'Italic',
|
|
968
|
+
hotkey: 'Ctrl+I',
|
|
969
|
+
icon: { glyph: 'glyphicon glyphicon-italic', fa: 'fa fa-italic', 'fa-3': 'icon-italic' },
|
|
970
|
+
callback: function(e){
|
|
971
|
+
// Give/remove * surround the selection
|
|
972
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent();
|
|
973
|
+
|
|
974
|
+
if (selected.length === 0) {
|
|
975
|
+
// Give extra word
|
|
976
|
+
chunk = e.__localize('emphasized text');
|
|
977
|
+
} else {
|
|
978
|
+
chunk = selected.text;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
// transform selection and set the cursor into chunked text
|
|
982
|
+
if (content.substr(selected.start-1,1) === '_'
|
|
983
|
+
&& content.substr(selected.end,1) === '_' ) {
|
|
984
|
+
e.setSelection(selected.start-1,selected.end+1);
|
|
985
|
+
e.replaceSelection(chunk);
|
|
986
|
+
cursor = selected.start-1;
|
|
987
|
+
} else {
|
|
988
|
+
e.replaceSelection('_'+chunk+'_');
|
|
989
|
+
cursor = selected.start+1;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// Set the cursor
|
|
993
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
994
|
+
}
|
|
995
|
+
},{
|
|
996
|
+
name: 'cmdHeading',
|
|
997
|
+
title: 'Heading',
|
|
998
|
+
hotkey: 'Ctrl+H',
|
|
999
|
+
icon: { glyph: 'glyphicon glyphicon-header', fa: 'fa fa-header', 'fa-3': 'icon-font' },
|
|
1000
|
+
callback: function(e){
|
|
1001
|
+
// Append/remove ### surround the selection
|
|
1002
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent(), pointer, prevChar;
|
|
1003
|
+
|
|
1004
|
+
if (selected.length === 0) {
|
|
1005
|
+
// Give extra word
|
|
1006
|
+
chunk = e.__localize('heading text');
|
|
1007
|
+
} else {
|
|
1008
|
+
chunk = selected.text + '\n';
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
// transform selection and set the cursor into chunked text
|
|
1012
|
+
if ((pointer = 4, content.substr(selected.start-pointer,pointer) === '### ')
|
|
1013
|
+
|| (pointer = 3, content.substr(selected.start-pointer,pointer) === '###')) {
|
|
1014
|
+
e.setSelection(selected.start-pointer,selected.end);
|
|
1015
|
+
e.replaceSelection(chunk);
|
|
1016
|
+
cursor = selected.start-pointer;
|
|
1017
|
+
} else if (selected.start > 0 && (prevChar = content.substr(selected.start-1,1), !!prevChar && prevChar != '\n')) {
|
|
1018
|
+
e.replaceSelection('\n\n### '+chunk);
|
|
1019
|
+
cursor = selected.start+6;
|
|
1020
|
+
} else {
|
|
1021
|
+
// Empty string before element
|
|
1022
|
+
e.replaceSelection('### '+chunk);
|
|
1023
|
+
cursor = selected.start+4;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
// Set the cursor
|
|
1027
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
1028
|
+
}
|
|
1029
|
+
}]
|
|
1030
|
+
},{
|
|
1031
|
+
name: 'groupLink',
|
|
1032
|
+
data: [{
|
|
1033
|
+
name: 'cmdUrl',
|
|
1034
|
+
title: 'URL/Link',
|
|
1035
|
+
hotkey: 'Ctrl+L',
|
|
1036
|
+
icon: { glyph: 'glyphicon glyphicon-link', fa: 'fa fa-link', 'fa-3': 'icon-link' },
|
|
1037
|
+
callback: function(e){
|
|
1038
|
+
// Give [] surround the selection and prepend the link
|
|
1039
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent(), link;
|
|
1040
|
+
|
|
1041
|
+
if (selected.length === 0) {
|
|
1042
|
+
// Give extra word
|
|
1043
|
+
chunk = e.__localize('enter link description here');
|
|
1044
|
+
} else {
|
|
1045
|
+
chunk = selected.text;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
link = prompt(e.__localize('Insert Hyperlink'),'http://');
|
|
1049
|
+
|
|
1050
|
+
var urlRegex = new RegExp('^((http|https)://|(mailto:)|(//))[a-z0-9]', 'i');
|
|
1051
|
+
if (link !== null && link !== '' && link !== 'http://' && urlRegex.test(link)) {
|
|
1052
|
+
var sanitizedLink = $('<div>'+link+'</div>').text();
|
|
1053
|
+
|
|
1054
|
+
// transform selection and set the cursor into chunked text
|
|
1055
|
+
e.replaceSelection('['+chunk+']('+sanitizedLink+')');
|
|
1056
|
+
cursor = selected.start+1;
|
|
1057
|
+
|
|
1058
|
+
// Set the cursor
|
|
1059
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
},{
|
|
1063
|
+
name: 'cmdImage',
|
|
1064
|
+
title: 'Image',
|
|
1065
|
+
hotkey: 'Ctrl+G',
|
|
1066
|
+
icon: { glyph: 'glyphicon glyphicon-picture', fa: 'fa fa-picture-o', 'fa-3': 'icon-picture' },
|
|
1067
|
+
callback: function(e){
|
|
1068
|
+
// Give ![] surround the selection and prepend the image link
|
|
1069
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent(), link;
|
|
1070
|
+
|
|
1071
|
+
if (selected.length === 0) {
|
|
1072
|
+
// Give extra word
|
|
1073
|
+
chunk = e.__localize('enter image description here');
|
|
1074
|
+
} else {
|
|
1075
|
+
chunk = selected.text;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
link = prompt(e.__localize('Insert Image Hyperlink'),'http://');
|
|
1079
|
+
|
|
1080
|
+
var urlRegex = new RegExp('^((http|https)://|(//))[a-z0-9]', 'i');
|
|
1081
|
+
if (link !== null && link !== '' && link !== 'http://' && urlRegex.test(link)) {
|
|
1082
|
+
var sanitizedLink = $('<div>'+link+'</div>').text();
|
|
1083
|
+
|
|
1084
|
+
// transform selection and set the cursor into chunked text
|
|
1085
|
+
e.replaceSelection('+'")');
|
|
1086
|
+
cursor = selected.start+2;
|
|
1087
|
+
|
|
1088
|
+
// Set the next tab
|
|
1089
|
+
e.setNextTab(e.__localize('enter image title here'));
|
|
1090
|
+
|
|
1091
|
+
// Set the cursor
|
|
1092
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
}]
|
|
1096
|
+
},{
|
|
1097
|
+
name: 'groupMisc',
|
|
1098
|
+
data: [{
|
|
1099
|
+
name: 'cmdList',
|
|
1100
|
+
hotkey: 'Ctrl+U',
|
|
1101
|
+
title: 'Unordered List',
|
|
1102
|
+
icon: { glyph: 'glyphicon glyphicon-list', fa: 'fa fa-list', 'fa-3': 'icon-list-ul' },
|
|
1103
|
+
callback: function(e){
|
|
1104
|
+
// Prepend/Give - surround the selection
|
|
1105
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent();
|
|
1106
|
+
|
|
1107
|
+
// transform selection and set the cursor into chunked text
|
|
1108
|
+
if (selected.length === 0) {
|
|
1109
|
+
// Give extra word
|
|
1110
|
+
chunk = e.__localize('list text here');
|
|
1111
|
+
|
|
1112
|
+
e.replaceSelection('- '+chunk);
|
|
1113
|
+
// Set the cursor
|
|
1114
|
+
cursor = selected.start+2;
|
|
1115
|
+
} else {
|
|
1116
|
+
if (selected.text.indexOf('\n') < 0) {
|
|
1117
|
+
chunk = selected.text;
|
|
1118
|
+
|
|
1119
|
+
e.replaceSelection('- '+chunk);
|
|
1120
|
+
|
|
1121
|
+
// Set the cursor
|
|
1122
|
+
cursor = selected.start+2;
|
|
1123
|
+
} else {
|
|
1124
|
+
var list = [];
|
|
1125
|
+
|
|
1126
|
+
list = selected.text.split('\n');
|
|
1127
|
+
chunk = list[0];
|
|
1128
|
+
|
|
1129
|
+
$.each(list,function(k,v) {
|
|
1130
|
+
list[k] = '- '+v;
|
|
1131
|
+
});
|
|
1132
|
+
|
|
1133
|
+
e.replaceSelection('\n\n'+list.join('\n'));
|
|
1134
|
+
|
|
1135
|
+
// Set the cursor
|
|
1136
|
+
cursor = selected.start+4;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
// Set the cursor
|
|
1141
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
1142
|
+
}
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
name: 'cmdListO',
|
|
1146
|
+
hotkey: 'Ctrl+O',
|
|
1147
|
+
title: 'Ordered List',
|
|
1148
|
+
icon: { glyph: 'glyphicon glyphicon-th-list', fa: 'fa fa-list-ol', 'fa-3': 'icon-list-ol' },
|
|
1149
|
+
callback: function(e) {
|
|
1150
|
+
|
|
1151
|
+
// Prepend/Give - surround the selection
|
|
1152
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent();
|
|
1153
|
+
|
|
1154
|
+
// transform selection and set the cursor into chunked text
|
|
1155
|
+
if (selected.length === 0) {
|
|
1156
|
+
// Give extra word
|
|
1157
|
+
chunk = e.__localize('list text here');
|
|
1158
|
+
e.replaceSelection('1. '+chunk);
|
|
1159
|
+
// Set the cursor
|
|
1160
|
+
cursor = selected.start+3;
|
|
1161
|
+
} else {
|
|
1162
|
+
if (selected.text.indexOf('\n') < 0) {
|
|
1163
|
+
chunk = selected.text;
|
|
1164
|
+
|
|
1165
|
+
e.replaceSelection('1. '+chunk);
|
|
1166
|
+
|
|
1167
|
+
// Set the cursor
|
|
1168
|
+
cursor = selected.start+3;
|
|
1169
|
+
} else {
|
|
1170
|
+
var list = [];
|
|
1171
|
+
|
|
1172
|
+
list = selected.text.split('\n');
|
|
1173
|
+
chunk = list[0];
|
|
1174
|
+
|
|
1175
|
+
$.each(list,function(k,v) {
|
|
1176
|
+
list[k] = '1. '+v;
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
e.replaceSelection('\n\n'+list.join('\n'));
|
|
1180
|
+
|
|
1181
|
+
// Set the cursor
|
|
1182
|
+
cursor = selected.start+5;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
// Set the cursor
|
|
1187
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
name: 'cmdCode',
|
|
1192
|
+
hotkey: 'Ctrl+K',
|
|
1193
|
+
title: 'Code',
|
|
1194
|
+
icon: { glyph: 'glyphicon glyphicon-asterisk', fa: 'fa fa-code', 'fa-3': 'icon-code' },
|
|
1195
|
+
callback: function(e) {
|
|
1196
|
+
// Give/remove ** surround the selection
|
|
1197
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent();
|
|
1198
|
+
|
|
1199
|
+
if (selected.length === 0) {
|
|
1200
|
+
// Give extra word
|
|
1201
|
+
chunk = e.__localize('code text here');
|
|
1202
|
+
} else {
|
|
1203
|
+
chunk = selected.text;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
// transform selection and set the cursor into chunked text
|
|
1207
|
+
if (content.substr(selected.start-4,4) === '```\n'
|
|
1208
|
+
&& content.substr(selected.end,4) === '\n```') {
|
|
1209
|
+
e.setSelection(selected.start-4, selected.end+4);
|
|
1210
|
+
e.replaceSelection(chunk);
|
|
1211
|
+
cursor = selected.start-4;
|
|
1212
|
+
} else if (content.substr(selected.start-1,1) === '`'
|
|
1213
|
+
&& content.substr(selected.end,1) === '`') {
|
|
1214
|
+
e.setSelection(selected.start-1,selected.end+1);
|
|
1215
|
+
e.replaceSelection(chunk);
|
|
1216
|
+
cursor = selected.start-1;
|
|
1217
|
+
} else if (content.indexOf('\n') > -1) {
|
|
1218
|
+
e.replaceSelection('```\n'+chunk+'\n```');
|
|
1219
|
+
cursor = selected.start+4;
|
|
1220
|
+
} else {
|
|
1221
|
+
e.replaceSelection('`'+chunk+'`');
|
|
1222
|
+
cursor = selected.start+1;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
// Set the cursor
|
|
1226
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
name: 'cmdQuote',
|
|
1231
|
+
hotkey: 'Ctrl+Q',
|
|
1232
|
+
title: 'Quote',
|
|
1233
|
+
icon: { glyph: 'glyphicon glyphicon-comment', fa: 'fa fa-quote-left', 'fa-3': 'icon-quote-left' },
|
|
1234
|
+
callback: function(e) {
|
|
1235
|
+
// Prepend/Give - surround the selection
|
|
1236
|
+
var chunk, cursor, selected = e.getSelection(), content = e.getContent();
|
|
1237
|
+
|
|
1238
|
+
// transform selection and set the cursor into chunked text
|
|
1239
|
+
if (selected.length === 0) {
|
|
1240
|
+
// Give extra word
|
|
1241
|
+
chunk = e.__localize('quote here');
|
|
1242
|
+
|
|
1243
|
+
e.replaceSelection('> '+chunk);
|
|
1244
|
+
|
|
1245
|
+
// Set the cursor
|
|
1246
|
+
cursor = selected.start+2;
|
|
1247
|
+
} else {
|
|
1248
|
+
if (selected.text.indexOf('\n') < 0) {
|
|
1249
|
+
chunk = selected.text;
|
|
1250
|
+
|
|
1251
|
+
e.replaceSelection('> '+chunk);
|
|
1252
|
+
|
|
1253
|
+
// Set the cursor
|
|
1254
|
+
cursor = selected.start+2;
|
|
1255
|
+
} else {
|
|
1256
|
+
var list = [];
|
|
1257
|
+
|
|
1258
|
+
list = selected.text.split('\n');
|
|
1259
|
+
chunk = list[0];
|
|
1260
|
+
|
|
1261
|
+
$.each(list,function(k,v) {
|
|
1262
|
+
list[k] = '> '+v;
|
|
1263
|
+
});
|
|
1264
|
+
|
|
1265
|
+
e.replaceSelection('\n\n'+list.join('\n'));
|
|
1266
|
+
|
|
1267
|
+
// Set the cursor
|
|
1268
|
+
cursor = selected.start+4;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
// Set the cursor
|
|
1273
|
+
e.setSelection(cursor,cursor+chunk.length);
|
|
1274
|
+
}
|
|
1275
|
+
}]
|
|
1276
|
+
},{
|
|
1277
|
+
name: 'groupUtil',
|
|
1278
|
+
data: [{
|
|
1279
|
+
name: 'cmdPreview',
|
|
1280
|
+
toggle: true,
|
|
1281
|
+
hotkey: 'Ctrl+P',
|
|
1282
|
+
title: 'Preview',
|
|
1283
|
+
btnText: 'Preview',
|
|
1284
|
+
btnClass: 'btn btn-primary btn-sm',
|
|
1285
|
+
icon: { glyph: 'glyphicon glyphicon-search', fa: 'fa fa-search', 'fa-3': 'icon-search' },
|
|
1286
|
+
callback: function(e){
|
|
1287
|
+
// Check the preview mode and toggle based on this flag
|
|
1288
|
+
var isPreview = e.$isPreview,content;
|
|
1289
|
+
|
|
1290
|
+
if (isPreview === false) {
|
|
1291
|
+
// Give flag that tell the editor enter preview mode
|
|
1292
|
+
e.showPreview();
|
|
1293
|
+
} else {
|
|
1294
|
+
e.hidePreview();
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
}]
|
|
1298
|
+
}]
|
|
1299
|
+
],
|
|
1300
|
+
additionalButtons:[], // Place to hook more buttons by code
|
|
1301
|
+
reorderButtonGroups:[],
|
|
1302
|
+
hiddenButtons:[], // Default hidden buttons
|
|
1303
|
+
disabledButtons:[], // Default disabled buttons
|
|
1304
|
+
footer: '',
|
|
1305
|
+
fullscreen: {
|
|
1306
|
+
enable: true,
|
|
1307
|
+
icons: {
|
|
1308
|
+
fullscreenOn: {
|
|
1309
|
+
fa: 'fa fa-expand',
|
|
1310
|
+
glyph: 'glyphicon glyphicon-fullscreen',
|
|
1311
|
+
'fa-3': 'icon-resize-full'
|
|
1312
|
+
},
|
|
1313
|
+
fullscreenOff: {
|
|
1314
|
+
fa: 'fa fa-compress',
|
|
1315
|
+
glyph: 'glyphicon glyphicon-fullscreen',
|
|
1316
|
+
'fa-3': 'icon-resize-small'
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
|
|
1321
|
+
/* Events hook */
|
|
1322
|
+
onShow: function (e) {},
|
|
1323
|
+
onPreview: function (e) {},
|
|
1324
|
+
onSave: function (e) {},
|
|
1325
|
+
onBlur: function (e) {},
|
|
1326
|
+
onFocus: function (e) {},
|
|
1327
|
+
onChange: function(e) {},
|
|
1328
|
+
onFullscreen: function(e) {},
|
|
1329
|
+
onSelect: function (e) {}
|
|
1330
|
+
};
|
|
1331
|
+
|
|
1332
|
+
$.fn.markdown.Constructor = Markdown;
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
/* MARKDOWN NO CONFLICT
|
|
1336
|
+
* ==================== */
|
|
1337
|
+
|
|
1338
|
+
$.fn.markdown.noConflict = function () {
|
|
1339
|
+
$.fn.markdown = old;
|
|
1340
|
+
return this;
|
|
1341
|
+
};
|
|
1342
|
+
|
|
1343
|
+
/* MARKDOWN GLOBAL FUNCTION & DATA-API
|
|
1344
|
+
* ==================================== */
|
|
1345
|
+
var initMarkdown = function(el) {
|
|
1346
|
+
var $this = el;
|
|
1347
|
+
|
|
1348
|
+
if ($this.data('markdown')) {
|
|
1349
|
+
$this.data('markdown').showEditor();
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
$this.markdown()
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
var blurNonFocused = function(e) {
|
|
1357
|
+
var $activeElement = $(document.activeElement);
|
|
1358
|
+
|
|
1359
|
+
// Blur event
|
|
1360
|
+
$(document).find('.md-editor').each(function(){
|
|
1361
|
+
var $this = $(this),
|
|
1362
|
+
focused = $activeElement.closest('.md-editor')[0] === this,
|
|
1363
|
+
attachedMarkdown = $this.find('textarea').data('markdown') ||
|
|
1364
|
+
$this.find('div[data-provider="markdown-preview"]').data('markdown');
|
|
1365
|
+
|
|
1366
|
+
if (attachedMarkdown && !focused) {
|
|
1367
|
+
attachedMarkdown.blur();
|
|
1368
|
+
}
|
|
1369
|
+
})
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
$(document)
|
|
1373
|
+
.on('click.markdown.data-api', '[data-provide="markdown-editable"]', function (e) {
|
|
1374
|
+
initMarkdown($(this));
|
|
1375
|
+
e.preventDefault();
|
|
1376
|
+
})
|
|
1377
|
+
.on('click focusin', function (e) {
|
|
1378
|
+
blurNonFocused(e);
|
|
1379
|
+
})
|
|
1380
|
+
.ready(function(){
|
|
1381
|
+
$('textarea[data-provide="markdown"]').each(function(){
|
|
1382
|
+
initMarkdown($(this));
|
|
1383
|
+
})
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
}));
|