my_forum 0.0.2 → 0.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee1ba421dcc871ea818bc90b35ad0ec9c0c0e74b
4
- data.tar.gz: f08beb05ab8c50fe16c9a0fb40cd793a426a679d
3
+ metadata.gz: b41182adb8b596c4921371310fbd823932646e8f
4
+ data.tar.gz: b1a66385c9b08ce3d4b02ecf581ef348b3b48c6a
5
5
  SHA512:
6
- metadata.gz: 2c3b1e5edb986c2cb9247315cd3edf131776d1b7ffb242a674fb3040d028fee1e04a3b6307b6e39021c8e85ccb40a25f699a776a777b38ed8475f8f86dd7b05e
7
- data.tar.gz: c54770fa9defa218db1581bf133b9ccb384615444ded4a803119edfb8e981b2842782f168adfbe3834a78d0a0f6fe62fdf5e11b588b599268f74e653d62bbd98
6
+ metadata.gz: e30aebce379a7b413628cc63b46f7974740ca76872a06612d13d3e1b5b1861cb3e86b82e311798b24686261767d992dbf62b7a39f1307de40d0b30706e1345c1
7
+ data.tar.gz: 0bac644ed881e21bdbdcb841e737c4b7d626d01cece21c5e618053b73d4dd5449fbd1358f21ec5a5030047956ee2a25779eeaa93697d059909cc34f23ec214fe
@@ -16,5 +16,9 @@ ready = ->
16
16
  data:
17
17
  text: data
18
18
 
19
+ $('.user_autocomplete').keypress (event) ->
20
+ # determinate @ char
21
+ return unless event.keyCode == 64
22
+
19
23
  $(document).ready(ready)
20
24
  $(document).on('page:load', ready)
@@ -12,6 +12,7 @@ module MyForum
12
12
  # Images
13
13
  text.gsub!(/\[img\]/i, '<img src="')
14
14
  text.gsub!(/\[\/img\]/i, '" />')
15
+ text.gsub!(/\[img\](.*?)\[\/img\]/i) { ActionController::Base.helpers.image_tag($1) }
15
16
 
16
17
  # Youtube
17
18
  text.gsub!(/(?:https?:\/\/)?(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=)?(?<video_code>[\w-]{10,})/i) do |match|
@@ -56,16 +57,16 @@ module MyForum
56
57
  text.gsub!(/#{Regexp.quote(code)}/) { "<img src='#{path}' class='smile' />" }
57
58
  end
58
59
 
59
- # Link
60
+ # Link TODO
60
61
  # ActionController::Base.helpers.... - this method uses in controller, which don`t know link_to
61
- text.gsub!(/\[url=(.*?)\](.*?)\[\/url\]/i) { ActionController::Base.helpers.link_to($2, $1, target: '_blank') }
62
- text.gsub!(/(http:\/\/[\S]+|www:\/\/[\S]+)/i) { ActionController::Base.helpers.link_to($1, $1, target: '_blank') }
62
+ #text.gsub!(/\[url=(.*?)\](.*?)\[\/url\]/i) { ActionController::Base.helpers.link_to($2, $1, target: '_blank') }
63
+ #text.gsub!(/(http:\/\/[\S]+|www:\/\/[\S]+)/i) { ActionController::Base.helpers.link_to($1, $1, target: '_blank') }
63
64
 
64
65
  # Ping user
65
66
  text.gsub!(/@\S+/) { |match| "<span class='badge'>#{match}</span>" }
66
67
 
67
68
 
68
- text.html_safe
69
+ auto_link(text).html_safe
69
70
  end
70
71
 
71
72
  def bbquote(author:, date:)
@@ -5,7 +5,7 @@ ru:
5
5
  sent: 'Сообщение отправленно'
6
6
  mailer:
7
7
  new_pm_notification_subject: 'Уведомление о новом личном сообщении'
8
- ping_user: "Вас упоминули в теме %{topic_name}"
8
+ ping_user: "Вас упоминули в теме '%{topic_name}'"
9
9
  shared:
10
10
  post_preview:
11
11
  preview: 'Предпросмотр сообщения'
@@ -4,6 +4,7 @@ module MyForum
4
4
 
5
5
  require 'jquery-rails'
6
6
  require 'bootstrap-sass'
7
+ require 'rails_autolink'
7
8
 
8
9
  config.after_initialize do
9
10
  ActionView::Base.sanitized_allowed_tags = %w(strong em a img br p i pre div span iframe)
@@ -1,3 +1,3 @@
1
1
  module MyForum
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_forum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Omelchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-25 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rails_autolink
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: Simple forum engine.
140
154
  email:
141
155
  - prosto.vint@gmail.com