Skip to content

Commit

Permalink
Set advanced editing class directly
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Dec 9, 2024
1 parent a74ee6c commit 1bd2869
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 14 deletions.
5 changes: 0 additions & 5 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,6 @@ def init_cookies
cookies["resize_image"] = "0"
end

if @current_user.show_advanced_editing
cookies["show_advanced_editing"] = "1"
else
cookies["show_advanced_editing"] = "0"
end
cookies["my_tags"] = @current_user.my_tags
end

Expand Down
6 changes: 0 additions & 6 deletions app/javascript/src/legacy/common.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ window.InitTextAreas = ->
return
return

window.InitAdvancedEditing = ->
if Cookie.get('show_advanced_editing') != '1'
return
$(document.documentElement).removeClassName 'hide-advanced-editing'
return

### Return the squared distance between two points. ###
window.distance_squared = (x1, y1, x2, y2) ->
(x1 - x2) ** 2 + (y1 - y2) ** 2
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="action-<%= params[:controller] %> action-<%= params[:controller] %>-<%= params[:action] %> hide-advanced-editing">
<html class="action-<%= params[:controller] %> action-<%= params[:controller] %>-<%= params[:action] %> <%= 'hide-advanced-editing' if !@current_user.show_advanced_editing %>">
<head>
<% if params[:tags] =~ /(\A(source:|fav:|date:|rating:|mpixels:|parent:|sub:|vote:|score:|order:|user:|limit:|holds:|pool:|[~-])|[ *])/ %>
<meta name="robots" content="noindex, follow">
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/default.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

<script type="text/javascript">
InitTextAreas();
InitAdvancedEditing();
Post.InitBrowserLinks();
if(TagCompletion)
TagCompletion.init(<%= json_escape Tag.get_summary_version.to_json.html_safe %>);
Expand Down
1 change: 0 additions & 1 deletion app/views/post/browse.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@

document.observe("dom:loaded", function()
{
InitAdvancedEditing();
InitializeFullScreenBrowserHandlers();
Post.init_blacklisted();

Expand Down

0 comments on commit 1bd2869

Please sign in to comment.