Browse Source

Remove javascript

v1
Aeris 6 years ago
parent
commit
81e2bcc3b1
  1. 1
      Gemfile
  2. 2
      app/assets/javascripts/application.coffee
  3. 0
      app/assets/javascripts/check.coffee
  4. 0
      app/assets/javascripts/https.coffee
  5. 12
      app/assets/javascripts/site.coffee.erb
  6. 3
      app/assets/javascripts/smtp.coffee
  7. 16
      app/assets/javascripts/ssh.coffee.erb
  8. 18
      app/assets/javascripts/tls.coffee.erb
  9. 3
      app/assets/javascripts/xmpp.coffee
  10. 25
      config/initializers/sprocket_helpers.rb

1
Gemfile

@ -29,6 +29,7 @@ group :development, :test do
gem 'binding_of_caller'
gem 'quiet_assets'
gem 'guard', require: false
gem 'guard-livereload', require: false
gem 'rack-livereload'
end

2
app/assets/javascripts/application.coffee

@ -1,4 +1,2 @@
##= require jquery2
##= require jquery_ujs
##= require bootstrap/dropdown
##= require_tree .

0
app/assets/javascripts/check.coffee

0
app/assets/javascripts/https.coffee

12
app/assets/javascripts/site.coffee.erb

@ -1,12 +0,0 @@
$ ->
submit = ->
host = $('#check_host').val()
type = $('#check_type').val()
window.location.href = "<%= Rails.configuration.relative_url_root %>/#{type}/#{host}"
$('#check_host').keypress (e) ->
submit() if e.which == 13
return
$('#check_submit').click ->
submit()
return

3
app/assets/javascripts/smtp.coffee

@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

16
app/assets/javascripts/ssh.coffee.erb

@ -1,16 +0,0 @@
$ ->
ssh_submit = ->
host = $('#ssh_check_host').val()
port = $('#ssh_check_port').val()
port = 22 if port == ''
window.location.href = "<%= Rails.configuration.relative_url_root %>/ssh/#{host}:#{port}"
$('#ssh_check_host').keypress (e) ->
ssh_submit() if e.which == 13
return
$('#ssh_check_port').keypress (e) ->
ssh_submit() if e.which == 13
return
$('#ssh_check_submit').click ->
ssh_submit()
return

18
app/assets/javascripts/tls.coffee.erb

@ -1,18 +0,0 @@
$ ->
tls_submit = ->
host = $('#tls_check_host').val()
port = $('#tls_check_port').val()
if port == ''
alert 'Veuillez saisir un port'
return
window.location.href = "<%= Rails.configuration.relative_url_root %>/tls/#{host}:#{port}"
$('#tls_check_host').keypress (e) ->
tls_submit() if e.which == 13
return
$('#tls_check_port').keypress (e) ->
tls_submit() if e.which == 13
return
$('#tls_check_submit').click ->
tls_submit()
return

3
app/assets/javascripts/xmpp.coffee

@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

25
config/initializers/sprocket_helpers.rb

@ -1,25 +0,0 @@
Rails.application.assets.context_class.class_eval do
def path(name, params=[], **options)
helper = "#{name}_path"
names = []
replace = []
params.each_with_index do |n, p|
arg = "__p#{p}__"
names << arg
replace << [arg, "\#{#{n}}"]
end
query_params = options.delete :params
unless query_params.nil?
query_params.each_with_index do |n, p|
arg = "__q#{p}__"
names << arg
replace << [arg, "\#{#{n}}"]
options[n] = arg
end
end
path = Rails.application.routes.url_helpers.send helper, *names, **options
replace.each { |p, n| path.sub! p, n }
"#{config.relative_url_root}#{path}"
end
end
Loading…
Cancel
Save