diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b84e9ad..8195815 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -4,9 +4,6 @@ //= require turbolinks //= require bootstrap.min.js -//= require contextmenu.js -//= require flash.js - //= require gentelella/src/js/custom.js //= require gentelella/vendors/Chart.js/dist/Chart.min.js //= require gentelella/vendors/Flot/jquery.flot.js @@ -22,5 +19,23 @@ //= require gentelella/vendors/validator/validator.js $(function() { - console.log("Application js"); + $('#flash').delay(500).fadeIn('normal', function() { + $(this).delay(2500).fadeOut(); + }); }); + +function CheckLocation(){ + $(document).mousedown(function(e){ + // context menu 가 아닌 다른 영역을 클릭한경우 판단 + if ($(e.target).parents(".contextmenu").length !== 0) + return; + $(".contextmenu").hide(); + $(document).unbind('mousedown'); + }); +} +function ShowContextMenu(className){ + $("."+className).css({ + left:event.pageX+"px", + top:event.pageY+"px" + }).show(); +} diff --git a/app/assets/javascripts/contextmenu.js b/app/assets/javascripts/contextmenu.js deleted file mode 100644 index ab6ac8f..0000000 --- a/app/assets/javascripts/contextmenu.js +++ /dev/null @@ -1,15 +0,0 @@ -function CheckLocation(){ - $(document).mousedown(function(e){ - // context menu 가 아닌 다른 영역을 클릭한경우 판단 - if ($(e.target).parents(".contextmenu").length !== 0) - return; - $(".contextmenu").hide(); - $(document).unbind('mousedown'); - }); -} -function ShowContextMenu(className){ - $("."+className).css({ - left:event.pageX+"px", - top:event.pageY+"px" - }).show(); -} diff --git a/app/assets/javascripts/flash.js b/app/assets/javascripts/flash.js deleted file mode 100644 index 0240a2c..0000000 --- a/app/assets/javascripts/flash.js +++ /dev/null @@ -1,6 +0,0 @@ -$(function() { - $('#flash').delay(500).fadeIn('normal', function() { - $(this).delay(2500).fadeOut(); - }); -}); - diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 523c16d..62a70d9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,9 +1,5 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception - include ApplicationHelper - include HomeHelper - include VolumeHelper - include NodeHelper def require_login unless user_signed_in? diff --git a/app/controllers/web/home_controller.rb b/app/controllers/web/home_controller.rb index ee84871..4711bb7 100644 --- a/app/controllers/web/home_controller.rb +++ b/app/controllers/web/home_controller.rb @@ -1,6 +1,4 @@ class Web::HomeController < WebController - before_action :require_login - def index @current_dir = "/mnt" end diff --git a/app/controllers/web/node_controller.rb b/app/controllers/web/node_controller.rb index beb1b9b..bffdd75 100644 --- a/app/controllers/web/node_controller.rb +++ b/app/controllers/web/node_controller.rb @@ -1,6 +1,4 @@ class Web::NodeController < WebController - before_action :require_login - def index end def detail diff --git a/app/controllers/web/volume_controller.rb b/app/controllers/web/volume_controller.rb index 2fa65b4..da1cd89 100644 --- a/app/controllers/web/volume_controller.rb +++ b/app/controllers/web/volume_controller.rb @@ -1,6 +1,4 @@ class Web::VolumeController < WebController - before_action :require_login - def index @current_dir = "/mnt" end diff --git a/app/controllers/web_controller.rb b/app/controllers/web_controller.rb index 00168a4..591496f 100644 --- a/app/controllers/web_controller.rb +++ b/app/controllers/web_controller.rb @@ -1,2 +1,3 @@ class WebController < ApplicationController + before_action :require_login end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 0cdb72b..75e2b3c 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -9,5 +9,4 @@ Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( search.js ) - -Rails.application.config.assets.precompile += %w( footermanifest.js) +# Rails.application.config.assets.precompile += %w( footermanifest.js)