autonumeric-rails 1.9.22.1 → 1.9.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.9.24.0
2
+
3
+ - Update autoNumeric v 1.9.24
4
+
1
5
  # 1.9.22.1
2
6
 
3
7
  - Merge PR #4 "Sanitize hidden input on blur event" - Thanks to @tiagoamaro
@@ -1,5 +1,5 @@
1
1
  module Autonumeric
2
2
  module Rails
3
- VERSION = '1.9.22.1'
3
+ VERSION = '1.9.24.0'
4
4
  end
5
5
  end
@@ -2,7 +2,7 @@
2
2
  * autoNumeric.js
3
3
  * @author: Bob Knothe
4
4
  * @author: Sokolov Yura
5
- * @version: 1.9.22 - 2014-04-20 GMT 7:00 PM
5
+ * @version: 1.9.24 - 2014-06-29 GMT 10:30 AM
6
6
  *
7
7
  * Created by Robert J. Knothe on 2010-10-25. Please report any bugs to https://github.com/BobKnothe/autoNumeric
8
8
  * Created by Sokolov Yura on 2010-11-07
@@ -105,7 +105,7 @@
105
105
  function autoCode($this, settings) {
106
106
  runCallbacks($this, settings);
107
107
  settings.oEvent = null;
108
- settings.tagList = ['B', 'CAPTION', 'CITE', 'CODE', 'DD', 'DEL', 'DIV', 'DFN', 'DT', 'EM', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'INS', 'KDB', 'LABEL', 'LI', 'OUTPUT', 'P', 'Q', 'S', 'SAMPLE', 'SPAN', 'STRONG', 'TD', 'TH', 'U', 'VAR'];
108
+ settings.tagList = ['b', 'caption', 'cite', 'code', 'dd', 'del', 'div', 'dfn', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ins', 'kdb', 'label', 'li', 'output', 'p', 'q', 's', 'sample', 'span', 'strong', 'td', 'th', 'u', 'var'];
109
109
  var vmax = settings.vMax.toString().split('.'),
110
110
  vmin = (!settings.vMin && settings.vMin !== 0) ? [] : settings.vMin.toString().split('.');
111
111
  convertKeyToNumber(settings, 'vMax');
@@ -621,7 +621,7 @@
621
621
  },
622
622
  /**
623
623
  * process pasting, cursor moving and skipping of not interesting keys
624
- * if returns true, futher processing is not performed
624
+ * if returns true, further processing is not performed
625
625
  */
626
626
  skipAllways: function (e) {
627
627
  var kdCode = this.kdCode,
@@ -731,9 +731,11 @@
731
731
  }
732
732
  this.setValueParts(left + settingsClone.aDec, right);
733
733
  return true;
734
- } /** start rule on negative sign */
735
-
736
- if (cCode === '-' || cCode === '+') { /** prevent minus if not allowed */
734
+ }
735
+ /**
736
+ * start rule on negative sign & prevent minus if not allowed
737
+ */
738
+ if (cCode === '-' || cCode === '+') {
737
739
  if (!settingsClone.aNeg) {
738
740
  return true;
739
741
  } /** caret is always after minus */
@@ -801,7 +803,7 @@
801
803
  position = newLeft[0].length;
802
804
  /** if we are just before sign which is in prefix position */
803
805
  if (((position === 0 && value.charAt(0) !== settingsClone.aNeg) || (position === 1 && value.charAt(0) === settingsClone.aNeg)) && settingsClone.aSign && settingsClone.pSign === 'p') {
804
- /** place carret after prefix sign */
806
+ /** place caret after prefix sign */
805
807
  position = this.settingsClone.aSign.length + (value.charAt(0) === '-' ? 1 : 0);
806
808
  }
807
809
  } else if (settingsClone.aSign && settingsClone.pSign === 's') {
@@ -955,8 +957,8 @@
955
957
  }
956
958
  settings.runOnce = false;
957
959
  var holder = getHolder($this, settings);
958
- if ($.inArray($this.prop('tagName'), settings.tagList) === -1 && $this.prop('tagName') !== 'INPUT') {
959
- $.error("The <" + $this.prop('tagName') + "> is not supported by autoNumeric()");
960
+ if ($.inArray($this.prop('tagName').toLowerCase(), settings.tagList) === -1 && $this.prop('tagName').toLowerCase() !== 'input') {
961
+ $.error("The <" + $this.prop('tagName').toLowerCase() + "> is not supported by autoNumeric()");
960
962
  return this;
961
963
  }
962
964
  if (settings.runOnce === false && settings.aForm) {/** routine to format default value on page load */
@@ -974,7 +976,7 @@
974
976
  $this.autoNumeric('set', $this.val());
975
977
  }
976
978
  }
977
- if ($.inArray($this.prop('tagName'), settings.tagList) !== -1 && $this.text() !== '') {
979
+ if ($.inArray($this.prop('tagName').toLowerCase(), settings.tagList) !== -1 && $this.text() !== '') {
978
980
  $this.autoNumeric('set', $this.text());
979
981
  }
980
982
  }
@@ -1154,7 +1156,7 @@
1154
1156
  return this;
1155
1157
  }
1156
1158
  /** routine to handle page re-load from back button */
1157
- if (testValue !== $this.attr('value') && $this.prop('tagName') === 'INPUT' && settings.runOnce === false) {
1159
+ if (testValue !== $this.attr('value') && $this.prop('tagName').toLowerCase() === 'input' && settings.runOnce === false) {
1158
1160
  value = (settings.nBracket !== null) ? negativeBracket($this.val(), settings.nBracket, 'pageLoad') : value;
1159
1161
  value = autoStrip(value, settings);
1160
1162
  }
@@ -1180,10 +1182,10 @@
1180
1182
  if ($this.is('input[type=text], input[type=hidden], input[type=tel], input:not([type])')) { /**added hidden type */
1181
1183
  return $this.val(value);
1182
1184
  }
1183
- if ($.inArray($this.prop('tagName'), settings.tagList) !== -1) {
1185
+ if ($.inArray($this.prop('tagName').toLowerCase(), settings.tagList) !== -1) {
1184
1186
  return $this.text(value);
1185
1187
  }
1186
- $.error("The <" + $this.prop('tagName') + "> is not supported by autoNumeric()");
1188
+ $.error("The <" + $this.prop('tagName').toLowerCase() + "> is not supported by autoNumeric()");
1187
1189
  return false;
1188
1190
  });
1189
1191
  },
@@ -1200,10 +1202,10 @@
1200
1202
  /** determine the element type then use .eq(0) selector to grab the value of the first element in selector */
1201
1203
  if ($this.is('input[type=text], input[type=hidden], input[type=tel], input:not([type])')) { /**added hidden type */
1202
1204
  getValue = $this.eq(0).val();
1203
- } else if ($.inArray($this.prop('tagName'), settings.tagList) !== -1) {
1205
+ } else if ($.inArray($this.prop('tagName').toLowerCase(), settings.tagList) !== -1) {
1204
1206
  getValue = $this.eq(0).text();
1205
1207
  } else {
1206
- $.error("The <" + $this.prop('tagName') + "> is not supported by autoNumeric()");
1208
+ $.error("The <" + $this.prop('tagName').toLowerCase() + "> is not supported by autoNumeric()");
1207
1209
  return false;
1208
1210
  }
1209
1211
  if ((getValue === '' && settings.wEmpty === 'empty') || (getValue === settings.aSign && (settings.wEmpty === 'sign' || settings.wEmpty === 'empty'))) {
@@ -1246,8 +1248,7 @@
1246
1248
  if (isAutoNumeric === true) {
1247
1249
  return parts.join('&');
1248
1250
  }
1249
- $.error("You must initialize autoNumeric('init', {options}) prior to calling the 'getString' method");
1250
- return this;
1251
+ return str;
1251
1252
  },
1252
1253
  /** method to get the unformatted value from multiple fields */
1253
1254
  getArray: function () {
@@ -1284,4 +1285,4 @@
1284
1285
  }
1285
1286
  $.error('Method "' + method + '" is not supported by autoNumeric()');
1286
1287
  };
1287
- }(jQuery));
1288
+ }(jQuery));
@@ -1,2 +1,2 @@
1
- //= require autoNumeric-1.9.22.js
1
+ //= require autoNumeric-1.9.24.js
2
2
  //= require autonumeric_ujs.js
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * autonumeric_ujs.js
3
3
  * @author: randoum
4
- * @version: 1.9.22 - 2014-04-22
4
+ * @version: 1.9.24.0 - 2014-07-01
5
5
  *
6
6
  * Created by Randoum on 2013-08-15. Please report any bugs to https://github.com/randoum/autonumeric-rails
7
7
  *
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autonumeric-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.22.1
4
+ version: 1.9.24.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-16 00:00:00.000000000 Z
12
+ date: 2014-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails
@@ -253,7 +253,7 @@ files:
253
253
  - spec/dummy/public/favicon.ico
254
254
  - spec/spec_helper.rb
255
255
  - spec/support/wait_for_jquery.rb
256
- - vendor/assets/javascripts/autoNumeric-1.9.22.js
256
+ - vendor/assets/javascripts/autoNumeric-1.9.24.js
257
257
  - vendor/assets/javascripts/autonumeric.js
258
258
  - vendor/assets/javascripts/autonumeric_ujs.js
259
259
  homepage: https://github.com/randoum/autonumeric-rails