From 4529e0928cd4f36dcf0220ac241a8e3a8935ec36 Mon Sep 17 00:00:00 2001 From: Arnold Daniels Date: Tue, 17 Jul 2012 18:35:05 +0200 Subject: [PATCH] Documented inputmask javascript plugin Added bootstrap-inputmask.js to Makefile --- Makefile | 7 ++- docs/templates/layout.mustache | 1 + docs/templates/pages/index.mustache | 5 ++ docs/templates/pages/javascript.mustache | 77 ++++++++++++++++++++++++ js/bootstrap-inputmask.js | 2 +- 5 files changed, 88 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1e9d1643..82776d1b 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ build: @cp -r fonts docs/assets/ @cp js/tests/vendor/jquery.js docs/assets/js/ @echo "Compiling documentation... ${CHECK} Done" - @cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js + @cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-inputmask.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js @uglifyjs -nc docs/assets/js/bootstrap.js > docs/assets/js/bootstrap.min.tmp.js @echo "/**\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js @cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js @@ -69,7 +69,7 @@ bootstrap: recess --compress ${BOOTSTRAP_LESS} ${JASNY_BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} ${JASNY_BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css recess --compress ${BOOTSTRAP_RESPONSIVE_LESS} ${JASNY_BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css - cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > bootstrap/js/bootstrap.js + cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-inputmask.js js/bootstrap-affix.js > bootstrap/js/bootstrap.js uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js @@ -84,12 +84,13 @@ jasny-bootstrap: mkdir -p jasny-bootstrap/css mkdir -p jasny-bootstrap/js mkdir -p jasny-bootstrap/fonts + cp js/bootstrap-inputmask.js jasny-bootstrap/js cp fonts/* jasny-bootstrap/fonts/ recess --compile ${JASNY_BOOTSTRAP_LESS} > jasny-bootstrap/css/jasny-bootstrap.css recess --compress ${JASNY_BOOTSTRAP_LESS} > jasny-bootstrap/css/jasny-bootstrap.min.css recess --compile ${JASNY_BOOTSTRAP_RESPONSIVE_LESS} > jasny-bootstrap/css/jasny-bootstrap-responsive.css recess --compress ${JASNY_BOOTSTRAP_RESPONSIVE_LESS} > jasny-bootstrap/css/jasny-bootstrap-responsive.min.css - cat /dev/null > jasny-bootstrap/js/jasny-bootstrap.js + cat js/bootstrap-inputmask.js > jasny-bootstrap/js/jasny-bootstrap.js uglifyjs -nc jasny-bootstrap/js/jasny-bootstrap.js > jasny-bootstrap/js/jasny-bootstrap.min.tmp.js echo "/*!\n* Jasny-Bootstrap.js by @ArnoldDaniels\n* Copyright 2012 Jasny BV.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > jasny-bootstrap/js/copyright.js cat jasny-bootstrap/js/copyright.js jasny-bootstrap/js/jasny-bootstrap.min.tmp.js > jasny-bootstrap/js/jasny-bootstrap.min.js diff --git a/docs/templates/layout.mustache b/docs/templates/layout.mustache index b056df5a..b2e45fd1 100644 --- a/docs/templates/layout.mustache +++ b/docs/templates/layout.mustache @@ -124,6 +124,7 @@ + diff --git a/docs/templates/pages/index.mustache b/docs/templates/pages/index.mustache index ff3321ea..a66bcea6 100644 --- a/docs/templates/pages/index.mustache +++ b/docs/templates/pages/index.mustache @@ -48,6 +48,11 @@

{{_i}}Sometimes a button will pull to much attention to an action. In those cases, you can use action links instead.{{/i}}

{{_i}}Action links look distinctly different than normal links.{{/i}}

+
+

{{_i}}Input mask{{/i}}

+

{{_i}}Force the user to enter data conform a specific format.{{/i}}

+

{{_i}}Unlike validation, the user can't enter any other key than the ones specified by the mask.{{/i}}

+
diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache index 9df09bd3..48b5a2b3 100644 --- a/docs/templates/pages/javascript.mustache +++ b/docs/templates/pages/javascript.mustache @@ -28,6 +28,7 @@
  • {{_i}}Collapse{{/i}}
  • {{_i}}Carousel{{/i}}
  • {{_i}}Typeahead{{/i}}
  • +
  • {{_i}}Input mask{{/i}}
  • {{_i}}Affix{{/i}}
  • @@ -1520,6 +1521,82 @@ $('.carousel').carousel({ + +
    + + +

    {{_i}}Example{{/i}}

    +

    {{_i}}Input masks can be used to force the user to enter data conform a specific format.{{/i}}

    +

    {{_i}}Unlike validation, the user can't enter any other key than the ones specified by the mask.{{/i}}

    +
    + +
    +
    +<input type="text" data-mask="999-99-999-9999-9">
    +
    + + +
    + + +

    {{_i}}Usage{{/i}}

    + +

    {{_i}}Via data attributes{{/i}}

    +

    {{_i}}Add data attributes to register an element with inputmask functionality as shown in the example above.{{/i}}

    + +

    {{_i}}Via JavaScript{{/i}}

    +

    {{_i}}Call the input mask via javascript:{{/i}}

    +
    $('.inputmask').inputmask()
    + +

    {{_i}}Options{{/i}}

    + + + + + + + + + + + + + + + + + + + + + + + +
    {{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
    {{_i}}mask{{/i}}{{_i}}string{{/i}}''{{_i}}A string of formatting and literal characters, defining the input mask (see below).{{/i}}
    {{_i}}placeholder{{/i}}{{_i}}string{{/i}}'_'{{_i}}The character that is displayed where something needs to be typed.{{/i}}
    + +

    {{_i}}Format{{/i}}

    + + + + + + + + + + +
    {{_i}}Character{{/i}}{{_i}}Description{{/i}}
    9{{_i}}Number{{/i}}
    a{{_i}}Letter{{/i}}
    ?{{_i}}Alphanumeric{{/i}}
    *{{_i}}Any character{{/i}}
    + +

    {{_i}}Methods{{/i}}

    +

    .inputmask({{_i}}options{{/i}})

    +

    {{_i}}Initializes an input with an input mask.{{/i}}

    +
    + + +
    diff --git a/js/bootstrap-inputmask.js b/js/bootstrap-inputmask.js index fff06336..438074b6 100644 --- a/js/bootstrap-inputmask.js +++ b/js/bootstrap-inputmask.js @@ -3,7 +3,7 @@ * http://twitter.github.com/bootstrap/javascript.html#tooltips * Based on Masked Input plugin by Josh Bush (digitalbush.com) * =========================================================== - * Copyright 2012 Twitter, Inc. + * Copyright 2012 Jasny BV, Netherlands. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License.