spree_zaez_clearsale 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +14 -0
- data/.rspec +1 -0
- data/.travis.yml +12 -0
- data/Gemfile +7 -0
- data/Guardfile +90 -0
- data/LICENSE +26 -0
- data/README.md +81 -0
- data/Rakefile +21 -0
- data/app/assets/javascripts/spree/backend/app/clear_sale_settings/clear_sale_add_provider.js.coffee +80 -0
- data/app/assets/javascripts/spree/backend/app/clear_sale_settings/clear_sale_provider.js.coffee +27 -0
- data/app/assets/javascripts/spree/backend/app/clear_sale_settings/clear_sale_settings.js.coffee +39 -0
- data/app/assets/javascripts/spree/backend/spree_zaez_clearsale.js +1 -0
- data/app/assets/javascripts/spree/frontend/app/addresses/phone_mask_address.js.coffee +26 -0
- data/app/assets/javascripts/spree/frontend/spree_zaez_clearsale.js +3 -0
- data/app/assets/stylesheets/spree/backend/spree_zaez_clearsale.css +18 -0
- data/app/assets/stylesheets/spree/frontend/spree_zaez_clearsale.css +4 -0
- data/app/controllers/spree/admin/clear_sale_settings_controller.rb +33 -0
- data/app/controllers/spree/admin/payments_controller_decorator.rb +9 -0
- data/app/helpers/orders_helper_decorator.rb +12 -0
- data/app/models/spree/clear_sale.rb +153 -0
- data/app/models/spree/credit_card_decorator.rb +10 -0
- data/app/models/spree/payment_decorator.rb +33 -0
- data/app/overrides/spree/address/_form/add_constructor_to_form.html.erb.deface +4 -0
- data/app/overrides/spree/admin/orders/index/replace_considered_risk_column.html.erb.deface +2 -0
- data/app/overrides/spree/admin/orders/index/replace_considered_risky_label.html.erb.deface +6 -0
- data/app/overrides/spree/admin/shared/_order_tabs/add_clear_sale_iframe_to_order_menu.html.erb.deface +6 -0
- data/app/overrides/spree/admin/shared/sub_menu/_configuration/add_clear_sale_settings_tab.html.erb.deface +2 -0
- data/app/views/spree/admin/clear_sale_settings/edit.html.erb +142 -0
- data/app/views/spree/admin/payments/clear_sale.html.erb +36 -0
- data/bin/rails +7 -0
- data/config/locales/en.yml +36 -0
- data/config/locales/pt-br.yml +36 -0
- data/config/routes.rb +9 -0
- data/db/migrate/20150608175547_add_bin_card_to_spree_credit_card.rb +5 -0
- data/db/migrate/20150611113444_add_clearsale_score_to_spree_payments.rb +5 -0
- data/lib/generators/spree_zaez_clearsale/install/install_generator.rb +31 -0
- data/lib/spree/clear_sale_configuration.rb +36 -0
- data/lib/spree_zaez_clearsale.rb +2 -0
- data/lib/spree_zaez_clearsale/engine.rb +27 -0
- data/lib/spree_zaez_clearsale/factories.rb +6 -0
- data/spec/features/admin/clear_sale_settings_spec.rb +145 -0
- data/spec/features/admin/orders/clearsale_spec.rb +60 -0
- data/spec/features/admin/orders/listing_spec.rb +47 -0
- data/spec/fixtures/clearsale_critical.txt +51 -0
- data/spec/fixtures/clearsale_high.txt +51 -0
- data/spec/fixtures/clearsale_low.txt +51 -0
- data/spec/fixtures/clearsale_medium.txt +51 -0
- data/spec/helpers/admin/orders_helper_decorator_spec.rb +32 -0
- data/spec/lib/spree/clear_sale_configuration_spec.rb +41 -0
- data/spec/models/spree/clear_sale_spec.rb +126 -0
- data/spec/models/spree/credit_card_decorator_spec.rb +11 -0
- data/spec/models/spree/payment_decorator_spec.rb +73 -0
- data/spec/spec_helper.rb +92 -0
- data/spec/support/capybara_login.rb +13 -0
- data/spec/support/verify_input_field.rb +16 -0
- data/spree_zaez_clearsale.gemspec +38 -0
- data/vendor/assets/javascripts/inputmask/inputmask.min.js +10 -0
- data/vendor/assets/javascripts/inputmask/jquery.inputmask.min.js +8 -0
- metadata +76 -3
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Spree::CreditCard do
|
4
|
+
context 'bin card' do
|
5
|
+
it 'should save the BIN of the card' do
|
6
|
+
cred_card = Spree::CreditCard.create(number: '1234567890000', month: '01', year: '2020',
|
7
|
+
name: 'Spree Commerce', verification_value: '123')
|
8
|
+
expect(cred_card.bin_card).to eq '123456'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Spree::Payment do
|
4
|
+
|
5
|
+
let(:order) { FactoryGirl.build(:completed_order_with_pending_payment) }
|
6
|
+
let(:payment) { FactoryGirl.build(:payment, order: order, created_at: Date.today) }
|
7
|
+
|
8
|
+
context 'register payment in ClearSale' do
|
9
|
+
it 'should return true if the payment is registered' do
|
10
|
+
payment.clearsale_score = 'low'
|
11
|
+
expect(payment.clearsale_registered?).to be true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'send request to ClearSale' do
|
16
|
+
|
17
|
+
before(:all) { Spree::ClearSaleConfig.providers = {'Spree::Gateway::Bogus' => 1} }
|
18
|
+
|
19
|
+
after(:all) { Spree::ClearSaleConfig.providers = {} }
|
20
|
+
|
21
|
+
it 'when score is low' do
|
22
|
+
stub_request(:post, Spree::ClearSaleConfig.integration_url).
|
23
|
+
with(:headers => {'Accept'=>'*/*',
|
24
|
+
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
25
|
+
'Content-Type'=>'application/x-www-form-urlencoded',
|
26
|
+
'User-Agent'=>'Ruby'},
|
27
|
+
:body => hash_including({'CodigoIntegracao'=>Spree::ClearSaleConfig.token})).
|
28
|
+
to_return(:body => File.read('spec/fixtures/clearsale_low.txt'), :status => 200)
|
29
|
+
|
30
|
+
payment.complete
|
31
|
+
expect(payment.reload.clearsale_score).to eq 'low'
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'when score is medium' do
|
35
|
+
stub_request(:post, Spree::ClearSaleConfig.integration_url).
|
36
|
+
with(:headers => {'Accept'=>'*/*',
|
37
|
+
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
38
|
+
'Content-Type'=>'application/x-www-form-urlencoded',
|
39
|
+
'User-Agent'=>'Ruby'},
|
40
|
+
:body => hash_including({'CodigoIntegracao'=>Spree::ClearSaleConfig.token})).
|
41
|
+
to_return(:body => File.read('spec/fixtures/clearsale_medium.txt'), :status => 200)
|
42
|
+
|
43
|
+
payment.complete
|
44
|
+
expect(payment.reload.clearsale_score).to eq 'medium'
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'when score is high' do
|
48
|
+
stub_request(:post, Spree::ClearSaleConfig.integration_url).
|
49
|
+
with(:headers => {'Accept'=>'*/*',
|
50
|
+
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
51
|
+
'Content-Type'=>'application/x-www-form-urlencoded',
|
52
|
+
'User-Agent'=>'Ruby'},
|
53
|
+
:body => hash_including({'CodigoIntegracao'=>Spree::ClearSaleConfig.token})).
|
54
|
+
to_return(:body => File.read('spec/fixtures/clearsale_high.txt'), :status => 200)
|
55
|
+
|
56
|
+
payment.complete
|
57
|
+
expect(payment.reload.clearsale_score).to eq 'high'
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'when score is critical' do
|
61
|
+
stub_request(:post, Spree::ClearSaleConfig.integration_url).
|
62
|
+
with(:headers => {'Accept'=>'*/*',
|
63
|
+
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
64
|
+
'Content-Type'=>'application/x-www-form-urlencoded',
|
65
|
+
'User-Agent'=>'Ruby'},
|
66
|
+
:body => hash_including({'CodigoIntegracao'=>Spree::ClearSaleConfig.token})).
|
67
|
+
to_return(:body => File.read('spec/fixtures/clearsale_critical.txt'), :status => 200)
|
68
|
+
|
69
|
+
payment.complete
|
70
|
+
expect(payment.reload.clearsale_score).to eq 'critical'
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# Run Coverage report
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start do
|
4
|
+
add_filter 'spec/dummy'
|
5
|
+
add_group 'Controllers', 'app/controllers'
|
6
|
+
add_group 'Helpers', 'app/helpers'
|
7
|
+
add_group 'Mailers', 'app/mailers'
|
8
|
+
add_group 'Models', 'app/models'
|
9
|
+
add_group 'Views', 'app/views'
|
10
|
+
add_group 'Libraries', 'lib'
|
11
|
+
end
|
12
|
+
|
13
|
+
# Configure Rails Environment
|
14
|
+
ENV['RAILS_ENV'] = 'test'
|
15
|
+
|
16
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
17
|
+
|
18
|
+
require 'rspec/rails'
|
19
|
+
require 'database_cleaner'
|
20
|
+
require 'ffaker'
|
21
|
+
require 'capybara/poltergeist'
|
22
|
+
Capybara.javascript_driver = :poltergeist
|
23
|
+
|
24
|
+
require 'webmock/rspec'
|
25
|
+
WebMock.disable_net_connect!(allow_localhost: true)
|
26
|
+
|
27
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
28
|
+
# in spec/support/ and its subdirectories.
|
29
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
30
|
+
|
31
|
+
# Requires factories and other useful helpers defined in spree_core.
|
32
|
+
require 'spree/testing_support/authorization_helpers'
|
33
|
+
require 'spree/testing_support/capybara_ext'
|
34
|
+
require 'spree/testing_support/controller_requests'
|
35
|
+
require 'spree/testing_support/factories'
|
36
|
+
require 'spree/testing_support/url_helpers'
|
37
|
+
|
38
|
+
# Requires factories defined in lib/spree_zaez_clearsale/factories.rb
|
39
|
+
require 'spree_zaez_clearsale/factories'
|
40
|
+
|
41
|
+
RSpec.configure do |config|
|
42
|
+
config.include FactoryGirl::Syntax::Methods
|
43
|
+
|
44
|
+
# Infer an example group's spec type from the file location.
|
45
|
+
config.infer_spec_type_from_file_location!
|
46
|
+
|
47
|
+
# == URL Helpers
|
48
|
+
#
|
49
|
+
# Allows access to Spree's routes in specs:
|
50
|
+
#
|
51
|
+
# visit spree.admin_path
|
52
|
+
# current_path.should eql(spree.products_path)
|
53
|
+
config.include Spree::TestingSupport::UrlHelpers
|
54
|
+
|
55
|
+
# == Mock Framework
|
56
|
+
#
|
57
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
58
|
+
#
|
59
|
+
# config.mock_with :mocha
|
60
|
+
# config.mock_with :flexmock
|
61
|
+
# config.mock_with :rr
|
62
|
+
config.mock_with :rspec
|
63
|
+
config.color = true
|
64
|
+
|
65
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
66
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
67
|
+
|
68
|
+
# Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
|
69
|
+
# to cleanup after each test instead. Without transactional fixtures set to false the records created
|
70
|
+
# to setup a test will be unavailable to the browser, which runs under a separate server instance.
|
71
|
+
config.use_transactional_fixtures = false
|
72
|
+
|
73
|
+
# Ensure Suite is set to use transactions for speed.
|
74
|
+
config.before :suite do
|
75
|
+
DatabaseCleaner.strategy = :transaction
|
76
|
+
DatabaseCleaner.clean_with :truncation
|
77
|
+
end
|
78
|
+
|
79
|
+
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
|
80
|
+
config.before :each do
|
81
|
+
DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
|
82
|
+
DatabaseCleaner.start
|
83
|
+
end
|
84
|
+
|
85
|
+
# After each spec clean the database.
|
86
|
+
config.after :each do
|
87
|
+
DatabaseCleaner.clean
|
88
|
+
end
|
89
|
+
|
90
|
+
config.fail_fast = ENV['FAIL_FAST'] || false
|
91
|
+
config.order = "random"
|
92
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
def sign_in_admin!(user)
|
2
|
+
visit '/admin'
|
3
|
+
fill_in 'Email', :with => user.email
|
4
|
+
fill_in 'Password', :with => user.password
|
5
|
+
click_button 'Login'
|
6
|
+
end
|
7
|
+
|
8
|
+
def create_admin_in_sign_in
|
9
|
+
@admin = Spree.user_class.create(email: 'admin@admin.com', password: 'password', password_confirmation: 'password')
|
10
|
+
@role = Spree::Role.create(name: 'admin')
|
11
|
+
@role.users << @admin
|
12
|
+
sign_in_admin! @admin
|
13
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Verify if the input has the value
|
2
|
+
#
|
3
|
+
# @author Isabella Santos
|
4
|
+
#
|
5
|
+
# @param name [String]
|
6
|
+
# @param object [Object]
|
7
|
+
# @param value [String, Integer]
|
8
|
+
#
|
9
|
+
def verify_input_value(name, object, value, default = nil)
|
10
|
+
expect(object[name]).to eq value
|
11
|
+
expect(find_field(name).value).to eq value.to_s
|
12
|
+
|
13
|
+
unless default.nil?
|
14
|
+
object[name] = default
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.platform = Gem::Platform::RUBY
|
4
|
+
s.name = 'spree_zaez_clearsale'
|
5
|
+
s.version = '3.0.1'
|
6
|
+
s.summary = 'Add the ClearSale verification to Spree Commerce'
|
7
|
+
s.description = 'Add the ClearSale verification to Spree Commerce'
|
8
|
+
s.required_ruby_version = '>= 2.0.0'
|
9
|
+
|
10
|
+
s.author = 'Zaez Team'
|
11
|
+
s.email = 'contato@zaez.net'
|
12
|
+
s.homepage = 'https://github.com/zaeznet/spree_zaez_clearsale'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.require_path = 'lib'
|
17
|
+
s.requirements << 'none'
|
18
|
+
|
19
|
+
s.add_dependency 'spree_core', '~> 3.0.0'
|
20
|
+
|
21
|
+
s.add_development_dependency 'poltergeist', '~> 1.5.0'
|
22
|
+
s.add_development_dependency 'capybara', '~> 2.4'
|
23
|
+
s.add_development_dependency 'coffee-rails'
|
24
|
+
s.add_development_dependency 'database_cleaner'
|
25
|
+
s.add_development_dependency 'factory_girl', '~> 4.5'
|
26
|
+
s.add_development_dependency 'factory_girl_rails'
|
27
|
+
s.add_development_dependency 'ffaker'
|
28
|
+
s.add_development_dependency 'rspec-rails', '~> 3.1'
|
29
|
+
s.add_development_dependency 'sass-rails', '~> 5.0.0.beta1'
|
30
|
+
s.add_development_dependency 'selenium-webdriver'
|
31
|
+
s.add_development_dependency 'simplecov'
|
32
|
+
s.add_development_dependency 'sqlite3'
|
33
|
+
s.add_development_dependency 'guard'
|
34
|
+
s.add_development_dependency 'guard-bundler'
|
35
|
+
s.add_development_dependency 'guard-rspec'
|
36
|
+
s.add_development_dependency 'guard-shell'
|
37
|
+
s.add_development_dependency 'webmock'
|
38
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/*!
|
2
|
+
* inputmask.min.js
|
3
|
+
* http://github.com/RobinHerbots/jquery.inputmask
|
4
|
+
* Copyright (c) 2010 - 2015 Robin Herbots
|
5
|
+
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
6
|
+
* Version: 3.1.64-74
|
7
|
+
*/
|
8
|
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function b(b){this.el=void 0,this.opts=a.extend(!0,{},this.defaults,b),this.noMasksCache=b&&void 0!==b.definitions,this.userOptions=b||{},e(this.opts.alias,b,this.opts)}function c(a){var b=document.createElement("input"),c="on"+a,d=c in b;return d||(b.setAttribute(c,"return;"),d="function"==typeof b[c]),b=null,d}function d(a){var b="text"==a||"tel"==a||"password"==a;if(!b){var c=document.createElement("input");c.setAttribute("type",a),b="text"===c.type,c=null}return b}function e(b,c,d){var f=d.aliases[b];return f?(f.alias&&e(f.alias,void 0,d),a.extend(!0,d,f),a.extend(!0,d,c),!0):(void 0==d.mask&&(d.mask=b),!1)}function f(b,c,d){var f=a(b),g=f.data("inputmask");if(g&&""!=g)try{g=g.replace(new RegExp("'","g"),'"');var h=a.parseJSON("{"+g+"}");a.extend(!0,d,h)}catch(i){}for(var j in c){var k=f.data("inputmask-"+j.toLowerCase());void 0!=k&&(k="boolean"==typeof k?k:k.toString(),"mask"==j&&0==k.indexOf("[")?(d[j]=k.replace(/[\s[\]]/g,"").split("','"),d[j][0]=d[j][0].replace("'",""),d[j][d[j].length-1]=d[j][d[j].length-1].replace("'","")):d[j]=k)}return d.alias?e(d.alias,d,c):a.extend(!0,c,d),c}function g(c,d){function e(b){function d(a,b,c,d){this.matches=[],this.isGroup=a||!1,this.isOptional=b||!1,this.isQuantifier=c||!1,this.isAlternator=d||!1,this.quantifier={min:1,max:1}}function e(b,d,e){var f=c.definitions[d],g=0==b.matches.length;if(e=void 0!=e?e:b.matches.length,f&&!m){f.placeholder=a.isFunction(f.placeholder)?f.placeholder.call(this,c):f.placeholder;for(var h=f.prevalidator,i=h?h.length:0,j=1;j<f.cardinality;j++){var k=i>=j?h[j-1]:[],l=k.validator,n=k.cardinality;b.matches.splice(e++,0,{fn:l?"string"==typeof l?new RegExp(l):new function(){this.test=l}:new RegExp("."),cardinality:n?n:1,optionality:b.isOptional,newBlockMarker:g,casing:f.casing,def:f.definitionSymbol||d,placeholder:f.placeholder,mask:d})}b.matches.splice(e++,0,{fn:f.validator?"string"==typeof f.validator?new RegExp(f.validator):new function(){this.test=f.validator}:new RegExp("."),cardinality:f.cardinality,optionality:b.isOptional,newBlockMarker:g,casing:f.casing,def:f.definitionSymbol||d,placeholder:f.placeholder,mask:d})}else b.matches.splice(e++,0,{fn:null,cardinality:0,optionality:b.isOptional,newBlockMarker:g,casing:null,def:d,placeholder:void 0,mask:d}),m=!1}for(var f,g,h,i,j,k,l=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})\??|[^.?*+^${[]()|\\]+|./g,m=!1,n=new d,o=[],p=[];f=l.exec(b);)switch(g=f[0],g.charAt(0)){case c.optionalmarker.end:case c.groupmarker.end:if(h=o.pop(),o.length>0){if(i=o[o.length-1],i.matches.push(h),i.isAlternator){j=o.pop();for(var q=0;q<j.matches.length;q++)j.matches[q].isGroup=!1;o.length>0?(i=o[o.length-1],i.matches.push(j)):n.matches.push(j)}}else n.matches.push(h);break;case c.optionalmarker.start:o.push(new d(!1,!0));break;case c.groupmarker.start:o.push(new d(!0));break;case c.quantifiermarker.start:var r=new d(!1,!1,!0);g=g.replace(/[{}]/g,"");var s=g.split(","),t=isNaN(s[0])?s[0]:parseInt(s[0]),u=1==s.length?t:isNaN(s[1])?s[1]:parseInt(s[1]);if(("*"==u||"+"==u)&&(t="*"==u?0:1),r.quantifier={min:t,max:u},o.length>0){var v=o[o.length-1].matches;if(f=v.pop(),!f.isGroup){var w=new d(!0);w.matches.push(f),f=w}v.push(f),v.push(r)}else{if(f=n.matches.pop(),!f.isGroup){var w=new d(!0);w.matches.push(f),f=w}n.matches.push(f),n.matches.push(r)}break;case c.escapeChar:m=!0;break;case c.alternatormarker:o.length>0?(i=o[o.length-1],k=i.matches.pop()):k=n.matches.pop(),k.isAlternator?o.push(k):(j=new d(!1,!1,!1,!0),j.matches.push(k),o.push(j));break;default:if(o.length>0){if(i=o[o.length-1],i.matches.length>0&&!i.isAlternator&&(k=i.matches[i.matches.length-1],k.isGroup&&(k.isGroup=!1,e(k,c.groupmarker.start,0),e(k,c.groupmarker.end))),e(i,g),i.isAlternator){j=o.pop();for(var q=0;q<j.matches.length;q++)j.matches[q].isGroup=!1;o.length>0?(i=o[o.length-1],i.matches.push(j)):n.matches.push(j)}}else n.matches.length>0&&(k=n.matches[n.matches.length-1],k.isGroup&&(k.isGroup=!1,e(k,c.groupmarker.start,0),e(k,c.groupmarker.end))),e(n,g)}return n.matches.length>0&&(k=n.matches[n.matches.length-1],k.isGroup&&(k.isGroup=!1,e(k,c.groupmarker.start,0),e(k,c.groupmarker.end)),p.push(n)),p}function f(f,g){if(void 0==f||""==f)return void 0;if(1==f.length&&0==c.greedy&&0!=c.repeat&&(c.placeholder=""),c.repeat>0||"*"==c.repeat||"+"==c.repeat){var h="*"==c.repeat?0:"+"==c.repeat?1:c.repeat;f=c.groupmarker.start+f+c.groupmarker.end+c.quantifiermarker.start+h+","+c.repeat+c.quantifiermarker.end}var i;return void 0==b.prototype.masksCache[f]||d===!0?(i={mask:f,maskToken:e(f),validPositions:{},_buffer:void 0,buffer:void 0,tests:{},metadata:g},d!==!0&&(b.prototype.masksCache[f]=i)):i=a.extend(!0,{},b.prototype.masksCache[f]),i}function g(a){if(a=a.toString(),c.numericInput){a=a.split("").reverse();for(var b=0;b<a.length;b++)a[b]==c.optionalmarker.start?a[b]=c.optionalmarker.end:a[b]==c.optionalmarker.end?a[b]=c.optionalmarker.start:a[b]==c.groupmarker.start?a[b]=c.groupmarker.end:a[b]==c.groupmarker.end&&(a[b]=c.groupmarker.start);a=a.join("")}return a}var h=void 0;if(a.isFunction(c.mask)&&(c.mask=c.mask.call(this,c)),a.isArray(c.mask)){if(c.mask.length>1){c.keepStatic=void 0==c.keepStatic?!0:c.keepStatic;var i="(";return a.each(c.mask,function(b,c){i.length>1&&(i+=")|("),i+=g(void 0==c.mask||a.isFunction(c.mask)?c:c.mask)}),i+=")",f(i,c.mask)}c.mask=c.mask.pop()}return c.mask&&(h=void 0==c.mask.mask||a.isFunction(c.mask.mask)?f(g(c.mask),c.mask):f(g(c.mask.mask),c.mask)),h}function h(e,f,g){function h(a,b,c){b=b||0;var d,e,f,g=[],h=0;do{if(a===!0&&i().validPositions[h]){var j=i().validPositions[h];e=j.match,d=j.locator.slice(),g.push(c===!0?j.input:H(h,e))}else f=r(h,d,h-1),e=f.match,d=f.locator.slice(),g.push(H(h,e));h++}while((void 0==fa||fa>h-1)&&null!=e.fn||null==e.fn&&""!=e.def||b>=h);return g.pop(),g}function i(){return f}function n(a){var b=i();b.buffer=void 0,b.tests={},a!==!0&&(b._buffer=void 0,b.validPositions={},b.p=0)}function o(a,b){var c=i(),d=-1,e=c.validPositions;void 0==a&&(a=-1);var f=d,g=d;for(var h in e){var j=parseInt(h);e[j]&&(b||null!=e[j].match.fn)&&(a>=j&&(f=j),j>=a&&(g=j))}return d=-1!=f&&a-f>1||a>g?f:g}function p(b,c,d){if(g.insertMode&&void 0!=i().validPositions[b]&&void 0==d){var e,f=a.extend(!0,{},i().validPositions),h=o();for(e=b;h>=e;e++)delete i().validPositions[e];i().validPositions[b]=c;var j,k=!0,l=i().validPositions;for(e=j=b;h>=e;e++){var m=f[e];if(void 0!=m)for(var n=j,p=-1;n<C()&&(null==m.match.fn&&l[e]&&(l[e].match.optionalQuantifier===!0||l[e].match.optionality===!0)||null!=m.match.fn);){if(null==m.match.fn||!g.keepStatic&&l[e]&&(void 0!=l[e+1]&&u(e+1,l[e].locator.slice(),e).length>1||void 0!=l[e].alternation)?n++:n=D(j),t(n,m.match.def)){k=A(n,m.input,!0,!0)!==!1,j=n;break}if(k=null==m.match.fn,p==n)break;p=n}if(!k)break}if(!k)return i().validPositions=a.extend(!0,{},f),!1}else i().validPositions[b]=c;return!0}function q(a,b,c,d){var e,f=a;i().p=a;for(e=f;b>e;e++)void 0!=i().validPositions[e]&&(c===!0||0!=g.canClearPosition(i(),e,o(),d,g))&&delete i().validPositions[e];for(n(!0),e=f+1;e<=o();){for(;void 0!=i().validPositions[f];)f++;var h=i().validPositions[f];f>e&&(e=f+1);var j=i().validPositions[e];void 0!=j&&void 0==h?(t(f,j.match.def)&&A(f,j.input,!0)!==!1&&(delete i().validPositions[e],e++),f++):e++}var k=o(),l=C();for(c!==!0&&void 0!=i().validPositions[k]&&i().validPositions[k].input==g.radixPoint&&delete i().validPositions[k],e=k+1;l>=e;e++)i().validPositions[e]&&delete i().validPositions[e];n(!0)}function r(a,b,c){var d=i().validPositions[a];if(void 0==d)for(var e=u(a,b,c),f=o(),h=i().validPositions[f]||u(0)[0],j=void 0!=h.alternation?h.locator[h.alternation].toString().split(","):[],k=0;k<e.length&&(d=e[k],!(d.match&&(g.greedy&&d.match.optionalQuantifier!==!0||(d.match.optionality===!1||d.match.newBlockMarker===!1)&&d.match.optionalQuantifier!==!0)&&(void 0==h.alternation||h.alternation!=d.alternation||void 0!=d.locator[h.alternation]&&z(d.locator[h.alternation].toString().split(","),j))));k++);return d}function s(a){return i().validPositions[a]?i().validPositions[a].match:u(a)[0].match}function t(a,b){for(var c=!1,d=u(a),e=0;e<d.length;e++)if(d[e].match&&d[e].match.def==b){c=!0;break}return c}function u(b,c,d,e){function f(c,d,e,g){function j(e,g,n){if(h>1e4)return alert("jquery.inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. "+i().mask),!0;if(h==b&&void 0==e.matches)return k.push({match:e,locator:g.reverse()}),!0;if(void 0!=e.matches){if(e.isGroup&&n!==!0){if(e=j(c.matches[m+1],g))return!0}else if(e.isOptional){var o=e;if(e=f(e,d,g,n)){var p=k[k.length-1].match,q=0==a.inArray(p,o.matches);if(!q)return!0;l=!0,h=b}}else if(e.isAlternator){var r,s=e,t=[],u=k.slice(),v=g.length,w=d.length>0?d.shift():-1;if(-1==w||"string"==typeof w){var x=h,y=d.slice(),z=[];"string"==typeof w&&(z=w.split(","));for(var A=0;A<s.matches.length;A++){if(k=[],e=j(s.matches[A],[A].concat(g),n)||e,e!==!0&&void 0!=e&&z[z.length-1]<s.matches.length){var B=c.matches.indexOf(e)+1;c.matches.length>B&&(e=j(c.matches[B],[B].concat(g.slice(1,g.length)),n),e&&(z.push(B.toString()),a.each(k,function(a,b){b.alternation=g.length-1})))}r=k.slice(),h=x,k=[];for(var C=0;C<y.length;C++)d[C]=y[C];for(var D=0;D<r.length;D++){var E=r[D];E.alternation=E.alternation||v;for(var F=0;F<t.length;F++){var G=t[F];if(E.match.mask==G.match.mask&&("string"!=typeof w||-1!=a.inArray(E.locator[E.alternation].toString(),z))){r.splice(D,1),D--,G.locator[E.alternation]=G.locator[E.alternation]+","+E.locator[E.alternation],G.alternation=E.alternation;break}}}t=t.concat(r)}"string"==typeof w&&(t=a.map(t,function(b,c){if(isFinite(c)){var d,e=b.alternation,f=b.locator[e].toString().split(",");b.locator[e]=void 0,b.alternation=void 0;for(var g=0;g<f.length;g++)d=-1!=a.inArray(f[g],z),d&&(void 0!=b.locator[e]?(b.locator[e]+=",",b.locator[e]+=f[g]):b.locator[e]=parseInt(f[g]),b.alternation=e);if(void 0!=b.locator[e])return b}})),k=u.concat(t),h=b,l=k.length>0}else e=s.matches[w]?j(s.matches[w],[w].concat(g),n):!1;if(e)return!0}else if(e.isQuantifier&&n!==!0)for(var H=e,I=d.length>0&&n!==!0?d.shift():0;I<(isNaN(H.quantifier.max)?I+1:H.quantifier.max)&&b>=h;I++){var J=c.matches[a.inArray(H,c.matches)-1];if(e=j(J,[I].concat(g),!0)){var p=k[k.length-1].match;p.optionalQuantifier=I>H.quantifier.min-1;var q=0==a.inArray(p,J.matches);if(q){if(I>H.quantifier.min-1){l=!0,h=b;break}return!0}return!0}}else if(e=f(e,d,g,n))return!0}else h++}for(var m=d.length>0?d.shift():0;m<c.matches.length;m++)if(c.matches[m].isQuantifier!==!0){var n=j(c.matches[m],[m].concat(e),g);if(n&&h==b)return n;if(h>b)break}}var g=i().maskToken,h=c?d:0,j=c||[0],k=[],l=!1;if(e===!0&&i().tests[b])return i().tests[b];if(void 0==c){for(var m,n=b-1;void 0==(m=i().validPositions[n])&&n>-1&&(!i().tests[n]||void 0==(m=i().tests[n][0]));)n--;void 0!=m&&n>-1&&(h=n,j=m.locator.slice())}for(var o=j.shift();o<g.length;o++){var p=f(g[o],j,[o]);if(p&&h==b||h>b)break}return(0==k.length||l)&&k.push({match:{fn:null,cardinality:0,optionality:!0,casing:null,def:""},locator:[]}),i().tests[b]=a.extend(!0,[],k),i().tests[b]}function v(){return void 0==i()._buffer&&(i()._buffer=h(!1,1)),i()._buffer}function w(){return void 0==i().buffer&&(i().buffer=h(!0,o(),!0)),i().buffer}function x(a,b,c){if(c=c||w().slice(),a===!0)n(),a=0,b=c.length;else for(var d=a;b>d;d++)delete i().validPositions[d],delete i().tests[d];for(var d=a;b>d;d++)c[d]!=g.skipOptionalPartCharacter&&A(d,c[d],!0,!0)}function y(a,b){switch(b.casing){case"upper":a=a.toUpperCase();break;case"lower":a=a.toLowerCase()}return a}function z(b,c){for(var d=g.greedy?c:c.slice(0,1),e=!1,f=0;f<b.length;f++)if(-1!=a.inArray(b[f],d)){e=!0;break}return e}function A(b,c,d,e){function f(b,c,d,e){var f=!1;return a.each(u(b),function(h,j){for(var k=j.match,l=c?1:0,m="",r=(w(),k.cardinality);r>l;r--)m+=F(b-(r-1));if(c&&(m+=c),f=null!=k.fn?k.fn.test(m,i(),b,d,g):c!=k.def&&c!=g.skipOptionalPartCharacter||""==k.def?!1:{c:k.def,pos:b},f!==!1){var s=void 0!=f.c?f.c:c;s=s==g.skipOptionalPartCharacter&&null===k.fn?k.def:s;var t=b,u=w();if(void 0!=f.remove&&(a.isArray(f.remove)||(f.remove=[f.remove]),a.each(f.remove.sort(function(a,b){return b-a}),function(a,b){q(b,b+1,!0)})),void 0!=f.insert&&(a.isArray(f.insert)||(f.insert=[f.insert]),a.each(f.insert.sort(function(a,b){return a-b}),function(a,b){A(b.pos,b.c,!0)})),f.refreshFromBuffer){var v=f.refreshFromBuffer;if(d=!0,x(v===!0?v:v.start,v.end,u),void 0==f.pos&&void 0==f.c)return f.pos=o(),!1;if(t=void 0!=f.pos?f.pos:b,t!=b)return f=a.extend(f,A(t,s,!0)),!1}else if(f!==!0&&void 0!=f.pos&&f.pos!=b&&(t=f.pos,x(b,t),t!=b))return f=a.extend(f,A(t,s,!0)),!1;return 1!=f&&void 0==f.pos&&void 0==f.c?!1:(h>0&&n(!0),p(t,a.extend({},j,{input:y(s,k)}),e)||(f=!1),!1)}}),f}function h(b,c,d,e){for(var f,h,j,k,l=a.extend(!0,{},i().validPositions),m=o();m>=0&&(k=i().validPositions[m],!k||void 0==k.alternation||(f=m,h=i().validPositions[f].alternation,r(f).locator[k.alternation]==k.locator[k.alternation]));m--);if(void 0!=h){f=parseInt(f);for(var p in i().validPositions)if(p=parseInt(p),k=i().validPositions[p],p>=f&&void 0!=k.alternation){var q=i().validPositions[f].locator[h].toString().split(","),s=k.locator[h]||q[0];s.length>0&&(s=s.split(",")[0]);for(var t=0;t<q.length;t++)if(s<q[t]){for(var u,v,w=p;w>=0;w--)if(u=i().validPositions[w],void 0!=u){v=u.locator[h],u.locator[h]=parseInt(q[t]);break}if(s!=u.locator[h]){for(var x=[],y=0,z=p+1;z<o()+1;z++){var B=i().validPositions[z];B&&(null!=B.match.fn?x.push(B.input):b>z&&y++),delete i().validPositions[z],delete i().tests[z]}for(n(!0),g.keepStatic=!g.keepStatic,j=!0;x.length>0;){var C=x.shift();if(C!=g.skipOptionalPartCharacter&&!(j=A(o()+1,C,!1,!0)))break}if(u.alternation=h,u.locator[h]=v,j){for(var D=o(b)+1,E=0,z=p+1;z<o()+1;z++){var B=i().validPositions[z];B&&null==B.match.fn&&b>z&&E++}b+=E-y,j=A(b>D?D:b,c,d,e)}if(g.keepStatic=!g.keepStatic,j)return j;n(),i().validPositions=a.extend(!0,{},l)}}break}}return!1}function j(b,c){for(var d=i().validPositions[c],e=d.locator,f=e.length,g=b;c>g;g++)if(!B(g)){var h=u(g),j=h[0],k=-1;a.each(h,function(a,b){for(var c=0;f>c;c++)b.locator[c]&&z(b.locator[c].toString().split(","),e[c].toString().split(","))&&c>k&&(k=c,j=b)}),p(g,a.extend({},j,{input:j.match.def}),!0)}}d=d===!0;for(var k=w(),l=b-1;l>-1&&!i().validPositions[l];l--);for(l++;b>l;l++)void 0==i().validPositions[l]&&((!B(l)||k[l]!=H(l))&&u(l).length>1||k[l]==g.radixPoint||"0"==k[l]&&a.inArray(g.radixPoint,k)<l)&&f(l,k[l],!0);var m=b,s=!1,t=a.extend(!0,{},i().validPositions);if(m<C()&&(s=f(m,c,d,e),(!d||e)&&s===!1)){var v=i().validPositions[m];if(!v||null!=v.match.fn||v.match.def!=c&&c!=g.skipOptionalPartCharacter){if((g.insertMode||void 0==i().validPositions[D(m)])&&!B(m))for(var E=m+1,G=D(m);G>=E;E++)if(s=f(E,c,d,e),s!==!1){j(m,E),m=E;break}}else s={caret:D(m)}}if(s===!1&&g.keepStatic&&P(k)&&(s=h(b,c,d,e)),s===!0&&(s={pos:m}),a.isFunction(g.postValidation)&&0!=s&&!d){n(!0);var I=g.postValidation(w(),g);if(!I)return n(!0),i().validPositions=a.extend(!0,{},t),!1}return s}function B(a){var b=s(a);if(null!=b.fn)return b.fn;if(!g.keepStatic&&void 0==i().validPositions[a]){for(var c=u(a),d=!0,e=0;e<c.length;e++)if(""!=c[e].match.def&&(void 0==c[e].alternation||c[e].locator[c[e].alternation].length>1)){d=!1;break}return d}return!1}function C(){var a;fa=ea.prop("maxLength"),-1==fa&&(fa=void 0);var b,c=o(),d=i().validPositions[c],e=void 0!=d?d.locator.slice():void 0;for(b=c+1;void 0==d||null!=d.match.fn||null==d.match.fn&&""!=d.match.def;b++)d=r(b,e,b-1),e=d.locator.slice();var f=s(b-1);return a=""!=f.def?b:b-1,void 0==fa||fa>a?a:fa}function D(a){var b=C();if(a>=b)return b;for(var c=a;++c<b&&!B(c)&&(g.nojumps!==!0||g.nojumpsThreshold>c););return c}function E(a){var b=a;if(0>=b)return 0;for(;--b>0&&!B(b););return b}function F(a){return void 0==i().validPositions[a]?H(a):i().validPositions[a].input}function G(b,c,d,e,f){if(e&&a.isFunction(g.onBeforeWrite)){var h=g.onBeforeWrite.call(b,e,c,d,g);if(h){if(h.refreshFromBuffer){var i=h.refreshFromBuffer;x(i===!0?i:i.start,i.end,h.buffer),n(!0),c=w()}d=h.caret||d}}b._valueSet(c.join("")),void 0!=d&&M(b,d),f===!0&&(ia=!0,a(b).trigger("input"))}function H(a,b){if(b=b||s(a),void 0!=b.placeholder)return b.placeholder;if(null==b.fn){if(!g.keepStatic&&void 0==i().validPositions[a]){for(var c,d=u(a),e=!1,f=0;f<d.length;f++){if(c&&""!=d[f].match.def&&d[f].match.def!=c.match.def&&(void 0==d[f].alternation||d[f].alternation==c.alternation)){e=!0;break}1!=d[f].match.optionality&&1!=d[f].match.optionalQuantifier&&(c=d[f])}if(e)return g.placeholder.charAt(a%g.placeholder.length)}return b.def}return g.placeholder.charAt(a%g.placeholder.length)}function I(b,c,d,e){function f(){var a=!1,b=v().slice(j,D(j)).join("").indexOf(h);if(-1!=b&&!B(j)){a=!0;for(var c=v().slice(j,j+b),d=0;d<c.length;d++)if(" "!=c[d]){a=!1;break}}return a}var g=void 0!=e?e.slice():b._valueGet().split(""),h="",j=0;if(n(),i().p=D(-1),c&&b._valueSet(""),!d){var k=v().slice(0,D(-1)).join(""),l=g.join("").match(new RegExp("^"+J(k),"g"));l&&l.length>0&&(g.splice(0,l.length*k.length),j=D(j))}a.each(g,function(c,e){var g=a.Event("keypress");g.which=e.charCodeAt(0),h+=e;var k=o(void 0,!0),l=i().validPositions[k],m=r(k+1,l?l.locator.slice():void 0,k);if(!f()||d){var n=d?c:null==m.match.fn&&m.match.optionality&&k+1<i().p?k+1:i().p;V.call(b,g,!0,!1,d,n),j=n+1,h=""}else V.call(b,g,!0,!1,!0,k+1)}),c&&G(b,w(),a(b).is(":focus")?D(o(0)):void 0,a.Event("checkval"))}function J(a){return b.escapeRegex(a)}function K(b){if(b[0].inputmask&&!b.hasClass("hasDatepicker")){var c=[],d=i().validPositions;for(var e in d)d[e].match&&null!=d[e].match.fn&&c.push(d[e].input);var f=(ga?c.reverse():c).join(""),h=(ga?w().slice().reverse():w()).join("");return a.isFunction(g.onUnMask)&&(f=g.onUnMask.call(b,h,f,g)||f),f}return b[0]._valueGet()}function L(a){if(ga&&"number"==typeof a&&(!g.greedy||""!=g.placeholder)){var b=w().length;a=b-a}return a}function M(b,c,d){var e,f=b.jquery&&b.length>0?b[0]:b;if("number"!=typeof c)return f.setSelectionRange?(c=f.selectionStart,d=f.selectionEnd):window.getSelection?(e=window.getSelection().getRangeAt(0),(e.commonAncestorContainer.parentNode==f||e.commonAncestorContainer==f)&&(c=e.startOffset,d=e.endOffset)):document.selection&&document.selection.createRange&&(e=document.selection.createRange(),c=0-e.duplicate().moveStart("character",-1e5),d=c+e.text.length),{begin:L(c),end:L(d)};if(c=L(c),d=L(d),d="number"==typeof d?d:c,a(f).is(":visible")){var h=a(f).css("font-size").replace("px","")*d;if(f.scrollLeft=h>f.scrollWidth?h:0,k||0!=g.insertMode||c!=d||d++,f.setSelectionRange)f.selectionStart=c,f.selectionEnd=d;else if(window.getSelection){if(e=document.createRange(),void 0==f.firstChild){var i=document.createTextNode("");f.appendChild(i)}e.setStart(f.firstChild,c<f._valueGet().length?c:f._valueGet().length),e.setEnd(f.firstChild,d<f._valueGet().length?d:f._valueGet().length),e.collapse(!0);var j=window.getSelection();j.removeAllRanges(),j.addRange(e)}else f.createTextRange&&(e=f.createTextRange(),e.collapse(!0),e.moveEnd("character",d),e.moveStart("character",c),e.select())}}function N(b){var c,d,e=w(),f=e.length,g=o(),h={},j=i().validPositions[g],k=void 0!=j?j.locator.slice():void 0;for(c=g+1;c<e.length;c++)d=r(c,k,c-1),k=d.locator.slice(),h[c]=a.extend(!0,{},d);var l=j&&void 0!=j.alternation?j.locator[j.alternation]:void 0;for(c=f-1;c>g&&(d=h[c],(d.match.optionality||d.match.optionalQuantifier||l&&(l!=h[c].locator[j.alternation]&&null!=d.match.fn||null==d.match.fn&&d.locator[j.alternation]&&z(d.locator[j.alternation].toString().split(","),l.split(","))&&""!=u(c)[0].def))&&e[c]==H(c,d.match));c--)f--;return b?{l:f,def:h[f]?h[f].match:void 0}:f}function O(a){for(var b=N(),c=a.length-1;c>b&&!B(c);c--);return a.splice(b,c+1-b),a}function P(b){if(a.isFunction(g.isComplete))return g.isComplete.call(ea,b,g);if("*"==g.repeat)return void 0;{var c=!1,d=N(!0),e=E(d.l);o()}if(void 0==d.def||d.def.newBlockMarker||d.def.optionality||d.def.optionalQuantifier){c=!0;for(var f=0;e>=f;f++){var h=r(f).match;if(null!=h.fn&&void 0==i().validPositions[f]&&h.optionality!==!0&&h.optionalQuantifier!==!0||null==h.fn&&b[f]!=H(f,h)){c=!1;break}}}return c}function Q(a,b){return ga?a-b>1||a-b==1&&g.insertMode:b-a>1||b-a==1&&g.insertMode}function R(c){var d=a._data(c).events,e=!1;a.each(d,function(c,d){a.each(d,function(a,c){if("inputmask"==c.namespace&&"setvalue"!=c.type){var d=c.handler;c.handler=function(a){if(!(this.disabled||this.readOnly&&!("keydown"==a.type&&a.ctrlKey&&67==a.keyCode||a.keyCode==b.keyCode.TAB))){switch(a.type){case"input":if(ia===!0||e===!0)return ia=!1,a.preventDefault();break;case"keydown":ha=!1,e=!1;break;case"keypress":if(ha===!0)return a.preventDefault();ha=!0;break;case"compositionstart":e=!0;break;case"compositionupdate":ia=!0;break;case"compositionend":e=!1}return d.apply(this,arguments)}a.preventDefault()}}})})}function S(b){function c(b){if(void 0==a.valHooks[b]||1!=a.valHooks[b].inputmaskpatch){var c=a.valHooks[b]&&a.valHooks[b].get?a.valHooks[b].get:function(a){return a.value},d=a.valHooks[b]&&a.valHooks[b].set?a.valHooks[b].set:function(a,b){return a.value=b,a};a.valHooks[b]={get:function(b){a(b);if(b.inputmask){if(b.inputmask.opts.autoUnmask)return b.inputmask.unmaskedvalue();var d=c(b),e=b.inputmask.maskset,f=e._buffer;return f=f?f.join(""):"",d!=f?d:""}return c(b)},set:function(b,c){var e,f=a(b);return e=d(b,c),b.inputmask&&f.triggerHandler("setvalue.inputmask"),e},inputmaskpatch:!0}}}function d(){a(this);return this.inputmask?this.inputmask.opts.autoUnmask?this.inputmask.unmaskedvalue():g.call(this)!=v().join("")?g.call(this):"":g.call(this)}function e(b){h.call(this,b),this.inputmask&&a(this).triggerHandler("setvalue.inputmask")}function f(b){a(b).bind("mouseenter.inputmask",function(b){var c=a(this),d=this,e=d._valueGet();""!=e&&e!=w().join("")&&c.triggerHandler("setvalue.inputmask")});
|
9
|
+
//!! the bound handlers are executed in the order they where bound
|
10
|
+
var c=a._data(b).events,d=c.mouseover;if(d){for(var e=d[d.length-1],f=d.length-1;f>0;f--)d[f]=d[f-1];d[0]=e}}var g,h;if(!b._valueGet){var i;Object.getOwnPropertyDescriptor&&void 0==b.value?(g=function(){return this.textContent},h=function(a){this.textContent=a},Object.defineProperty(b,"value",{get:d,set:e})):((i=Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(b,"value"))&&i.configurable,document.__lookupGetter__&&b.__lookupGetter__("value")?(g=b.__lookupGetter__("value"),h=b.__lookupSetter__("value"),b.__defineGetter__("value",d),b.__defineSetter__("value",e)):(g=function(){return b.value},h=function(a){b.value=a},c(b.type),f(b))),b._valueGet=function(a){return ga&&a!==!0?g.call(this).split("").reverse().join(""):g.call(this)},b._valueSet=function(a){h.call(this,ga?a.split("").reverse().join(""):a)}}}function T(c,d,e,f){function h(){if(g.keepStatic){n(!0);var b,d=[],e=a.extend(!0,{},i().validPositions);for(b=o();b>=0;b--){var f=i().validPositions[b];if(f&&(null!=f.match.fn&&d.push(f.input),delete i().validPositions[b],void 0!=f.alternation&&f.locator[f.alternation]==r(b).locator[f.alternation]))break}if(b>-1)for(;d.length>0;){i().p=D(o());var h=a.Event("keypress");h.which=d.pop().charCodeAt(0),V.call(c,h,!0,!1,!1,i().p)}else i().validPositions=a.extend(!0,{},e)}}if((g.numericInput||ga)&&(d==b.keyCode.BACKSPACE?d=b.keyCode.DELETE:d==b.keyCode.DELETE&&(d=b.keyCode.BACKSPACE),ga)){var j=e.end;e.end=e.begin,e.begin=j}if(d==b.keyCode.BACKSPACE&&(e.end-e.begin<1||0==g.insertMode)?(e.begin=E(e.begin),void 0==i().validPositions[e.begin]||i().validPositions[e.begin].input!=g.groupSeparator&&i().validPositions[e.begin].input!=g.radixPoint||e.begin--):d==b.keyCode.DELETE&&e.begin==e.end&&(e.end=B(e.end)?e.end+1:D(e.end)+1,void 0==i().validPositions[e.begin]||i().validPositions[e.begin].input!=g.groupSeparator&&i().validPositions[e.begin].input!=g.radixPoint||e.end++),q(e.begin,e.end,!1,f),f!==!0){h();var k=o(e.begin);k<e.begin?(-1==k&&n(),i().p=D(k)):i().p=e.begin}}function U(d){var e=this,f=a(e),h=d.keyCode,k=M(e);h==b.keyCode.BACKSPACE||h==b.keyCode.DELETE||j&&127==h||d.ctrlKey&&88==h&&!c("cut")?(d.preventDefault(),88==h&&(aa=w().join("")),T(e,h,k),G(e,w(),i().p,d,aa!=w().join("")),e._valueGet()==v().join("")?f.trigger("cleared"):P(w())===!0&&f.trigger("complete"),g.showTooltip&&f.prop("title",i().mask)):h==b.keyCode.END||h==b.keyCode.PAGE_DOWN?setTimeout(function(){var a=D(o());g.insertMode||a!=C()||d.shiftKey||a--,M(e,d.shiftKey?k.begin:a,a)},0):h==b.keyCode.HOME&&!d.shiftKey||h==b.keyCode.PAGE_UP?M(e,0,d.shiftKey?k.begin:0):(g.undoOnEscape&&h==b.keyCode.ESCAPE||90==h&&d.ctrlKey)&&d.altKey!==!0?(I(e,!0,!1,aa.split("")),f.click()):h!=b.keyCode.INSERT||d.shiftKey||d.ctrlKey?0!=g.insertMode||d.shiftKey||(h==b.keyCode.RIGHT?setTimeout(function(){var a=M(e);M(e,a.begin)},0):h==b.keyCode.LEFT&&setTimeout(function(){var a=M(e);M(e,ga?a.begin+1:a.begin-1)},0)):(g.insertMode=!g.insertMode,M(e,g.insertMode||k.begin!=C()?k.begin:k.begin-1)),g.onKeyDown.call(this,d,w(),M(e).begin,g),ja=-1!=a.inArray(h,g.ignorables)}function V(c,d,e,f,h){var j=this,k=a(j),l=c.which||c.charCode||c.keyCode;if(!(d===!0||c.ctrlKey&&c.altKey)&&(c.ctrlKey||c.metaKey||ja))return!0;if(l){46==l&&0==c.shiftKey&&","==g.radixPoint&&(l=44);var m,o=d?{begin:h,end:h}:M(j),q=String.fromCharCode(l),r=Q(o.begin,o.end);r&&(i().undoPositions=a.extend(!0,{},i().validPositions),T(j,b.keyCode.DELETE,o,!0),o.begin=i().p,g.insertMode||(g.insertMode=!g.insertMode,p(o.begin,f),g.insertMode=!g.insertMode),r=!g.multi),i().writeOutBuffer=!0;var s=ga&&!r?o.end:o.begin,t=A(s,q,f);if(t!==!1){if(t!==!0&&(s=void 0!=t.pos?t.pos:s,q=void 0!=t.c?t.c:q),n(!0),void 0!=t.caret)m=t.caret;else{var v=i().validPositions;m=!g.keepStatic&&(void 0!=v[s+1]&&u(s+1,v[s].locator.slice(),s).length>1||void 0!=v[s].alternation)?s+1:D(s)}i().p=m}if(e!==!1){var y=this;if(setTimeout(function(){g.onKeyValidation.call(y,t,g)},0),i().writeOutBuffer&&t!==!1){var z=w();G(j,z,d?void 0:g.numericInput?E(m):m,c,d!==!0),d!==!0&&setTimeout(function(){P(z)===!0&&k.trigger("complete")},0)}else r&&(i().buffer=void 0,i().validPositions=i().undoPositions)}else r&&(i().buffer=void 0,i().validPositions=i().undoPositions);if(g.showTooltip&&k.prop("title",i().mask),d&&a.isFunction(g.onBeforeWrite)){var B=g.onBeforeWrite.call(this,c,w(),m,g);if(B&&B.refreshFromBuffer){var C=B.refreshFromBuffer;x(C===!0?C:C.start,C.end,B.buffer),n(!0),B.caret&&(i().p=B.caret)}}c.preventDefault()}}function W(b){var c=this,d=a(c),e=c._valueGet(!0),f=M(c);if("propertychange"==b.type&&c._valueGet().length<=C())return!0;if("paste"==b.type){var h=e.substr(0,f.begin),i=e.substr(f.end,e.length);h==v().slice(0,f.begin).join("")&&(h=""),i==v().slice(f.end).join("")&&(i=""),window.clipboardData&&window.clipboardData.getData?e=h+window.clipboardData.getData("Text")+i:b.originalEvent&&b.originalEvent.clipboardData&&b.originalEvent.clipboardData.getData&&(e=h+b.originalEvent.clipboardData.getData("text/plain")+i)}var j=e;if(a.isFunction(g.onBeforePaste)){if(j=g.onBeforePaste.call(c,e,g),j===!1)return b.preventDefault(),!1;j||(j=e)}return I(c,!1,!1,ga?j.split("").reverse():j.split("")),G(c,w(),void 0,b,!0),d.click(),P(w())===!0&&d.trigger("complete"),!1}function X(b){var c=this;I(c,!0,!1),P(w())===!0&&a(c).trigger("complete"),b.preventDefault()}function Y(a){var b=this;aa=w().join(""),(""==ca||0!=a.originalEvent.data.indexOf(ca))&&(ba=M(b))}function Z(b){var c=this,d=M(c);0==b.originalEvent.data.indexOf(ca)&&(n(),d=ba);var e=b.originalEvent.data;M(c,d.begin,d.end);for(var f=0;f<e.length;f++){var h=a.Event("keypress");h.which=e.charCodeAt(f),ha=!1,ja=!1,V.call(c,h)}setTimeout(function(){var a=i().p;G(c,w(),g.numericInput?E(a):a)},0),ca=b.originalEvent.data}function $(a){}function _(c){ea=a(c),g.showTooltip&&ea.prop("title",i().mask),("rtl"==c.dir||g.rightAlign)&&ea.css("text-align","right"),("rtl"==c.dir||g.numericInput)&&(c.dir="ltr",ea.removeAttr("dir"),c.inputmask.isRTL=!0,ga=!0),ea.unbind(".inputmask"),(ea.is(":input")&&d(ea.attr("type"))||c.isContentEditable)&&(ea.closest("form").bind("submit",function(a){aa!=w().join("")&&ea.change(),g.clearMaskOnLostFocus&&ea[0]._valueGet&&ea[0]._valueGet()==v().join("")&&ea[0]._valueSet(""),g.removeMaskOnSubmit&&ea.inputmask("remove")}).bind("reset",function(){setTimeout(function(){ea.triggerHandler("setvalue.inputmask")},0)}),ea.bind("mouseenter.inputmask",function(){var b=a(this),c=this;la=!0,!b.is(":focus")&&g.showMaskOnHover&&c._valueGet()!=w().join("")&&G(c,w())}).bind("blur.inputmask",function(b){var c=a(this),d=this;if(d.inputmask){var e=d._valueGet(),f=w().slice();ka=!0,aa!=f.join("")&&setTimeout(function(){c.change(),aa=f.join("")},0),""!=e&&(g.clearMaskOnLostFocus&&(e==v().join("")?f=[]:O(f)),P(f)===!1&&(c.trigger("incomplete"),g.clearIncomplete&&(n(),f=g.clearMaskOnLostFocus?[]:v().slice())),G(d,f,void 0,b))}}).bind("focus.inputmask",function(b){var c=(a(this),this),d=c._valueGet();g.showMaskOnFocus&&(!g.showMaskOnHover||g.showMaskOnHover&&""==d)?c._valueGet()!=w().join("")&&G(c,w(),D(o())):la===!1&&M(c,D(o())),aa=w().join("")}).bind("mouseleave.inputmask",function(){var b=a(this),c=this;if(la=!1,g.clearMaskOnLostFocus){var d=w().slice(),e=c._valueGet();b.is(":focus")||e==b.attr("placeholder")||""==e||(e==v().join("")?d=[]:O(d),G(c,d))}}).bind("click.inputmask",function(){var b=a(this),c=this;if(b.is(":focus")){var d=M(c);if(d.begin==d.end)if(g.radixFocus&&""!=g.radixPoint&&-1!=a.inArray(g.radixPoint,w())&&(ka||w().join("")==v().join("")))M(c,a.inArray(g.radixPoint,w())),ka=!1;else{var e=L(d.begin),f=D(o(e));f>e?M(c,B(e)?e:D(e)):M(c,f)}}}).bind("dblclick.inputmask",function(){var a=this;setTimeout(function(){M(a,0,D(o()))},0)}).bind(m+".inputmask dragdrop.inputmask drop.inputmask",W).bind("cut.inputmask",function(c){ia=!0;var d=this,e=a(d),f=M(d);T(d,b.keyCode.DELETE,f),G(d,w(),i().p,c,aa!=w().join("")),d._valueGet()==v().join("")&&e.trigger("cleared"),g.showTooltip&&e.prop("title",i().mask)}).bind("complete.inputmask",g.oncomplete).bind("incomplete.inputmask",g.onincomplete).bind("cleared.inputmask",g.oncleared),ea.bind("keydown.inputmask",U).bind("keypress.inputmask",V),l||ea.bind("compositionstart.inputmask",Y).bind("compositionupdate.inputmask",Z).bind("compositionend.inputmask",$),"paste"===m&&ea.bind("input.inputmask",X)),ea.bind("setvalue.inputmask",function(){var b=this,c=b._valueGet();b._valueSet(a.isFunction(g.onBeforeMask)?g.onBeforeMask.call(b,c,g)||c:c),I(b,!0,!1),aa=w().join(""),(g.clearMaskOnLostFocus||g.clearIncomplete)&&b._valueGet()==v().join("")&&b._valueSet("")}),S(c);var e=a.isFunction(g.onBeforeMask)?g.onBeforeMask.call(c,c._valueGet(),g)||c._valueGet():c._valueGet();I(c,!0,!1,e.split(""));var f=w().slice();aa=f.join("");var h;try{h=document.activeElement}catch(j){}P(f)===!1&&g.clearIncomplete&&n(),g.clearMaskOnLostFocus&&(f.join("")==v().join("")?f=[]:O(f)),G(c,f),h===c&&M(c,D(o())),R(c)}var aa,ba,ca,da,ea,fa,ga=!1,ha=!1,ia=!1,ja=!1,ka=!0,la=!0;if(void 0!=e)switch(e.action){case"isComplete":return da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,P(e.buffer);case"unmaskedvalue":return da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,ga=da.inputmask.isRTL,K(ea);case"mask":aa=w().join(""),_(e.el);break;case"format":ea=a({}),ea[0].inputmask=new b,ea[0].inputmask.opts=g,ea[0].inputmask.el=ea[0],ea[0].inputmask.maskset=f,ea[0].inputmask.isRTL=g.numericInput,g.numericInput&&(ga=!0);var ma=(a.isFunction(g.onBeforeMask)?g.onBeforeMask.call(ea,e.value,g)||e.value:e.value).split("");return I(ea,!1,!1,ga?ma.reverse():ma),a.isFunction(g.onBeforeWrite)&&g.onBeforeWrite.call(this,void 0,w(),0,g),e.metadata?{value:ga?w().slice().reverse().join(""):w().join(""),metadata:ea.inputmask("getmetadata")}:ga?w().slice().reverse().join(""):w().join("");case"isValid":ea=a({}),ea[0].inputmask=new b,ea[0].inputmask.opts=g,ea[0].inputmask.el=ea[0],ea[0].inputmask.maskset=f,ea[0].inputmask.isRTL=g.numericInput,g.numericInput&&(ga=!0);var ma=e.value.split("");I(ea,!1,!0,ga?ma.reverse():ma);for(var na=w(),oa=N(),pa=na.length-1;pa>oa&&!B(pa);pa--);return na.splice(oa,pa+1-oa),P(na)&&e.value==na.join("");case"getemptymask":return da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,v();case"remove":da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,da._valueSet(K(ea)),ea.unbind(".inputmask"),da.inputmask=void 0;var qa;Object.getOwnPropertyDescriptor&&(qa=Object.getOwnPropertyDescriptor(da,"value")),qa&&qa.get?da._valueGet&&Object.defineProperty(da,"value",{get:da._valueGet,set:da._valueSet}):document.__lookupGetter__&&da.__lookupGetter__("value")&&da._valueGet&&(da.__defineGetter__("value",da._valueGet),da.__defineSetter__("value",da._valueSet));try{delete da._valueGet,delete da._valueSet}catch(ra){da._valueGet=void 0,da._valueSet=void 0}break;case"getmetadata":if(da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,a.isArray(f.metadata)){for(var sa,ta=o(),ua=ta;ua>=0;ua--)if(i().validPositions[ua]&&void 0!=i().validPositions[ua].alternation){sa=i().validPositions[ua].alternation;break}return void 0!=sa?f.metadata[i().validPositions[ta].locator[sa]]:f.metadata[0]}return f.metadata}}b.prototype={defaults:{placeholder:"_",optionalmarker:{start:"[",end:"]"},quantifiermarker:{start:"{",end:"}"},groupmarker:{start:"(",end:")"},alternatormarker:"|",escapeChar:"\\",mask:null,oncomplete:a.noop,onincomplete:a.noop,oncleared:a.noop,repeat:0,greedy:!0,autoUnmask:!1,removeMaskOnSubmit:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,aliases:{},alias:null,onKeyDown:a.noop,onBeforeMask:void 0,onBeforePaste:void 0,onBeforeWrite:void 0,onUnMask:void 0,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:a.noop,skipOptionalPartCharacter:" ",showTooltip:!1,numericInput:!1,rightAlign:!1,undoOnEscape:!0,radixPoint:"",groupSeparator:"",radixFocus:!1,nojumps:!1,nojumpsThreshold:0,keepStatic:void 0,definitions:{9:{validator:"[0-9]",cardinality:1,definitionSymbol:"*"},a:{validator:"[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1,definitionSymbol:"*"},"*":{validator:"[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1}},ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123],isComplete:void 0,canClearPosition:a.noop,postValidation:void 0},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},masksCache:{},mask:function(c){var d=c.jquery&&c.length>0?c[0]:c,e=a.extend(!0,{},this.opts);f(c,e,a.extend(!0,{},this.userOptions));var i=g(e,this.noMasksCache);return void 0!=i&&(d.inputmask=new b,d.inputmask.opts=e,d.inputmask.noMasksCache=this.noMasksCache,d.inputmask.el=d,d.inputmask.maskset=i,d.inputmask.isRTL=!1,h({action:"mask",el:d},i,d.inputmask.opts)),c},unmaskedvalue:function(){return this.el?h({action:"unmaskedvalue",el:this.el}):void 0},remove:function(){return this.el?(h({action:"remove",el:this.el}),this.el.inputmask=void 0,this.el):void 0},getemptymask:function(){return this.el?h({action:"getemptymask",el:this.el}):void 0},hasMaskedValue:function(){return!this.opts.autoUnmask},isComplete:function(){return this.el?h({action:"isComplete",buffer:this.el._valueGet().split(""),el:this.el}):void 0},getmetadata:function(){return this.el?h({action:"getmetadata",el:this.el}):void 0}},b.extendDefaults=function(c){a.extend(b.prototype.defaults,c)},b.extendDefinitions=function(c){a.extend(b.prototype.defaults.definitions,c)},b.extendAliases=function(c){a.extend(b.prototype.defaults.aliases,c)},b.format=function(c,d,f){var i=a.extend(!0,{},b.prototype.defaults,d);return e(i.alias,d,i),h({action:"format",value:c,metadata:f},g(i,d&&void 0!==d.definitions),i)},b.isValid=function(c,d){var f=a.extend(!0,{},b.prototype.defaults,d);return e(f.alias,d,f),h({action:"isValid",value:c},g(f,d&&void 0!==d.definitions),f)},b.escapeRegex=function(a){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^"];return a.replace(new RegExp("(\\"+b.join("|\\")+")","gim"),"\\$1")},b.keyCode={ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91};var i=navigator.userAgent,j=null!==i.match(new RegExp("iphone","i")),k=(null!==i.match(new RegExp("android.*safari.*","i")),null!==i.match(new RegExp("android.*chrome.*","i"))),l=null!==i.match(new RegExp("android.*firefox.*","i")),m=(/Kindle/i.test(i)||/Silk/i.test(i)||/KFTT/i.test(i)||/KFOT/i.test(i)||/KFJWA/i.test(i)||/KFJWI/i.test(i)||/KFSOWI/i.test(i)||/KFTHWA/i.test(i)||/KFTHWI/i.test(i)||/KFAPWA/i.test(i)||/KFAPWI/i.test(i),c("paste")?"paste":c("input")?"input":"propertychange");return window.inputmask=b,b});
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/*!
|
2
|
+
* jquery.inputmask.min.js
|
3
|
+
* http://github.com/RobinHerbots/jquery.inputmask
|
4
|
+
* Copyright (c) 2010 - 2015 Robin Herbots
|
5
|
+
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
6
|
+
* Version: 3.1.64-74
|
7
|
+
*/
|
8
|
+
!function(a){"function"==typeof define&&define.amd?define(["jquery","./inputmask"],a):"object"==typeof exports?module.exports=a(require("jquery"),require("./inputmask")):a(jQuery)}(function(a){return void 0===a.fn.inputmask&&(a.fn.inputmask=function(b,c){var d;if(c=c||{},"string"==typeof b)switch(b){case"mask":return d=new inputmask(c),this.each(function(){d.mask(this)});case"unmaskedvalue":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.unmaskedvalue():a(e).val();case"remove":return this.each(function(){this.inputmask&&this.inputmask.remove()});case"getemptymask":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.getemptymask():"";case"hasMaskedValue":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.hasMaskedValue():!1;case"isComplete":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.isComplete():!0;case"getmetadata":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.getmetadata():void 0;default:return c.alias=b,d=new inputmask(c),this.each(function(){d.mask(this)})}else{if("object"==typeof b)return d=new inputmask(b),this.each(function(){d.mask(this)});if(void 0==b)return this.each(function(){d=new inputmask(c),d.mask(this)})}}),a.fn.inputmask});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_zaez_clearsale
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zaez Team
|
@@ -267,7 +267,65 @@ email: contato@zaez.net
|
|
267
267
|
executables: []
|
268
268
|
extensions: []
|
269
269
|
extra_rdoc_files: []
|
270
|
-
files:
|
270
|
+
files:
|
271
|
+
- ".gitignore"
|
272
|
+
- ".rspec"
|
273
|
+
- ".travis.yml"
|
274
|
+
- Gemfile
|
275
|
+
- Guardfile
|
276
|
+
- LICENSE
|
277
|
+
- README.md
|
278
|
+
- Rakefile
|
279
|
+
- app/assets/javascripts/spree/backend/app/clear_sale_settings/clear_sale_add_provider.js.coffee
|
280
|
+
- app/assets/javascripts/spree/backend/app/clear_sale_settings/clear_sale_provider.js.coffee
|
281
|
+
- app/assets/javascripts/spree/backend/app/clear_sale_settings/clear_sale_settings.js.coffee
|
282
|
+
- app/assets/javascripts/spree/backend/spree_zaez_clearsale.js
|
283
|
+
- app/assets/javascripts/spree/frontend/app/addresses/phone_mask_address.js.coffee
|
284
|
+
- app/assets/javascripts/spree/frontend/spree_zaez_clearsale.js
|
285
|
+
- app/assets/stylesheets/spree/backend/spree_zaez_clearsale.css
|
286
|
+
- app/assets/stylesheets/spree/frontend/spree_zaez_clearsale.css
|
287
|
+
- app/controllers/spree/admin/clear_sale_settings_controller.rb
|
288
|
+
- app/controllers/spree/admin/payments_controller_decorator.rb
|
289
|
+
- app/helpers/orders_helper_decorator.rb
|
290
|
+
- app/models/spree/clear_sale.rb
|
291
|
+
- app/models/spree/credit_card_decorator.rb
|
292
|
+
- app/models/spree/payment_decorator.rb
|
293
|
+
- app/overrides/spree/address/_form/add_constructor_to_form.html.erb.deface
|
294
|
+
- app/overrides/spree/admin/orders/index/replace_considered_risk_column.html.erb.deface
|
295
|
+
- app/overrides/spree/admin/orders/index/replace_considered_risky_label.html.erb.deface
|
296
|
+
- app/overrides/spree/admin/shared/_order_tabs/add_clear_sale_iframe_to_order_menu.html.erb.deface
|
297
|
+
- app/overrides/spree/admin/shared/sub_menu/_configuration/add_clear_sale_settings_tab.html.erb.deface
|
298
|
+
- app/views/spree/admin/clear_sale_settings/edit.html.erb
|
299
|
+
- app/views/spree/admin/payments/clear_sale.html.erb
|
300
|
+
- bin/rails
|
301
|
+
- config/locales/en.yml
|
302
|
+
- config/locales/pt-br.yml
|
303
|
+
- config/routes.rb
|
304
|
+
- db/migrate/20150608175547_add_bin_card_to_spree_credit_card.rb
|
305
|
+
- db/migrate/20150611113444_add_clearsale_score_to_spree_payments.rb
|
306
|
+
- lib/generators/spree_zaez_clearsale/install/install_generator.rb
|
307
|
+
- lib/spree/clear_sale_configuration.rb
|
308
|
+
- lib/spree_zaez_clearsale.rb
|
309
|
+
- lib/spree_zaez_clearsale/engine.rb
|
310
|
+
- lib/spree_zaez_clearsale/factories.rb
|
311
|
+
- spec/features/admin/clear_sale_settings_spec.rb
|
312
|
+
- spec/features/admin/orders/clearsale_spec.rb
|
313
|
+
- spec/features/admin/orders/listing_spec.rb
|
314
|
+
- spec/fixtures/clearsale_critical.txt
|
315
|
+
- spec/fixtures/clearsale_high.txt
|
316
|
+
- spec/fixtures/clearsale_low.txt
|
317
|
+
- spec/fixtures/clearsale_medium.txt
|
318
|
+
- spec/helpers/admin/orders_helper_decorator_spec.rb
|
319
|
+
- spec/lib/spree/clear_sale_configuration_spec.rb
|
320
|
+
- spec/models/spree/clear_sale_spec.rb
|
321
|
+
- spec/models/spree/credit_card_decorator_spec.rb
|
322
|
+
- spec/models/spree/payment_decorator_spec.rb
|
323
|
+
- spec/spec_helper.rb
|
324
|
+
- spec/support/capybara_login.rb
|
325
|
+
- spec/support/verify_input_field.rb
|
326
|
+
- spree_zaez_clearsale.gemspec
|
327
|
+
- vendor/assets/javascripts/inputmask/inputmask.min.js
|
328
|
+
- vendor/assets/javascripts/inputmask/jquery.inputmask.min.js
|
271
329
|
homepage: https://github.com/zaeznet/spree_zaez_clearsale
|
272
330
|
licenses: []
|
273
331
|
metadata: {}
|
@@ -292,4 +350,19 @@ rubygems_version: 2.2.2
|
|
292
350
|
signing_key:
|
293
351
|
specification_version: 4
|
294
352
|
summary: Add the ClearSale verification to Spree Commerce
|
295
|
-
test_files:
|
353
|
+
test_files:
|
354
|
+
- spec/features/admin/clear_sale_settings_spec.rb
|
355
|
+
- spec/features/admin/orders/clearsale_spec.rb
|
356
|
+
- spec/features/admin/orders/listing_spec.rb
|
357
|
+
- spec/fixtures/clearsale_critical.txt
|
358
|
+
- spec/fixtures/clearsale_high.txt
|
359
|
+
- spec/fixtures/clearsale_low.txt
|
360
|
+
- spec/fixtures/clearsale_medium.txt
|
361
|
+
- spec/helpers/admin/orders_helper_decorator_spec.rb
|
362
|
+
- spec/lib/spree/clear_sale_configuration_spec.rb
|
363
|
+
- spec/models/spree/clear_sale_spec.rb
|
364
|
+
- spec/models/spree/credit_card_decorator_spec.rb
|
365
|
+
- spec/models/spree/payment_decorator_spec.rb
|
366
|
+
- spec/spec_helper.rb
|
367
|
+
- spec/support/capybara_login.rb
|
368
|
+
- spec/support/verify_input_field.rb
|