├── .eslintrc.cjs ├── .github ├── FUNDING.yml └── workflows │ └── deploy.yml ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── Gemfile ├── LICENSE ├── README.md ├── _config.yml ├── bootstrap-show-password.jquery.json ├── dist ├── bootstrap-show-password.esm.js ├── bootstrap-show-password.esm.min.js ├── bootstrap-show-password.js └── bootstrap-show-password.min.js ├── docs ├── CNAME ├── LICENSE ├── README.md ├── _i18n │ ├── en.yml │ ├── en │ │ ├── documentation │ │ │ ├── events.md │ │ │ ├── methods.md │ │ │ └── options.md │ │ ├── donate.md │ │ ├── footer.html │ │ ├── getting-started │ │ │ ├── download.md │ │ │ ├── usage.md │ │ │ └── whats-include.md │ │ └── home │ │ │ └── feature.md │ └── sp.yml ├── _includes │ ├── ads.html │ ├── example-list.md │ ├── footer.html │ ├── header.html │ ├── latest-release.md │ ├── nav.html │ └── social-buttons.html ├── _layouts │ ├── default.html │ ├── examples.html │ └── home.html ├── assets │ ├── css │ │ ├── ads.css │ │ ├── docs.min.css │ │ ├── examples.css │ │ ├── sidenav.css │ │ ├── style.css │ │ └── template.css │ ├── flash │ │ └── ZeroClipboard.swf │ ├── images │ │ ├── alipay.jpg │ │ ├── alipayLogo.png │ │ ├── paypalLogo.png │ │ ├── weixin.png │ │ └── weixinLogo.png │ └── js │ │ ├── common.js │ │ ├── examples.js │ │ ├── ga.js │ │ ├── ie-emulation-modes-warning.js │ │ ├── ie10-viewport-bug-workaround.js │ │ ├── ie8-responsive-file-warning.js │ │ ├── sidenav.js │ │ └── template.js ├── documentation.md ├── donate.md ├── examples.md ├── examples │ ├── basic.html │ ├── basic.js.html │ ├── disabled.html │ ├── disabled.js.html │ ├── events.html │ ├── eye-class.html │ ├── eye-class.js.html │ ├── material-icons.html │ ├── material-icons.js.html │ ├── message.html │ ├── message.js.html │ ├── methods.html │ ├── placement.html │ ├── placement.js.html │ ├── size.html │ ├── size.js.html │ ├── template-svg.html │ ├── template-v3.html │ └── template.html ├── getting-started.md ├── home.md ├── index.html ├── robots.txt └── sitemap.xml ├── package.json ├── rollup.config.js └── src ├── .babelrc └── bootstrap-show-password.js /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | browser: true, 5 | es2021: true, 6 | node: true 7 | }, 8 | extends: [ 9 | 'eslint:recommended' 10 | ], 11 | parserOptions: { 12 | parser: '@babel/eslint-parser', 13 | ecmaVersion: 'latest', 14 | sourceType: 'module' 15 | }, 16 | rules: { 17 | 'array-bracket-newline': ['error', 'consistent'], 18 | 'array-bracket-spacing': ['error', 'never'], 19 | 'array-element-newline': 'off', 20 | 'arrow-parens': ['error', 'as-needed'], 21 | 'arrow-spacing': ['error', { after: true, before: true }], 22 | 'block-spacing': 'error', 23 | 'brace-style': ['error', '1tbs'], 24 | camelcase: 'off', 25 | 'comma-dangle': ['error', 'never'], 26 | 'comma-spacing': ['error', { after: true, before: false }], 27 | 'comma-style': 'off', 28 | 'computed-property-spacing': ['error', 'never'], 29 | 'default-case': 'error', 30 | 'dot-location': ['error', 'property'], 31 | 'eol-last': ['error', 'always'], 32 | eqeqeq: 'error', 33 | 'func-call-spacing': ['error', 'never'], 34 | 'guard-for-in': 'warn', 35 | indent: ['error', 2, { 36 | ArrayExpression: 1, 37 | CallExpression: { arguments: 1 }, 38 | FunctionDeclaration: { parameters: 'first' }, 39 | ImportDeclaration: 'first', 40 | MemberExpression: 1, 41 | ObjectExpression: 1, 42 | SwitchCase: 1 43 | }], 44 | 'jsdoc/require-jsdoc': 0, 45 | 'key-spacing': ['error', { afterColon: true, beforeColon: false, mode: 'strict' }], 46 | 'keyword-spacing': ['error', { after: true, before: true }], 47 | 'linebreak-style': 'off', 48 | 'line-comment-position': 'off', 49 | 'lines-around-comment': 'off', 50 | 'lines-between-class-members': ['error', 'always'], 51 | 'max-len': 'off', 52 | 'max-statements-per-line': ['error', { max: 1 }], 53 | 'multiline-ternary': 'off', 54 | 'no-alert': 'error', 55 | 'no-async-promise-executor': 'off', 56 | 'no-case-declarations': 'off', 57 | 'no-console': ['warn', { allow: ['warn', 'error', 'trace'] }], 58 | 'no-duplicate-imports': 'error', 59 | 'no-else-return': ['error', { allowElseIf: false }], 60 | 'no-extra-parens': 'error', 61 | 'no-lonely-if': 'error', 62 | 'no-mixed-spaces-and-tabs': 'error', 63 | 'no-multi-spaces': 'error', 64 | 'no-multi-str': 'error', 65 | 'no-multiple-empty-lines': 'error', 66 | 'no-new-func': 'error', 67 | 'no-param-reassign': 'off', 68 | 'no-prototype-builtins': 'off', 69 | 'no-return-assign': 'error', 70 | 'no-return-await': 'error', 71 | 'no-sequences': 'error', 72 | 'no-tabs': 'error', 73 | 'no-throw-literal': 'error', 74 | 'no-trailing-spaces': 'error', 75 | 'no-undef-init': 'error', 76 | 'no-unused-vars': 'error', 77 | 'no-use-before-define': 'warn', 78 | 'no-useless-constructor': 'warn', 79 | 'no-var': 'error', 80 | 'no-void': 'error', 81 | 'no-whitespace-before-property': 'error', 82 | 'object-curly-spacing': ['error', 'always'], 83 | 'object-shorthand': 'error', 84 | 'one-var': ['error', 'never'], 85 | 'operator-assignment': ['error', 'always'], 86 | 'operator-linebreak': ['error', 'after'], 87 | 'padding-line-between-statements': [ 88 | 'error', 89 | { blankLine: 'always', next: '*', prev: ['const', 'let', 'var'] }, 90 | { blankLine: 'any', next: ['const', 'let', 'var'], prev: ['const', 'let', 'var'] }, 91 | { blankLine: 'always', next: 'export', prev: '*' } 92 | ], 93 | 'prefer-const': 'error', 94 | 'prefer-spread': 'error', 95 | 'prefer-template': 'error', 96 | 'quote-props': ['error', 'as-needed'], 97 | quotes: ['error', 'single'], 98 | semi: ['error', 'never'], 99 | 'semi-spacing': ['error', { after: true, before: false }], 100 | 'semi-style': ['error', 'last'], 101 | 'sort-imports': 'off', 102 | 'space-before-blocks': ['error', { classes: 'always', functions: 'always', keywords: 'always' }], 103 | 'space-before-function-paren': ['error', 'always'], 104 | 'space-in-parens': ['error', 'never'], 105 | 'space-infix-ops': 'error', 106 | 'spaced-comment': ['error', 'always'], 107 | 'switch-colon-spacing': 'error', 108 | 'template-curly-spacing': ['error', 'never'] 109 | }, 110 | globals: { 111 | $: true, 112 | jQuery: true 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: wenzhixin 4 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Site 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | with: 14 | fetch-depth: '0' 15 | 16 | - uses: ruby/setup-ruby@v1 17 | with: 18 | ruby-version: 2.6 19 | bundler-cache: true 20 | 21 | - name: Build page with Jekyll 22 | run: bundle exec jekyll build 23 | 24 | - name: Deploy to GitHub Pages 25 | uses: JamesIves/github-pages-deploy-action@v4.3.3 26 | with: 27 | branch: gh-pages 28 | folder: _gh_pages 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Gemfile.lock 2 | _gh_pages/ 3 | node_modules/ 4 | yarn-error.log 5 | yarn.lock 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github 2 | docs 3 | _config.yml 4 | Gemfile 5 | Gemfile.lock 6 | src 7 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## CHANGELOG 2 | 3 | ### 1.3.0 4 | 5 | - **New:** Supported bootstrap v5. 6 | - **New:** Supported all attributes without `data-*`. 7 | - **Update:** Fix bootstrap v3 old version is `undefined` bug. 8 | 9 | ### 1.2.1 10 | 11 | - **New:** Added font-awesome svg support. 12 | - **New:** Added `size` option of the input group. 13 | 14 | ### 1.2.0 15 | 16 | - **New:** Rewrote the src to ES6. 17 | - **New:** Supported bootstrap v4. 18 | - **New:** Use Font Awesome v5 as default. 19 | - **New:** Supported `maxlength` attribute. 20 | - **New:** Supported `disabled` attribute. 21 | - **New:** Updated the docs and added examples. 22 | 23 | ### 1.1.2 24 | 25 | * Add support for google material design icons, by using the data-eye-class-position-inside property. 26 | 27 | ### 1.1.1 28 | 29 | * Add `focus` method. 30 | 31 | ### 1.1.0 32 | 33 | * Add support for google material design icons, by usgin the ```data-eye-class-position-inside``` property. 34 | 35 | ### 1.0.3 36 | 37 | * Add `eyeClass`, `eyeOpenClass`, `eyeCloseClass` to use custom font (for example Font Awesome) instead of Bootstrap's default Glyphicon. 38 | 39 | ### 1.0.2 40 | 41 | * Add `val` option. 42 | 43 | ### 1.0.1 44 | 45 | * Via data attribute support. 46 | * Rename file name to bootstrap-show-password.js 47 | * Add bootstrap-show-password.min.js 48 | 49 | ### 1.0.0 50 | 51 | * Initial release 52 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "jekyll" 4 | gem "rouge" 5 | gem "kramdown" 6 | gem "jekyll-multiple-languages-plugin" 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 20010-2019 文翼 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Bootstrap Show Password 2 | ======================= 3 | 4 | Show/hide password plugin for twitter bootstrap. 5 | 6 | To get started, check out: 7 | 8 | * [Docs](http://bootstrap-show-password.wenzhixin.net.cn) 9 | * [Examples](http://bootstrap-show-password.wenzhixin.net.cn/examples) 10 | 11 | ## Reporting issues 12 | 13 | Please provide jsFiddle when creating issues! 14 | 15 | It's really saves much time. Use this as template: 16 | 17 | [jsFiddle Bootstrap Show Password](http://jsfiddle.net/wenyi/L1ugpqk5/1/) 18 | 19 | Your feedback is very appreciated! 20 | 21 | ## Release History 22 | 23 | Look at the [Change Log](https://github.com/wenzhixin/bootstrap-show-password/blob/master/CHANGELOG.md) 24 | 25 | ## LICENSE 26 | 27 | [The MIT License](https://github.com/wenzhixin/bootstrap-show-password/blob/master/LICENSE) 28 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | markdown: kramdown 3 | highlighter: rouge 4 | 5 | plugins: 6 | - jekyll-multiple-languages-plugin 7 | baseurl: "" 8 | 9 | # Permalinks 10 | permalink: pretty 11 | 12 | # Server 13 | source: docs 14 | destination: _gh_pages 15 | host: 0.0.0.0 16 | port: 4000 17 | url: http://bootstrap-show-password.wenzhixin.net.cn 18 | encoding: UTF-8 19 | 20 | # Languages 21 | languages: ["en"] 22 | languages_string: ["English"] 23 | 24 | # Custom vars 25 | current_version: 1.3.0 26 | repo: https://github.com/wenzhixin/bootstrap-show-password 27 | website: http://wenzhixin.net.cn 28 | repos: http://repos.wenzhixin.net.cn 29 | email: wenzhixin2010@gmail.com 30 | master_zip: https://github.com/wenzhixin/bootstrap-show-password/archive/master.zip 31 | -------------------------------------------------------------------------------- /bootstrap-show-password.jquery.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-show-password", 3 | "version": "1.3.0", 4 | "title": "Bootstrap Show Password", 5 | "description": "Show/hide password plugin for twitter bootstrap.", 6 | "author": { 7 | "name": "zhixin wen", 8 | "email": "wenzhixin2010@gmail.com", 9 | "url": "http://wenzhixin.net.cn/" 10 | }, 11 | "licenses": [ 12 | { 13 | "type": "MIT License", 14 | "url": "http://opensource.org/licenses/MIT" 15 | } 16 | ], 17 | "dependencies": { 18 | "jquery": ">=1.7" 19 | }, 20 | "keywords": ["bootstrap.password", "show.password", "hide.password"], 21 | "homepage": "https://github.com/wenzhixin/bootstrap-show-password", 22 | "demo": "http://wenzhixin.net.cn/p/bootstrap-show-password/", 23 | "bugs": { 24 | "url": "https://github.com/wenzhixin/bootstrap-show-password/issues" 25 | }, 26 | "docs": "https://github.com/wenzhixin/bootstrap-show-password#usage", 27 | "download": "https://github.com/wenzhixin/bootstrap-show-password/archive/master.zip" 28 | } 29 | -------------------------------------------------------------------------------- /dist/bootstrap-show-password.esm.js: -------------------------------------------------------------------------------- 1 | import 'core-js/modules/es.array.concat.js'; 2 | import 'core-js/modules/es.array.find.js'; 3 | import 'core-js/modules/es.array.includes.js'; 4 | import 'core-js/modules/es.array.index-of.js'; 5 | import 'core-js/modules/es.array.join.js'; 6 | import 'core-js/modules/es.function.name.js'; 7 | import 'core-js/modules/es.object.to-string.js'; 8 | import 'core-js/modules/es.parse-int.js'; 9 | import 'core-js/modules/es.regexp.exec.js'; 10 | import 'core-js/modules/es.string.replace.js'; 11 | 12 | function _toPrimitive(t, r) { 13 | if ("object" != typeof t || !t) return t; 14 | var e = t[Symbol.toPrimitive]; 15 | if (void 0 !== e) { 16 | var i = e.call(t, r || "default"); 17 | if ("object" != typeof i) return i; 18 | throw new TypeError("@@toPrimitive must return a primitive value."); 19 | } 20 | return ("string" === r ? String : Number)(t); 21 | } 22 | function _toPropertyKey(t) { 23 | var i = _toPrimitive(t, "string"); 24 | return "symbol" == typeof i ? i : String(i); 25 | } 26 | function _typeof(o) { 27 | "@babel/helpers - typeof"; 28 | 29 | return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { 30 | return typeof o; 31 | } : function (o) { 32 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; 33 | }, _typeof(o); 34 | } 35 | function _classCallCheck(instance, Constructor) { 36 | if (!(instance instanceof Constructor)) { 37 | throw new TypeError("Cannot call a class as a function"); 38 | } 39 | } 40 | function _defineProperties(target, props) { 41 | for (var i = 0; i < props.length; i++) { 42 | var descriptor = props[i]; 43 | descriptor.enumerable = descriptor.enumerable || false; 44 | descriptor.configurable = true; 45 | if ("value" in descriptor) descriptor.writable = true; 46 | Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); 47 | } 48 | } 49 | function _createClass(Constructor, protoProps, staticProps) { 50 | if (protoProps) _defineProperties(Constructor.prototype, protoProps); 51 | if (staticProps) _defineProperties(Constructor, staticProps); 52 | Object.defineProperty(Constructor, "prototype", { 53 | writable: false 54 | }); 55 | return Constructor; 56 | } 57 | function _unsupportedIterableToArray(o, minLen) { 58 | if (!o) return; 59 | if (typeof o === "string") return _arrayLikeToArray(o, minLen); 60 | var n = Object.prototype.toString.call(o).slice(8, -1); 61 | if (n === "Object" && o.constructor) n = o.constructor.name; 62 | if (n === "Map" || n === "Set") return Array.from(o); 63 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 64 | } 65 | function _arrayLikeToArray(arr, len) { 66 | if (len == null || len > arr.length) len = arr.length; 67 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 68 | return arr2; 69 | } 70 | function _createForOfIteratorHelper(o, allowArrayLike) { 71 | var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; 72 | if (!it) { 73 | if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 74 | if (it) o = it; 75 | var i = 0; 76 | var F = function () {}; 77 | return { 78 | s: F, 79 | n: function () { 80 | if (i >= o.length) return { 81 | done: true 82 | }; 83 | return { 84 | done: false, 85 | value: o[i++] 86 | }; 87 | }, 88 | e: function (e) { 89 | throw e; 90 | }, 91 | f: F 92 | }; 93 | } 94 | throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 95 | } 96 | var normalCompletion = true, 97 | didErr = false, 98 | err; 99 | return { 100 | s: function () { 101 | it = it.call(o); 102 | }, 103 | n: function () { 104 | var step = it.next(); 105 | normalCompletion = step.done; 106 | return step; 107 | }, 108 | e: function (e) { 109 | didErr = true; 110 | err = e; 111 | }, 112 | f: function () { 113 | try { 114 | if (!normalCompletion && it.return != null) it.return(); 115 | } finally { 116 | if (didErr) throw err; 117 | } 118 | } 119 | }; 120 | } 121 | 122 | /** 123 | * @author zhixin wen 124 | * https://github.com/wenzhixin/bootstrap-show-password 125 | * version: 1.3.0 126 | */ 127 | 128 | var bootstrapVersion = 5; 129 | try { 130 | var rawVersion = $.fn.dropdown.Constructor.VERSION; 131 | 132 | // Only try to parse VERSION if it is defined. 133 | // It is undefined in older versions of Bootstrap (tested with 3.1.1). 134 | if (rawVersion !== undefined) { 135 | bootstrapVersion = parseInt(rawVersion, 10); 136 | } 137 | } catch (e) { 138 | // ignore 139 | } 140 | try { 141 | // eslint-disable-next-line no-undef 142 | var _rawVersion = bootstrap.Tooltip.VERSION; 143 | if (_rawVersion !== undefined) { 144 | bootstrapVersion = parseInt(_rawVersion, 10); 145 | } 146 | } catch (e) { 147 | // ignore 148 | } 149 | var Constants = { 150 | html: { 151 | inputGroups: { 152 | 3: ['', ''], 153 | 4: ['
'], 154 | 5: [''] 155 | }[bootstrapVersion] 156 | } 157 | }; 158 | 159 | // TOOLS DEFINITION 160 | // ====================== 161 | 162 | // it only does '%s', and return '' when arguments are undefined 163 | var sprintf = function sprintf(str) { 164 | var args = arguments; 165 | var flag = true; 166 | var i = 1; 167 | str = str.replace(/%s/g, function () { 168 | var arg = args[i++]; 169 | if (typeof arg === 'undefined') { 170 | flag = false; 171 | return ''; 172 | } 173 | return arg; 174 | }); 175 | if (flag) { 176 | return str; 177 | } 178 | return ''; 179 | }; 180 | var Password = /*#__PURE__*/function () { 181 | function Password(element, options) { 182 | _classCallCheck(this, Password); 183 | this.options = options; 184 | this.$element = $(element); 185 | this.isShown = false; 186 | this.init(); 187 | } 188 | _createClass(Password, [{ 189 | key: "init", 190 | value: function init() { 191 | var placementFuc; 192 | var inputClass; 193 | if (this.options.placement === 'before') { 194 | placementFuc = 'insertBefore'; 195 | inputClass = 'input-group-prepend'; 196 | } else { 197 | this.options.placement = 'after'; // default to after 198 | placementFuc = 'insertAfter'; 199 | inputClass = 'input-group-append'; 200 | } 201 | 202 | // Create the text, icon and assign 203 | this.$element.wrap("
")); 204 | this.$text = $('')[placementFuc](this.$element).css('display', this.$element.css('display')).val(this.$element.val()).hide(); 205 | var _iterator = _createForOfIteratorHelper(this.$element[0].attributes), 206 | _step; 207 | try { 208 | for (_iterator.s(); !(_step = _iterator.n()).done;) { 209 | var attr = _step.value; 210 | if (!attr.specified || ['id', 'type'].includes(attr.name) || attr.name.indexOf('data-') === 0) { 211 | continue; 212 | } 213 | this.$text.attr(attr.name, attr.value); 214 | } 215 | } catch (err) { 216 | _iterator.e(err); 217 | } finally { 218 | _iterator.f(); 219 | } 220 | this.$icon = $(["".concat(sprintf(Constants.html.inputGroups[0], inputClass, this.options.message), "\n \n ").concat(this.options.eyeClassPositionInside ? this.options.eyeOpenClass : '', "\n "), Constants.html.inputGroups[1]].join(''))[placementFuc](this.$text).css('cursor', 'pointer'); 221 | 222 | // events 223 | this.$text.off('keyup').on('keyup', $.proxy(function () { 224 | if (!this.isShown) return; 225 | this.$element.val(this.$text.val()).trigger('change'); 226 | }, this)); 227 | this.$icon.off('click').on('click', $.proxy(function () { 228 | this.$text.val(this.$element.val()).trigger('change'); 229 | this.toggle(); 230 | }, this)); 231 | } 232 | }, { 233 | key: "toggle", 234 | value: function toggle(_relatedTarget) { 235 | this[!this.isShown ? 'show' : 'hide'](_relatedTarget); 236 | } 237 | }, { 238 | key: "show", 239 | value: function show(_relatedTarget) { 240 | var e = $.Event('show.bs.password', { 241 | relatedTarget: _relatedTarget 242 | }); 243 | this.$element.trigger(e); 244 | this.isShown = true; 245 | this.$element.hide(); 246 | this.$text.show(); 247 | if (this.options.eyeClassPositionInside) { 248 | this.$icon.find('i,svg').removeClass('icon-eye-open').addClass('icon-eye-close').html(this.options.eyeCloseClass); 249 | } else { 250 | this.$icon.find('i,svg').removeClass("icon-eye-open ".concat(this.options.eyeOpenClass)).addClass("icon-eye-close ".concat(this.options.eyeCloseClass)); 251 | } 252 | this.$text[this.options.placement](this.$element); 253 | } 254 | }, { 255 | key: "hide", 256 | value: function hide(_relatedTarget) { 257 | var e = $.Event('hide.bs.password', { 258 | relatedTarget: _relatedTarget 259 | }); 260 | this.$element.trigger(e); 261 | this.isShown = false; 262 | this.$element.show(); 263 | this.$text.hide(); 264 | if (this.options.eyeClassPositionInside) { 265 | this.$icon.find('i,svg').removeClass('icon-eye-close').addClass('icon-eye-open').html(this.options.eyeOpenClass); 266 | } else { 267 | this.$icon.find('i,svg').removeClass("icon-eye-close ".concat(this.options.eyeCloseClass)).addClass("icon-eye-open ".concat(this.options.eyeOpenClass)); 268 | } 269 | this.$element[this.options.placement](this.$text); 270 | } 271 | }, { 272 | key: "val", 273 | value: function val(value) { 274 | if (typeof value === 'undefined') { 275 | return this.$element.val(); 276 | } 277 | this.$element.val(value).trigger('change'); 278 | this.$text.val(value); 279 | } 280 | }, { 281 | key: "focus", 282 | value: function focus() { 283 | this.$element.focus(); 284 | } 285 | }]); 286 | return Password; 287 | }(); 288 | Password.DEFAULTS = { 289 | placement: 'after', 290 | // 'before' or 'after' 291 | message: 'Click here to show/hide password', 292 | size: undefined, 293 | // '', 'sm', 'large' 294 | eyeClass: 'fa', 295 | // 'glyphicon', 296 | eyeOpenClass: 'fa-eye', 297 | // 'glyphicon-eye-open', 298 | eyeCloseClass: 'fa-eye-slash', 299 | // 'glyphicon-eye-close', 300 | eyeClassPositionInside: false 301 | }; 302 | 303 | // PASSWORD PLUGIN DEFINITION 304 | // ======================= 305 | 306 | var old = $.fn.password; 307 | $.fn.password = function () { 308 | var option = arguments[0]; // public function 309 | var args = arguments; 310 | var value; 311 | var allowedMethods = ['show', 'hide', 'toggle', 'val', 'focus']; 312 | this.each(function () { 313 | var $this = $(this); 314 | var data = $this.data('bs.password'); 315 | var options = $.extend({}, Password.DEFAULTS, $this.data(), _typeof(option) === 'object' && option); 316 | if (typeof option === 'string') { 317 | if ($.inArray(option, allowedMethods) < 0) { 318 | throw new Error("Unknown method: ".concat(option)); 319 | } 320 | value = data[option](args[1]); 321 | } else if (!data) { 322 | data = new Password($this, options); 323 | $this.data('bs.password', data); 324 | } else { 325 | data.init(options); 326 | } 327 | }); 328 | return value ? value : this; 329 | }; 330 | $.fn.password.Constructor = Password; 331 | 332 | // PASSWORD NO CONFLICT 333 | // ================= 334 | 335 | $.fn.password.noConflict = function () { 336 | $.fn.password = old; 337 | return this; 338 | }; 339 | $(function () { 340 | $('[data-toggle="password"]').password(); 341 | }); 342 | -------------------------------------------------------------------------------- /dist/bootstrap-show-password.esm.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bootstrap-show-password - Show/hide password plugin for twitter bootstrap. 3 | * 4 | * @version v1.3.0 5 | * @homepage https://github.com/wenzhixin/bootstrap-show-password 6 | * @author zhixin wen 7 | * @license MIT 8 | */ 9 | 10 | import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.array.index-of.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.parse-int.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(t,n){for(var s=0;se.length)&&(t=e.length);for(var n=0,s=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}var i=5;try{var r=$.fn.dropdown.Constructor.VERSION;void 0!==r&&(i=parseInt(r,10))}catch(e){}try{var a=bootstrap.Tooltip.VERSION;void 0!==a&&(i=parseInt(a,10))}catch(e){}var l={html:{inputGroups:{3:['',""],4:['
"],5:['"]}[i]}},c=function(e){var t=arguments,n=!0,s=1;return e=e.replace(/%s/g,(function(){var e=t[s++];return void 0===e?(n=!1,""):e})),n?e:""},p=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=n,this.$element=$(t),this.isShown=!1,this.init()}var t,s,i;return t=e,(s=[{key:"init",value:function(){var e,t;"before"===this.options.placement?(e="insertBefore",t="input-group-prepend"):(this.options.placement="after",e="insertAfter",t="input-group-append"),this.$element.wrap('
')),this.$text=$('')[e](this.$element).css("display",this.$element.css("display")).val(this.$element.val()).hide();var n,s=o(this.$element[0].attributes);try{for(s.s();!(n=s.n()).done;){var i=n.value;i.specified&&!["id","type"].includes(i.name)&&0!==i.name.indexOf("data-")&&this.$text.attr(i.name,i.value)}}catch(e){s.e(e)}finally{s.f()}this.$icon=$(["".concat(c(l.html.inputGroups[0],t,this.options.message),'\n \n ').concat(this.options.eyeClassPositionInside?this.options.eyeOpenClass:"","\n "),l.html.inputGroups[1]].join(""))[e](this.$text).css("cursor","pointer"),this.$text.off("keyup").on("keyup",$.proxy((function(){this.isShown&&this.$element.val(this.$text.val()).trigger("change")}),this)),this.$icon.off("click").on("click",$.proxy((function(){this.$text.val(this.$element.val()).trigger("change"),this.toggle()}),this))}},{key:"toggle",value:function(e){this[this.isShown?"hide":"show"](e)}},{key:"show",value:function(e){var t=$.Event("show.bs.password",{relatedTarget:e});this.$element.trigger(t),this.isShown=!0,this.$element.hide(),this.$text.show(),this.options.eyeClassPositionInside?this.$icon.find("i,svg").removeClass("icon-eye-open").addClass("icon-eye-close").html(this.options.eyeCloseClass):this.$icon.find("i,svg").removeClass("icon-eye-open ".concat(this.options.eyeOpenClass)).addClass("icon-eye-close ".concat(this.options.eyeCloseClass)),this.$text[this.options.placement](this.$element)}},{key:"hide",value:function(e){var t=$.Event("hide.bs.password",{relatedTarget:e});this.$element.trigger(t),this.isShown=!1,this.$element.show(),this.$text.hide(),this.options.eyeClassPositionInside?this.$icon.find("i,svg").removeClass("icon-eye-close").addClass("icon-eye-open").html(this.options.eyeOpenClass):this.$icon.find("i,svg").removeClass("icon-eye-close ".concat(this.options.eyeCloseClass)).addClass("icon-eye-open ".concat(this.options.eyeOpenClass)),this.$element[this.options.placement](this.$text)}},{key:"val",value:function(e){if(void 0===e)return this.$element.val();this.$element.val(e).trigger("change"),this.$text.val(e)}},{key:"focus",value:function(){this.$element.focus()}}])&&n(t.prototype,s),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();p.DEFAULTS={placement:"after",message:"Click here to show/hide password",size:void 0,eyeClass:"fa",eyeOpenClass:"fa-eye",eyeCloseClass:"fa-eye-slash",eyeClassPositionInside:!1};var u=$.fn.password;$.fn.password=function(){var e,n=arguments[0],s=arguments,o=["show","hide","toggle","val","focus"];return this.each((function(){var i=$(this),r=i.data("bs.password"),a=$.extend({},p.DEFAULTS,i.data(),"object"===t(n)&&n);if("string"==typeof n){if($.inArray(n,o)<0)throw new Error("Unknown method: ".concat(n));e=r[n](s[1])}else r?r.init(a):(r=new p(i,a),i.data("bs.password",r))})),e||this},$.fn.password.Constructor=p,$.fn.password.noConflict=function(){return $.fn.password=u,this},$((function(){$('[data-toggle="password"]').password()})); 11 | -------------------------------------------------------------------------------- /dist/bootstrap-show-password.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.function.name.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.parse-int.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.replace.js'), require('jquery')) : 3 | typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.function.name.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.parse-int.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.replace.js', 'jquery'], factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, global.jQuery)); 5 | })(this, (function (es_array_concat_js, es_array_find_js, es_array_includes_js, es_array_indexOf_js, es_array_join_js, es_function_name_js, es_object_toString_js, es_parseInt_js, es_regexp_exec_js, es_string_replace_js, $) { 'use strict'; 6 | 7 | function _toPrimitive(t, r) { 8 | if ("object" != typeof t || !t) return t; 9 | var e = t[Symbol.toPrimitive]; 10 | if (void 0 !== e) { 11 | var i = e.call(t, r || "default"); 12 | if ("object" != typeof i) return i; 13 | throw new TypeError("@@toPrimitive must return a primitive value."); 14 | } 15 | return ("string" === r ? String : Number)(t); 16 | } 17 | function _toPropertyKey(t) { 18 | var i = _toPrimitive(t, "string"); 19 | return "symbol" == typeof i ? i : String(i); 20 | } 21 | function _typeof(o) { 22 | "@babel/helpers - typeof"; 23 | 24 | return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { 25 | return typeof o; 26 | } : function (o) { 27 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; 28 | }, _typeof(o); 29 | } 30 | function _classCallCheck(instance, Constructor) { 31 | if (!(instance instanceof Constructor)) { 32 | throw new TypeError("Cannot call a class as a function"); 33 | } 34 | } 35 | function _defineProperties(target, props) { 36 | for (var i = 0; i < props.length; i++) { 37 | var descriptor = props[i]; 38 | descriptor.enumerable = descriptor.enumerable || false; 39 | descriptor.configurable = true; 40 | if ("value" in descriptor) descriptor.writable = true; 41 | Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); 42 | } 43 | } 44 | function _createClass(Constructor, protoProps, staticProps) { 45 | if (protoProps) _defineProperties(Constructor.prototype, protoProps); 46 | if (staticProps) _defineProperties(Constructor, staticProps); 47 | Object.defineProperty(Constructor, "prototype", { 48 | writable: false 49 | }); 50 | return Constructor; 51 | } 52 | function _unsupportedIterableToArray(o, minLen) { 53 | if (!o) return; 54 | if (typeof o === "string") return _arrayLikeToArray(o, minLen); 55 | var n = Object.prototype.toString.call(o).slice(8, -1); 56 | if (n === "Object" && o.constructor) n = o.constructor.name; 57 | if (n === "Map" || n === "Set") return Array.from(o); 58 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 59 | } 60 | function _arrayLikeToArray(arr, len) { 61 | if (len == null || len > arr.length) len = arr.length; 62 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 63 | return arr2; 64 | } 65 | function _createForOfIteratorHelper(o, allowArrayLike) { 66 | var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; 67 | if (!it) { 68 | if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 69 | if (it) o = it; 70 | var i = 0; 71 | var F = function () {}; 72 | return { 73 | s: F, 74 | n: function () { 75 | if (i >= o.length) return { 76 | done: true 77 | }; 78 | return { 79 | done: false, 80 | value: o[i++] 81 | }; 82 | }, 83 | e: function (e) { 84 | throw e; 85 | }, 86 | f: F 87 | }; 88 | } 89 | throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 90 | } 91 | var normalCompletion = true, 92 | didErr = false, 93 | err; 94 | return { 95 | s: function () { 96 | it = it.call(o); 97 | }, 98 | n: function () { 99 | var step = it.next(); 100 | normalCompletion = step.done; 101 | return step; 102 | }, 103 | e: function (e) { 104 | didErr = true; 105 | err = e; 106 | }, 107 | f: function () { 108 | try { 109 | if (!normalCompletion && it.return != null) it.return(); 110 | } finally { 111 | if (didErr) throw err; 112 | } 113 | } 114 | }; 115 | } 116 | 117 | /** 118 | * @author zhixin wen 119 | * https://github.com/wenzhixin/bootstrap-show-password 120 | * version: 1.3.0 121 | */ 122 | 123 | var bootstrapVersion = 5; 124 | try { 125 | var rawVersion = $.fn.dropdown.Constructor.VERSION; 126 | 127 | // Only try to parse VERSION if it is defined. 128 | // It is undefined in older versions of Bootstrap (tested with 3.1.1). 129 | if (rawVersion !== undefined) { 130 | bootstrapVersion = parseInt(rawVersion, 10); 131 | } 132 | } catch (e) { 133 | // ignore 134 | } 135 | try { 136 | // eslint-disable-next-line no-undef 137 | var _rawVersion = bootstrap.Tooltip.VERSION; 138 | if (_rawVersion !== undefined) { 139 | bootstrapVersion = parseInt(_rawVersion, 10); 140 | } 141 | } catch (e) { 142 | // ignore 143 | } 144 | var Constants = { 145 | html: { 146 | inputGroups: { 147 | 3: ['', ''], 148 | 4: ['
'], 149 | 5: [''] 150 | }[bootstrapVersion] 151 | } 152 | }; 153 | 154 | // TOOLS DEFINITION 155 | // ====================== 156 | 157 | // it only does '%s', and return '' when arguments are undefined 158 | var sprintf = function sprintf(str) { 159 | var args = arguments; 160 | var flag = true; 161 | var i = 1; 162 | str = str.replace(/%s/g, function () { 163 | var arg = args[i++]; 164 | if (typeof arg === 'undefined') { 165 | flag = false; 166 | return ''; 167 | } 168 | return arg; 169 | }); 170 | if (flag) { 171 | return str; 172 | } 173 | return ''; 174 | }; 175 | var Password = /*#__PURE__*/function () { 176 | function Password(element, options) { 177 | _classCallCheck(this, Password); 178 | this.options = options; 179 | this.$element = $(element); 180 | this.isShown = false; 181 | this.init(); 182 | } 183 | _createClass(Password, [{ 184 | key: "init", 185 | value: function init() { 186 | var placementFuc; 187 | var inputClass; 188 | if (this.options.placement === 'before') { 189 | placementFuc = 'insertBefore'; 190 | inputClass = 'input-group-prepend'; 191 | } else { 192 | this.options.placement = 'after'; // default to after 193 | placementFuc = 'insertAfter'; 194 | inputClass = 'input-group-append'; 195 | } 196 | 197 | // Create the text, icon and assign 198 | this.$element.wrap("
")); 199 | this.$text = $('')[placementFuc](this.$element).css('display', this.$element.css('display')).val(this.$element.val()).hide(); 200 | var _iterator = _createForOfIteratorHelper(this.$element[0].attributes), 201 | _step; 202 | try { 203 | for (_iterator.s(); !(_step = _iterator.n()).done;) { 204 | var attr = _step.value; 205 | if (!attr.specified || ['id', 'type'].includes(attr.name) || attr.name.indexOf('data-') === 0) { 206 | continue; 207 | } 208 | this.$text.attr(attr.name, attr.value); 209 | } 210 | } catch (err) { 211 | _iterator.e(err); 212 | } finally { 213 | _iterator.f(); 214 | } 215 | this.$icon = $(["".concat(sprintf(Constants.html.inputGroups[0], inputClass, this.options.message), "\n \n ").concat(this.options.eyeClassPositionInside ? this.options.eyeOpenClass : '', "\n "), Constants.html.inputGroups[1]].join(''))[placementFuc](this.$text).css('cursor', 'pointer'); 216 | 217 | // events 218 | this.$text.off('keyup').on('keyup', $.proxy(function () { 219 | if (!this.isShown) return; 220 | this.$element.val(this.$text.val()).trigger('change'); 221 | }, this)); 222 | this.$icon.off('click').on('click', $.proxy(function () { 223 | this.$text.val(this.$element.val()).trigger('change'); 224 | this.toggle(); 225 | }, this)); 226 | } 227 | }, { 228 | key: "toggle", 229 | value: function toggle(_relatedTarget) { 230 | this[!this.isShown ? 'show' : 'hide'](_relatedTarget); 231 | } 232 | }, { 233 | key: "show", 234 | value: function show(_relatedTarget) { 235 | var e = $.Event('show.bs.password', { 236 | relatedTarget: _relatedTarget 237 | }); 238 | this.$element.trigger(e); 239 | this.isShown = true; 240 | this.$element.hide(); 241 | this.$text.show(); 242 | if (this.options.eyeClassPositionInside) { 243 | this.$icon.find('i,svg').removeClass('icon-eye-open').addClass('icon-eye-close').html(this.options.eyeCloseClass); 244 | } else { 245 | this.$icon.find('i,svg').removeClass("icon-eye-open ".concat(this.options.eyeOpenClass)).addClass("icon-eye-close ".concat(this.options.eyeCloseClass)); 246 | } 247 | this.$text[this.options.placement](this.$element); 248 | } 249 | }, { 250 | key: "hide", 251 | value: function hide(_relatedTarget) { 252 | var e = $.Event('hide.bs.password', { 253 | relatedTarget: _relatedTarget 254 | }); 255 | this.$element.trigger(e); 256 | this.isShown = false; 257 | this.$element.show(); 258 | this.$text.hide(); 259 | if (this.options.eyeClassPositionInside) { 260 | this.$icon.find('i,svg').removeClass('icon-eye-close').addClass('icon-eye-open').html(this.options.eyeOpenClass); 261 | } else { 262 | this.$icon.find('i,svg').removeClass("icon-eye-close ".concat(this.options.eyeCloseClass)).addClass("icon-eye-open ".concat(this.options.eyeOpenClass)); 263 | } 264 | this.$element[this.options.placement](this.$text); 265 | } 266 | }, { 267 | key: "val", 268 | value: function val(value) { 269 | if (typeof value === 'undefined') { 270 | return this.$element.val(); 271 | } 272 | this.$element.val(value).trigger('change'); 273 | this.$text.val(value); 274 | } 275 | }, { 276 | key: "focus", 277 | value: function focus() { 278 | this.$element.focus(); 279 | } 280 | }]); 281 | return Password; 282 | }(); 283 | Password.DEFAULTS = { 284 | placement: 'after', 285 | // 'before' or 'after' 286 | message: 'Click here to show/hide password', 287 | size: undefined, 288 | // '', 'sm', 'large' 289 | eyeClass: 'fa', 290 | // 'glyphicon', 291 | eyeOpenClass: 'fa-eye', 292 | // 'glyphicon-eye-open', 293 | eyeCloseClass: 'fa-eye-slash', 294 | // 'glyphicon-eye-close', 295 | eyeClassPositionInside: false 296 | }; 297 | 298 | // PASSWORD PLUGIN DEFINITION 299 | // ======================= 300 | 301 | var old = $.fn.password; 302 | $.fn.password = function () { 303 | var option = arguments[0]; // public function 304 | var args = arguments; 305 | var value; 306 | var allowedMethods = ['show', 'hide', 'toggle', 'val', 'focus']; 307 | this.each(function () { 308 | var $this = $(this); 309 | var data = $this.data('bs.password'); 310 | var options = $.extend({}, Password.DEFAULTS, $this.data(), _typeof(option) === 'object' && option); 311 | if (typeof option === 'string') { 312 | if ($.inArray(option, allowedMethods) < 0) { 313 | throw new Error("Unknown method: ".concat(option)); 314 | } 315 | value = data[option](args[1]); 316 | } else if (!data) { 317 | data = new Password($this, options); 318 | $this.data('bs.password', data); 319 | } else { 320 | data.init(options); 321 | } 322 | }); 323 | return value ? value : this; 324 | }; 325 | $.fn.password.Constructor = Password; 326 | 327 | // PASSWORD NO CONFLICT 328 | // ================= 329 | 330 | $.fn.password.noConflict = function () { 331 | $.fn.password = old; 332 | return this; 333 | }; 334 | $(function () { 335 | $('[data-toggle="password"]').password(); 336 | }); 337 | 338 | })); 339 | -------------------------------------------------------------------------------- /dist/bootstrap-show-password.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bootstrap-show-password - Show/hide password plugin for twitter bootstrap. 3 | * 4 | * @version v1.3.0 5 | * @homepage https://github.com/wenzhixin/bootstrap-show-password 6 | * @author zhixin wen 7 | * @license MIT 8 | */ 9 | 10 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.find.js"),require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.array.index-of.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.parse-int.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.replace.js"),require("jquery")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.array.find.js","core-js/modules/es.array.includes.js","core-js/modules/es.array.index-of.js","core-js/modules/es.array.join.js","core-js/modules/es.function.name.js","core-js/modules/es.object.to-string.js","core-js/modules/es.parse-int.js","core-js/modules/es.regexp.exec.js","core-js/modules/es.string.replace.js","jquery"],t):t(null,null,null,null,null,null,null,null,null,null,(e="undefined"!=typeof globalThis?globalThis:e||self).jQuery)}(this,(function(e,t,s,n,o,i,r,a,l,c,u){"use strict";function p(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e,t){for(var s=0;se.length)&&(t=e.length);for(var s=0,n=new Array(t);s=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,r=!0,a=!1;return{s:function(){s=s.call(e)},n:function(){var e=s.next();return r=e.done,e},e:function(e){a=!0,i=e},f:function(){try{r||null==s.return||s.return()}finally{if(a)throw i}}}}var m=5;try{var v=u.fn.dropdown.Constructor.VERSION;void 0!==v&&(m=parseInt(v,10))}catch(e){}try{var g=bootstrap.Tooltip.VERSION;void 0!==g&&(m=parseInt(g,10))}catch(e){}var j={html:{inputGroups:{3:['',""],4:['
"],5:['"]}[m]}},b=function(e){var t=arguments,s=!0,n=1;return e=e.replace(/%s/g,(function(){var e=t[n++];return void 0===e?(s=!1,""):e})),s?e:""},w=function(){function e(t,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=s,this.$element=u(t),this.isShown=!1,this.init()}var t,s,n;return t=e,(s=[{key:"init",value:function(){var e,t;"before"===this.options.placement?(e="insertBefore",t="input-group-prepend"):(this.options.placement="after",e="insertAfter",t="input-group-append"),this.$element.wrap('
')),this.$text=u('')[e](this.$element).css("display",this.$element.css("display")).val(this.$element.val()).hide();var s,n=y(this.$element[0].attributes);try{for(n.s();!(s=n.n()).done;){var o=s.value;o.specified&&!["id","type"].includes(o.name)&&0!==o.name.indexOf("data-")&&this.$text.attr(o.name,o.value)}}catch(e){n.e(e)}finally{n.f()}this.$icon=u(["".concat(b(j.html.inputGroups[0],t,this.options.message),'\n \n ').concat(this.options.eyeClassPositionInside?this.options.eyeOpenClass:"","\n "),j.html.inputGroups[1]].join(""))[e](this.$text).css("cursor","pointer"),this.$text.off("keyup").on("keyup",u.proxy((function(){this.isShown&&this.$element.val(this.$text.val()).trigger("change")}),this)),this.$icon.off("click").on("click",u.proxy((function(){this.$text.val(this.$element.val()).trigger("change"),this.toggle()}),this))}},{key:"toggle",value:function(e){this[this.isShown?"hide":"show"](e)}},{key:"show",value:function(e){var t=u.Event("show.bs.password",{relatedTarget:e});this.$element.trigger(t),this.isShown=!0,this.$element.hide(),this.$text.show(),this.options.eyeClassPositionInside?this.$icon.find("i,svg").removeClass("icon-eye-open").addClass("icon-eye-close").html(this.options.eyeCloseClass):this.$icon.find("i,svg").removeClass("icon-eye-open ".concat(this.options.eyeOpenClass)).addClass("icon-eye-close ".concat(this.options.eyeCloseClass)),this.$text[this.options.placement](this.$element)}},{key:"hide",value:function(e){var t=u.Event("hide.bs.password",{relatedTarget:e});this.$element.trigger(t),this.isShown=!1,this.$element.show(),this.$text.hide(),this.options.eyeClassPositionInside?this.$icon.find("i,svg").removeClass("icon-eye-close").addClass("icon-eye-open").html(this.options.eyeOpenClass):this.$icon.find("i,svg").removeClass("icon-eye-close ".concat(this.options.eyeCloseClass)).addClass("icon-eye-open ".concat(this.options.eyeOpenClass)),this.$element[this.options.placement](this.$text)}},{key:"val",value:function(e){if(void 0===e)return this.$element.val();this.$element.val(e).trigger("change"),this.$text.val(e)}},{key:"focus",value:function(){this.$element.focus()}}])&&f(t.prototype,s),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();w.DEFAULTS={placement:"after",message:"Click here to show/hide password",size:void 0,eyeClass:"fa",eyeOpenClass:"fa-eye",eyeCloseClass:"fa-eye-slash",eyeClassPositionInside:!1};var C=u.fn.password;u.fn.password=function(){var e,t=arguments[0],s=arguments,n=["show","hide","toggle","val","focus"];return this.each((function(){var o=u(this),i=o.data("bs.password"),r=u.extend({},w.DEFAULTS,o.data(),"object"===d(t)&&t);if("string"==typeof t){if(u.inArray(t,n)<0)throw new Error("Unknown method: ".concat(t));e=i[t](s[1])}else i?i.init(r):(i=new w(o,r),o.data("bs.password",i))})),e||this},u.fn.password.Constructor=w,u.fn.password.noConflict=function(){return u.fn.password=C,this},u((function(){u('[data-toggle="password"]').password()}))})); 11 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | bootstrap-show-password.wenzhixin.net.cn 2 | -------------------------------------------------------------------------------- /docs/LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | Attribution 3.0 Unported 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR 10 | DAMAGES RESULTING FROM ITS USE. 11 | 12 | License 13 | 14 | THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE 15 | COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY 16 | COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS 17 | AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. 18 | 19 | BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE 20 | TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY 21 | BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS 22 | CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND 23 | CONDITIONS. 24 | 25 | 1. Definitions 26 | 27 | a. "Adaptation" means a work based upon the Work, or upon the Work and 28 | other pre-existing works, such as a translation, adaptation, 29 | derivative work, arrangement of music or other alterations of a 30 | literary or artistic work, or phonogram or performance and includes 31 | cinematographic adaptations or any other form in which the Work may be 32 | recast, transformed, or adapted including in any form recognizably 33 | derived from the original, except that a work that constitutes a 34 | Collection will not be considered an Adaptation for the purpose of 35 | this License. For the avoidance of doubt, where the Work is a musical 36 | work, performance or phonogram, the synchronization of the Work in 37 | timed-relation with a moving image ("synching") will be considered an 38 | Adaptation for the purpose of this License. 39 | b. "Collection" means a collection of literary or artistic works, such as 40 | encyclopedias and anthologies, or performances, phonograms or 41 | broadcasts, or other works or subject matter other than works listed 42 | in Section 1(f) below, which, by reason of the selection and 43 | arrangement of their contents, constitute intellectual creations, in 44 | which the Work is included in its entirety in unmodified form along 45 | with one or more other contributions, each constituting separate and 46 | independent works in themselves, which together are assembled into a 47 | collective whole. A work that constitutes a Collection will not be 48 | considered an Adaptation (as defined above) for the purposes of this 49 | License. 50 | c. "Distribute" means to make available to the public the original and 51 | copies of the Work or Adaptation, as appropriate, through sale or 52 | other transfer of ownership. 53 | d. "Licensor" means the individual, individuals, entity or entities that 54 | offer(s) the Work under the terms of this License. 55 | e. "Original Author" means, in the case of a literary or artistic work, 56 | the individual, individuals, entity or entities who created the Work 57 | or if no individual or entity can be identified, the publisher; and in 58 | addition (i) in the case of a performance the actors, singers, 59 | musicians, dancers, and other persons who act, sing, deliver, declaim, 60 | play in, interpret or otherwise perform literary or artistic works or 61 | expressions of folklore; (ii) in the case of a phonogram the producer 62 | being the person or legal entity who first fixes the sounds of a 63 | performance or other sounds; and, (iii) in the case of broadcasts, the 64 | organization that transmits the broadcast. 65 | f. "Work" means the literary and/or artistic work offered under the terms 66 | of this License including without limitation any production in the 67 | literary, scientific and artistic domain, whatever may be the mode or 68 | form of its expression including digital form, such as a book, 69 | pamphlet and other writing; a lecture, address, sermon or other work 70 | of the same nature; a dramatic or dramatico-musical work; a 71 | choreographic work or entertainment in dumb show; a musical 72 | composition with or without words; a cinematographic work to which are 73 | assimilated works expressed by a process analogous to cinematography; 74 | a work of drawing, painting, architecture, sculpture, engraving or 75 | lithography; a photographic work to which are assimilated works 76 | expressed by a process analogous to photography; a work of applied 77 | art; an illustration, map, plan, sketch or three-dimensional work 78 | relative to geography, topography, architecture or science; a 79 | performance; a broadcast; a phonogram; a compilation of data to the 80 | extent it is protected as a copyrightable work; or a work performed by 81 | a variety or circus performer to the extent it is not otherwise 82 | considered a literary or artistic work. 83 | g. "You" means an individual or entity exercising rights under this 84 | License who has not previously violated the terms of this License with 85 | respect to the Work, or who has received express permission from the 86 | Licensor to exercise rights under this License despite a previous 87 | violation. 88 | h. "Publicly Perform" means to perform public recitations of the Work and 89 | to communicate to the public those public recitations, by any means or 90 | process, including by wire or wireless means or public digital 91 | performances; to make available to the public Works in such a way that 92 | members of the public may access these Works from a place and at a 93 | place individually chosen by them; to perform the Work to the public 94 | by any means or process and the communication to the public of the 95 | performances of the Work, including by public digital performance; to 96 | broadcast and rebroadcast the Work by any means including signs, 97 | sounds or images. 98 | i. "Reproduce" means to make copies of the Work by any means including 99 | without limitation by sound or visual recordings and the right of 100 | fixation and reproducing fixations of the Work, including storage of a 101 | protected performance or phonogram in digital form or other electronic 102 | medium. 103 | 104 | 2. Fair Dealing Rights. Nothing in this License is intended to reduce, 105 | limit, or restrict any uses free from copyright or rights arising from 106 | limitations or exceptions that are provided for in connection with the 107 | copyright protection under copyright law or other applicable laws. 108 | 109 | 3. License Grant. Subject to the terms and conditions of this License, 110 | Licensor hereby grants You a worldwide, royalty-free, non-exclusive, 111 | perpetual (for the duration of the applicable copyright) license to 112 | exercise the rights in the Work as stated below: 113 | 114 | a. to Reproduce the Work, to incorporate the Work into one or more 115 | Collections, and to Reproduce the Work as incorporated in the 116 | Collections; 117 | b. to create and Reproduce Adaptations provided that any such Adaptation, 118 | including any translation in any medium, takes reasonable steps to 119 | clearly label, demarcate or otherwise identify that changes were made 120 | to the original Work. For example, a translation could be marked "The 121 | original work was translated from English to Spanish," or a 122 | modification could indicate "The original work has been modified."; 123 | c. to Distribute and Publicly Perform the Work including as incorporated 124 | in Collections; and, 125 | d. to Distribute and Publicly Perform Adaptations. 126 | e. For the avoidance of doubt: 127 | 128 | i. Non-waivable Compulsory License Schemes. In those jurisdictions in 129 | which the right to collect royalties through any statutory or 130 | compulsory licensing scheme cannot be waived, the Licensor 131 | reserves the exclusive right to collect such royalties for any 132 | exercise by You of the rights granted under this License; 133 | ii. Waivable Compulsory License Schemes. In those jurisdictions in 134 | which the right to collect royalties through any statutory or 135 | compulsory licensing scheme can be waived, the Licensor waives the 136 | exclusive right to collect such royalties for any exercise by You 137 | of the rights granted under this License; and, 138 | iii. Voluntary License Schemes. The Licensor waives the right to 139 | collect royalties, whether individually or, in the event that the 140 | Licensor is a member of a collecting society that administers 141 | voluntary licensing schemes, via that society, from any exercise 142 | by You of the rights granted under this License. 143 | 144 | The above rights may be exercised in all media and formats whether now 145 | known or hereafter devised. The above rights include the right to make 146 | such modifications as are technically necessary to exercise the rights in 147 | other media and formats. Subject to Section 8(f), all rights not expressly 148 | granted by Licensor are hereby reserved. 149 | 150 | 4. Restrictions. The license granted in Section 3 above is expressly made 151 | subject to and limited by the following restrictions: 152 | 153 | a. You may Distribute or Publicly Perform the Work only under the terms 154 | of this License. You must include a copy of, or the Uniform Resource 155 | Identifier (URI) for, this License with every copy of the Work You 156 | Distribute or Publicly Perform. You may not offer or impose any terms 157 | on the Work that restrict the terms of this License or the ability of 158 | the recipient of the Work to exercise the rights granted to that 159 | recipient under the terms of the License. You may not sublicense the 160 | Work. You must keep intact all notices that refer to this License and 161 | to the disclaimer of warranties with every copy of the Work You 162 | Distribute or Publicly Perform. When You Distribute or Publicly 163 | Perform the Work, You may not impose any effective technological 164 | measures on the Work that restrict the ability of a recipient of the 165 | Work from You to exercise the rights granted to that recipient under 166 | the terms of the License. This Section 4(a) applies to the Work as 167 | incorporated in a Collection, but this does not require the Collection 168 | apart from the Work itself to be made subject to the terms of this 169 | License. If You create a Collection, upon notice from any Licensor You 170 | must, to the extent practicable, remove from the Collection any credit 171 | as required by Section 4(b), as requested. If You create an 172 | Adaptation, upon notice from any Licensor You must, to the extent 173 | practicable, remove from the Adaptation any credit as required by 174 | Section 4(b), as requested. 175 | b. If You Distribute, or Publicly Perform the Work or any Adaptations or 176 | Collections, You must, unless a request has been made pursuant to 177 | Section 4(a), keep intact all copyright notices for the Work and 178 | provide, reasonable to the medium or means You are utilizing: (i) the 179 | name of the Original Author (or pseudonym, if applicable) if supplied, 180 | and/or if the Original Author and/or Licensor designate another party 181 | or parties (e.g., a sponsor institute, publishing entity, journal) for 182 | attribution ("Attribution Parties") in Licensor's copyright notice, 183 | terms of service or by other reasonable means, the name of such party 184 | or parties; (ii) the title of the Work if supplied; (iii) to the 185 | extent reasonably practicable, the URI, if any, that Licensor 186 | specifies to be associated with the Work, unless such URI does not 187 | refer to the copyright notice or licensing information for the Work; 188 | and (iv) , consistent with Section 3(b), in the case of an Adaptation, 189 | a credit identifying the use of the Work in the Adaptation (e.g., 190 | "French translation of the Work by Original Author," or "Screenplay 191 | based on original Work by Original Author"). The credit required by 192 | this Section 4 (b) may be implemented in any reasonable manner; 193 | provided, however, that in the case of a Adaptation or Collection, at 194 | a minimum such credit will appear, if a credit for all contributing 195 | authors of the Adaptation or Collection appears, then as part of these 196 | credits and in a manner at least as prominent as the credits for the 197 | other contributing authors. For the avoidance of doubt, You may only 198 | use the credit required by this Section for the purpose of attribution 199 | in the manner set out above and, by exercising Your rights under this 200 | License, You may not implicitly or explicitly assert or imply any 201 | connection with, sponsorship or endorsement by the Original Author, 202 | Licensor and/or Attribution Parties, as appropriate, of You or Your 203 | use of the Work, without the separate, express prior written 204 | permission of the Original Author, Licensor and/or Attribution 205 | Parties. 206 | c. Except as otherwise agreed in writing by the Licensor or as may be 207 | otherwise permitted by applicable law, if You Reproduce, Distribute or 208 | Publicly Perform the Work either by itself or as part of any 209 | Adaptations or Collections, You must not distort, mutilate, modify or 210 | take other derogatory action in relation to the Work which would be 211 | prejudicial to the Original Author's honor or reputation. Licensor 212 | agrees that in those jurisdictions (e.g. Japan), in which any exercise 213 | of the right granted in Section 3(b) of this License (the right to 214 | make Adaptations) would be deemed to be a distortion, mutilation, 215 | modification or other derogatory action prejudicial to the Original 216 | Author's honor and reputation, the Licensor will waive or not assert, 217 | as appropriate, this Section, to the fullest extent permitted by the 218 | applicable national law, to enable You to reasonably exercise Your 219 | right under Section 3(b) of this License (right to make Adaptations) 220 | but not otherwise. 221 | 222 | 5. Representations, Warranties and Disclaimer 223 | 224 | UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR 225 | OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY 226 | KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, 227 | INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, 228 | FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF 229 | LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, 230 | WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION 231 | OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 232 | 233 | 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE 234 | LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR 235 | ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES 236 | ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS 237 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 238 | 239 | 7. Termination 240 | 241 | a. This License and the rights granted hereunder will terminate 242 | automatically upon any breach by You of the terms of this License. 243 | Individuals or entities who have received Adaptations or Collections 244 | from You under this License, however, will not have their licenses 245 | terminated provided such individuals or entities remain in full 246 | compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will 247 | survive any termination of this License. 248 | b. Subject to the above terms and conditions, the license granted here is 249 | perpetual (for the duration of the applicable copyright in the Work). 250 | Notwithstanding the above, Licensor reserves the right to release the 251 | Work under different license terms or to stop distributing the Work at 252 | any time; provided, however that any such election will not serve to 253 | withdraw this License (or any other license that has been, or is 254 | required to be, granted under the terms of this License), and this 255 | License will continue in full force and effect unless terminated as 256 | stated above. 257 | 258 | 8. Miscellaneous 259 | 260 | a. Each time You Distribute or Publicly Perform the Work or a Collection, 261 | the Licensor offers to the recipient a license to the Work on the same 262 | terms and conditions as the license granted to You under this License. 263 | b. Each time You Distribute or Publicly Perform an Adaptation, Licensor 264 | offers to the recipient a license to the original Work on the same 265 | terms and conditions as the license granted to You under this License. 266 | c. If any provision of this License is invalid or unenforceable under 267 | applicable law, it shall not affect the validity or enforceability of 268 | the remainder of the terms of this License, and without further action 269 | by the parties to this agreement, such provision shall be reformed to 270 | the minimum extent necessary to make such provision valid and 271 | enforceable. 272 | d. No term or provision of this License shall be deemed waived and no 273 | breach consented to unless such waiver or consent shall be in writing 274 | and signed by the party to be charged with such waiver or consent. 275 | e. This License constitutes the entire agreement between the parties with 276 | respect to the Work licensed here. There are no understandings, 277 | agreements or representations with respect to the Work not specified 278 | here. Licensor shall not be bound by any additional provisions that 279 | may appear in any communication from You. This License may not be 280 | modified without the mutual written agreement of the Licensor and You. 281 | f. The rights granted under, and the subject matter referenced, in this 282 | License were drafted utilizing the terminology of the Berne Convention 283 | for the Protection of Literary and Artistic Works (as amended on 284 | September 28, 1979), the Rome Convention of 1961, the WIPO Copyright 285 | Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 286 | and the Universal Copyright Convention (as revised on July 24, 1971). 287 | These rights and subject matter take effect in the relevant 288 | jurisdiction in which the License terms are sought to be enforced 289 | according to the corresponding provisions of the implementation of 290 | those treaty provisions in the applicable national law. If the 291 | standard suite of rights granted under applicable copyright law 292 | includes additional rights not granted under this License, such 293 | additional rights are deemed to be included in the License; this 294 | License is not intended to restrict the license of any rights under 295 | applicable law. 296 | 297 | 298 | Creative Commons Notice 299 | 300 | Creative Commons is not a party to this License, and makes no warranty 301 | whatsoever in connection with the Work. Creative Commons will not be 302 | liable to You or any party on any legal theory for any damages 303 | whatsoever, including without limitation any general, special, 304 | incidental or consequential damages arising in connection to this 305 | license. Notwithstanding the foregoing two (2) sentences, if Creative 306 | Commons has expressly identified itself as the Licensor hereunder, it 307 | shall have all rights and obligations of Licensor. 308 | 309 | Except for the limited purpose of indicating to the public that the 310 | Work is licensed under the CCPL, Creative Commons does not authorize 311 | the use by either party of the trademark "Creative Commons" or any 312 | related trademark or logo of Creative Commons without the prior 313 | written consent of Creative Commons. Any permitted use will be in 314 | compliance with Creative Commons' then-current trademark usage 315 | guidelines, as may be published on its website or otherwise made 316 | available upon request from time to time. For the avoidance of doubt, 317 | this trademark restriction does not form part of this License. 318 | 319 | Creative Commons may be contacted at http://creativecommons.org/. -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | Bootstrap Show Password's documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com/) and publicly hosted on http://bootstrap-show-password.wenzhixin.net.cn. The docs may also be run locally. 4 | 5 | ## Running documentation locally 6 | 7 | 1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) (requires v2.5.x). 8 | - **Windows users:** Read [this unofficial](http://jekyll-windows.juthilo.com/) guide to get Jekyll up and running without problems. 9 | 10 | 2. Install the Ruby-based syntax highlighter, [Rouge](https://github.com/jneen/rouge), with `gem install rouge`. 11 | 3. From the root / directory, run `jekyll serve` in the command line. 12 | 4. Open http://localhost:4000 in your browser, and voilà. 13 | -------------------------------------------------------------------------------- /docs/_i18n/en.yml: -------------------------------------------------------------------------------- 1 | pages: 2 | home: 3 | title: "Bootstrap Show Password" 4 | lead: "Bootstrap Show Password is a show/hide password plugin." 5 | sub_title: "Designed for twitter bootstrap" 6 | sub_lead: "Bootstrap Show Password has been designed to reduce development time and to require no specific knowledge from developers. It is both featherweight and feature-rich." 7 | download: "Download" 8 | current_version: "Current version:" 9 | getting_started: 10 | title: "Getting started" 11 | lead: "An overview of Bootstrap Show Password, how to download and use, basic templates, and more." 12 | examples: 13 | title: "Examples" 14 | lead: "The examples of Bootstrap Show Password." 15 | documentation: 16 | title: "Documentation" 17 | lead: "The documentation contains Constructor, Events, Methods." 18 | donate: 19 | title: "Donate" 20 | lead: "If you like Bootstrap Show Password, if your project uses Bootstrap Show Password, if you want Bootstrap Show Password do better..." 21 | common: 22 | social_tip: "If you like Bootstrap Show Password: " 23 | help: "Questions/Helps: " 24 | -------------------------------------------------------------------------------- /docs/_i18n/en/documentation/events.md: -------------------------------------------------------------------------------- 1 | # Events []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/documentation/events.md) 2 | 3 | --- 4 | 5 | To use event syntax: 6 | 7 | ```js 8 | $('#password').on('show.bs.password', function (e) { 9 | // code here 10 | }) 11 | ``` 12 | 13 |
14 | 15 | | Event Type | Description | 16 | |------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 17 | | show.bs.password | This event fires immediately when the show instance method is called. If caused by a click, the clicked element is available as the relatedTarget property of the event. | 18 | | hide.bs.password | This event is fired immediately when the hide instance method has been called. | 19 | -------------------------------------------------------------------------------- /docs/_i18n/en/documentation/methods.md: -------------------------------------------------------------------------------- 1 | # Methods []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/documentation/methods.md) 2 | 3 | --- 4 | 5 | The calling method syntax: `$('#password').password('method', parameter)`. 6 | 7 |
8 | 9 | | Name | Parameter | Description | 10 | |--------|-----------|---------------------------------------------------------------------| 11 | | show | - | Manually show the password. | 12 | | hide | - | Manually hide the password. | 13 | | toggle | - | Manually toggle the password. | 14 | | val | [value] | Get the current value of the password or set the value of password. | 15 | | focus | - | Focus the password input. | 16 | -------------------------------------------------------------------------------- /docs/_i18n/en/documentation/options.md: -------------------------------------------------------------------------------- 1 | # Options []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/documentation/options.md) 2 | 3 | --- 4 | 5 | The Options are defined in `jQuery.fn.password.defaults`. 6 | 7 |
8 | 9 | | Name | Attribute | Type | Default | Description | 10 | |------------------------|--------------------------------|---------|------------------------------------|-----------------------------------------------------------------------------------------| 11 | | - | data-toggle | String | 'password' | Active password without writing JavaScript. | 12 | | placement | data-placement | String | 'after' | The placement of show/hide icon, can be 'before' or 'after'. | 13 | | message | data-message | String | 'Click here to show/hide password' | The tooltip of show/hide icon. | 14 | | size | data-size | String | undefined | The size of the input group. | 15 | | eyeClass | data-eye-class | String | 'fa' | Base eye icon class. | 16 | | eyeOpenClass | data-eye-open-class | String | 'fa-eye' | Open eye icon class. | 17 | | eyeCloseClass | data-eye-close-class | String | 'fa-eye-slash' | Close eye icon class. | 18 | | eyeClassPositionInside | data-eye-class-position-inside | Boolean | false | Puts the open/close class inside the ``. Use this option with google material icons. | 19 | -------------------------------------------------------------------------------- /docs/_i18n/en/donate.md: -------------------------------------------------------------------------------- 1 | Bootstrap Show Password is a free plug-in which be made in my spare time. 2 | 3 | If your project get the help from Bootstrap Show Password, you can donate to Bootstrap Show Password. 4 | 5 | With your help, I believe that I will continue to strive to let Bootstrap Show Password be better. 6 | -------------------------------------------------------------------------------- /docs/_i18n/en/footer.html: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /docs/_i18n/en/getting-started/download.md: -------------------------------------------------------------------------------- 1 | # Download []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/getting-started/download.md) 2 | 3 | --- 4 | 5 |

6 | Bootstrap Show Password (currently v{{ site.current_version }}) has a few easy ways to quickly get started, each one appealing to a different skill level and use case. Read through to see what suits your particular needs. 7 |

8 | 9 | ## Source code 10 | 11 | Source JavaScript, along with our docs. 12 | 13 | Download source 14 | 15 | ## Clone or fork via GitHub 16 | 17 | Via GitHub 18 | 19 | ## CDN 20 | 21 | The folks over at [UNPKG](https://unpkg.com/) graciously provide CDN support for CSS and JavaScript of Bootstrap Show Password. Just use these CDN links. 22 | 23 | ```html 24 | 25 | 26 | ``` 27 | 28 | ## NPM 29 | 30 | Install and manage Bootstrap Show Password's CSS, JavaScript using [NPM](http://npmjs.com). 31 | 32 | ```bash 33 | $ npm install bootstrap-show-password 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/_i18n/en/getting-started/usage.md: -------------------------------------------------------------------------------- 1 | # Usage []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/getting-started/usage.md) 2 | 3 | --- 4 | 5 | Include jQuery library, bootstrap library (if your project doesn't use it already) and `bootstrap-show-password.js` in the head tag or at the very bottom of your document, just before the closing body tag (usually recommended for better performance). 6 | 7 | ```html 8 | 9 | 10 | 11 | ``` 12 | 13 | --- 14 | 15 | The plugin acts on `` elements (typically password fields). 16 | 17 | ## Via data attributes 18 | 19 | Activate Bootstrap Show Password without writing JavaScript. Set `data-toggle="password"` on a normal input. 20 | 21 | ```html 22 | 23 | ``` 24 | ## Via JavaScript 25 | 26 | Call a Bootstrap Show Password with id select with JavaScript. 27 | 28 | ```html 29 | 30 | ``` 31 | 32 | ```js 33 | $('#password').password() 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/_i18n/en/getting-started/whats-include.md: -------------------------------------------------------------------------------- 1 | # What's included []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/getting-started/whats-include.md) 2 | 3 | --- 4 | 5 | The Multiple Select source code download includes the precompiled CSS, JavaScript, and provides both compiled and minified variations, along with documentation. More specifically, it includes the following and more: 6 | 7 | ```bash 8 | bootstrap-show-password/ 9 | ├── docs/ 10 | ├── bootstrap-show-password.js 11 | └── bootstrap-show-password.min.js 12 | ``` 13 | 14 | The `src/`, are the source code for our CSS, JS. The `dist/` folder includes everything compiled and minified with `src/`. The `docs/` folder includes the source code for our documentation. Beyond that, any other included file provides support for packages, license information, and development. 15 | -------------------------------------------------------------------------------- /docs/_i18n/en/home/feature.md: -------------------------------------------------------------------------------- 1 | ### Features 2 | 3 | * Show/Hide password for a normal input element 4 | * Support all bootstrap version 5 | * Set placement of icon 6 | * Custom icons 7 | * Options can be passed via data attributes or JavaScript 8 | -------------------------------------------------------------------------------- /docs/_i18n/sp.yml: -------------------------------------------------------------------------------- 1 | pages: 2 | home: 3 | title: "Bootstrap Show Password" 4 | lead: "Bootstrap Show Password es un módulo para mostrar/ocultar contraseñas." 5 | sub_title: "Diseñada para ser usada con el proyecto Bootstrap de Twitter" 6 | sub_lead: "Bootstrap Mostrar contraseña ha sido diseñado para reducir el tiempo de desarrollo y no requiere de conocimientos específicos de parte de sus desarrolladores. Es liviano y rico en funciones." 7 | download: "Descargar" 8 | current_version: "Versión actual:" 9 | getting_started: 10 | title: "Empezando" 11 | lead: "Una descripción general de Bootstrap Show Password, cómo descargar y usarlo, plantillas básicas y más." 12 | examples: 13 | title: "Ejemplos" 14 | lead: "Los ejemplos de Bootstrap Show Password." 15 | documentation: 16 | title: "Documentación" 17 | lead: "La documentación contiene el Constructor, Eventos, Métodos." 18 | donate: 19 | title: "Donar" 20 | lead: "Si le gusta Bootstrap Show Password, si su proyecto usa Bootstrap Show Password, si desea que Bootstrap Show Password mejore..." 21 | common: 22 | social_tip: "Si le gusta Bootstrap Show Password: " 23 | help: "Preguntas/Ayudas: " 24 | -------------------------------------------------------------------------------- /docs/_includes/ads.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /docs/_includes/example-list.md: -------------------------------------------------------------------------------- 1 |
  • The Basic
  • 2 |
  • The Disabled
  • 3 |
  • The Placement
  • 4 |
  • The Message
  • 5 |
  • The Size
  • 6 |
  • Custom Eye Class
  • 7 |
  • Material Icons
  • 8 |
  • The Events
  • 9 |
  • The Methods
  • 10 |
  • Bootstrap v3
  • 11 |
  • Font Awesome SVG
  • 12 | -------------------------------------------------------------------------------- /docs/_includes/footer.html: -------------------------------------------------------------------------------- 1 | 3 | {% if page.layout != "examples" %} 4 | {% tf footer.html %} 5 | {% endif %} 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/_includes/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {% if page.layout == "home" %} 10 | {% t page.title %} 11 | {% else %} 12 | {% t page.title %} · Bootstrap Show Password 13 | {% endif %} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /docs/_includes/latest-release.md: -------------------------------------------------------------------------------- 1 | ### Latest release (2024-02-18) 2 | 3 | ### 1.3.0 4 | 5 | - **New:** Supported bootstrap v5. 6 | - **New:** Supported all attributes without `data-*`. 7 | - **Update:** Fix bootstrap v3 old version is `undefined` bug. 8 | 9 | ### 1.2.1 10 | 11 | - **New:** Added font-awesome svg support. 12 | - **New:** Added `size` option of the input group. 13 | 14 | ### 1.2.0 15 | 16 | - **New:** Rewrote the src to ES6. 17 | - **New:** Supported bootstrap v4. 18 | - **New:** Use Font Awesome v5 as default. 19 | - **New:** Supported `maxlength` attribute. 20 | - **New:** Supported `disabled` attribute. 21 | - **New:** Updated the docs and added examples. 22 | -------------------------------------------------------------------------------- /docs/_includes/nav.html: -------------------------------------------------------------------------------- 1 | 58 | -------------------------------------------------------------------------------- /docs/_includes/social-buttons.html: -------------------------------------------------------------------------------- 1 |
    2 | {% t common.social_tip %} 3 |
      4 |
    • 5 | 8 |
    • 9 |
    • 10 | 13 |
    • 14 |
    • 15 | 17 |
    • 18 |
    19 | {% t common.help %} 20 | 25 |
    26 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% include header.html %} 6 | 7 | 8 | Skip to main content 9 | 10 | 11 | {% include nav.html %} 12 | 13 | 14 |
    15 |
    16 |
    17 |
    18 |

    {% t page.title %}

    19 |
    {% t page.lead %}
    20 |
    21 |
    22 | {% include ads.html %} 23 |
    24 |
    25 |
    26 |
    27 | 28 | {% include social-buttons.html %} 29 | 30 |
    31 | 32 |
    33 | 34 |
    35 |
    42 | {{ content }} 43 |
    44 | {% unless page.fullwidth == true %} 45 |
    46 |
    47 |
    48 | {% endunless %} 49 |
    50 |
    51 | 52 | {% include footer.html %} 53 | 54 | 55 | -------------------------------------------------------------------------------- /docs/_layouts/examples.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% include header.html %} 6 | 7 | 8 | 9 | Skip to main content 10 | 11 | 12 | {% include nav.html %} 13 | 14 | {{ content }} 15 | 16 | {% include footer.html %} 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/_layouts/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% include header.html %} 6 | 7 | 8 | Skip to main content 9 | 10 | 11 | {% include nav.html %} 12 | 13 | 14 | {{ content }} 15 | 16 | {% include footer.html %} 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/assets/css/ads.css: -------------------------------------------------------------------------------- 1 | #carbonads { 2 | border: none!important; 3 | border-radius: 4px; 4 | width: 330px!important; 5 | height: auto!important; 6 | padding: 15px!important; 7 | overflow: hidden; 8 | margin-bottom: 10px 9 | } 10 | 11 | .carbon-text,.carbon-poweredby { 12 | display: block!important; 13 | margin-left: 145px!important; 14 | font-size: 13px!important; 15 | line-height: 16px!important; 16 | color: #333 !important; 17 | } 18 | 19 | .bs-docs-header .carbon-text, 20 | .bs-docs-header .carbon-poweredby { 21 | color: #cdbfe3 !important; 22 | } 23 | 24 | .carbon-poweredby { 25 | margin-top: 10px; 26 | } 27 | 28 | .carbon-img>img { 29 | float: left; 30 | display: block; 31 | width: 130px; 32 | height: 100px 33 | } 34 | 35 | .bs-docs-header .ea-content { 36 | background-color: #fff !important; 37 | } 38 | -------------------------------------------------------------------------------- /docs/assets/css/docs.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Docs (http://getbootstrap.com) 3 | * Copyright 2011-2014 Twitter, Inc. 4 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 5 | * details, see http://creativecommons.org/licenses/by/3.0/. 6 | */body{position:relative}.table code{font-size:13px;font-weight:400}.btn-outline{color:#563d7c;background-color:transparent;border-color:#563d7c}.btn-outline:hover,.btn-outline:focus,.btn-outline:active{color:#fff;background-color:#563d7c;border-color:#563d7c}.btn-outline-inverse{color:#fff;background-color:transparent;border-color:#cdbfe3}.btn-outline-inverse:hover,.btn-outline-inverse:focus,.btn-outline-inverse:active{color:#563d7c;text-shadow:none;background-color:#fff;border-color:#fff}.bs-docs-booticon{display:block;font-weight:500;color:#fff;text-align:center;cursor:default;background-color:#563d7c;border-radius:15%}.bs-docs-booticon-sm{width:30px;height:30px;font-size:20px;line-height:28px}.bs-docs-booticon-lg{width:144px;height:144px;font-size:108px;line-height:140px}.bs-docs-booticon-inverse{color:#563d7c;background-color:#fff}.bs-docs-booticon-outline{background-color:transparent;border:1px solid #cdbfe3}.bs-docs-nav{margin-bottom:0;background-color:#fff;border-bottom:0}.bs-home-nav .bs-nav-b{display:none}.bs-docs-nav .navbar-brand,.bs-docs-nav .navbar-nav>li>a{font-weight:500;color:#563d7c}.bs-docs-nav .navbar-nav>li>a:hover,.bs-docs-nav .navbar-nav>.active>a,.bs-docs-nav .navbar-nav>.active>a:hover{color:#463265;background-color:#f9f9f9}.bs-docs-nav .navbar-toggle .icon-bar{background-color:#563d7c}.bs-docs-nav .navbar-header .navbar-toggle{border-color:#fff}.bs-docs-nav .navbar-header .navbar-toggle:hover,.bs-docs-nav .navbar-header .navbar-toggle:focus{background-color:#f9f9f9;border-color:#f9f9f9}.bs-docs-footer{padding-top:40px;padding-bottom:40px;margin-top:100px;color:#777;text-align:center;border-top:1px solid #e5e5e5}.bs-docs-footer-links{padding-left:0;margin-top:20px;color:#999}.bs-docs-footer-links li{display:inline;padding:0 2px}.bs-docs-footer-links li:first-child{padding-left:0}@media (min-width:768px){.bs-docs-footer p{margin-bottom:0}}.bs-docs-social{margin-bottom:20px;text-align:center}.bs-docs-social-buttons{display:inline-block;padding-left:0;margin-bottom:0;list-style:none}.bs-docs-social-buttons li{display:inline-block;padding:5px 8px;line-height:1}.bs-docs-social-buttons .twitter-follow-button{width:225px!important}.bs-docs-social-buttons .twitter-share-button{width:98px!important}.github-btn{overflow:hidden;border:0}.bs-docs-masthead,.bs-docs-header{position:relative;padding:30px 15px;color:#cdbfe3;text-align:center;text-shadow:0 1px 0 rgba(0,0,0,.1);background-color:#6f5499;background-image:-webkit-gradient(linear,left top,left bottom,from(#563d7c),to(#6f5499));background-image:-webkit-linear-gradient(top,#563d7c 0,#6f5499 100%);background-image:-o-linear-gradient(top,#563d7c 0,#6f5499 100%);background-image:linear-gradient(to bottom,#563d7c 0,#6f5499 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);background-repeat:repeat-x}.bs-docs-masthead .bs-docs-booticon{margin:0 auto 30px}.bs-docs-masthead h1{font-weight:300;line-height:1;color:#fff}.bs-docs-masthead .lead{margin:0 auto 30px;font-size:20px;color:#fff}.bs-docs-masthead .version{margin-top:-15px;margin-bottom:30px;color:#9783b9}.bs-docs-masthead .btn{width:100%;padding:15px 30px;font-size:20px}@media (min-width:480px){.bs-docs-masthead .btn{width:auto}}@media (min-width:768px){.bs-docs-masthead{padding:80px 0}.bs-docs-masthead h1{font-size:60px}.bs-docs-masthead .lead{font-size:24px}}@media (min-width:992px){.bs-docs-masthead .lead{width:80%;font-size:30px}}.bs-docs-header{margin-bottom:40px;font-size:20px}.bs-docs-header h1{margin-top:0;color:#fff}.bs-docs-header p{margin-bottom:0;font-weight:300;line-height:1.4}.bs-docs-header .container{position:relative}@media (min-width:768px){.bs-docs-header{padding-top:60px;padding-bottom:60px;font-size:24px;text-align:left}.bs-docs-header h1{font-size:60px;line-height:1}}@media (min-width:992px){.bs-docs-header h1,.bs-docs-header p{margin-right:380px}}.carbonad{width:auto!important;height:auto!important;padding:20px!important;margin:30px -30px -31px!important;overflow:hidden;font-size:13px!important;line-height:16px!important;text-align:left;background:transparent!important;border:solid #866ab3!important;border-width:1px 0!important}.carbonad-img{margin:0!important}.carbonad-text,.carbonad-tag{display:block!important;float:none!important;width:auto!important;height:auto!important;margin-left:145px!important;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif!important}.carbonad-text{padding-top:0!important}.carbonad-tag{color:inherit!important;text-align:left!important}.carbonad-text a,.carbonad-tag a{color:#fff!important}.carbonad #azcarbon>img{display:none}@media (min-width:480px){.carbonad{width:330px!important;margin:20px auto!important;border-width:1px!important;border-radius:4px}.bs-docs-masthead .carbonad{margin:50px auto 0!important}}@media (min-width:768px){.carbonad{margin-right:0!important;margin-left:0!important}}@media (min-width:992px){.carbonad{position:absolute;top:0;right:15px;width:330px!important;padding:15px!important;margin:0!important}.bs-docs-masthead .carbonad{position:static}}.bs-docs-featurette{padding-top:40px;padding-bottom:40px;font-size:16px;line-height:1.5;color:#555;text-align:center;background-color:#fff;border-bottom:1px solid #e5e5e5}.bs-docs-featurette+.bs-docs-footer{margin-top:0;border-top:0}.bs-docs-featurette-title{margin-bottom:5px;font-size:30px;font-weight:400;color:#333}.half-rule{width:100px;margin:40px auto}.bs-docs-featurette h3{margin-bottom:5px;font-weight:400;color:#333}.bs-docs-featurette-img{display:block;margin-bottom:20px;color:#333}.bs-docs-featurette-img:hover{color:#428bca;text-decoration:none}.bs-docs-featurette-img img{display:block;margin-bottom:15px}@media (min-width:480px){.bs-docs-featurette .img-responsive{margin-top:30px}}@media (min-width:768px){.bs-docs-featurette{padding-top:100px;padding-bottom:100px}.bs-docs-featurette-title{font-size:40px}.bs-docs-featurette .lead{max-width:80%;margin-right:auto;margin-left:auto}.bs-docs-featurette .img-responsive{margin-top:0}}.bs-docs-featured-sites{margin-right:-1px;margin-left:-1px}.bs-docs-featured-sites .col-xs-6{padding:1px}.bs-docs-featured-sites .img-responsive{margin-top:0}@media (min-width:768px){.bs-docs-featured-sites .col-sm-3:first-child img{border-top-left-radius:4px;border-bottom-left-radius:4px}.bs-docs-featured-sites .col-sm-3:last-child img{border-top-right-radius:4px;border-bottom-right-radius:4px}}.bs-examples .thumbnail{margin-bottom:10px}.bs-examples h4{margin-bottom:5px}.bs-examples p{margin-bottom:20px}@media (max-width:480px){.bs-examples{margin-right:-10px;margin-left:-10px}.bs-examples>[class^=col-]{padding-right:10px;padding-left:10px}}.bs-docs-sidebar.affix{position:static}@media (min-width:768px){.bs-docs-sidebar{padding-left:20px}}.bs-docs-sidenav{margin-top:20px;margin-bottom:20px}.bs-docs-sidebar .nav>li>a{display:block;padding:4px 20px;font-size:13px;font-weight:500;color:#999}.bs-docs-sidebar .nav>li>a:hover,.bs-docs-sidebar .nav>li>a:focus{padding-left:19px;color:#563d7c;text-decoration:none;background-color:transparent;border-left:1px solid #563d7c}.bs-docs-sidebar .nav>.active>a,.bs-docs-sidebar .nav>.active:hover>a,.bs-docs-sidebar .nav>.active:focus>a{padding-left:18px;font-weight:700;color:#563d7c;background-color:transparent;border-left:2px solid #563d7c}.bs-docs-sidebar .nav .nav{display:none;padding-bottom:10px}.bs-docs-sidebar .nav .nav>li>a{padding-top:1px;padding-bottom:1px;padding-left:30px;font-size:12px;font-weight:400}.bs-docs-sidebar .nav .nav>li>a:hover,.bs-docs-sidebar .nav .nav>li>a:focus{padding-left:29px}.bs-docs-sidebar .nav .nav>.active>a,.bs-docs-sidebar .nav .nav>.active:hover>a,.bs-docs-sidebar .nav .nav>.active:focus>a{padding-left:28px;font-weight:500}.back-to-top,.bs-docs-theme-toggle{display:none;padding:4px 10px;margin-top:10px;margin-left:10px;font-size:12px;font-weight:500;color:#999}.back-to-top:hover,.bs-docs-theme-toggle:hover{color:#563d7c;text-decoration:none}.bs-docs-theme-toggle{margin-top:0}@media (min-width:768px){.back-to-top,.bs-docs-theme-toggle{display:block}}@media (min-width:992px){.bs-docs-sidebar .nav>.active>ul{display:block}.bs-docs-sidebar.affix,.bs-docs-sidebar.affix-bottom{width:213px}.bs-docs-sidebar.affix{position:fixed;top:20px}.bs-docs-sidebar.affix-bottom{position:absolute}.bs-docs-sidebar.affix-bottom .bs-docs-sidenav,.bs-docs-sidebar.affix .bs-docs-sidenav{margin-top:0;margin-bottom:0}}@media (min-width:1200px){.bs-docs-sidebar.affix-bottom,.bs-docs-sidebar.affix{width:263px}}.bs-docs-section{margin-bottom:60px}.bs-docs-section:last-child{margin-bottom:0}h1[id]{padding-top:20px;margin-top:0}.bs-callout{padding:20px;margin:20px 0;border:1px solid #eee;border-left-width:5px;border-radius:3px}.bs-callout h4{margin-top:0;margin-bottom:5px}.bs-callout p:last-child{margin-bottom:0}.bs-callout code{border-radius:3px}.bs-callout+.bs-callout{margin-top:-5px}.bs-callout-danger{border-left-color:#d9534f}.bs-callout-danger h4{color:#d9534f}.bs-callout-warning{border-left-color:#f0ad4e}.bs-callout-warning h4{color:#f0ad4e}.bs-callout-info{border-left-color:#5bc0de}.bs-callout-info h4{color:#5bc0de}.color-swatches{margin:0 -5px;overflow:hidden}.color-swatch{float:left;width:60px;height:60px;margin:0 5px;border-radius:3px}@media (min-width:768px){.color-swatch{width:100px;height:100px}}.color-swatches .gray-darker{background-color:#222}.color-swatches .gray-dark{background-color:#333}.color-swatches .gray{background-color:#555}.color-swatches .gray-light{background-color:#999}.color-swatches .gray-lighter{background-color:#eee}.color-swatches .brand-primary{background-color:#428bca}.color-swatches .brand-success{background-color:#5cb85c}.color-swatches .brand-warning{background-color:#f0ad4e}.color-swatches .brand-danger{background-color:#d9534f}.color-swatches .brand-info{background-color:#5bc0de}.color-swatches .bs-purple{background-color:#563d7c}.color-swatches .bs-purple-light{background-color:#c7bfd3}.color-swatches .bs-purple-lighter{background-color:#e5e1ea}.color-swatches .bs-gray{background-color:#f9f9f9}.bs-team .team-member{line-height:32px;color:#555}.bs-team .team-member:hover{color:#333;text-decoration:none}.bs-team .github-btn{float:right;width:180px;height:20px;margin-top:6px}.bs-team img{float:left;width:32px;margin-right:10px;border-radius:4px}.bs-docs-browser-bugs td p{margin-bottom:0}.bs-docs-browser-bugs th:first-child{width:18%}.show-grid{margin-bottom:15px}.show-grid [class^=col-]{padding-top:10px;padding-bottom:10px;background-color:#eee;background-color:rgba(86,61,124,.15);border:1px solid #ddd;border:1px solid rgba(86,61,124,.2)}.bs-example{position:relative;padding:45px 15px 15px;margin:0 -15px 15px;border-color:#e5e5e5 #eee #eee;border-style:solid;border-width:1px 0;-webkit-box-shadow:inset 0 3px 6px rgba(0,0,0,.05);box-shadow:inset 0 3px 6px rgba(0,0,0,.05)}.bs-example:after{position:absolute;top:15px;left:15px;font-size:12px;font-weight:700;color:#959595;text-transform:uppercase;letter-spacing:1px;content:"Example"}.bs-example+.highlight,.bs-example+.zero-clipboard+.highlight{margin:-15px -15px 15px;border-width:0 0 1px;border-radius:0}@media (min-width:768px){.bs-example{margin-right:0;margin-left:0;background-color:#fff;border-color:#ddd;border-width:1px;border-radius:4px 4px 0 0;-webkit-box-shadow:none;box-shadow:none}.bs-example+.highlight,.bs-example+.zero-clipboard+.highlight{margin-top:-16px;margin-right:0;margin-left:0;border-width:1px;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.bs-example-standalone{border-radius:4px}}.bs-example .container{width:auto}.bs-example>p:last-child,.bs-example>ul:last-child,.bs-example>ol:last-child,.bs-example>blockquote:last-child,.bs-example>.form-control:last-child,.bs-example>.table:last-child,.bs-example>.navbar:last-child,.bs-example>.jumbotron:last-child,.bs-example>.alert:last-child,.bs-example>.panel:last-child,.bs-example>.list-group:last-child,.bs-example>.well:last-child,.bs-example>.progress:last-child,.bs-example>.table-responsive:last-child>.table{margin-bottom:0}.bs-example>p>.close{float:none}.bs-example-type .table .type-info{color:#999;vertical-align:middle}.bs-example-type .table td{padding:15px 0;border-color:#eee}.bs-example-type .table tr:first-child td{border-top:0}.bs-example-type h1,.bs-example-type h2,.bs-example-type h3,.bs-example-type h4,.bs-example-type h5,.bs-example-type h6{margin:0}.bs-example-bg-classes p{padding:15px}.bs-example>.img-circle,.bs-example>.img-rounded,.bs-example>.img-thumbnail{margin:5px}.bs-example>.table-responsive>.table{background-color:#fff}.bs-example>.btn,.bs-example>.btn-group{margin-top:5px;margin-bottom:5px}.bs-example>.btn-toolbar+.btn-toolbar{margin-top:10px}.bs-example-control-sizing select,.bs-example-control-sizing input[type=text]+input[type=text]{margin-top:10px}.bs-example-form .input-group{margin-bottom:10px}.bs-example>textarea.form-control{resize:vertical}.bs-example>.list-group{max-width:400px}.bs-example .navbar:last-child{margin-bottom:0}.bs-navbar-top-example,.bs-navbar-bottom-example{z-index:1;padding:0;overflow:hidden}.bs-navbar-top-example .navbar-header,.bs-navbar-bottom-example .navbar-header{margin-left:0}.bs-navbar-top-example .navbar-fixed-top,.bs-navbar-bottom-example .navbar-fixed-bottom{position:relative;margin-right:0;margin-left:0}.bs-navbar-top-example{padding-bottom:45px}.bs-navbar-top-example:after{top:auto;bottom:15px}.bs-navbar-top-example .navbar-fixed-top{top:-1px}.bs-navbar-bottom-example{padding-top:45px}.bs-navbar-bottom-example .navbar-fixed-bottom{bottom:-1px}.bs-navbar-bottom-example .navbar{margin-bottom:0}@media (min-width:768px){.bs-navbar-top-example .navbar-fixed-top,.bs-navbar-bottom-example .navbar-fixed-bottom{position:absolute}}.bs-example .pagination{margin-top:10px;margin-bottom:10px}.bs-example>.pager{margin-top:0}.bs-example-modal{background-color:#f5f5f5}.bs-example-modal .modal{position:relative;top:auto;right:auto;bottom:auto;left:auto;z-index:1;display:block}.bs-example-modal .modal-dialog{left:auto;margin-right:auto;margin-left:auto}.bs-example>.dropdown>.dropdown-toggle{float:left}.bs-example>.dropdown>.dropdown-menu{position:static;display:block;margin-bottom:5px;clear:left}.bs-example-tabs .nav-tabs{margin-bottom:15px}.bs-example-tooltips{text-align:center}.bs-example-tooltips>.btn{margin-top:5px;margin-bottom:5px}.bs-example-tooltip .tooltip{position:relative;display:inline-block;margin:10px 20px;opacity:1}.bs-example-popover{padding-bottom:24px;background-color:#f9f9f9}.bs-example-popover .popover{position:relative;display:block;float:left;width:260px;margin:20px}.scrollspy-example{position:relative;height:200px;margin-top:10px;overflow:auto}.highlight{padding:9px 14px;margin-bottom:14px;background-color:#f7f7f9;border:1px solid #e1e1e8;border-radius:4px}.highlight pre{padding:0;margin-top:0;margin-bottom:0;word-break:normal;white-space:nowrap;background-color:transparent;border:0}.highlight pre code{font-size:inherit;color:#333}.highlight pre code:first-child{display:inline-block;padding-right:45px}.table-responsive .highlight pre{white-space:normal}.bs-table th small,.responsive-utilities th small{display:block;font-weight:400;color:#999}.responsive-utilities tbody th{font-weight:400}.responsive-utilities td{text-align:center}.responsive-utilities td.is-visible{color:#468847;background-color:#dff0d8!important}.responsive-utilities td.is-hidden{color:#ccc;background-color:#f9f9f9!important}.responsive-utilities-test{margin-top:5px}.responsive-utilities-test .col-xs-6{margin-bottom:10px}.responsive-utilities-test span{display:block;padding:15px 10px;font-size:14px;font-weight:700;line-height:1.1;text-align:center;border-radius:4px}.visible-on .col-xs-6 .hidden-xs,.visible-on .col-xs-6 .hidden-sm,.visible-on .col-xs-6 .hidden-md,.visible-on .col-xs-6 .hidden-lg,.hidden-on .col-xs-6 .hidden-xs,.hidden-on .col-xs-6 .hidden-sm,.hidden-on .col-xs-6 .hidden-md,.hidden-on .col-xs-6 .hidden-lg{color:#999;border:1px solid #ddd}.visible-on .col-xs-6 .visible-xs-block,.visible-on .col-xs-6 .visible-sm-block,.visible-on .col-xs-6 .visible-md-block,.visible-on .col-xs-6 .visible-lg-block,.hidden-on .col-xs-6 .visible-xs-block,.hidden-on .col-xs-6 .visible-sm-block,.hidden-on .col-xs-6 .visible-md-block,.hidden-on .col-xs-6 .visible-lg-block{color:#468847;background-color:#dff0d8;border:1px solid #d6e9c6}.bs-glyphicons{margin:0 -10px 20px;overflow:hidden}.bs-glyphicons-list{padding-left:0;list-style:none}.bs-glyphicons li{float:left;width:25%;height:115px;padding:10px;font-size:10px;line-height:1.4;text-align:center;background-color:#f9f9f9;border:1px solid #fff}.bs-glyphicons .glyphicon{margin-top:5px;margin-bottom:10px;font-size:24px}.bs-glyphicons .glyphicon-class{display:block;text-align:center;word-wrap:break-word}.bs-glyphicons li:hover{color:#fff;background-color:#563d7c}@media (min-width:768px){.bs-glyphicons{margin-right:0;margin-left:0}.bs-glyphicons li{width:12.5%;font-size:12px}}.bs-customizer .toggle{float:right;margin-top:25px}.bs-customizer label{margin-top:10px;font-weight:500;color:#555}.bs-customizer h2{padding-top:30px;margin-top:0;margin-bottom:5px}.bs-customizer h3{margin-bottom:0}.bs-customizer h4{margin-top:15px;margin-bottom:0}.bs-customizer .bs-callout h4{margin-top:0;margin-bottom:5px}.bs-customizer input[type=text]{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;background-color:#fafafa}.bs-customizer .help-block{margin-bottom:5px;font-size:12px}#less-section label{font-weight:400}.bs-customize-download .btn-outline{padding:20px}.bs-customizer-alert{position:fixed;top:0;right:0;left:0;z-index:1030;padding:15px 0;color:#fff;background-color:#d9534f;border-bottom:1px solid #b94441;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25);box-shadow:inset 0 1px 0 rgba(255,255,255,.25)}.bs-customizer-alert .close{margin-top:-4px;font-size:24px}.bs-customizer-alert p{margin-bottom:0}.bs-customizer-alert .glyphicon{margin-right:5px}.bs-customizer-alert pre{margin:10px 0 0;color:#fff;background-color:#a83c3a;border-color:#973634;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 2px 4px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}.bs-dropzone{position:relative;padding:20px;margin-bottom:20px;color:#777;text-align:center;border:2px dashed #eee;border-radius:4px}.bs-dropzone h2{margin-top:0;margin-bottom:5px}.bs-dropzone hr{width:100px}.bs-dropzone .lead{margin-bottom:10px;font-weight:400;color:#333}#import-manual-trigger{cursor:pointer}.bs-dropzone p:last-child{margin-bottom:0}.bs-brand-logos{display:table;width:100%;margin-bottom:15px;overflow:hidden;color:#563d7c;background-color:#f9f9f9;border-radius:4px}.bs-brand-item{padding:60px 0;text-align:center}.bs-brand-item+.bs-brand-item{border-top:1px solid #fff}.bs-brand-logos .inverse{color:#fff;background-color:#563d7c}.bs-brand-item .svg{width:144px;height:144px}.bs-brand-item h1,.bs-brand-item h3{margin-top:0;margin-bottom:0}.bs-brand-item .bs-docs-booticon{margin-right:auto;margin-left:auto}.bs-brand-item .glyphicon{width:30px;height:30px;margin:10px auto -10px;line-height:30px;color:#fff;border-radius:50%}.bs-brand-item .glyphicon-ok{background-color:#5cb85c}.bs-brand-item .glyphicon-remove{background-color:#d9534f}@media (min-width:768px){.bs-brand-item{display:table-cell;width:1%}.bs-brand-item+.bs-brand-item{border-top:0;border-left:1px solid #fff}.bs-brand-item h1{font-size:60px}}.zero-clipboard{position:relative;display:none}.btn-clipboard{position:absolute;top:0;right:0;z-index:10;display:block;padding:5px 8px;font-size:12px;color:#777;cursor:pointer;background-color:#fff;border:1px solid #e1e1e8;border-radius:0 4px 0 4px}.btn-clipboard-hover{color:#fff;background-color:#563d7c;border-color:#563d7c}@media (min-width:768px){.zero-clipboard{display:block}.bs-example+.zero-clipboard .btn-clipboard{top:-16px;border-top-right-radius:0}}#focusedInput{border-color:#ccc;border-color:rgba(82,168,236,.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:0 0 8px rgba(82,168,236,.6);box-shadow:0 0 8px rgba(82,168,236,.6)}.hll{background-color:#ffc}.c{color:#999}.err{color:#A00;background-color:#FAA}.k{color:#069}.o{color:#555}.cm{color:#999}.cp{color:#099}.c1{color:#999}.cs{color:#999}.gd{background-color:#FCC;border:1px solid #C00}.ge{font-style:italic}.gr{color:red}.gh{color:#030}.gi{background-color:#CFC;border:1px solid #0C0}.go{color:#AAA}.gp{color:#009}.gu{color:#030}.gt{color:#9C6}.kc{color:#069}.kd{color:#069}.kn{color:#069}.kp{color:#069}.kr{color:#069}.kt{color:#078}.m{color:#F60}.s{color:#d44950}.na{color:#4f9fcf}.nb{color:#366}.nc{color:#0A8}.no{color:#360}.nd{color:#99F}.ni{color:#999}.ne{color:#C00}.nf{color:#C0F}.nl{color:#99F}.nn{color:#0CF}.nt{color:#2f6f9f}.nv{color:#033}.ow{color:#000}.w{color:#bbb}.mf{color:#F60}.mh{color:#F60}.mi{color:#F60}.mo{color:#F60}.sb{color:#C30}.sc{color:#C30}.sd{color:#C30;font-style:italic}.s2{color:#C30}.se{color:#C30}.sh{color:#C30}.si{color:#A00}.sx{color:#C30}.sr{color:#3AA}.s1{color:#C30}.ss{color:#FC3}.bp{color:#366}.vc{color:#033}.vg{color:#033}.vi{color:#033}.il{color:#F60}.css .o,.css .o+.nt,.css .nt+.nt{color:#999} 7 | -------------------------------------------------------------------------------- /docs/assets/css/examples.css: -------------------------------------------------------------------------------- 1 | body { 2 | overflow: hidden; 3 | } 4 | 5 | .nav-list { 6 | top: 50px; 7 | left: 0; 8 | width: 400px; 9 | bottom: 0; 10 | background-color: rgb(247, 247, 247); 11 | border-right: 1px solid rgb(221, 221, 221); 12 | z-index: 91; 13 | transition: transform 0.2s ease; 14 | -webkit-transition: transform 0.2s ease; 15 | -webkit-transform: translate3d(-100%, 0, 0); 16 | transform: translate3d(-100%, 0, 0); 17 | position: fixed; 18 | padding-top: 49px; 19 | } 20 | 21 | .nav-list.active { 22 | transform: translate3d(0, 0, 0); 23 | -webkit-transform: translate3d(0, 0, 0); 24 | } 25 | 26 | .nav-list .title { 27 | line-height: 46px; 28 | font-size: 18px; 29 | padding-left: 10px; 30 | text-shadow: rgb(255, 255, 255) 0 1px 0; 31 | border-bottom: 1px solid rgb(229, 229, 229); 32 | position: absolute; 33 | height: 49px; 34 | top: 0; 35 | right: 0; 36 | left: 0; 37 | } 38 | 39 | a.toggle { 40 | position: absolute; 41 | top: 9px; 42 | right: -49px; 43 | } 44 | 45 | .nav-list.active a.toggle { 46 | right: 9px; 47 | } 48 | 49 | a.toggle .glyphicon-chevron-left, 50 | .nav-list.active a.toggle .glyphicon-chevron-right { 51 | display: none; 52 | } 53 | 54 | a.toggle .glyphicon-chevron-right, 55 | .nav-list.active a.toggle .glyphicon-chevron-left { 56 | display: block; 57 | } 58 | 59 | .nav-list ul { 60 | height: 100%; 61 | overflow: auto; 62 | padding: 10px; 63 | } 64 | 65 | .navigation { 66 | position: fixed; 67 | top: 0; 68 | bottom: 0; 69 | width: 4rem; 70 | font-size: 32px; 71 | height: 100%; 72 | cursor: pointer; 73 | display: table; 74 | text-align: center; 75 | text-decoration: none; 76 | } 77 | 78 | .navigation:hover { 79 | background: #F6F6F6; 80 | text-decoration: none; 81 | } 82 | 83 | .navigation:focus { 84 | text-decoration: none; 85 | } 86 | 87 | .navigation.next { 88 | right: 0; 89 | } 90 | 91 | .navigation i { 92 | display: table-cell; 93 | vertical-align: middle; 94 | text-align: center; 95 | } 96 | 97 | .content { 98 | position: fixed; 99 | width: 100%; 100 | top: 50px; 101 | bottom: 30px; 102 | } 103 | 104 | iframe { 105 | border: 0; 106 | } 107 | 108 | .dropdown-menu { 109 | max-height: 500px; 110 | overflow: auto; 111 | } 112 | -------------------------------------------------------------------------------- /docs/assets/css/sidenav.css: -------------------------------------------------------------------------------- 1 | body { 2 | position: relative; /* For scrollspy */ 3 | } 4 | 5 | /* By default it's not affixed in mobile views, so undo that */ 6 | .bs-sidebar.affix { 7 | position: static; 8 | } 9 | @media (min-width: 768px) { 10 | .bs-sidebar { 11 | padding-left: 20px; 12 | } 13 | } 14 | 15 | /* First level of nav */ 16 | .bs-sidenav { 17 | margin-top: 20px; 18 | margin-bottom: 20px; 19 | } 20 | 21 | /* All levels of nav */ 22 | .bs-sidebar .nav > li > a { 23 | display: block; 24 | padding: 4px 20px; 25 | font-size: 13px; 26 | font-weight: 500; 27 | color: #999; 28 | } 29 | .bs-sidebar .nav > li > a:hover, 30 | .bs-sidebar .nav > li > a:focus { 31 | padding-left: 19px; 32 | color: #6D6D6D; 33 | text-decoration: none; 34 | background-color: transparent; 35 | border-left: 1px solid #6D6D6D; 36 | } 37 | .bs-sidebar .nav > .active > a, 38 | .bs-sidebar .nav > .active:hover > a, 39 | .bs-sidebar .nav > .active:focus > a { 40 | padding-left: 18px; 41 | font-weight: bold; 42 | color: #6D6D6D; 43 | background-color: transparent; 44 | border-left: 2px solid #6D6D6D; 45 | } 46 | 47 | /* Nav: second level (shown on .active) */ 48 | .bs-sidebar .nav .nav { 49 | display: none; /* Hide by default, but at >768px, show it */ 50 | padding-bottom: 10px; 51 | } 52 | .bs-sidebar .nav .nav > li > a { 53 | padding-top: 1px; 54 | padding-bottom: 1px; 55 | padding-left: 30px; 56 | font-size: 12px; 57 | font-weight: normal; 58 | } 59 | .bs-sidebar .nav .nav > li > a:hover, 60 | .bs-sidebar .nav .nav > li > a:focus { 61 | padding-left: 29px; 62 | } 63 | .bs-sidebar .nav .nav > .active > a, 64 | .bs-sidebar .nav .nav > .active:hover > a, 65 | .bs-sidebar .nav .nav > .active:focus > a { 66 | padding-left: 28px; 67 | font-weight: 500; 68 | } 69 | 70 | /* Back to top (hidden on mobile) */ 71 | .back-to-top { 72 | display: none; 73 | padding: 4px 10px; 74 | margin-top: 10px; 75 | margin-left: 10px; 76 | font-size: 12px; 77 | font-weight: 500; 78 | color: #999; 79 | } 80 | .back-to-top:hover { 81 | color: #6D6D6D; 82 | text-decoration: none; 83 | } 84 | 85 | @media (min-width: 768px) { 86 | .back-to-top { 87 | display: block; 88 | } 89 | } 90 | 91 | /* Show and affix the side nav when space allows it */ 92 | @media (min-width: 992px) { 93 | .bs-sidebar .nav > .active > ul { 94 | display: block; 95 | } 96 | /* Widen the fixed sidebar */ 97 | .bs-sidebar.affix, 98 | .bs-sidebar.affix-bottom { 99 | width: 213px; 100 | } 101 | .bs-sidebar.affix { 102 | position: fixed; /* Undo the static from mobile first approach */ 103 | top: 20px; 104 | } 105 | .bs-sidebar.affix-bottom { 106 | position: absolute; /* Undo the static from mobile first approach */ 107 | } 108 | .bs-sidebar.affix-bottom .bs-sidenav, 109 | .bs-sidebar.affix .bs-sidenav { 110 | margin-top: 0; 111 | margin-bottom: 0; 112 | } 113 | } 114 | @media (min-width: 1200px) { 115 | /* Widen the fixed sidebar again */ 116 | .bs-sidebar.affix-bottom, 117 | .bs-sidebar.affix { 118 | width: 263px; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /docs/assets/css/style.css: -------------------------------------------------------------------------------- 1 | .bs-docs-featurette .row { 2 | text-align: left; 3 | } 4 | 5 | .bs-docs-nav + p { 6 | margin-bottom: 0; 7 | } 8 | 9 | .bs-docs-header { 10 | padding: 10px 0 0; 11 | } 12 | 13 | .bs-docs-header .col-md-8 { 14 | padding: 0 0 20px; 15 | } 16 | 17 | .bs-docs-header h1 { 18 | margin-top: 20px; 19 | margin-right: 0; 20 | } 21 | 22 | .bs-docs-header div { 23 | font-size: 16px; 24 | line-height: 24px; 25 | } 26 | 27 | .bs-docs-header a { 28 | color: #fff; 29 | } 30 | 31 | .edit-page-link { 32 | float: right; 33 | font-size: 16px; 34 | font-weight: normal; 35 | line-height: 39px; 36 | } 37 | 38 | .examples-parent { 39 | position: relative; 40 | } 41 | 42 | .examples-button { 43 | position: absolute; 44 | left: 20px; 45 | top: 20px; 46 | } 47 | 48 | .tc { 49 | text-align: center; 50 | } 51 | 52 | .tc img { 53 | max-width: 100%; 54 | } 55 | 56 | .help-btn { 57 | background-color: #eee; 58 | background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,#fcfcfc),color-stop(100%,#eee)); 59 | background-image: -webkit-linear-gradient(top,#fcfcfc 0,#eee 100%); 60 | background-image: -moz-linear-gradient(top,#fcfcfc 0,#eee 100%); 61 | background-image: -ms-linear-gradient(top,#fcfcfc 0,#eee 100%); 62 | background-image: -o-linear-gradient(top,#fcfcfc 0,#eee 100%); 63 | background-image: linear-gradient(to bottom,#fcfcfc 0,#eee 100%); 64 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fcfcfc', endColorstr='#eeeeee', GradientType=0); 65 | background-repeat: no-repeat; 66 | border: 1px solid #d5d5d5; 67 | padding: 2px 5px 2px 4px; 68 | color: #333; 69 | text-decoration: none; 70 | text-shadow: 0 1px 0 #fff; 71 | white-space: nowrap; 72 | cursor: pointer; 73 | border-radius: 3px; 74 | font-weight: bold; 75 | font-size: 12px; 76 | } 77 | 78 | .github-btn, .help-btn { 79 | vertical-align: bottom; 80 | } 81 | -------------------------------------------------------------------------------- /docs/assets/css/template.css: -------------------------------------------------------------------------------- 1 | .bs-docs-header { 2 | padding: 10px 0 0; 3 | } 4 | 5 | .bs-docs-header .col-md-8 { 6 | padding: 0 0 20px; 7 | } 8 | 9 | .bs-docs-header h1 { 10 | margin-top: 20px; 11 | margin-right: 0; 12 | } 13 | 14 | .bs-docs-header div { 15 | font-size: 16px; 16 | line-height: 24px; 17 | } 18 | 19 | .bs-docs-header a, 20 | .bs-docs-header code { 21 | color: #fff; 22 | } 23 | 24 | .source-pre { 25 | padding: 1.5rem; 26 | } 27 | 28 | .source-pre, 29 | .hljs { 30 | background: #f8f9fa; 31 | } 32 | 33 | #example { 34 | padding: 1.5rem; 35 | margin-right: 0; 36 | margin-left: 0; 37 | border: .2rem solid #f8f9fa; 38 | } 39 | -------------------------------------------------------------------------------- /docs/assets/flash/ZeroClipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenzhixin/bootstrap-show-password/f529d9311a9f54484dd96379587dccd9079938ac/docs/assets/flash/ZeroClipboard.swf -------------------------------------------------------------------------------- /docs/assets/images/alipay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenzhixin/bootstrap-show-password/f529d9311a9f54484dd96379587dccd9079938ac/docs/assets/images/alipay.jpg -------------------------------------------------------------------------------- /docs/assets/images/alipayLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenzhixin/bootstrap-show-password/f529d9311a9f54484dd96379587dccd9079938ac/docs/assets/images/alipayLogo.png -------------------------------------------------------------------------------- /docs/assets/images/paypalLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenzhixin/bootstrap-show-password/f529d9311a9f54484dd96379587dccd9079938ac/docs/assets/images/paypalLogo.png -------------------------------------------------------------------------------- /docs/assets/images/weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenzhixin/bootstrap-show-password/f529d9311a9f54484dd96379587dccd9079938ac/docs/assets/images/weixin.png -------------------------------------------------------------------------------- /docs/assets/images/weixinLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenzhixin/bootstrap-show-password/f529d9311a9f54484dd96379587dccd9079938ac/docs/assets/images/weixinLogo.png -------------------------------------------------------------------------------- /docs/assets/js/common.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('h1').find('a') 3 | .attr('target', '_blank') 4 | .addClass('edit-page-link') 5 | .text('Edit on GitHub') 6 | 7 | // languages 8 | var currentLanguage = 'en' 9 | var baseDir = '../' 10 | var pathDir = location.href.replace(/\/$/, '').split('/').pop() 11 | $('[data-language]').each(function (i) { 12 | var $this = $(this), 13 | language = $this.data('language') 14 | 15 | // default 16 | if (i === 0) { 17 | $this.addClass('active') 18 | } 19 | if (location.href.indexOf('/' + language + '/') !== -1) { 20 | $this.addClass('active').siblings().removeClass('active') 21 | $('.language').text($(this).text()) 22 | currentLanguage = language 23 | } 24 | }) 25 | if (currentLanguage !== 'en') { 26 | baseDir = '../../' 27 | } 28 | $('[data-language]').each(function (i) { 29 | var language = $(this).data('language') 30 | $(this).find('a').attr('href', baseDir + 31 | (language === 'en' ? '' : language + '/') + pathDir) 32 | }) 33 | 34 | $('.start-table').next().bootstrapTable({ 35 | search: true, 36 | showToggle: true, 37 | showColumns: true, 38 | mobileResponsive: true 39 | }) 40 | }) 41 | -------------------------------------------------------------------------------- /docs/assets/js/examples.js: -------------------------------------------------------------------------------- 1 | function loadUrl(url) { 2 | var template = 'template.html' 3 | var hash = '' 4 | if (/v3$/.test(location.search)) { 5 | template = 'template-v3.html' 6 | } else if (/svg$/.test(location.search)) { 7 | template = 'template-svg.html' 8 | } 9 | if (location.search.slice(1) === 'view-source') { 10 | hash = '#view-source' 11 | } else if (location.search.slice(1) === 'is-debug') { 12 | hash = '#is-debug' 13 | } 14 | $('iframe').attr('src', template + '?v=VERSION&' + url + hash) 15 | } 16 | 17 | function initNavigation(href) { 18 | var $el = $('a[href="../examples#' + href + '"]') 19 | 20 | $('.navigation').hide() 21 | 22 | if (!$el.length) { 23 | return 24 | } 25 | var $prev = $el.parent().prev('li') 26 | var $next = $el.parent().next('li') 27 | 28 | if ($prev.text()) { 29 | $('.navigation.previous').show() 30 | .attr('href', $prev.find('a').attr('href')) 31 | .attr('title', 'Previous: ' + $prev.text()) 32 | } 33 | if ($next.text()) { 34 | $('.navigation.next').show() 35 | .attr('href', $next.find('a').attr('href')) 36 | .attr('title', 'Next: ' + $next.text()) 37 | } 38 | } 39 | 40 | $(function () { 41 | $('[data-toggle="tooltip"]').tooltip() 42 | 43 | $(window).hashchange(function () { 44 | var href = location.hash.substring(1) 45 | loadUrl(href) 46 | initNavigation(href) 47 | }) 48 | 49 | $(window).on('blur',function() { 50 | $('.dropdown-toggle').parent().removeClass('open') 51 | }) 52 | 53 | var href = location.hash.substring(1) || 'basic.html' 54 | loadUrl(href) 55 | initNavigation(href) 56 | }) 57 | -------------------------------------------------------------------------------- /docs/assets/js/ga.js: -------------------------------------------------------------------------------- 1 | // (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 2 | // (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 3 | // m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 4 | // })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 5 | // ga('create', 'UA-36708951-1', 'wenzhixin.net.cn'); 6 | // ga('send', 'pageview'); 7 | -------------------------------------------------------------------------------- /docs/assets/js/ie-emulation-modes-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2014 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see http://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. 11 | (function () { 12 | 'use strict'; 13 | 14 | function emulatedIEMajorVersion() { 15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) 16 | if (groups === null) { 17 | return null 18 | } 19 | var ieVersionNum = parseInt(groups[1], 10) 20 | var ieMajorVersion = Math.floor(ieVersionNum) 21 | return ieMajorVersion 22 | } 23 | 24 | function actualNonEmulatedIEMajorVersion() { 25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. 26 | // IE JavaScript conditional compilation docs: http://msdn.microsoft.com/en-us/library/ie/121hztk3(v=vs.94).aspx 27 | // @cc_on docs: http://msdn.microsoft.com/en-us/library/ie/8ka90k2e(v=vs.94).aspx 28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line 29 | if (jscriptVersion === undefined) { 30 | return 11 // IE11+ not in emulation mode 31 | } 32 | if (jscriptVersion < 9) { 33 | return 8 // IE8 (or lower; haven't tested on IE<8) 34 | } 35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode 36 | } 37 | 38 | var ua = window.navigator.userAgent 39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { 40 | return // Opera, which might pretend to be IE 41 | } 42 | var emulated = emulatedIEMajorVersion() 43 | if (emulated === null) { 44 | return // Not IE 45 | } 46 | var nonEmulated = actualNonEmulatedIEMajorVersion() 47 | 48 | if (emulated !== nonEmulated) { 49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /docs/assets/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014 Twitter, Inc. 4 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 5 | * details, see http://creativecommons.org/licenses/by/3.0/. 6 | */ 7 | 8 | // See the Getting Started docs for more information: 9 | // http://getbootstrap.com/getting-started/#support-ie10-width 10 | 11 | (function () { 12 | 'use strict'; 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | })(); 23 | -------------------------------------------------------------------------------- /docs/assets/js/ie8-responsive-file-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see http://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about responsive styling supposedly not working in IE8. 11 | if (window.location.protocol == 'file:') { 12 | window.alert('ERROR: Bootstrap\'s responsive CSS is disabled!\nSee getbootstrap.com/getting-started/#respond-file-proto for details.') 13 | } 14 | -------------------------------------------------------------------------------- /docs/assets/js/sidenav.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @file sidenav.js 3 | * @author Jianlong Chen 4 | * @date 2014-03-08 5 | * @update 2014-11-12 6 | */ 7 | 8 | (function($) { 9 | 10 | 'use strict'; 11 | 12 | function SideNav($el) { 13 | this.$el = $el; 14 | } 15 | 16 | 17 | SideNav.prototype = { 18 | constructor: SideNav, 19 | 20 | init: function(options) { 21 | this.options = options; 22 | 23 | this.initViews(); 24 | this.initAffix(); 25 | }, 26 | 27 | initViews: function() { 28 | var that = this, 29 | counts = {}, 30 | preLevel = 0, 31 | parentId = ''; 32 | 33 | this.$menu = $([ 34 | '
    ', 35 | ' ', 37 | '
    ' 38 | ].join('')); 39 | this.$list = ''; 40 | 41 | // Support String type, for example use: data-hs="h1, h2, h3" 42 | if (typeof this.options.hs === 'string') { 43 | this.options.hs = $.map(this.options.hs.split(','), function (h) { 44 | return $.trim(h); // remove space 45 | }); 46 | } 47 | 48 | this.$el.find(this.options.hs.join(',')).each(function(i) { 49 | var $this = $(this), 50 | $div, 51 | name = $this[0].localName, 52 | title = $this.text(), 53 | level = $.inArray(name, that.options.hs) + 1, 54 | nums = [], 55 | index, 56 | id; 57 | 58 | if (level - preLevel > 1) { 59 | return; 60 | } 61 | if (!counts.hasOwnProperty(name) || level - preLevel === 1) { 62 | counts[name] = 0; 63 | } 64 | counts[name]++; 65 | 66 | $.each(counts, function(i) { 67 | nums.push(counts[i]); 68 | if (nums.length === level) { 69 | return false; 70 | } 71 | }); 72 | index = nums.join('-'); 73 | 74 | id = 'sideNavTitle' + index; 75 | 76 | if (that.options.smartId) { 77 | id = $.trim($(this).text()).toLowerCase(); 78 | id = id.replace(/ /g, '-'); 79 | id = id.replace(/'|"/g, ''); 80 | if (level === 2) { 81 | id = parentId + '-' + id; 82 | } 83 | } 84 | $div = $('
    '); 85 | $div.insertAfter($this).append($this); 86 | 87 | var aElem = '' + title + ''; 88 | if (level === 1 && preLevel === 0) { 89 | that.$list += '
  • ' + aElem; 90 | } else if (level === preLevel) { 91 | that.$list += '
  • ' + aElem; 92 | } else if (level - preLevel === 1) { 93 | that.$list += '
  • '; 97 | } 98 | that.$list += '
  • ' + aElem; 99 | } 100 | if (level === 1) { 101 | parentId = id; 102 | } 103 | preLevel = level; 104 | }); 105 | 106 | for (; preLevel > 0; preLevel--) { 107 | if (preLevel > 1) { 108 | that.$list += ''; 109 | } 110 | that.$list += '
  • '; 111 | } 112 | this.$menu.find('ul').append(this.$list); 113 | 114 | var backElem = '' + this.options.toTopText + ''; 116 | this.$menu.append(backElem); 117 | 118 | $(this.options.container).append(this.$menu); 119 | }, 120 | 121 | initAffix: function() { 122 | $('body').scrollspy({target: '.bs-sidebar'}); 123 | 124 | if (typeof this.options.top === 'undefined') { 125 | this.options.top = this.options.container; 126 | } 127 | if (typeof this.options.top === 'string' && $(this.options.top).length) { 128 | this.options.top = $(this.options.top).offset().top; 129 | } 130 | if (typeof this.options.bottom === 'string' && $(this.options.bottom).length) { 131 | this.options.bottom = $(this.options.bottom).outerHeight(true); 132 | } 133 | this.$menu.affix({ 134 | offset: { 135 | top: this.options.top || 0, 136 | bottom: this.options.bottom || 0 137 | } 138 | }); 139 | } 140 | }; 141 | 142 | $.fn.sideNav = function() { 143 | var option = arguments[0], 144 | args = arguments, 145 | value; 146 | 147 | this.each(function() { 148 | var $this = $(this), data = $this.data('sideNav'), 149 | options = $.extend({}, $.fn.sideNav.defaults, $this.data(), option); 150 | 151 | if (!data) { 152 | data = new SideNav($this); 153 | data.init(options, true); 154 | $this.data('sideNav', data); 155 | } else { 156 | data.init(options); 157 | } 158 | }); 159 | 160 | return value ? value : this; 161 | }; 162 | 163 | $.fn.sideNav.defaults = { 164 | container: 'body', 165 | hs: ['h2', 'h3', 'h4'], 166 | smartId: false, 167 | top: undefined, 168 | bottom: undefined, 169 | toTopHref: '#top', 170 | toTopText: 'Back to top' 171 | }; 172 | 173 | $(function () { 174 | $('[data-toggle="sidenav"]').sideNav(); 175 | }); 176 | })(jQuery); 177 | -------------------------------------------------------------------------------- /docs/assets/js/template.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | var url = location.search.replace(/\?v=\d+&/, '').replace(/\?v=VERSION&/, '') 3 | $.ajax({ 4 | type: 'GET', 5 | url: url + '?v=VERSION', // todo: add version to solve cache problem 6 | dataType: 'html', 7 | global: false, 8 | cache: true, // (warning: setting it to false will cause a timestamp and will call the request twice) 9 | success: function (data) { 10 | $('#example').html(data) 11 | $('#source').text(_beautifySource(data)) 12 | window.hljs.highlightAll() 13 | } 14 | }) 15 | 16 | if (/js\.html$/.test(url)) { 17 | $('[data-nav="javascript"]').addClass('active') 18 | } else { 19 | $('[data-nav="attributes"]').addClass('active') 20 | } 21 | $('[data-nav]').click(function () { 22 | if ($(this).hasClass('active')) { 23 | return false 24 | } 25 | if (/js\.html$/.test(location.href)) { 26 | location.href = location.href.replace(/\.js\.html$/, '.html') 27 | } else { 28 | location.href = location.href.replace(/\.html$/, '.js.html') 29 | } 30 | }) 31 | 32 | $('.nav-tabs').toggle(['events.html', 'methods.html'].indexOf(url) === -1) 33 | }) 34 | 35 | window._config = { 36 | isDebug: location.hash.slice(1) === 'is-debug' || 37 | ['localhost'].indexOf(location.hostname) > -1, 38 | cdnUrl: 'https://unpkg.com/bootstrap-show-password@1.3.0/dist/', 39 | localUrl: 'http://localhost:8080/github/bootstrap-show-password/src/' 40 | } 41 | 42 | function _getLink(file) { 43 | var url = file 44 | if (!/^http/.test(file)) { 45 | url = window._config.cdnUrl + file 46 | 47 | if (window._config.isDebug) { 48 | url = window._config.localUrl + file.replace(/\.min/, '') + '?t=' + (+new Date()) 49 | } 50 | } 51 | return '' 52 | } 53 | 54 | function _getScript(file, isScriptTag) { 55 | var url = file 56 | if (!/^http/.test(file)) { 57 | url = window._config.cdnUrl + file 58 | 59 | if (window._config.isDebug) { 60 | url = window._config.localUrl + file.replace(/\.min/, '') + '?t=' + (+new Date()) 61 | } 62 | } 63 | if (isScriptTag) { 64 | return '' 65 | } 66 | return url 67 | } 68 | 69 | function _link(file) { 70 | $('head').append(_getLink(file)) 71 | } 72 | 73 | function _script(file, callback) { 74 | var head = document.getElementsByTagName('head')[0] 75 | var script = document.createElement('script') 76 | 77 | script.src = _getScript(file) 78 | 79 | var done = false 80 | // Attach handlers for all browsers 81 | script.onload = script.onreadystatechange = function() { 82 | if (!done && (!this.readyState || 83 | this.readyState === 'loaded' || this.readyState === 'complete')) { 84 | done = true 85 | if (callback) 86 | callback() 87 | 88 | // Handle memory leak in IE 89 | script.onload = script.onreadystatechange = null 90 | } 91 | } 92 | 93 | head.appendChild(script) 94 | } 95 | 96 | function _scripts(scripts, callback) { 97 | var eachSeries = function (arr, iterator, callback_) { 98 | var callback = callback_ || function () {} 99 | if (!arr.length) { 100 | return callback() 101 | } 102 | var completed = 0 103 | var iterate = function () { 104 | iterator(arr[completed], function (err) { 105 | if (err) { 106 | callback(err) 107 | callback = function () {} 108 | } else { 109 | completed += 1 110 | if (completed >= arr.length) { 111 | callback(null) 112 | } else { 113 | iterate() 114 | } 115 | } 116 | }) 117 | } 118 | iterate() 119 | } 120 | 121 | eachSeries(scripts, _script, function () { 122 | callback() 123 | }) 124 | } 125 | 126 | function _beautifySource(data) { 127 | var lines = data.split('\n') 128 | var scriptStart = lines.indexOf('', scriptStart) 130 | var strings = lines.slice(scriptStart + 1, scriptEnd) 131 | strings = $.map(strings, function (s) { 132 | return $.trim(s) 133 | }) 134 | /* eslint-disable no-control-regex */ 135 | var obj = eval('(' + strings.join('').replace(/[^\u0000-\u007E]/g, '') 136 | .replace(/^init\((.*)\)$/, '$1') + ')') 137 | 138 | var theme = location.pathname.replace('/examples/template', '') 139 | .replace('-', '').replace('.html', '') 140 | var result = [] 141 | 142 | if (theme === 'v3') { 143 | result.push( 144 | '' 145 | ) 146 | } else if (theme === 'svg') { 147 | result.push( 148 | '' 149 | ) 150 | } else { 151 | result.push( 152 | '', 153 | '' 154 | ) 155 | } 156 | result = result.concat($.map(obj.links, _getLink)) 157 | result.push('') 158 | 159 | result.push('') 160 | if (theme === 'v3') { 161 | result.push( 162 | '' 163 | ) 164 | } else if (theme === 'svg') { 165 | result.push( 166 | '', 167 | '' 168 | ) 169 | } else { 170 | result.push( 171 | '' 172 | ) 173 | } 174 | result = result.concat($.map(obj.scripts, function (script) { 175 | return _getScript(script, true) 176 | })) 177 | lines = result.concat(lines.slice(scriptEnd + 1)) 178 | 179 | var mountedStart = lines.indexOf(' function mounted() {') 180 | var mountedEnd = lines.indexOf(' }', mountedStart) 181 | lines[mountedStart] = ' $(function() {' 182 | lines[mountedEnd] = ' })' 183 | 184 | return lines.join('\n') 185 | } 186 | 187 | window.init = function (options_) { 188 | var options = $.extend({ 189 | title: '', 190 | desc: '', 191 | links: [], 192 | scripts: [], 193 | bootstrapVersion: 3, 194 | callback: function () { 195 | if (typeof window.mounted === 'function') { 196 | window.mounted() 197 | } 198 | } 199 | }, options_) 200 | 201 | $('#header h1 span').html(options.title) 202 | $('#header div').html(options.desc) 203 | $.each(options.links, function (i, file) { 204 | _link(file) 205 | }) 206 | _scripts(options.scripts, options.callback) 207 | } 208 | -------------------------------------------------------------------------------- /docs/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: pages.documentation.title 4 | slug: documentation 5 | lead: pages.documentation.lead 6 | --- 7 | 8 | {% tf documentation/options.md %} 9 | 10 | {% tf documentation/events.md %} 11 | 12 | {% tf documentation/methods.md %} 13 | -------------------------------------------------------------------------------- /docs/donate.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: pages.donate.title 4 | slug: donate 5 | lead: pages.donate.lead 6 | --- 7 | 8 | {% tf donate.md %} 9 | 10 |
    11 |
    12 |
    13 |
    14 | 15 |
    16 |
    17 | 18 |
    19 |
    20 |
    21 |
    22 | 23 |
    24 |
    25 | 26 |
    27 |
    28 |
    注:由于支付宝和微信使用匿名的方式,导致无法查询捐助者,麻烦发送邮件告知捐助信息,谢谢。
    29 |
    30 |
    31 |
    32 | 33 |
    34 |
    35 | 36 | 37 | 38 |
    39 |
    40 |
    41 | -------------------------------------------------------------------------------- /docs/examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: examples 3 | title: pages.examples.title 4 | --- 5 | 6 |
    7 | 8 |
    9 | 10 | 18 | -------------------------------------------------------------------------------- /docs/examples/basic.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | -------------------------------------------------------------------------------- /docs/examples/basic.js.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /docs/examples/disabled.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | -------------------------------------------------------------------------------- /docs/examples/disabled.js.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | 17 | 22 | -------------------------------------------------------------------------------- /docs/examples/events.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 16 | 17 | 28 | -------------------------------------------------------------------------------- /docs/examples/eye-class.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | -------------------------------------------------------------------------------- /docs/examples/eye-class.js.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 23 | -------------------------------------------------------------------------------- /docs/examples/material-icons.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | 16 | 25 | -------------------------------------------------------------------------------- /docs/examples/material-icons.js.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | 16 | 21 | 22 | 32 | -------------------------------------------------------------------------------- /docs/examples/message.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | -------------------------------------------------------------------------------- /docs/examples/message.js.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/examples/methods.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 |
    16 | 17 | 18 | 19 | 20 | 21 | 22 |
    23 | 24 | 29 | 30 | 59 | -------------------------------------------------------------------------------- /docs/examples/placement.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | -------------------------------------------------------------------------------- /docs/examples/placement.js.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/examples/size.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 21 | 22 | 27 | 28 | 34 | -------------------------------------------------------------------------------- /docs/examples/size.js.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 20 | 21 | 26 | 27 | 32 | 33 | 46 | -------------------------------------------------------------------------------- /docs/examples/template-svg.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bootstrap Show Password Examples 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
    24 |
    25 |
    26 | 32 |
    33 |
    34 | 35 |
    36 |
    37 |
    38 |
    39 | 40 |
    41 | 49 | 50 |
    51 |
    52 |
    53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/examples/template-v3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
    21 |
    22 |
    23 | 29 |
    30 |
    31 | 32 |
    33 |
    34 |
    35 |
    36 | 37 |
    38 | 46 | 47 |
    48 |
    49 |
    50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /docs/examples/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bootstrap Show Password Examples 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
    24 |
    25 |
    26 | 32 |
    33 |
    34 | 35 |
    36 |
    37 |
    38 |
    39 | 40 |
    41 | 49 | 50 |
    51 |
    52 |
    53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/getting-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: pages.getting_started.title 4 | slug: getting-started 5 | lead: pages.getting_started.lead 6 | --- 7 | 8 | {% tf getting-started/download.md %} 9 | 10 | {% tf getting-started/whats-include.md %} 11 | 12 | {% tf getting-started/usage.md %} 13 | -------------------------------------------------------------------------------- /docs/home.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: home 3 | title: pages.home.title 4 | --- 5 | 6 |
    7 |
    8 |

    Bootstrap Show Password

    9 |

    {% t pages.home.lead %}

    10 |

    11 | 12 | {% t pages.home.download %} 13 | 14 | 15 | {% t pages.getting_started.title %} 16 | 17 |

    18 |

    {% t pages.home.current_version %} v{{ site.current_version }}

    19 |
    20 |
    21 | 22 |
    23 |
    24 |
    25 |
    26 |

    {% t pages.home.sub_title %}

    27 |

    {% t pages.home.sub_lead %}

    28 |
    29 | 30 |
    31 | {% include ads.html %} 32 |
    33 |
    34 | 35 |
    36 | 37 |
    38 |
    39 | {% tf home/feature.md %} 40 |
    41 |
    42 | {% capture my_include %}{% include latest-release.md %}{% endcapture %} 43 | {{ my_include | markdownify }} 44 |
    45 |
    46 |
    47 |
    48 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bootstrap Show Password 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/robots.txt: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | # www.robotstxt.org/ 5 | 6 | # Allow crawling of all content 7 | User-agent: * 8 | Disallow: 9 | Sitemap: {{ site.url }}/sitemap.xml -------------------------------------------------------------------------------- /docs/sitemap.xml: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | 5 | 6 | 7 | 8 | {{ site.url }}/ 9 | {{ site.time | date_to_xmlschema }} 10 | daily 11 | 1.0 12 | 13 | {% for page in site.html_pages %} 14 | {% if page.layout != "home" %} 15 | 16 | {{ site.url }}{{ page.url }} 17 | {{ site.time | date_to_xmlschema }} 18 | weekly 19 | 0.7 20 | 21 | {% endif %} 22 | {% endfor %} 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-show-password", 3 | "version": "1.3.0", 4 | "type": "module", 5 | "description": "Show/hide password plugin for twitter bootstrap.", 6 | "main": "dist/bootstrap-show-password.min.js", 7 | "module": "dist/bootstrap-show-password.esm.min.js", 8 | "devDependencies": { 9 | "@babel/core": "^7.23.9", 10 | "@babel/preset-env": "^7.23.9", 11 | "@rollup/plugin-babel": "^6.0.4", 12 | "@rollup/plugin-commonjs": "^25.0.7", 13 | "@rollup/plugin-inject": "^5.0.5", 14 | "@rollup/plugin-node-resolve": "^15.2.3", 15 | "eslint": "^8.56.0", 16 | "headr": "^0.0.4", 17 | "npm-run-all": "^4.1.5", 18 | "rollup": "^4.12.0", 19 | "rollup-plugin-babel": "^4.3.2", 20 | "rollup-plugin-terser": "^7.0.2" 21 | }, 22 | "scripts": { 23 | "lint": "eslint src", 24 | "build:base": "rollup -c", 25 | "build:min": "NODE_ENV=production rollup -c", 26 | "build:banner": "find dist -name '*.min.js' -exec headr {} -o {} --version --homepage --author --license \\;", 27 | "build": "run-s build:*", 28 | "docs": "bundle exec jekyll build", 29 | "docs-serve": "bundle exec jekyll serve" 30 | }, 31 | "author": "zhixin wen ", 32 | "repository": { 33 | "type": "git", 34 | "url": "https://github.com/wenzhixin/bootstrap-show-password.git" 35 | }, 36 | "keywords": [ 37 | "bootstrap", 38 | "password" 39 | ], 40 | "license": "MIT", 41 | "bugs": { 42 | "url": "https://github.com/wenzhixin/bootstrap-show-password/issues" 43 | }, 44 | "homepage": "https://github.com/wenzhixin/bootstrap-show-password" 45 | } 46 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import { babel } from '@rollup/plugin-babel' 2 | import { nodeResolve } from '@rollup/plugin-node-resolve' 3 | import commonjs from '@rollup/plugin-commonjs' 4 | import { terser } from 'rollup-plugin-terser' 5 | import inject from '@rollup/plugin-inject' 6 | 7 | const external = ['jquery'] 8 | const globals = { 9 | jquery: 'jQuery' 10 | } 11 | const config = [] 12 | const plugins = [ 13 | inject({ 14 | include: '**/*.js', 15 | exclude: 'node_modules/**', 16 | $: 'jquery' 17 | }), 18 | nodeResolve(), 19 | commonjs(), 20 | babel({ 21 | babelHelpers: 'bundled', 22 | exclude: 'node_modules/**' 23 | }) 24 | ] 25 | 26 | if (process.env.NODE_ENV === 'production') { 27 | plugins.push(terser({ 28 | output: { 29 | comments () { 30 | return false 31 | } 32 | } 33 | })) 34 | } 35 | 36 | let out = 'dist/bootstrap-show-password.js' 37 | if (process.env.NODE_ENV === 'production') { 38 | out = out.replace(/.js$/, '.min.js') 39 | } 40 | config.push({ 41 | input: 'src/bootstrap-show-password.js', 42 | output: { 43 | name: 'BootstrapShowPassword', 44 | file: out, 45 | format: 'umd', 46 | globals 47 | }, 48 | external, 49 | plugins 50 | }) 51 | 52 | out = 'dist/bootstrap-show-password.esm.js' 53 | if (process.env.NODE_ENV === 'production') { 54 | out = out.replace(/.js$/, '.min.js') 55 | } 56 | config.push({ 57 | input: 'src/bootstrap-show-password.js', 58 | output: { 59 | file: out, 60 | format: 'esm' 61 | }, 62 | plugins: plugins.slice(1) 63 | }) 64 | 65 | export default config 66 | -------------------------------------------------------------------------------- /src/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/env", 5 | { 6 | "modules": false, 7 | "useBuiltIns": "usage", 8 | "corejs": 3 9 | } 10 | ] 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /src/bootstrap-show-password.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author zhixin wen 3 | * https://github.com/wenzhixin/bootstrap-show-password 4 | * version: 1.3.0 5 | */ 6 | 7 | let bootstrapVersion = 5 8 | 9 | try { 10 | const rawVersion = $.fn.dropdown.Constructor.VERSION 11 | 12 | // Only try to parse VERSION if it is defined. 13 | // It is undefined in older versions of Bootstrap (tested with 3.1.1). 14 | if (rawVersion !== undefined) { 15 | bootstrapVersion = parseInt(rawVersion, 10) 16 | } 17 | } catch (e) { 18 | // ignore 19 | } 20 | 21 | try { 22 | // eslint-disable-next-line no-undef 23 | const rawVersion = bootstrap.Tooltip.VERSION 24 | 25 | if (rawVersion !== undefined) { 26 | bootstrapVersion = parseInt(rawVersion, 10) 27 | } 28 | } catch (e) { 29 | // ignore 30 | } 31 | 32 | const Constants = { 33 | html: { 34 | inputGroups: { 35 | 3: [ 36 | '', 37 | '' 38 | ], 39 | 4: [ 40 | '
    ' 42 | ], 43 | 5: [ 44 | '' 46 | ] 47 | 48 | }[bootstrapVersion] 49 | } 50 | } 51 | 52 | // TOOLS DEFINITION 53 | // ====================== 54 | 55 | // it only does '%s', and return '' when arguments are undefined 56 | const sprintf = function (str) { 57 | const args = arguments 58 | let flag = true 59 | let i = 1 60 | 61 | str = str.replace(/%s/g, () => { 62 | const arg = args[i++] 63 | 64 | if (typeof arg === 'undefined') { 65 | flag = false 66 | return '' 67 | } 68 | return arg 69 | }) 70 | if (flag) { 71 | return str 72 | } 73 | return '' 74 | } 75 | 76 | class Password { 77 | constructor (element, options) { 78 | this.options = options 79 | this.$element = $(element) 80 | this.isShown = false 81 | 82 | this.init() 83 | } 84 | 85 | init () { 86 | let placementFuc 87 | let inputClass 88 | 89 | if (this.options.placement === 'before') { 90 | placementFuc = 'insertBefore' 91 | inputClass = 'input-group-prepend' 92 | } else { 93 | this.options.placement = 'after' // default to after 94 | placementFuc = 'insertAfter' 95 | inputClass = 'input-group-append' 96 | } 97 | 98 | // Create the text, icon and assign 99 | this.$element.wrap(`
    `) 100 | 101 | this.$text = $('')[placementFuc](this.$element) 102 | .css('display', this.$element.css('display')) 103 | .val(this.$element.val()).hide() 104 | 105 | for (const attr of this.$element[0].attributes) { 106 | if ( 107 | !attr.specified || 108 | ['id', 'type'].includes(attr.name) || 109 | attr.name.indexOf('data-') === 0 110 | ) { 111 | continue 112 | } 113 | 114 | this.$text.attr(attr.name, attr.value) 115 | } 116 | 117 | this.$icon = $([ 118 | `${sprintf(Constants.html.inputGroups[0], inputClass, this.options.message)} 119 | 120 | ${this.options.eyeClassPositionInside ? this.options.eyeOpenClass : ''} 121 | `, 122 | Constants.html.inputGroups[1] 123 | ].join(''))[placementFuc](this.$text).css('cursor', 'pointer') 124 | 125 | // events 126 | this.$text.off('keyup').on('keyup', $.proxy(function () { 127 | if (!this.isShown) return 128 | this.$element.val(this.$text.val()).trigger('change') 129 | }, this)) 130 | 131 | this.$icon.off('click').on('click', $.proxy(function () { 132 | this.$text.val(this.$element.val()).trigger('change') 133 | this.toggle() 134 | }, this)) 135 | } 136 | 137 | toggle (_relatedTarget) { 138 | this[!this.isShown ? 'show' : 'hide'](_relatedTarget) 139 | } 140 | 141 | show (_relatedTarget) { 142 | const e = $.Event('show.bs.password', { relatedTarget: _relatedTarget }) 143 | 144 | this.$element.trigger(e) 145 | 146 | this.isShown = true 147 | this.$element.hide() 148 | this.$text.show() 149 | if (this.options.eyeClassPositionInside) { 150 | this.$icon.find('i,svg') 151 | .removeClass('icon-eye-open') 152 | .addClass('icon-eye-close') 153 | .html(this.options.eyeCloseClass) 154 | } else { 155 | this.$icon.find('i,svg') 156 | .removeClass(`icon-eye-open ${this.options.eyeOpenClass}`) 157 | .addClass(`icon-eye-close ${this.options.eyeCloseClass}`) 158 | } 159 | 160 | this.$text[this.options.placement](this.$element) 161 | } 162 | 163 | hide (_relatedTarget) { 164 | const e = $.Event('hide.bs.password', { relatedTarget: _relatedTarget }) 165 | 166 | this.$element.trigger(e) 167 | 168 | this.isShown = false 169 | this.$element.show() 170 | this.$text.hide() 171 | if (this.options.eyeClassPositionInside) { 172 | this.$icon.find('i,svg') 173 | .removeClass('icon-eye-close') 174 | .addClass('icon-eye-open') 175 | .html(this.options.eyeOpenClass) 176 | } else { 177 | this.$icon.find('i,svg') 178 | .removeClass(`icon-eye-close ${this.options.eyeCloseClass}`) 179 | .addClass(`icon-eye-open ${this.options.eyeOpenClass}`) 180 | } 181 | 182 | this.$element[this.options.placement](this.$text) 183 | } 184 | 185 | val (value) { 186 | if (typeof value === 'undefined') { 187 | return this.$element.val() 188 | } 189 | this.$element.val(value).trigger('change') 190 | this.$text.val(value) 191 | 192 | } 193 | 194 | focus () { 195 | this.$element.focus() 196 | } 197 | } 198 | 199 | Password.DEFAULTS = { 200 | placement: 'after', // 'before' or 'after' 201 | message: 'Click here to show/hide password', 202 | size: undefined, // '', 'sm', 'large' 203 | eyeClass: 'fa', // 'glyphicon', 204 | eyeOpenClass: 'fa-eye', // 'glyphicon-eye-open', 205 | eyeCloseClass: 'fa-eye-slash', // 'glyphicon-eye-close', 206 | eyeClassPositionInside: false 207 | } 208 | 209 | // PASSWORD PLUGIN DEFINITION 210 | // ======================= 211 | 212 | const old = $.fn.password 213 | 214 | $.fn.password = function () { 215 | const option = arguments[0] // public function 216 | const args = arguments 217 | let value 218 | 219 | const allowedMethods = [ 220 | 'show', 'hide', 'toggle', 'val', 'focus' 221 | ] 222 | 223 | this.each(function () { 224 | const $this = $(this) 225 | let data = $this.data('bs.password') 226 | const options = $.extend({}, Password.DEFAULTS, $this.data(), typeof option === 'object' && option) 227 | 228 | if (typeof option === 'string') { 229 | if ($.inArray(option, allowedMethods) < 0) { 230 | throw new Error(`Unknown method: ${option}`) 231 | } 232 | value = data[option](args[1]) 233 | } else if (!data) { 234 | data = new Password($this, options) 235 | $this.data('bs.password', data) 236 | } else { 237 | data.init(options) 238 | } 239 | }) 240 | 241 | return value ? value : this 242 | } 243 | 244 | $.fn.password.Constructor = Password 245 | 246 | // PASSWORD NO CONFLICT 247 | // ================= 248 | 249 | $.fn.password.noConflict = function () { 250 | $.fn.password = old 251 | return this 252 | } 253 | 254 | $(() => { 255 | $('[data-toggle="password"]').password() 256 | }) 257 | --------------------------------------------------------------------------------