Skip to content
Permalink
Browse files

ref: removed „open links in new tab“ feature

  • Loading branch information...
Christian Kruse
Christian Kruse committed Jun 1, 2016
1 parent 7a6e6b5 commit c0b270d8e24df12885a998fde9890c8432fb96aa
@@ -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)
@@ -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'
@@ -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'
)
@@ -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 %>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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">
@@ -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

@@ -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',

0 comments on commit c0b270d

Please sign in to comment.
You can’t perform that action at this time.