xforum 0.0.34 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbb5ecbeff2816d4cdada6de761f7bef7b15fc92
4
- data.tar.gz: f5530cbc54472978cfcbe6fe85e21c69d6f961c5
3
+ metadata.gz: 7f4eb6df653dcbfd2fb36f28f9be5a7224bea8a4
4
+ data.tar.gz: 27abc8487fc43cb744cadbbac3e617995b457f1c
5
5
  SHA512:
6
- metadata.gz: 646132bc513c5fc7fbc3a9105d29e3035c6618b8213633cf35aeee65bf99a819ec6e3f0391ca8aa916406ba627c9411c6ed194250258a239be64f1b3466e1fab
7
- data.tar.gz: d98e7c78d1a5688ea3b0aa9a294e61ec045be6b2ebd05a8d1748dd40104598126b7d2fd4fee08fb8710e23edd42afd194468a8c32a99ea16c5f8e365802e9f19
6
+ metadata.gz: 9c0f6ae2f4720cf33eb452701d663154e78026a2fcde7abf05f065434b5a0ad46920d1a577edb88d8681f7c8fc723c6f2896ae6f820be50909f3f66a877bf85f
7
+ data.tar.gz: dcc38311759fdc8f7c10cbcbb77206c2cb5825aa12da0b55574c5fcb15deb657f763bdd67d1cee5d31ac482eefdd1b6085b93e29733e2a1b2fa275b20d5ad3f6
@@ -20,7 +20,7 @@ jQuery ->
20
20
  $('#forum-category').change ->
21
21
  changeTopic()
22
22
  $('#forum-video-replay').click ->
23
- img=document.getElementById('big-forum-photo')
23
+ img=document.getElementById('big-forum-picture')
24
24
  img.src=img.src
25
25
  $('#forum-video-back').click ->
26
26
  goBackToSenate()
@@ -33,10 +33,29 @@ goBackToSenate=->
33
33
  runPhotoGallery=(target)->
34
34
  hideMe({id:'forum-senate'})
35
35
  showMe({id:'forum-senate-video'})
36
- img=document.getElementById('big-forum-photo')
37
- img.src=target.src
36
+ console.log('target.video ' + target.dataset.video)
37
+ if target.dataset.video=='true'
38
+ getTheVideo(target)
39
+ else
40
+ showMe({id:'big-forum-picture-span'})
41
+ img=document.getElementById('big-forum-picture')
42
+ img.src=target.src
38
43
  hideForumElements()
39
44
 
45
+
46
+ getTheVideo=(photo)->
47
+ console.log('in get video')
48
+ showMe({id:'big-forum-video-span'})
49
+ hideMe({id:'big-forum-picture-span'})
50
+ forumWait()
51
+ $.post('xforum/forum_ajax',{function:'get video',forum_id:photo.dataset.forum_id},playVideo)
52
+
53
+ playVideo=(params)->
54
+ video=document.getElementById('big-forum-video')
55
+ video.src=params.video
56
+ video.canplay=forumGo()
57
+
58
+
40
59
  window.startForum = ->
41
60
  hideMe({id: showPageName()})
42
61
  showForumElements()
@@ -231,7 +250,7 @@ buildSpan = (page, index, params) ->
231
250
  paragraph.style.marginLeft = "#{params.indent * 20}px" #why doesn't this make it out
232
251
  putOwnerIn(span,params)
233
252
  if params.has_photo
234
- putPhotosIn(span,params.photos,params.video)
253
+ putPhotosIn(span,params.photos.urls,params.photos.video,params.photos.forum)
235
254
  if params.hyperlinks?
236
255
  hyperlinks=params.hyperlinks
237
256
  for i in [0...hyperlinks.length]
@@ -257,7 +276,8 @@ window.getSelectedId = ->
257
276
  span = spans[spans.length - 1]
258
277
  {selection: html, id: span.dataset.id}
259
278
 
260
- putPhotosIn=(span,urls,video)->
279
+ putPhotosIn=(span,urls,video,forum_id)->
280
+ console.log('photo ', video)
261
281
  span.dataset.already_has_photo=true
262
282
  lineReturn=document.createElement('span')
263
283
  lineReturn.innerHTML='<br>'
@@ -268,7 +288,8 @@ putPhotosIn=(span,urls,video)->
268
288
  img.src=urls[i]
269
289
  img.className= 'forum-photo'
270
290
  img.id='forum-photo'
271
- img.ddataset.index=i
291
+ img.dataset.index=i
292
+ img.dataset.forum_id=forum_id
272
293
  if video
273
294
  img.dataset.video=true
274
295
  paragraph.appendChild(img)
@@ -144,4 +144,21 @@ function deleteMyData(obj) {
144
144
  ref = 'data-' + the_keys[i];
145
145
  obj.removeAttribute(ref);
146
146
  }
147
+ }
148
+ function forumWait() {
149
+ 'use strict';
150
+ $('#forum-box').spin({
151
+ lines: 18, // The number of lines to draw
152
+ length: 14, // The length of each line
153
+ width: 9, // The line thickness
154
+ radius: 30, // The radius of the inner circle
155
+ color: '#fff', // #rgb or #rrggbb
156
+ speed: 1, // Rounds per second
157
+ trail: 60, // Afterglow percentage
158
+ shadow: false // Whether to render a shadow
159
+ });
160
+ }
161
+ function forumGo() {
162
+ 'use strict';
163
+ $('#forum-box').spin(false);
147
164
  }
@@ -48,6 +48,13 @@ $blue: #a0a0ff;
48
48
  padding:3px;
49
49
  margin-left:10px;
50
50
  }
51
+
52
+ .big-forum-video{
53
+ width:960px;
54
+ position:relative;
55
+ margin-left:75px;
56
+ margin-top:10px;
57
+ }
51
58
  input{
52
59
  border: 1px solid rgb(187, 187, 187);
53
60
  width: 95%;
@@ -21,6 +21,8 @@ module Xforum
21
21
  render json: PeopleList.get_forum_distribution_lists(params,current_user)
22
22
  else
23
23
  end
24
+ when 'get video'
25
+ render json: Photo.get_video(params)
24
26
  when 'forum admin action'
25
27
  render json: Forum.do_admin_action(params, current_user)
26
28
  when 'categories'
@@ -25,7 +25,7 @@ module Xforum
25
25
  urls.push(ForumAssist.get_url(photo[:key]) )
26
26
  video=true if photo[:has_video]
27
27
  }
28
- {urls:urls,video:video}
28
+ {urls:urls,video:video,forum:forum_id}
29
29
  end
30
30
 
31
31
  def self.get_photo(params)
@@ -34,6 +34,8 @@ module Xforum
34
34
  answer=Photo.get_photos(data[:id])
35
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}
36
36
  end
37
+
38
+
37
39
  def self.get_video(params)
38
40
  photos=Photo.grab({forum_id:params[:forum_id]},[:key,:has_video,:name],{})
39
41
  if photos.size>1
@@ -41,10 +43,10 @@ module Xforum
41
43
  else
42
44
  photo=photos[0]
43
45
  ext= photo[:name].split('.').last
44
- name=photos[:name].split(ext).first
46
+ name=photo[:name].split(ext).first
45
47
  name+='mp4'
46
48
  folder=ENV['XFORUM_VIDEOS']
47
- {video:AssistMe.get_url(File.join(folder,name))}
49
+ {video:ForumAssist.get_url(File.join(folder,name))}
48
50
  end
49
51
 
50
52
  end
@@ -42,4 +42,8 @@
42
42
 
43
43
  <div class="forum-senate" id='forum-senate'>
44
44
  <%=render partial: 'xforum/comments/forum_entry'%>
45
- </div>
45
+ </div>
46
+ <div id="forum-senate-video" style="display: none;">
47
+ <%=render partial: 'xforum/comments/forum_video'%>
48
+ </div>
49
+
@@ -1,12 +1,11 @@
1
- <div id="forum-senate-video" style="display: none;">
2
- <div>
1
+
2
+ <div>
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
- </div>
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>
12
- </div>
5
+ </div>
6
+ <span id="big-forum-picture-span">
7
+ <%=image_tag('',id:'big-forum-picture', class:'biggest-forum-photo') %>
8
+ </span>
9
+ <span id='big-forum-video-span' hidden>
10
+ <%=video_tag('' , {:canplay=> '' , :controls=>true ,:class => 'big-forum-video',:id=>'big-forum-video'} ) %>
11
+ </span>
@@ -14,5 +14,4 @@
14
14
 
15
15
  <%=render partial: 'xforum/comments/forum_comments'%>
16
16
  <%=render partial: 'xforum/forums/forum_admin'%>
17
- <%=render partial: 'xforum/comments/forum_video'%>
18
17
  </div>
@@ -25,6 +25,7 @@
25
25
  def load_the_forum_file(file_name)
26
26
  CSV.foreach(file_name, headers: true) { |row|
27
27
  the_row=row.to_hash
28
+ puts "'row ' #{the_row['topic']} , #{the_row['content']}"
28
29
  category_id=Xforum::Category.where(name:the_row['category']).pluck(:id)[0]
29
30
  category_id=Xforum::Category.create(name:the_row['category']).id if category_id.nil?
30
31
  topic_id=Xforum::Topic.where(name:the_row['topic']).pluck(:id)[0]
@@ -1,3 +1,3 @@
1
1
  module Xforum
2
- VERSION = '0.0.34'
2
+ VERSION = '0.0.35'
3
3
  end
@@ -3,7 +3,7 @@ Rails.application.configure do
3
3
 
4
4
  # The test environment is used exclusively to run your application's
5
5
  # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
6
+ # your test database is "PDM Dues.csv space" for the test suite and is wiped
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
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.34
4
+ version: 0.0.35
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-07-11 00:00:00.000000000 Z
11
+ date: 2014-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '4.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: spinjs-rails
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: turbolinks
169
183
  requirement: !ruby/object:Gem::Requirement