jegolize 0.1.6 → 0.1.8

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.8
@@ -40,4 +40,15 @@ class JegolController < ApplicationController
40
40
  client.close
41
41
  return username
42
42
  end
43
+
44
+ def demo
45
+ @room = 'demo_room'
46
+ @active = true
47
+ @room = session[:room] if !session[:room].nil? && !session[:room].empty?
48
+ @active = !session[:active].nil? && session[:active].downcase == 'true'
49
+
50
+ respond_to do |format|
51
+ format.html #demo.html.erb
52
+ end
53
+ end
43
54
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  <%= stylesheet_link_tag "jegol", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" %>
3
- <%= javascript_include_tag 'jegol', 'strophe', 'jegol.tag', 'jegol/plugin/viewer.default', 'jegol/plugin/update.tag', 'jegol/plugin/viewer.image', 'jegol/plugin/viewer.youtube', 'jegol/plugin/viewer.poll', 'jegol/plugin/update.subject', 'jegol/plugin/update.notify', 'http://platform.twitter.com/widgets.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js'%>
3
+ <%= javascript_include_tag 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js', 'jegol', 'strophe', 'jegol.tag', 'jegol.plugin/viewer.default', 'jegol.plugin/update.tag', 'jegol.plugin/viewer.image', 'jegol.plugin/viewer.youtube', 'jegol.plugin/viewer.poll', 'jegol.plugin/update.subject', 'jegol.plugin/update.notify', 'http://platform.twitter.com/widgets.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js'%>
4
4
  <div id="jegol_box">
5
5
  <input type='hidden' id='jegol_service_url' value='<%= service %>' />
6
6
  <div>
@@ -0,0 +1,3 @@
1
+ <div>
2
+ <%= render "jegol", :service => "/jegol/boshsession/#{Jegol.get_MUC_name(@room)}", :readonly => !@active , :tweeturl => "https://github.com/alemyis/jegolize/wiki"%>
3
+ </div>
@@ -1,3 +1 @@
1
- if __FILE__ == $0
2
- JEGOL_CONFIG = YAML.load_file("#{Rails.root}/config/jegol.yml")
3
- end
1
+ JEGOL_CONFIG = YAML.load_file("#{Rails.root}/config/jegol.yml")
data/config/jegol.yml CHANGED
@@ -26,6 +26,4 @@
26
26
  muc_namespace: conference.<TODO: XMPP.MYSERVER.COM>
27
27
 
28
28
  #chat rooms are named [jegolizating_<ID>]
29
- muc_name_constant: jegolizing_
30
-
31
-
29
+ muc_name_constant: jegolizing_
data/jegolize.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jegolize}
8
- s.version = "0.1.6"
8
+ s.version = "0.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alemeshet Alemu"]
@@ -25,8 +25,8 @@ Gem::Specification.new do |s|
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "app/controllers/jegol_controller.rb",
28
- "app/views/_jegol.html.erb",
29
- "app/views/jebol_demo.html.erb",
28
+ "app/views/jegol/_jegol.html.erb",
29
+ "app/views/jegol/demo.html.erb",
30
30
  "config/initializers/jegol.rb",
31
31
  "config/jegol.yml",
32
32
  "jegolize.gemspec",
@@ -1,8 +1,8 @@
1
1
  Description:
2
- TODO -
2
+ Generate's jebol files - controllers
3
3
 
4
4
  Usage:
5
- TODO -
5
+ rails g jegolize:scaffold
6
6
 
7
7
  Examples:
8
- TODO -
8
+ rails g jegolize:scaffold
@@ -10,9 +10,9 @@ module Jegolize
10
10
  puts '-----------------------------------------------------'
11
11
 
12
12
  # Copy views
13
- filename_pattern = File.join self.class.source_root, "app/views/*.html.erb"
13
+ filename_pattern = File.join self.class.source_root, "app/views/jegol/*.html.erb"
14
14
  Dir.glob(filename_pattern).map {|f| File.basename f}.each do |f|
15
- copy_file "#{self.class.source_root}/app/views/#{f}", "app/views/jegol/#{f}"
15
+ copy_file "#{self.class.source_root}/app/views/jegol/#{f}", "app/views/jegol/#{f}"
16
16
  end
17
17
 
18
18
  # Copy server side components - controller, config, init,
@@ -37,6 +37,7 @@ module Jegolize
37
37
 
38
38
  def create_route
39
39
  route "match 'jegol/boshsession/:room_jid' => 'jegol#new_boshsession', :conditions => {:method => :get }"
40
+ route "match 'jegol/demo/:room/:active' => 'jegol#demo', :conditions => {:method => :get }"
40
41
  end
41
42
  end
42
43
  end
@@ -8,6 +8,9 @@ var JeGol = {
8
8
  participants: null,
9
9
  lastmessagefrom: null,
10
10
  autoReconnect: true,
11
+ reconnectionDelay: 1000, //delay this many msec before trying to reconnect
12
+ reconnectionAttempt: 0,
13
+ reconnectionAttemptLimit: 10,
11
14
  viewerPlugins: {},
12
15
  updatePlugins: {},
13
16
  /**
@@ -518,7 +521,13 @@ $(document).bind('disconnected', function(){
518
521
 
519
522
  if(JeGol.autoReconnect == true)
520
523
  {
521
- $(document).trigger('connect');
524
+ JeGol.reconnectionAttempt += 1;
525
+ //incrementally delay connection attempt
526
+ if (JeGol.reconnectionAttempt < JeGol.reconnectionAttemptLimit) {
527
+ setTimeout(function(){
528
+ $(document).trigger('connect');
529
+ }, JeGol.reconnectionAttempt * JeGol.reconnectionDelay);
530
+ }
522
531
  }
523
532
  });
524
533
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jegolize
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.6
5
+ version: 0.1.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Alemeshet Alemu
@@ -108,8 +108,8 @@ files:
108
108
  - Rakefile
109
109
  - VERSION
110
110
  - app/controllers/jegol_controller.rb
111
- - app/views/_jegol.html.erb
112
- - app/views/jebol_demo.html.erb
111
+ - app/views/jegol/_jegol.html.erb
112
+ - app/views/jegol/demo.html.erb
113
113
  - config/initializers/jegol.rb
114
114
  - config/jegol.yml
115
115
  - jegolize.gemspec
@@ -157,7 +157,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- hash: -535598431
160
+ hash: -748024717
161
161
  segments:
162
162
  - 0
163
163
  version: "0"
@@ -1,3 +0,0 @@
1
- <div>
2
- <%= render "jegol", :service => "/jegol/boshsession/#{Jegol.get_MUC_name(@meeting.id.to_s)}", :readonly => !@meeting.active? , :tweeturl => "https://github.com/alemyis/jegolize/wiki"%>
3
- </div>