autotab-rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9351c775fcd31092b75263022302081712754caf
4
- data.tar.gz: c62d02214f1f6d6c2fad18603aab24d6e46c48bd
3
+ metadata.gz: a5996412b1831ab12acf35bf1710a8f4b1b8c7da
4
+ data.tar.gz: 813c8b43ac9d108c1dfb17e5378e5f550e41db07
5
5
  SHA512:
6
- metadata.gz: 7f6c9b6a08e5cc15765c57cf121c551b368b28a5de0c91d98750288aee4615af1e728b419acae402e8ae4170f8b84df4bfd9622d970157ae2a5548b9bed510b1
7
- data.tar.gz: 3c0aa3a3b2a07db7f14e5c6426acd38ee7612ba2fe5a8618e3f7a807b4d773a498002a103617cdbc43c0c97cf163bcba7f99960e8dcbb28f5defb11007f16300
6
+ metadata.gz: 8fb3f1a5e521cbc21ea5d5df06cd92382f6ff2b38280104ad47e86886fd2567887f35f11a0d737147ea345e1c6d03d1515ed65a2d59177f4516b217a0608c57c
7
+ data.tar.gz: 3b9b0f44e3a4718cc88dad27e89926784a7ab398424cb28a14f60d3b78d32265d95f6931ecf79621df0be06ed4c2122a22a006d164e2ad62d1176c19045ac71a
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'http://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in autotab-rails.gemspec
4
4
  gemspec
5
+
6
+ gem 'debugger'
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2013 by Sachin Singh
1
+ Copyright (C) 2014 by Sachin Singh
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/Rakefile CHANGED
@@ -1,10 +1,12 @@
1
1
  #!/usr/bin/env rake
2
+ # @author Sachin Singh
3
+
2
4
  require 'bundler/gem_tasks'
3
5
  require File.expand_path('../lib/autotab-rails/source_file', __FILE__)
4
6
 
5
7
  desc "Update with Harvest's AutoTab Library"
6
8
  task 'update-autotab', 'repository_url', 'branch' do |task, args|
7
- remote = args['repository_url'] || 'https://github.com/sachin87/autotab-rails'
9
+ remote = args['repository_url'] || 'https://github.com/Mathachew/jquery-autotab'
8
10
  branch = args['branch'] || 'master'
9
11
  files = SourceFile.new
10
12
  files.fetch remote, branch
@@ -1,3 +1,4 @@
1
+ # @author Sachin Singh
1
2
  # -*- encoding: utf-8 -*-
2
3
  require File.expand_path('../lib/autotab-rails/version', __FILE__)
3
4
 
@@ -1,3 +1,5 @@
1
+ # @author Sachin Singh
2
+
1
3
  module AutoTab
2
4
  module Rails
3
5
  class Engine < ::Rails::Engine
@@ -1,3 +1,5 @@
1
+ # @author Sachin Singh
2
+
1
3
  module Autotab
2
4
  module Rails
3
5
  class Engine3 < ::Rails::Engine
@@ -1,3 +1,5 @@
1
+ # @author Sachin Singh
2
+
1
3
  module AutoTab
2
4
  module Rails
3
5
  class Railtie < ::Rails::Railtie
@@ -1,3 +1,5 @@
1
+ # @author Sachin Singh
2
+
1
3
  require 'thor'
2
4
  require 'json'
3
5
 
@@ -7,8 +9,8 @@ class SourceFile < Thor
7
9
  desc 'fetch source files', 'fetch source files from GitHub'
8
10
  def fetch remote, branch
9
11
  self.destination_root = 'vendor/assets'
10
- get "#{remote}/raw/#{branch}/js/autotab-jquery.js", 'javascripts/autotab-jquery.js'
11
- get "#{remote}/raw/#{branch}/js/autotab-jquery.min.js", 'javascripts/autotab-jquery.min.js'
12
+ get "#{remote}/raw/#{branch}/js/jquery.autotab.js", 'javascripts/autotab-jquery.js'
13
+ get "#{remote}/raw/#{branch}/js/jquery.autotab.min.js", 'javascripts/autotab-jquery.min.js'
12
14
  get "#{remote}/raw/#{branch}/component.json", 'component.json'
13
15
  bump_version
14
16
  end
@@ -1,3 +1,5 @@
1
+ # @author Sachin Singh
2
+
1
3
  require 'fileutils'
2
4
 
3
5
  desc 'Create nondigest versions of all autotab digest assets'
@@ -1,6 +1,8 @@
1
+ # @author Sachin Singh
2
+
1
3
  module AutoTab
2
4
  module Rails
3
- VERSION = '0.0.1'
4
- AUTO_TAB_VERSION = '0.0.1'
5
+ VERSION = '0.0.2'
6
+ AUTO_TAB_VERSION = '1.6'
5
7
  end
6
8
  end
data/lib/autotab-rails.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # @author Sachin Singh
2
+
1
3
  require 'autotab-rails/version'
2
4
 
3
5
  module AutoTab
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Autotab - jQuery plugin 1.5.5
2
+ * Autotab - jQuery plugin 1.6
3
3
  * https://github.com/Mathachew/jquery-autotab
4
4
  *
5
- * Copyright (c) 2013 Matthew Miller
5
+ * Copyright (c) 2008, 2014 Matthew Miller
6
6
  *
7
7
  * Licensed under the MIT licensing:
8
8
  * http://www.opensource.org/licenses/mit-license.php
@@ -101,7 +101,14 @@
101
101
  newOptions.previous = defaults.previous;
102
102
 
103
103
  $.extend(defaults, newOptions);
104
- setSettings(this[i], defaults);
104
+
105
+ if (!defaults.loaded) {
106
+ defaults.disabled = true;
107
+ autotabBind(this[i], newOptions);
108
+ }
109
+ else {
110
+ setSettings(this[i], defaults);
111
+ }
105
112
  }
106
113
  }
107
114
  // Disable auto tab and filtering
@@ -353,7 +360,7 @@
353
360
  keyCode = e.which || e.keyCode;
354
361
 
355
362
  // e.charCode == 0 indicates a special key has been pressed, which only Firefox triggers
356
- if (!defaults || defaults.disabled || (settings.firefox && e.charCode === 0) || e.ctrlKey || e.altKey || keyCode == 13 || this.type != 'text') {
363
+ if (!defaults || defaults.disabled || (settings.firefox && e.charCode === 0) || e.ctrlKey || e.altKey || keyCode == 13 || (this.type != 'text' && this.type != 'password')) {
357
364
  return true;
358
365
  }
359
366
 
@@ -1,22 +1,22 @@
1
1
  /**
2
- * Autotab - jQuery plugin 1.5.5
2
+ * Autotab - jQuery plugin 1.6
3
3
  * https://github.com/Mathachew/jquery-autotab
4
4
  *
5
- * Copyright (c) 2013 Matthew Miller
5
+ * Copyright (c) 2008, 2014 Matthew Miller
6
6
  *
7
7
  * Licensed under the MIT licensing:
8
8
  * http://www.opensource.org/licenses/mit-license.php
9
9
  */
10
10
 
11
- (function(e){var n=navigator.platform,m=null,p="iPad"===n||"iPhone"===n||"iPod"===n,t="undefined"!==typeof InstallTrigger,h=function(b,c){if(null!==c&&"undefined"!==typeof c)for(var a in c)e(b).data("autotab-"+a,c[a])},k=function(b){var c={format:"all",loaded:!1,disabled:!1,pattern:null,uppercase:!1,lowercase:!1,nospace:!1,maxlength:2147483647,target:null,previous:null,trigger:null,originalValue:"",changed:!1},a;for(a in c)c[a]=e(b).data("autotab-"+a)||c[a];c.loaded||(null!==c.trigger&&"string"===
12
- typeof c.trigger&&(c.trigger=c.trigger.toString()),h(b,c));return c};e.autotab={next:function(){var b=e(document.activeElement);b.length&&b.trigger("autotab-next")},previous:function(){var b=e(document.activeElement);b.length&&b.trigger("autotab-previous")}};e.fn.autotab=function(b,c){if(!this.length)return this;if("filter"==b){if("string"===typeof c||"function"===typeof c)c={format:c};for(var a=0,d=this.length;a<d;a++){var f=k(this[a]),l=c;l.target=f.target;l.previous=f.previous;e.extend(f,l);h(this[a],
13
- f)}}else if("remove"==b||"destroy"==b||"disable"==b)for(a=0,d=this.length;a<d;a++)f=k(this[a]),f.disabled=!0,h(this[a],f);else if("restore"==b||"enable"==b)for(a=0,d=this.length;a<d;a++)f=k(this[a]),f.disabled=!1,h(this[a],f);else if(null===b||"undefined"===typeof b?c={}:"string"===typeof b||"function"===typeof b?c={format:b}:"object"===typeof b&&(c=b),1<this.length)for(a=0,d=this.length;a<d;a++){var f=a+1,r=a-1,l=c;0<a&&f<d?(l.target=this[f],l.previous=this[r]):0<a?(l.target=null,l.previous=this[r]):
14
- (l.target=this[f],l.previous=null);s(this[a],l)}else s(this[0],c);return this};var q=function(b,c,a){if("function"===typeof a.format)return a.format(c,b);b=null;switch(a.format){case "text":b=RegExp("[0-9]+","g");break;case "alpha":b=RegExp("[^a-zA-Z]+","g");break;case "number":case "numeric":b=RegExp("[^0-9]+","g");break;case "alphanumeric":b=RegExp("[^0-9a-zA-Z]+","g");break;case "hex":case "hexadecimal":b=RegExp("[^0-9A-Fa-f]+","g");break;case "custom":b=RegExp(a.pattern,"g")}null!==b&&(c=c.replace(b,
15
- ""));a.nospace&&(b=RegExp("[ ]+","g"),c=c.replace(b,""));a.uppercase&&(c=c.toUpperCase());a.lowercase&&(c=c.toLowerCase());return c},s=function(b,c){var a=k(b);a.disabled&&(a.disabled=!1,a.target=null,a.previous=null);e.extend(a,c);"string"!==typeof a.target&&a.target instanceof jQuery||(a.target=e(a.target));"string"!==typeof a.previous&&a.previous instanceof jQuery||(a.previous=e(a.previous));var d=b.maxLength;2147483647==a.maxlength&&2147483647!=d&&-1!=d?a.maxlength=d:0<a.maxlength?b.maxLength=
16
- a.maxlength:a.target=null;a.loaded?h(b,a):(a.loaded=!0,h(b,a),e(b).on("autotab-next",function(a,b){var c=this;setTimeout(function(){b||(b=k(c));b.disabled||!b.target.length||p||(b.target.focus().select(),m=new Date)},1)}).on("autotab-previous",function(a,b){var c=this;setTimeout(function(){b||(b=k(c));var a=b.previous;if(!b.disabled&&a.length){var f=a.val();f.length?(a.focus().val(f.substring(0,f.length-1)),h(a,{changed:!0})):a.focus();m=null}},1)}).on("focus",function(){h(this,{originalValue:this.value})}).on("blur",
17
- function(){var a=k(this);a.changed&&this.value!=a.originalValue&&(h(this,{changed:!1}),e(this).change())}).on("keydown",function(a){var b=k(this);if(!b||b.disabled)return!0;var c=a.which||a.charCode;if(8==c)0===this.value.length&&b.previous.length?e(this).trigger("autotab-previous",b):h(this,{changed:this.value!=b.originalValue});else if(9==c&&null!==m)if(a.shiftKey)m=null;else if(800>(new Date).getTime()-m.getTime())return m=null,!1}).on("keypress",function(a){var b=k(this),c=a.which||a.keyCode;
18
- if(!b||b.disabled||t&&0===a.charCode||a.ctrlKey||a.altKey||13==c||"text"!=this.type)return!0;c=String.fromCharCode(c);if(null!==b.trigger&&0<=b.trigger.indexOf(c))return null!==m&&800>(new Date).getTime()-m.getTime()?m=null:e(this).trigger("autotab-next",b),!1;m=null;a=document.selection&&document.selection.createRange?!0:0<a.charCode;c=q(this,c,b);if(a&&(null===c||""===c))return!1;if(a&&this.value.length<=this.maxLength){var g,d;a=0;if("number"===typeof this.selectionStart&&"number"===typeof this.selectionEnd)g=
19
- this.selectionStart,d=this.selectionEnd,a=1;else if(document.selection&&document.selection.createRange){d=document.selection.createRange();g=this.createTextRange();a=this.createTextRange();var u=d.getBookmark();g.moveToBookmark(u);a.setEndPoint("EndToStart",g);g=a.text.length;d=g+d.text.length;a=2}if(0===g&&d==this.value.length)this.value=c;else{if(this.value.length==this.maxLength&&g===d)return e(this).trigger("autotab-next",b),!1;this.value=this.value.slice(0,g)+c+this.value.slice(d)}h(this,{changed:this.value!=
20
- b.originalValue});this.value.length!=b.maxlength&&(g++,1==a?this.selectionStart=this.selectionEnd=g:2==a&&(c=this.createTextRange(),c.collapse(!0),c.moveEnd("character",g),c.moveStart("character",g),c.select()))}this.value.length==b.maxlength&&e(this).trigger("autotab-next",b);return!1}).on("paste",function(a){var b=k(this);if(!b)return!0;this.maxLength=2147483647;(function(a,c){setTimeout(function(){var d=-1,f=document.createElement("input");f.type="hidden";f.value=a.value.toLowerCase();a.maxLength=
21
- c.maxlength;a.value=q(a,a.value,c).substr(0,c.maxlength);var h=function(a,b){if(a){for(var c=0,g=b.length;c<g;c++)d=f.value.indexOf(b.charAt(c),d)+1;c=k(a);g=f.value.substr(d);(g=q(a,g,c).substr(0,c.maxlength))?(a.value=g,g.length==c.maxlength&&(e(a).trigger("autotab-next",c),p||h(c.target[0],g))):a.value=""}};a.value.length==c.maxlength&&(e(a).trigger("autotab-next",b),p||h(c.target[0],a.value.toLowerCase()))},1)})(this,b)}))};e.fn.autotab_magic=function(b){e(this).autotab()};e.fn.autotab_filter=
22
- function(b){var c={};"string"===typeof b||"function"===typeof b?c.format=b:e.extend(c,b);e(this).autotab("filter",c)}})(jQuery);
11
+ (function(f){var n=navigator.platform,m=null,p="iPad"===n||"iPhone"===n||"iPod"===n,t="undefined"!==typeof InstallTrigger,h=function(b,c){if(null!==c&&"undefined"!==typeof c)for(var a in c)f(b).data("autotab-"+a,c[a])},l=function(b){var c={format:"all",loaded:!1,disabled:!1,pattern:null,uppercase:!1,lowercase:!1,nospace:!1,maxlength:2147483647,target:null,previous:null,trigger:null,originalValue:"",changed:!1},a;for(a in c)c[a]=f(b).data("autotab-"+a)||c[a];c.loaded||(null!==c.trigger&&"string"===
12
+ typeof c.trigger&&(c.trigger=c.trigger.toString()),h(b,c));return c};f.autotab={next:function(){var b=f(document.activeElement);b.length&&b.trigger("autotab-next")},previous:function(){var b=f(document.activeElement);b.length&&b.trigger("autotab-previous")}};f.fn.autotab=function(b,c){if(!this.length)return this;if("filter"==b){if("string"===typeof c||"function"===typeof c)c={format:c};for(var a=0,d=this.length;a<d;a++){var e=l(this[a]),k=c;k.target=e.target;k.previous=e.previous;f.extend(e,k);e.loaded?
13
+ h(this[a],e):(e.disabled=!0,q(this[a],k))}}else if("remove"==b||"destroy"==b||"disable"==b)for(a=0,d=this.length;a<d;a++)e=l(this[a]),e.disabled=!0,h(this[a],e);else if("restore"==b||"enable"==b)for(a=0,d=this.length;a<d;a++)e=l(this[a]),e.disabled=!1,h(this[a],e);else if(null===b||"undefined"===typeof b?c={}:"string"===typeof b||"function"===typeof b?c={format:b}:"object"===typeof b&&(c=b),1<this.length)for(a=0,d=this.length;a<d;a++){var e=a+1,s=a-1,k=c;0<a&&e<d?(k.target=this[e],k.previous=this[s]):
14
+ 0<a?(k.target=null,k.previous=this[s]):(k.target=this[e],k.previous=null);q(this[a],k)}else q(this[0],c);return this};var r=function(b,c,a){if("function"===typeof a.format)return a.format(c,b);b=null;switch(a.format){case "text":b=RegExp("[0-9]+","g");break;case "alpha":b=RegExp("[^a-zA-Z]+","g");break;case "number":case "numeric":b=RegExp("[^0-9]+","g");break;case "alphanumeric":b=RegExp("[^0-9a-zA-Z]+","g");break;case "hex":case "hexadecimal":b=RegExp("[^0-9A-Fa-f]+","g");break;case "custom":b=
15
+ RegExp(a.pattern,"g")}null!==b&&(c=c.replace(b,""));a.nospace&&(b=RegExp("[ ]+","g"),c=c.replace(b,""));a.uppercase&&(c=c.toUpperCase());a.lowercase&&(c=c.toLowerCase());return c},q=function(b,c){var a=l(b);a.disabled&&(a.disabled=!1,a.target=null,a.previous=null);f.extend(a,c);"string"!==typeof a.target&&a.target instanceof jQuery||(a.target=f(a.target));"string"!==typeof a.previous&&a.previous instanceof jQuery||(a.previous=f(a.previous));var d=b.maxLength;2147483647==a.maxlength&&2147483647!=d&&
16
+ -1!=d?a.maxlength=d:0<a.maxlength?b.maxLength=a.maxlength:a.target=null;a.loaded?h(b,a):(a.loaded=!0,h(b,a),f(b).on("autotab-next",function(a,b){var c=this;setTimeout(function(){b||(b=l(c));b.disabled||!b.target.length||p||(b.target.focus().select(),m=new Date)},1)}).on("autotab-previous",function(a,b){var c=this;setTimeout(function(){b||(b=l(c));var a=b.previous;if(!b.disabled&&a.length){var e=a.val();e.length?(a.focus().val(e.substring(0,e.length-1)),h(a,{changed:!0})):a.focus();m=null}},1)}).on("focus",
17
+ function(){h(this,{originalValue:this.value})}).on("blur",function(){var a=l(this);a.changed&&this.value!=a.originalValue&&(h(this,{changed:!1}),f(this).change())}).on("keydown",function(a){var b=l(this);if(!b||b.disabled)return!0;var c=a.which||a.charCode;if(8==c)0===this.value.length&&b.previous.length?f(this).trigger("autotab-previous",b):h(this,{changed:this.value!=b.originalValue});else if(9==c&&null!==m)if(a.shiftKey)m=null;else if(800>(new Date).getTime()-m.getTime())return m=null,!1}).on("keypress",
18
+ function(a){var b=l(this),c=a.which||a.keyCode;if(!b||b.disabled||t&&0===a.charCode||a.ctrlKey||a.altKey||13==c||"text"!=this.type&&"password"!=this.type)return!0;c=String.fromCharCode(c);if(null!==b.trigger&&0<=b.trigger.indexOf(c))return null!==m&&800>(new Date).getTime()-m.getTime()?m=null:f(this).trigger("autotab-next",b),!1;m=null;a=document.selection&&document.selection.createRange?!0:0<a.charCode;c=r(this,c,b);if(a&&(null===c||""===c))return!1;if(a&&this.value.length<=this.maxLength){var g,
19
+ d;a=0;if("number"===typeof this.selectionStart&&"number"===typeof this.selectionEnd)g=this.selectionStart,d=this.selectionEnd,a=1;else if(document.selection&&document.selection.createRange){d=document.selection.createRange();g=this.createTextRange();a=this.createTextRange();var u=d.getBookmark();g.moveToBookmark(u);a.setEndPoint("EndToStart",g);g=a.text.length;d=g+d.text.length;a=2}if(0===g&&d==this.value.length)this.value=c;else{if(this.value.length==this.maxLength&&g===d)return f(this).trigger("autotab-next",
20
+ b),!1;this.value=this.value.slice(0,g)+c+this.value.slice(d)}h(this,{changed:this.value!=b.originalValue});this.value.length!=b.maxlength&&(g++,1==a?this.selectionStart=this.selectionEnd=g:2==a&&(c=this.createTextRange(),c.collapse(!0),c.moveEnd("character",g),c.moveStart("character",g),c.select()))}this.value.length==b.maxlength&&f(this).trigger("autotab-next",b);return!1}).on("paste",function(a){var b=l(this);if(!b)return!0;this.maxLength=2147483647;(function(a,c){setTimeout(function(){var d=-1,
21
+ e=document.createElement("input");e.type="hidden";e.value=a.value.toLowerCase();a.maxLength=c.maxlength;a.value=r(a,a.value,c).substr(0,c.maxlength);var h=function(a,b){if(a){for(var c=0,g=b.length;c<g;c++)d=e.value.indexOf(b.charAt(c),d)+1;c=l(a);g=e.value.substr(d);(g=r(a,g,c).substr(0,c.maxlength))?(a.value=g,g.length==c.maxlength&&(f(a).trigger("autotab-next",c),p||h(c.target[0],g))):a.value=""}};a.value.length==c.maxlength&&(f(a).trigger("autotab-next",b),p||h(c.target[0],a.value.toLowerCase()))},
22
+ 1)})(this,b)}))};f.fn.autotab_magic=function(b){f(this).autotab()};f.fn.autotab_filter=function(b){var c={};"string"===typeof b||"function"===typeof b?c.format=b:f.extend(c,b);f(this).autotab("filter",c)}})(jQuery);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autotab-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sachin Singh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-16 00:00:00.000000000 Z
11
+ date: 2014-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties