Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
ref: removed „open links in new tab“ feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kruse committed Jun 1, 2016
1 parent 7a6e6b5 commit c0b270d
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 31 deletions.
8 changes: 0 additions & 8 deletions app/helpers/links_helper.rb
Expand Up @@ -20,10 +20,6 @@ def cf_link_to(*args, &block)
args << attrs
end

if uconf('open_links_in_tab') == 'yes' and not attrs.has_key?(:target)
attrs[:target] = '_blank'
end

url = args.second
url = args.first if not block.blank?
if not is_url_whitelisted?(url) and not attrs.has_key?(:rel)
Expand All @@ -41,10 +37,6 @@ def cf_link_to_unless(*args)
args << attrs
end

if uconf('open_links_in_tab') == 'yes' and not attrs.has_key?(:target)
attrs[:target] = '_blank'
end

url = args.third
if not is_url_whitelisted?(url) and not attrs.has_key?(:rel)
attrs[:rel] = 'nofollow'
Expand Down
1 change: 0 additions & 1 deletion app/helpers/parser_helper.rb
Expand Up @@ -69,7 +69,6 @@ def to_doc(app, opts = {})
no_follow: true,
root_url: opts[:root_url] || app.root_url,
math_engine_opts: { preview: true },
new_window: app.uconf('open_links_in_tab') == 'yes',
notify_mentions: true,
syntax_highlighter: 'rouge'
)
Expand Down
6 changes: 3 additions & 3 deletions app/views/cf_threads/_pages.html.erb
Expand Up @@ -13,13 +13,13 @@ end_page = all_pages_count if end_page > all_pages_count
if @all_threads_count > @limit
%><div class="cf-pages">
<ul>
<li class="first<% if @page == 0 %> disabled<% end %>"><%= cf_link_to '«', forum_path(current_forum), target: nil %></li>
<li class="first<% if @page == 0 %> disabled<% end %>"><%= cf_link_to '«', forum_path(current_forum) %></li>

<% (start_page..end_page).each do |i| %>
<li<% if i - 1 == @page %> class="active disabled"<% end %>><%= cf_link_to i, forum_path(current_forum, p: i-1), target: nil %></li>
<li<% if i - 1 == @page %> class="active disabled"<% end %>><%= cf_link_to i, forum_path(current_forum, p: i-1) %></li>
<% end %>

<li class="last<% if @page == all_pages_count - 1 %> disabled<% end %>"><%= cf_link_to '»', forum_path(current_forum, p: all_pages_count - 1), target: nil %></li>
<li class="last<% if @page == all_pages_count - 1 %> disabled<% end %>"><%= cf_link_to '»', forum_path(current_forum, p: all_pages_count - 1) %></li>
</ul>
</div>
<% end %>
8 changes: 4 additions & 4 deletions app/views/cites/show.html.erb
Expand Up @@ -9,10 +9,10 @@ content_for :body_classes, 'cites show'
<div class="cf-pages">
<ul>
<% unless @prev_cite.blank? %>
<li><%= cf_link_to t('views.pagination.prev_page'), cite_path(@prev_cite), rel: 'previous', target: nil %></li>
<li><%= cf_link_to t('views.pagination.prev_page'), cite_path(@prev_cite), rel: 'previous' %></li>
<% end %>
<% unless @next_cite.blank? %>
<li><%= cf_link_to t('views.pagination.next_page'), cite_path(@next_cite), rel: 'next', target: nil %></li>
<li><%= cf_link_to t('views.pagination.next_page'), cite_path(@next_cite), rel: 'next' %></li>
<% end %>
</ul>
</div>
Expand All @@ -35,10 +35,10 @@ content_for :body_classes, 'cites show'
<div class="cf-pages">
<ul>
<% unless @prev_cite.blank? %>
<li><%= cf_link_to t('views.pagination.prev_page'), cite_path(@prev_cite), rel: 'previous', target: nil %></li>
<li><%= cf_link_to t('views.pagination.prev_page'), cite_path(@prev_cite), rel: 'previous' %></li>
<% end %>
<% unless @next_cite.blank? %>
<li><%= cf_link_to t('views.pagination.next_page'), cite_path(@next_cite), rel: 'next', target: nil %></li>
<li><%= cf_link_to t('views.pagination.next_page'), cite_path(@next_cite), rel: 'next' %></li>
<% end %>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/kaminari/_first_page.html.erb
Expand Up @@ -7,5 +7,5 @@
remote: data-remote
-%>
<li<% if current_page.first? %> class="disabled"<% end %>>
<%= cf_link_to t('views.pagination.first_page'), url, remote: remote, target: nil %>
<%= cf_link_to t('views.pagination.first_page'), url, remote: remote %>
</li>
2 changes: 1 addition & 1 deletion app/views/kaminari/_last_page.html.erb
Expand Up @@ -7,5 +7,5 @@
remote: data-remote
-%>
<li<% if current_page.last? %> class="disabled"<% end %>>
<%= cf_link_to t('views.pagination.last_page'), url, remote: remote, target: nil %>
<%= cf_link_to t('views.pagination.last_page'), url, remote: remote %>
</li>
2 changes: 1 addition & 1 deletion app/views/kaminari/_next_page.html.erb
Expand Up @@ -7,5 +7,5 @@
remote: data-remote
-%>
<li<% if current_page.last? %> class="disabled"<% end %>>
<%= cf_link_to_unless current_page.last?, t('views.pagination.next_page'), url, rel: 'next', remote: remote, target: nil %>
<%= cf_link_to_unless current_page.last?, t('views.pagination.next_page'), url, rel: 'next', remote: remote %>
</li>
2 changes: 1 addition & 1 deletion app/views/kaminari/_page.html.erb
Expand Up @@ -8,5 +8,5 @@
remote: data-remote
-%>
<li class="page<%= ' active' if page.current? %>">
<%= cf_link_to page, url + @doc_fragment.to_s, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil, target: nil} %>
<%= cf_link_to page, url + @doc_fragment.to_s, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
</li>
2 changes: 1 addition & 1 deletion app/views/kaminari/_prev_page.html.erb
Expand Up @@ -7,5 +7,5 @@
remote: data-remote
-%>
<li<% if current_page.first? %> class="disabled"<% end %>>
<%= cf_link_to t('views.pagination.prev_page'), url, rel: 'prev', remote: remote, target: nil %>
<%= cf_link_to t('views.pagination.prev_page'), url, rel: 'prev', remote: remote %>
</li>
8 changes: 0 additions & 8 deletions app/views/users/settings/_komfort.html.erb
Expand Up @@ -61,14 +61,6 @@
</div>
</div>

<div class="cf-cgroup">
<label for="settings_open_links_in_tab"><%= t('users.settings.open_links_in_tab') %></label>
<div class="cntrls">
<%= hidden_field_tag 'settings[open_links_in_tab]', 'no', id: '' %>
<label class="checkbox"><%= check_box_tag 'settings[open_links_in_tab]', 'yes', @settings.conf('open_links_in_tab') == 'yes' %></label>
</div>
</div>

<div class="cf-cgroup">
<label for="settings_load_messages_via_js"><%= t('users.settings.load_messages_via_js') %></label>
<div class="cntrls">
Expand Down
1 change: 0 additions & 1 deletion config/locales/users.settings.de.yml
Expand Up @@ -57,7 +57,6 @@ de:
page_messages: Nachrichten auf mehrere Seiten verteilen
fold_quotes: Längere Zitate zusammenfalten
use_javascript_notifications: Mit JavaScript über neue Beiträge informieren
open_links_in_tab: Links in einem neuen Tab öffnen
load_messages_via_js: neue Nachrichten via JavaScript nachladen
hide_read_threads: vollständig gelesene Threads ausblenden

Expand Down
1 change: 0 additions & 1 deletion lib/config_manager.rb
Expand Up @@ -93,7 +93,6 @@ class ConfigManager
'fold_quotes' => 'no',
'live_preview' => 'yes',

'open_links_in_tab' => 'no',
'load_messages_via_js' => 'yes',

'hide_read_threads' => 'no',
Expand Down

0 comments on commit c0b270d

Please sign in to comment.