datainput
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -148,8 +148,13 @@ // | ||
if (!event.ctrlKey && c.length == 1 && c.match(new RegExp(opts.sectionRe) ) ) { | ||
if (!event.ctrlKey && c.length == 1 && | ||
c.match(new RegExp(opts.sectionInputRe || opts.sectionRe) ) ) { | ||
// 0~9, A~Z | ||
event.preventDefault(); | ||
if ($private.caretIndex != -1) { | ||
var perSectionInputRe = opts['sectionInputRe' + $private.sectionIndex]; | ||
if (perSectionInputRe && !c.match(new RegExp(perSectionInputRe) ) ) { | ||
return; | ||
} | ||
var section = sections[$private.sectionIndex]; | ||
@@ -207,3 +212,9 @@ if (section.value.length > section.format.length) { | ||
event.preventDefault(); | ||
$private.sectionIndex += 1; | ||
if ($private.sectionIndex == 0 && | ||
$private.selection.end == opts.mbformat.length) { | ||
// select all to select first | ||
} else { | ||
// next | ||
$private.sectionIndex += 1; | ||
} | ||
var section = sections[$private.sectionIndex]; | ||
@@ -215,2 +226,3 @@ $private.setCaretIndex(section.direction == 'rtol'? | ||
event.preventDefault(); | ||
// prev | ||
$private.sectionIndex -= 1; | ||
@@ -217,0 +229,0 @@ var section = sections[$private.sectionIndex]; |
{ | ||
"name": "datainput", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Formatted Data Input Library in JavaScript.", | ||
@@ -5,0 +5,0 @@ "author": "Kazuhiko Arase", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
50919
14
1296