about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2020-12-15 14:27:06 +0100
committerClaire <claire.github-309c@sitedethib.com>2020-12-15 14:27:06 +0100
commite4f8679eaeea062e1f9ca9f58703b51ff8162c35 (patch)
tree13940a853f1278a3c4ef89dd3a0bbedfeaaf7140 /app/helpers
parent1978f7265e1e83bda25413da26f53c53110af764 (diff)
parent8485c436d5d083c28df8c942fe521bfb46edfc9f (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/models/form/admin_settings.rb`:
  New setting added upstream. Ported it.
- `app/views/statuses/_simple_status.html.haml`:
  Upstream removed RTL classes. Did the same.
- `config/settings.yml`:
  New setting added upstream. Ported it.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/statuses_helper.rb20
1 files changed, 0 insertions, 20 deletions
diff --git a/app/helpers/statuses_helper.rb b/app/helpers/statuses_helper.rb
index daed9048f..1f654f34f 100644
--- a/app/helpers/statuses_helper.rb
+++ b/app/helpers/statuses_helper.rb
@@ -92,22 +92,6 @@ module StatusesHelper
     end
   end
 
-  def rtl_status?(status)
-    status.local? ? rtl?(status.text) : rtl?(strip_tags(status.text))
-  end
-
-  def rtl?(text)
-    text = simplified_text(text)
-    rtl_words = text.scan(/[\p{Hebrew}\p{Arabic}\p{Syriac}\p{Thaana}\p{Nko}]+/m)
-
-    if rtl_words.present?
-      total_size = text.size.to_f
-      rtl_size(rtl_words) / total_size > 0.3
-    else
-      false
-    end
-  end
-
   def fa_visibility_icon(status)
     case status.visibility
     when 'public'
@@ -143,10 +127,6 @@ module StatusesHelper
     end
   end
 
-  def rtl_size(words)
-    words.reduce(0) { |acc, elem| acc + elem.size }.to_f
-  end
-
   def embedded_view?
     params[:controller] == EMBEDDED_CONTROLLER && params[:action] == EMBEDDED_ACTION
   end