xforum 0.0.31 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/xforum/forum_basic.js.coffee +9 -3
- data/app/assets/stylesheets/xforum/custom.css.scss +5 -1
- data/app/models/xforum/photo.rb +20 -5
- data/app/views/xforum/comments/_forum_video.html.erb +6 -1
- data/db/migrate/{20140602_change_suggestion_default.rb → 20140603_change_suggestion_default.rb} +0 -0
- data/db/migrate/20140604_add_has_video_to_photo.rb +5 -0
- data/lib/xforum/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbb5ecbeff2816d4cdada6de761f7bef7b15fc92
|
4
|
+
data.tar.gz: f5530cbc54472978cfcbe6fe85e21c69d6f961c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 646132bc513c5fc7fbc3a9105d29e3035c6618b8213633cf35aeee65bf99a819ec6e3f0391ca8aa916406ba627c9411c6ed194250258a239be64f1b3466e1fab
|
7
|
+
data.tar.gz: d98e7c78d1a5688ea3b0aa9a294e61ec045be6b2ebd05a8d1748dd40104598126b7d2fd4fee08fb8710e23edd42afd194468a8c32a99ea16c5f8e365802e9f19
|
@@ -219,7 +219,10 @@ buildSpan = (page, index, params) ->
|
|
219
219
|
da_class = 'forum-comment-new'
|
220
220
|
else if page.dataset.moderator == 'true' && params.comment_state == 'reject'
|
221
221
|
da_class = 'forum-comment-reject'
|
222
|
-
else
|
222
|
+
else if params.needs_translation
|
223
|
+
da_class = 'forum-comment-translate'
|
224
|
+
else
|
225
|
+
da_class = 'forum-comment'
|
223
226
|
the_comment=params.content.replace('::',':<br>')
|
224
227
|
span.innerHTML = '<p>' + the_comment + '</p>'
|
225
228
|
page.appendChild(span)
|
@@ -228,7 +231,7 @@ buildSpan = (page, index, params) ->
|
|
228
231
|
paragraph.style.marginLeft = "#{params.indent * 20}px" #why doesn't this make it out
|
229
232
|
putOwnerIn(span,params)
|
230
233
|
if params.has_photo
|
231
|
-
putPhotosIn(span,params.photos)
|
234
|
+
putPhotosIn(span,params.photos,params.video)
|
232
235
|
if params.hyperlinks?
|
233
236
|
hyperlinks=params.hyperlinks
|
234
237
|
for i in [0...hyperlinks.length]
|
@@ -254,7 +257,7 @@ window.getSelectedId = ->
|
|
254
257
|
span = spans[spans.length - 1]
|
255
258
|
{selection: html, id: span.dataset.id}
|
256
259
|
|
257
|
-
putPhotosIn=(span,urls)->
|
260
|
+
putPhotosIn=(span,urls,video)->
|
258
261
|
span.dataset.already_has_photo=true
|
259
262
|
lineReturn=document.createElement('span')
|
260
263
|
lineReturn.innerHTML='<br>'
|
@@ -265,6 +268,9 @@ putPhotosIn=(span,urls)->
|
|
265
268
|
img.src=urls[i]
|
266
269
|
img.className= 'forum-photo'
|
267
270
|
img.id='forum-photo'
|
271
|
+
img.ddataset.index=i
|
272
|
+
if video
|
273
|
+
img.dataset.video=true
|
268
274
|
paragraph.appendChild(img)
|
269
275
|
|
270
276
|
window.putOwnerIn=(span,params)->
|
@@ -38,6 +38,10 @@ $blue: #a0a0ff;
|
|
38
38
|
@extend .forum-comment;
|
39
39
|
background: rgb(255, 235, 235);
|
40
40
|
}
|
41
|
+
.forum-comment-translate {
|
42
|
+
@extend .forum-comment;
|
43
|
+
color: rgb(0, 0, 180);
|
44
|
+
}
|
41
45
|
.admin-edit-field{
|
42
46
|
width:150px;
|
43
47
|
font-size: 10px;
|
@@ -80,7 +84,7 @@ input{
|
|
80
84
|
.forum-senate{
|
81
85
|
width:100%;
|
82
86
|
height:570px;
|
83
|
-
background:rgb(
|
87
|
+
background:rgb(240, 240, 240);
|
84
88
|
overflow-y: scroll;
|
85
89
|
padding:20px;
|
86
90
|
}
|
data/app/models/xforum/photo.rb
CHANGED
@@ -18,21 +18,36 @@ module Xforum
|
|
18
18
|
belongs_to :forum
|
19
19
|
|
20
20
|
def self.get_photos(forum_id)
|
21
|
-
photos=Photo.
|
21
|
+
photos=Photo.grab({forum_id:forum_id},[:key,:has_video],{order:[:id]})
|
22
22
|
urls=[]
|
23
|
+
video=false
|
23
24
|
photos.each {|photo|
|
24
|
-
urls.push(ForumAssist.get_url(photo) )
|
25
|
+
urls.push(ForumAssist.get_url(photo[:key]) )
|
26
|
+
video=true if photo[:has_video]
|
25
27
|
}
|
26
|
-
urls
|
28
|
+
{urls:urls,video:video}
|
27
29
|
end
|
28
30
|
|
29
31
|
def self.get_photo(params)
|
30
32
|
params[:id].nil? || params[:id] == '' ? which = {tag:params[:tag]} : which = {id:params[:id]}
|
31
33
|
data=Forum.grab(which,[:id,:parent],{})[0]
|
32
|
-
|
33
|
-
{tag:params[:tag],edit:params[:edit],urls:urls,id:data[:id],parent:data[:parent],count:params[:count].to_i+1}
|
34
|
+
answer=Photo.get_photos(data[:id])
|
35
|
+
{tag:params[:tag],edit:params[:edit],urls:answer[:urls],video:answer[:video],id:data[:id],parent:data[:parent],count:params[:count].to_i+1}
|
34
36
|
end
|
37
|
+
def self.get_video(params)
|
38
|
+
photos=Photo.grab({forum_id:params[:forum_id]},[:key,:has_video,:name],{})
|
39
|
+
if photos.size>1
|
40
|
+
{video:false}
|
41
|
+
else
|
42
|
+
photo=photos[0]
|
43
|
+
ext= photo[:name].split('.').last
|
44
|
+
name=photos[:name].split(ext).first
|
45
|
+
name+='mp4'
|
46
|
+
folder=ENV['XFORUM_VIDEOS']
|
47
|
+
{video:AssistMe.get_url(File.join(folder,name))}
|
48
|
+
end
|
35
49
|
|
50
|
+
end
|
36
51
|
def self.upload(params,user_id)
|
37
52
|
temp=JSON.load(params[:photo][:data])
|
38
53
|
pforward=Hash[temp.map{|k,v| [k.to_sym,v]}] #make the true/false strings again
|
@@ -3,5 +3,10 @@
|
|
3
3
|
<input class='red-ellipse comment-btn' type='button' id= 'forum-video-back' value= "<%= t('xForum.Back')%>" >
|
4
4
|
<input class='green-ellipse comment-btn' type='button' id= 'forum-video-replay' value= "<%= t('xForum.Replay')%>" >
|
5
5
|
</div>
|
6
|
-
|
6
|
+
<span id="big-forum-picture">
|
7
|
+
<%=image_tag('',id:'big-forum-photo', class:'biggest-forum-photo') %>
|
8
|
+
</span>
|
9
|
+
<span id='forum-big-video' hidden>
|
10
|
+
<%=video_tag('',id:'big-forum-video', class:'biggest-forum-photo') %>
|
11
|
+
</span>
|
7
12
|
</div>
|
data/db/migrate/{20140602_change_suggestion_default.rb → 20140603_change_suggestion_default.rb}
RENAMED
File without changes
|
data/lib/xforum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xforum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert D Blanton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|
@@ -235,7 +235,8 @@ files:
|
|
235
235
|
- db/migrate/20140600_add_forum_to_users.rb
|
236
236
|
- db/migrate/20140601_create_forum_forums.rb
|
237
237
|
- db/migrate/20140602_add_restricted_to_category.rb
|
238
|
-
- db/migrate/
|
238
|
+
- db/migrate/20140603_change_suggestion_default.rb
|
239
|
+
- db/migrate/20140604_add_has_video_to_photo.rb
|
239
240
|
- lib/active_record_extension.rb
|
240
241
|
- lib/tasks/xforum_tasks.rake
|
241
242
|
- lib/xforum.rb
|