This commit is contained in:
蔡玲
2024-12-03 16:40:54 +08:00
parent 6e6dd6a4fc
commit 9d776c65e9
408 changed files with 498647 additions and 99 deletions

View File

@@ -0,0 +1,3 @@
21 hdrcharset=BINARY
79 path=GUI_ws/Magic4/NumberPad/PaxHeader/PaxHeader/PaxHeader/jQuery之家.url
27 atime=1680163683.136177

View File

@@ -0,0 +1,3 @@
21 hdrcharset=BINARY
69 path=GUI_ws/Magic4/NumberPad/PaxHeader/PaxHeader/jQuery之家.url
27 atime=1680163683.140177

View File

@@ -0,0 +1,3 @@
21 hdrcharset=BINARY
59 path=GUI_ws/Magic4/NumberPad/PaxHeader/jQuery之家.url
27 atime=1680163683.144177

View File

@@ -0,0 +1,3 @@
21 hdrcharset=BINARY
42 path=GUI_ws/NumberPad/jQuery之家.url
27 atime=1597025996.409848

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,254 @@
@font-face {
font-family: 'icomoon';
src:url('../fonts/icomoon.eot?rretjt');
src:url('../fonts/icomoon.eot?#iefixrretjt') format('embedded-opentype'),
url('../fonts/icomoon.woff?rretjt') format('woff'),
url('../fonts/icomoon.ttf?rretjt') format('truetype'),
url('../fonts/icomoon.svg?rretjt#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body, html { font-size: 100%; padding: 0; margin: 0;}
/* Reset */
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* Clearfix hack by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
body{
font-weight: 500;
font-size: 1.05em;
font-family: "Microsoft YaHei","宋体","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif, FreeSans, Arimo;
}
a{ color: rgba(255, 255, 255, 0.6);outline: none;text-decoration: none;-webkit-transition: 0.2s;transition: 0.2s;}
a:hover,a:focus{color:#74777b;text-decoration: none;}
.htmleaf-container{
margin: 0 auto;
}
.bgcolor-1 { background: #f0efee; }
.bgcolor-2 { background: #f9f9f9; }
.bgcolor-3 { background: #e8e8e8; }/*light grey*/
.bgcolor-4 { background: #2f3238; color: #fff; }/*Dark grey*/
.bgcolor-5 { background: #df6659; color: #521e18; }/*pink1*/
.bgcolor-6 { background: #2fa8ec; }/*sky blue*/
.bgcolor-7 { background: #d0d6d6; }/*White tea*/
.bgcolor-8 { background: #3d4444; color: #fff; }/*Dark grey2*/
.bgcolor-9 { background: #ef3f52; color: #fff;}/*pink2*/
.bgcolor-10{ background: #64448f; color: #fff;}/*Violet*/
.bgcolor-11{ background: #3755ad; color: #fff;}/*dark blue*/
.bgcolor-12{ background: #3498DB; color: #fff;}/*light blue*/
.bgcolor-20{ background: #494A5F;color: #D5D6E2;}
/* Header */
.htmleaf-header{
padding: 1em 190px 1em;
letter-spacing: -1px;
text-align: center;
background: #66677c;
}
.htmleaf-header h1 {
color: #D5D6E2;
font-weight: 600;
font-size: 2em;
line-height: 1;
margin-bottom: 0;
font-family: "Microsoft YaHei","宋体","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif, FreeSans, Arimo;
}
.htmleaf-header h1 span {
font-family: "Microsoft YaHei","宋体","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif, FreeSans, Arimo;
display: block;
font-size: 60%;
font-weight: 400;
padding: 0.8em 0 0.5em 0;
color: #c3c8cd;
}
/*nav*/
.htmleaf-demo a{color: #fff;text-decoration: none;}
.htmleaf-demo{width: 100%;padding-bottom: 1.2em;}
.htmleaf-demo a{display: inline-block;margin: 0.5em;padding: 0.6em 1em;border: 3px solid #fff;font-weight: 700;}
.htmleaf-demo a:hover{opacity: 0.6;}
.htmleaf-demo a.current{background:#1d7db1;color: #fff; }
/* Top Navigation Style */
.htmleaf-links {
position: relative;
display: inline-block;
white-space: nowrap;
font-size: 1.5em;
text-align: center;
}
.htmleaf-links::after {
position: absolute;
top: 0;
left: 50%;
margin-left: -1px;
width: 2px;
height: 100%;
background: #dbdbdb;
content: '';
-webkit-transform: rotate3d(0,0,1,22.5deg);
transform: rotate3d(0,0,1,22.5deg);
}
.htmleaf-icon {
display: inline-block;
margin: 0.5em;
padding: 0em 0;
width: 1.5em;
text-decoration: none;
}
.htmleaf-icon span {
display: none;
}
.htmleaf-icon:before {
margin: 0 5px;
text-transform: none;
font-weight: normal;
font-style: normal;
font-variant: normal;
font-family: 'icomoon';
line-height: 1;
speak: none;
-webkit-font-smoothing: antialiased;
}
/* footer */
.htmleaf-footer{width: 100%;padding-top: 10px;}
.htmleaf-small{font-size: 0.8em;}
.center{text-align: center;}
/****/
.related {
color: #fff;
background: #494A5F;
text-align: center;
font-size: 1.25em;
padding: 0.5em 0;
overflow: hidden;
}
.related > a {
vertical-align: top;
width: calc(100% - 20px);
max-width: 340px;
display: inline-block;
text-align: center;
margin: 20px 10px;
padding: 25px;
font-family: "Microsoft YaHei","宋体","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif, FreeSans, Arimo;
}
.related a {
display: inline-block;
text-align: left;
margin: 20px auto;
padding: 10px 20px;
opacity: 0.8;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
-webkit-backface-visibility: hidden;
}
.related a:hover,
.related a:active {
opacity: 1;
}
.related a img {
max-width: 100%;
opacity: 0.8;
border-radius: 4px;
}
.related a:hover img,
.related a:active img {
opacity: 1;
}
.related h3{font-family: "Microsoft YaHei", sans-serif;font-size: 1.2em}
.related a h3 {
font-size: 0.85em;
font-weight: 300;
margin-top: 0.15em;
color: #fff;
}
/* icomoon */
.icon-htmleaf-home-outline:before {
content: "\e5000";
}
.icon-htmleaf-arrow-forward-outline:before {
content: "\e5001";
}
@media screen and (max-width: 1024px) {
.htmleaf-header {
padding: 2em 10% 2em;
}
.htmleaf-header h1 {
font-size:1.4em;
}
.htmleaf-links{font-size: 1.4em}
}
@media screen and (max-width: 960px) {
.htmleaf-header {
padding: 2em 10% 2em;
}
.htmleaf-header h1 {
font-size:1.2em;
}
.htmleaf-links{font-size: 1.2em}
.related h3{font-size: 1em;}
.related a h3 {
font-size: 0.8em;
}
}
@media screen and (max-width: 766px) {
.htmleaf-header h1 {
font-size:1.3em;
}
.htmleaf-links{font-size: 1.3em}
}
@media screen and (max-width: 640px) {
.htmleaf-header {
padding: 2em 10% 2em;
}
.htmleaf-header h1 {
font-size:1em;
}
.htmleaf-links{font-size: 1em}
.related h3{font-size: 0.8em;}
.related a h3 {
font-size: 0.6em;
}
}

View File

@@ -0,0 +1,5 @@
.nmpd-wrapper {display: none;}
.nmpd-target {cursor: pointer;}
.nmpd-grid {position:absolute; left:50px; top:50px; z-index:5000; -khtml-user-select: none; padding:10px; width: initial;}
.nmpd-overlay {z-index:4999;}
input.nmpd-display {text-align: right;}

View File

@@ -0,0 +1 @@
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;}

Binary file not shown.

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
<glyph unicode="&#xe5000;" d="M949.845 492.032c-144.64 121.771-407.296 348.629-409.899 350.933l-27.947 24.021-27.819-24.021c-2.645-2.261-265.429-229.035-412.16-351.915-18.688-16.811-29.355-40.32-29.355-64.384 0-47.104 38.229-85.333 85.333-85.333h42.667v-256c0-47.104 38.229-85.333 85.333-85.333h512c47.104 0 85.333 38.229 85.333 85.333v256h42.667c47.104 0 85.333 38.229 85.333 85.333 0 25.515-11.733 49.536-31.488 65.365zM597.333 85.334h-170.667v213.333h170.667v-213.333zM768 426.667l0.085-341.333c-0.085 0-128.085 0-128.085 0v256h-256v-256h-128v341.333h-128.043c117.973 98.645 312.107 265.685 384.043 327.68 71.936-61.995 265.984-228.992 384-327.723 0 0-128 0-128 0.043z" />
<glyph unicode="&#xe5001;" d="M170.667 85.376c-4.096 0-8.149 0.64-12.203 1.792-18.091 5.376-30.464 22.016-30.464 40.875v42.667c0 204.8 144.256 378.197 341.333 417.963v72.704c0 22.784 8.875 44.203 24.96 60.331 32.256 32.299 88.533 32.256 120.704 0.043l268.288-264.661c8.149-8.021 12.715-18.901 12.715-30.379s-4.565-22.357-12.715-30.379l-268.501-264.832c-31.829-31.829-88.192-32.043-120.448 0.213-16.128 16.128-25.003 37.547-25.003 60.331v61.312c-106.453-8.576-192.981-42.027-262.997-148.651-8.107-12.288-21.547-19.328-35.669-19.328zM512 340.907c11.179 0 42.667 0.427 42.667 0.427v-149.291l237.909 234.667-237.909 234.496v-149.205c0 0-16.384 0.171-38.016-2.219-145.749-16.128-261.333-122.197-294.059-259.413 90.496 73.728 194.176 88.149 289.408 90.539z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,140 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>移动端友好的jQuery数字键盘插件|DEMO1_jQuery之家-自由分享jQuery、html5、css3的插件库</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="css/htmleaf-demo.css">
<link rel="stylesheet" href="css/jquery.numpad.css">
<style type="text/css">
.nmpd-grid {border: none; padding: 20px;}
.nmpd-grid>tbody>tr>td {border: none;}
/* Some custom styling for Bootstrap */
.qtyInput {display: block;
width: 100%;
padding: 6px 12px;
color: #555;
background-color: white;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
</style>
<!--[if IE]>
<script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>
<div class="htmleaf-container">
<header class="htmleaf-header">
<h1>移动端友好的jQuery数字键盘插件 <span>Touch-optimized numeric on-screen keypad for jQuery</span></h1>
<div class="htmleaf-links">
<a class="htmleaf-icon icon-htmleaf-home-outline" href="http://www.htmleaf.com/" title="jQuery之家" target="_blank"><span> jQuery之家</span></a>
<a class="htmleaf-icon icon-htmleaf-arrow-forward-outline" href="http://www.htmleaf.com/jQuery/Form/201609174003.html" title="返回下载页" target="_blank"><span> 返回下载页</span></a>
</div>
<div class="htmleaf-demo center">
<a href="index.html" class="current">Bootstrap Demo</a>
<a href="index2.html">jQuery Mobile Demo</a>
</div>
</header>
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1>jQuery.NumPad demo for Boostrap</h1>
<div class="well well-lg">jQuery.NumPad is a touch optimized on-screen numeric keypad, which can be used within any web UIs based on jQuery. This page shows how the NumPad can be integrated with bootstrap. It is fully compatible with bootstrap themes! See the full <a href="http://a.kabachnik.info/jquery-numpad.html">docs</a> for more information.</div>
<h2>Simple forms</h2>
<form>
<div class="form-group">
<label for="text-basic">Simple numeric input</label>
<input type="number" class="form-control" id="text-basic" placeholder="Enter a number">
</div>
<div class="form-group">
<label for="password">Pin code</label>
<input type="password" class="form-control" id="password" placeholder="Pin code">
</div>
<label for="numpadButton">Separate numpad button + maxlength=4 + input validation</label>
<div class="input-group">
<input type="text" id="numpadButton" class="form-control" placeholder="Enter a number" aria-describedby="numpadButton-btn" maxlength="4" onchange="alert('Value changed to ' + $(this).val());">
<span class="input-group-btn">
<button class="btn btn-default" id="numpadButton-btn" type="button"><i class="glyphicon glyphicon-th"></i></button>
</span>
</div>
</form>
<h2>Table</h2>
<p>Click on a row to open the numpad for the editable cell programmatically</p>
<table id="numpad4column" class="table">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>XXL Keyboard</td>
<td>29,95</td>
<td class="qtyInput">1</td>
</tr>
<tr>
<td>XXL Mouse</td>
<td>19,95</td>
<td class="qtyInput">1</td>
</tr>
<tr>
<td>DVD-RW</td>
<td>1,95</td>
<td class="qtyInput">20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="http://cdn.bootcss.com/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.11.0.min.js"><\/script>')</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="js/jquery.numpad.js"></script>
<script type="text/javascript">
// Set NumPad defaults for jQuery mobile.
// These defaults will be applied to all NumPads within this document!
$.fn.numpad.defaults.gridTpl = '<table class="table modal-content"></table>';
$.fn.numpad.defaults.backgroundTpl = '<div class="modal-backdrop in"></div>';
$.fn.numpad.defaults.displayTpl = '<input type="text" class="form-control" />';
$.fn.numpad.defaults.buttonNumberTpl = '<button type="button" class="btn btn-default"></button>';
$.fn.numpad.defaults.buttonFunctionTpl = '<button type="button" class="btn" style="width: 100%;"></button>';
$.fn.numpad.defaults.onKeypadCreate = function(){$(this).find('.done').addClass('btn-primary');};
// Instantiate NumPad once the page is ready to be shown
$(document).ready(function(){
$('#text-basic').numpad();
$('#password').numpad({
displayTpl: '<input class="form-control" type="password" />',
hidePlusMinusButton: true,
hideDecimalButton: true
});
$('#numpadButton-btn').numpad({
target: $('#numpadButton')
});
$('#numpad4div').numpad();
$('#numpad4column .qtyInput').numpad();
$('#numpad4column tr').on('click', function(e){
$(this).find('.qtyInput').numpad('open');
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>移动端友好的jQuery数字键盘插件|DEMO2_jQuery之家-自由分享jQuery、html5、css3的插件库</title>
<link href="http://cdn.bootcss.com/jquery-mobile/1.4.5/jquery.mobile.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/htmleaf-demo.css">
<link rel="stylesheet" href="css/jquery.numpad.css">
<style type="text/css">
.controlgroup-textinput{
padding-top: .22em;
padding-bottom: .22em;
}
</style>
<!--[if IE]>
<script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>
<header class="htmleaf-header">
<h1>移动端友好的jQuery数字键盘插件 <span>Touch-optimized numeric on-screen keypad for jQuery</span></h1>
<div class="htmleaf-links">
<a class="htmleaf-icon icon-htmleaf-home-outline" href="http://www.htmleaf.com/" title="jQuery之家" target="_blank"><span> jQuery之家</span></a>
<a class="htmleaf-icon icon-htmleaf-arrow-forward-outline" href="http://www.htmleaf.com/jQuery/Form/201609174003.html" title="返回下载页" target="_blank"><span> 返回下载页</span></a>
</div>
<div class="htmleaf-demo center">
<a href="index.html">Bootstrap Demo</a>
<a href="index2.html" class="current">jQuery Mobile Demo</a>
</div>
</header>
<div data-role="page" class="jqm-demos" data-quicklinks="true">
<div data-role="header" class="jqm-header">
<h2>Numeric keypad for jQuery mobile</h2>
</div>
<div style="text-align: center;padding: 1em 0">
<a href="index.html">Bootstrap Demo</a>  
<a href="index2.html" class="current">jQuery Mobile Demo</a>
</div>
<div role="main" class="ui-content jqm-content">
<div class="ui-body ui-body-a ui-corner-all">
          <p>jQuery.NumPad is a touch optimized on-screen numeric keypad, which can be used within any web UIs based on jQuery. This page shows how the NumPad can be integrated with jQuery mobile. It is even compatible with ThemeRoller!</p>
       </div>
<h2>Numeric keypads for input fields</h2>
<div data-demo-html="true">
<label for="text-basic">Simple input (click to toggle numpad)</label>
<input type="text" name="text-basic" id="text-basic" value="1">
</div><!-- /demo-html -->
<div data-demo-html="true">
<label for="password">Password input for PIN codes (click to toggle numpad - note, that sensitive data is hidden at all times!)</label>
<input type="password" name="password" id="password" value="">
</div><!-- /demo-html -->
<div>
<label for="numpadButton">Input with extra numpad button (the input is directly editable, while the button shows the NumPad). Additionally this one has a maxlength="4" and an onChange event handler.</label>
<div data-role="controlgroup" data-type="horizontal">
<input type="text" id="numpadButton" data-wrapper-class="controlgroup-textinput ui-btn" value="2" maxlength="4" onchange="alert('Value changed to ' + $(this).val());">
<button id="numpadButton-btn" class="ui-btn ui-icon-grid ui-btn-icon-notext ui-alt-icon ui-nodisc-icon">&nbsp;</button>
</div>
</div><!-- /demo-html -->
<h2>Numeric keypad for a div element</h2>
<div data-demo-html="true">
<div id="numpad4div">3</div>
</div><!-- /demo-html -->
<h2>Numeric keypad for table column</h2>
<p>Click on a cell of the quantity column to get a numeric keypad for editing the quantity.</p>
<div data-demo-html="true">
<table id="numpad4column" data-role="table" class="ui-responsive">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>XXL Keyboard</td>
<td>29,95</td>
<td class="qtyInput">1</td>
</tr>
<tr>
<td>XXL Mouse</td>
<td>19,95</td>
<td class="qtyInput">1</td>
</tr>
<tr>
<td>DVD-RW</td>
<td>1,95</td>
<td class="qtyInput">20</td>
</tr>
</tbody>
</table>
</div><!-- /demo-html -->
</div>
</div><!-- /page -->
<script src="http://cdn.bootcss.com/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.11.0.min.js"><\/script>')</script>
<script src="http://cdn.bootcss.com/jquery-mobile/1.4.5/jquery.mobile.min.js"></script>
<script src="js/jquery.numpad.js"></script>
<script type="text/javascript">
// Set NumPad defaults for jQuery mobile.
// These defaults will be applied to all NumPads within this document!
$.fn.numpad.defaults.gridTpl = '<table class="ui-bar-a"></table>';
$.fn.numpad.defaults.backgroundTpl = '<div class="ui-popup-screen ui-overlay-a"></div>';
$.fn.numpad.defaults.displayTpl = '<input data-theme="b" type="text" />';
$.fn.numpad.defaults.buttonNumberTpl = '<a data-role="button" data-theme="b"></a>';
$.fn.numpad.defaults.buttonFunctionTpl = '<a data-role="button" data-theme="a"></a>';
$.fn.numpad.defaults.onKeypadCreate = function(){$(this).enhanceWithin();};
// Instantiate NumPad once the page is ready to be shown
$(document).on('pageshow', function(){
$('#text-basic').numpad();
$('#password').numpad({
displayTpl: '<input data-theme="b" type="password" />',
hidePlusMinusButton: true,
hideDecimalButton: true
});
$('#numpadButton-btn').numpad({
target: $('#numpadButton'),
});
$('#numpad4div').numpad();
$('#numpad4column .qtyInput').numpad();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.htmleaf.com/
IDList=
HotKey=0
IconFile=C:\Windows\system32\SHELL32.dll
IconIndex=220
[InternetShortcut.A]
[InternetShortcut.W]
IconFile=F:+AFx/UVP2-jQuery+AFw-favicon.ico

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,303 @@
/**
* jQuery.NumPad
*
* Copyright (c) 2015 Andrej Kabachnik
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* https://github.com/kabachello/jQuery.NumPad
*
* Version: 1.4
*
*/
(function($){
// From https://stackoverflow.com/questions/4963053/focus-to-input-without-scrolling
var cursorFocus = function(elem) {
var x = window.scrollX, y = window.scrollY;
elem.focus();
window.scrollTo(x, y);
}
$.fn.numpad=function(options){
if (typeof options == 'string'){
var nmpd = $.data(this[0], 'numpad');
if (!nmpd) throw "Cannot perform '" + options + "' on a numpad prior to initialization!";
switch (options){
case 'open':
nmpd.open(nmpd.options.target ? nmpd.options.target : this.first());
break;
case 'close':
nmpd.open(nmpd.options.target ? nmpd.options.target : this.first());
break;
}
return this;
}
// Apply the specified options overriding the defaults
options = $.extend({}, $.fn.numpad.defaults, options);
// Create a numpad. One for all elements in this jQuery selector.
// Since numpad() can be called on multiple elements on one page, each call will create a unique numpad id.
var id = 'nmpd' + ($('.nmpd-wrapper').length + 1);
var nmpd = {};
return this.each(function(){
// If an element with the generated unique numpad id exists, the numpad had been instantiated already.
// Otherwise create a new one!
if ($('#'+id).length == 0) {
/** @var nmpd jQuery object containing the entire numpad */
nmpd = $('<div id="' + id + '"></div>').addClass('nmpd-wrapper');
nmpd.options = options;
/** @var display jQuery object representing the display of the numpad (typically an input field) */
var display = $(options.displayTpl).addClass('nmpd-display');
nmpd.display = display;
/** @var grid jQuery object containing the grid for the numpad: the display, the buttons, etc. */
var table = $(options.gridTpl).addClass('nmpd-grid');
nmpd.grid = table;
table.append($(options.rowTpl).append($(options.displayCellTpl).append(display).append($('<input type="hidden" class="dirty" value="0"></input>'))));
// Create rows and columns of the the grid with appropriate buttons
table.append(
$(options.rowTpl)
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(7).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(8).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(9).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonFunctionTpl).html(options.textDelete).addClass('del').click(function(){
nmpd.setValue(nmpd.getValue().toString().substring(0,nmpd.getValue().toString().length - 1));
})))
).append(
$(options.rowTpl)
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(4).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(5).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(6).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonFunctionTpl).html(options.textClear).addClass('clear').click(function(){
nmpd.setValue('');
})))
).append(
$(options.rowTpl)
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(1).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(2).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(3).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonFunctionTpl).html(options.textCancel).addClass('cancel').click(function(){
nmpd.close(false);
})))
).append(
$(options.rowTpl)
.append($(options.cellTpl).append($(options.buttonFunctionTpl).html('&plusmn;').addClass('neg').click(function(){
nmpd.setValue(nmpd.getValue() * (-1));
})))
.append($(options.cellTpl).append($(options.buttonNumberTpl).html(0).addClass('numero')))
.append($(options.cellTpl).append($(options.buttonFunctionTpl).html(options.decimalSeparator).addClass('sep').click(function(){
nmpd.setValue(nmpd.getValue().toString() + options.decimalSeparator);
})))
.append($(options.cellTpl).append($(options.buttonFunctionTpl).html(options.textDone).addClass('done')))
);
// Create the backdrop of the numpad - an overlay for the main page
nmpd.append($(options.backgroundTpl).addClass('nmpd-overlay').click(function(){nmpd.close(false);}));
// Append the grid table to the nmpd element
nmpd.append(table);
// Hide buttons to be hidden
if (options.hidePlusMinusButton){
nmpd.find('.neg').hide();
}
if (options.hideDecimalButton){
nmpd.find('.sep').hide();
}
// Attach events
if (options.onKeypadCreate){
nmpd.on('numpad.create', options.onKeypadCreate);
}
if (options.onKeypadOpen){
nmpd.on('numpad.open', options.onKeypadOpen);
}
if (options.onKeypadClose){
nmpd.on('numpad.close', options.onKeypadClose);
}
if (options.onChange){
nmpd.on('numpad.change', options.onChange);
}
(options.appendKeypadTo ? options.appendKeypadTo : $(document.body)).append(nmpd);
// Special event for the numeric buttons
$('#'+id+' .numero').bind('click', function(){
var val;
if ($('#'+id+' .dirty').val() == '0'){
val = $(this).text();
} else {
val = nmpd.getValue() ? nmpd.getValue().toString() + $(this).text() : $(this).text();
}
nmpd.setValue(val);
});
// Finally, once the numpad is completely instantiated, trigger numpad.create
nmpd.trigger('numpad.create');
} else {
// If the numpad was already instantiated previously, just load it into the nmpd variable
//nmpd = $('#'+id);
//nmpd.display = $('#'+id+' input.nmpd-display');
}
$.data(this, 'numpad', nmpd);
// Make the target element readonly and save the numpad id in the data-numpad property. Also add the special nmpd-target CSS class.
$(this).attr("readonly", true).attr('data-numpad', id).addClass('nmpd-target');
// Register a listener to open the numpad on the event specified in the options
$(this).bind(options.openOnEvent,function(){
nmpd.open(options.target ? options.target : $(this));
});
// Define helper functions
/**
* Gets the current value displayed in the numpad
* @return string | number
*/
nmpd.getValue = function(){
return isNaN(nmpd.display.val()) ? 0 : nmpd.display.val();
};
/**
* Sets the display value of the numpad
* @param string value
* @return jQuery object nmpd
*/
nmpd.setValue = function(value){
if (nmpd.display.attr('maxLength') < value.toString().length) value = value.toString().substr(0, nmpd.display.attr('maxLength'));
nmpd.display.val(value);
nmpd.find('.dirty').val('1');
nmpd.trigger('numpad.change', [value]);
return nmpd;
};
/**
* Closes the numpad writing it's value to the given target element
* @param jQuery object target
* @return jQuery object nmpd
*/
nmpd.close = function(target){
// If a target element is given, set it's value to the dipslay value of the numpad. Otherwise just hide the numpad
if (target){
if (target.prop("tagName") == 'INPUT'){
target.val(nmpd.getValue().toString().replace('.', options.decimalSeparator));
} else {
target.html(nmpd.getValue().toString().replace('.', options.decimalSeparator));
}
}
// Hide the numpad and trigger numpad.close
nmpd.hide();
nmpd.trigger('numpad.close');
// Trigger a change event on the target element if the value has really been changed
// TODO check if the value has really been changed!
if (target && target.prop("tagName") == 'INPUT'){
target.trigger('change');
}
return nmpd;
};
/**
* Opens the numpad for a given target element optionally filling it with a given value
* @param jQuery object target
* @param string initialValue
* @return jQuery object nmpd
*/
nmpd.open = function(target, initialValue){
// Set the initial value
// Use nmpd.display.val to avoid triggering numpad.change for the initial value
if (initialValue){
nmpd.display.val(initialValue);
} else {
if (target.prop("tagName") == 'INPUT'){
nmpd.display.val(target.val());
nmpd.display.attr('maxLength', target.attr('maxLength'));
} else {
nmpd.display.val(isNaN(parseFloat(target.text())) ? '' : parseFloat(target.text()));
}
}
// Mark the numpad as not dirty initially
$('#'+id+' .dirty').val(0);
// Show the numpad and position it on the page
cursorFocus(nmpd.show().find('.cancel'));
position(nmpd.find('.nmpd-grid'), options.position, options.positionX, options.positionY);
// Register a click handler on the done button to update the target element
// Make sure all other click handlers get removed. Otherwise some unwanted sideeffects may occur if the numpad is
// opened multiple times for some reason
$('#'+id+' .done').off('click');
$('#'+id+' .done').one('click', function(){ nmpd.close(target); });
// Finally trigger numpad.open
nmpd.trigger('numpad.open');
return nmpd;
};
});
};
/**
* Positions any given jQuery element within the page
*/
function position(element, mode, posX, posY) {
var x = 0;
var y = 0;
if (mode == 'fixed'){
element.css('position','fixed');
if (posX == 'left'){
x = 0;
} else if (posX == 'right'){
x = $(window).width() - element.outerWidth();
} else if (posX == 'center'){
x = ($(window).width() / 2) - (element.outerWidth() / 2);
} else if ($.type(posX) == 'number'){
x = posX;
}
element.css('left', x);
if (posY == 'top'){
y = 0;
} else if (posY == 'bottom'){
y = $(window).height() - element.outerHeight();
} else if (posY == 'middle'){
y = ($(window).height() / 2) - (element.outerHeight() / 2);
} else if ($.type(posY) == 'number'){
y = posY;
}
element.css('top', y);
}
return element;
}
// Default values for numpad options
$.fn.numpad.defaults = {
target: false,
openOnEvent: 'click',
backgroundTpl: '<div></div>',
gridTpl: '<table></table>',
displayTpl: '<input type="text" />',
displayCellTpl: '<td colspan="4"></td>',
rowTpl: '<tr></tr>',
cellTpl: '<td></td>',
buttonNumberTpl: '<button></button>',
buttonFunctionTpl: '<button></button>',
gridTableClass: '',
hidePlusMinusButton: false,
hideDecimalButton: false,
textDone: 'Done',
textDelete: 'Del',
textClear: 'Clear',
textCancel: 'Cancel',
decimalSeparator: ',',
precision: null,
appendKeypadTo: false,
position: 'fixed',
positionX: 'center',
positionY: 'middle',
onKeypadCreate: false,
onKeypadOpen: false,
onKeypadClose: false,
onChange: false
};
})(jQuery);

View File

@@ -0,0 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>jQuery之家</title>
<style type="text/css">
body{font-size: 14px;}
.content{
width: 800px;
margin: 0 auto;
}
</style>
</head>
<body>
<h1>欢迎访问jQuery之家</h1>
<div class="content">
<p>更多精彩内容请访问jQuery之家<a href="http://www.htmleaf.com">http://www.htmleaf.com</a></p>
<p>jQuery之家致力于搜集和整理各种jQuery插件jQuery特效jquery uijQuery 教程JS特效网页特效以及各种html5css3动画和效果。</p>
<p>为前端开发者提供最全面的网页开发素材。</p>
</div>
</body>
</html>