phocoder-rails 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/.autotest +46 -0
  2. data/.document +5 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +44 -0
  5. data/LICENSE.txt +20 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.rdoc +3 -0
  8. data/Rakefile +56 -0
  9. data/VERSION +5 -0
  10. data/app/controllers/phocoder_controller.rb +118 -0
  11. data/app/helpers/phocoder_helper.rb +320 -0
  12. data/app/models/encodable_job.rb +91 -0
  13. data/app/views/phocoder/_offline_video_embed.html.erb +19 -0
  14. data/app/views/phocoder/_thumbnail_update.html.erb +3 -0
  15. data/app/views/phocoder/_video_embed.html.erb +23 -0
  16. data/app/views/phocoder/multi_thumbnail_update.json.erb +7 -0
  17. data/app/views/phocoder/thumbnail_update.js.erb +9 -0
  18. data/config/routes.rb +8 -0
  19. data/lib/generators/phocoder_rails/model_update_generator.rb +52 -0
  20. data/lib/generators/phocoder_rails/scaffold_generator.rb +94 -0
  21. data/lib/generators/phocoder_rails/setup_generator.rb +33 -0
  22. data/lib/generators/phocoder_rails/templates/controller.rb +71 -0
  23. data/lib/generators/phocoder_rails/templates/helper.rb +5 -0
  24. data/lib/generators/phocoder_rails/templates/migration.rb +24 -0
  25. data/lib/generators/phocoder_rails/templates/model.rb +20 -0
  26. data/lib/generators/phocoder_rails/templates/model_migration.rb +56 -0
  27. data/lib/generators/phocoder_rails/templates/model_thumbnail.rb +5 -0
  28. data/lib/generators/phocoder_rails/templates/model_update_migration.rb +64 -0
  29. data/lib/generators/phocoder_rails/templates/phocodable.yml +28 -0
  30. data/lib/generators/phocoder_rails/templates/views/_form.html.erb.tt +23 -0
  31. data/lib/generators/phocoder_rails/templates/views/index.html.erb.tt +26 -0
  32. data/lib/generators/phocoder_rails/templates/views/new.html.erb.tt +5 -0
  33. data/lib/generators/phocoder_rails/templates/views/show.html.erb.tt +12 -0
  34. data/lib/phocoder_rails.rb +12 -0
  35. data/lib/phocoder_rails/acts_as_phocodable.rb +1153 -0
  36. data/lib/phocoder_rails/engine.rb +24 -0
  37. data/lib/phocoder_rails/errors.rb +46 -0
  38. data/phocoder-rails.gemspec +219 -0
  39. data/public/images/building.gif +0 -0
  40. data/public/images/error.png +0 -0
  41. data/public/images/play_small.png +0 -0
  42. data/public/images/storing.gif +0 -0
  43. data/public/images/waiting.gif +0 -0
  44. data/public/javascripts/phocodable.js +110 -0
  45. data/public/javascripts/video-js-2.0.2/.DS_Store +0 -0
  46. data/public/javascripts/video-js-2.0.2/LICENSE.txt +165 -0
  47. data/public/javascripts/video-js-2.0.2/README.markdown +202 -0
  48. data/public/javascripts/video-js-2.0.2/demo-subtitles.srt +13 -0
  49. data/public/javascripts/video-js-2.0.2/demo.html +101 -0
  50. data/public/javascripts/video-js-2.0.2/skins/hu.css +116 -0
  51. data/public/javascripts/video-js-2.0.2/skins/tube.css +111 -0
  52. data/public/javascripts/video-js-2.0.2/skins/vim.css +89 -0
  53. data/public/javascripts/video-js-2.0.2/video-js.css +242 -0
  54. data/public/javascripts/video-js-2.0.2/video.js +1758 -0
  55. data/public/stylesheets/phocodable.css +19 -0
  56. data/spec/controllers/phocoder_controller_spec.rb +123 -0
  57. data/spec/dummy/Rakefile +7 -0
  58. data/spec/dummy/app/controllers/application_controller.rb +7 -0
  59. data/spec/dummy/app/controllers/images_controller.rb +72 -0
  60. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  61. data/spec/dummy/app/helpers/images_helper.rb +5 -0
  62. data/spec/dummy/app/models/image.rb +20 -0
  63. data/spec/dummy/app/models/image_thumbnail.rb +5 -0
  64. data/spec/dummy/app/models/image_upload.rb +11 -0
  65. data/spec/dummy/app/views/images/_form.html.erb +23 -0
  66. data/spec/dummy/app/views/images/index.html.erb +26 -0
  67. data/spec/dummy/app/views/images/new.html.erb +5 -0
  68. data/spec/dummy/app/views/images/show.html.erb +12 -0
  69. data/spec/dummy/app/views/layouts/application.html.erb +18 -0
  70. data/spec/dummy/config.ru +4 -0
  71. data/spec/dummy/config/application.rb +45 -0
  72. data/spec/dummy/config/boot.rb +10 -0
  73. data/spec/dummy/config/database.yml +25 -0
  74. data/spec/dummy/config/environment.rb +8 -0
  75. data/spec/dummy/config/environments/development.rb +26 -0
  76. data/spec/dummy/config/environments/production.rb +49 -0
  77. data/spec/dummy/config/environments/test.rb +40 -0
  78. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  79. data/spec/dummy/config/initializers/inflections.rb +10 -0
  80. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  81. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  82. data/spec/dummy/config/initializers/session_store.rb +8 -0
  83. data/spec/dummy/config/locales/en.yml +5 -0
  84. data/spec/dummy/config/routes.rb +60 -0
  85. data/spec/dummy/db/migrate/001_create_image_uploads.rb +37 -0
  86. data/spec/dummy/db/migrate/20110523165213_add_parent_type_to_image_uploads.rb +11 -0
  87. data/spec/dummy/db/migrate/20110523165522_create_encodable_jobs.rb +24 -0
  88. data/spec/dummy/db/migrate/20111101024507_create_images.rb +56 -0
  89. data/spec/dummy/db/schema.rb +99 -0
  90. data/spec/dummy/public/404.html +26 -0
  91. data/spec/dummy/public/422.html +26 -0
  92. data/spec/dummy/public/500.html +26 -0
  93. data/spec/dummy/public/favicon.ico +0 -0
  94. data/spec/dummy/public/index.html +239 -0
  95. data/spec/dummy/public/javascripts/application.js +2 -0
  96. data/spec/dummy/public/javascripts/controls.js +965 -0
  97. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  98. data/spec/dummy/public/javascripts/effects.js +1123 -0
  99. data/spec/dummy/public/javascripts/jquery-1.6.4.js +9046 -0
  100. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  101. data/spec/dummy/public/javascripts/rails.js +175 -0
  102. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  103. data/spec/dummy/script/rails +6 -0
  104. data/spec/engine_spec.rb +12 -0
  105. data/spec/fixtures/big_eye_tiny.jpg +0 -0
  106. data/spec/fixtures/octologo.png +0 -0
  107. data/spec/fixtures/test.txt +2 -0
  108. data/spec/fixtures/video-test.mov +0 -0
  109. data/spec/helpers/phocoder_helper_spec.rb +421 -0
  110. data/spec/integration/navigation_spec.rb +10 -0
  111. data/spec/models/acts_as_phocodable_spec.rb +664 -0
  112. data/spec/models/encodable_job_spec.rb +50 -0
  113. data/spec/phocoder_rails_spec.rb +8 -0
  114. data/spec/routing/phocoder_routing_spec.rb +19 -0
  115. data/spec/spec_helper.rb +75 -0
  116. metadata +375 -0
@@ -0,0 +1,24 @@
1
+ module PhocoderRails
2
+ class Engine < Rails::Engine
3
+
4
+
5
+
6
+ config.acts_as_phocodable = ActiveSupport::OrderedOptions.new
7
+
8
+ initializer "phocoder_config" do |app|
9
+
10
+ if !config.acts_as_phocodable.storage_mode.blank?
11
+ ActsAsPhocodable.storeage_mode = config.acts_as_phocodable.storage_mode
12
+ end
13
+
14
+ if !config.acts_as_phocodable.config_file.blank?
15
+ ActsAsPhocodable.config_file = config.acts_as_phocodable.config_file
16
+ end
17
+
18
+ app.middleware.use ::ActionDispatch::Static, "#{root}/public"
19
+
20
+ end
21
+
22
+
23
+ end
24
+ end
@@ -0,0 +1,46 @@
1
+ module ActsAsPhocodable
2
+
3
+ class Error < StandardError
4
+
5
+ def initialize(error_or_message)
6
+ if error_or_message.is_a?(Exception)
7
+ @error = error_or_message
8
+ else
9
+ @message = error_or_message
10
+ end
11
+ end
12
+
13
+ def message
14
+ @message || "#{@error.class} (wrapped in a #{self.class}) - #{@error.message}"
15
+ end
16
+
17
+ def backtrace
18
+ if @error
19
+ @error.backtrace
20
+ else
21
+ super
22
+ end
23
+ end
24
+
25
+ def inspect
26
+ if @error
27
+ "#{@error.inspect} (wrapped in a #{self.class})"
28
+ else
29
+ super
30
+ end
31
+ end
32
+
33
+ def to_s
34
+ if @error
35
+ "#{@error.class} (wrapped in a #{self.class}) - #{@error}"
36
+ else
37
+ super
38
+ end
39
+ end
40
+ end
41
+
42
+ class HTTPError < Error; end
43
+ class ThumbnailNotFoundError < Error; end
44
+ class ThumbnailAttributesNotFoundError < Error; end
45
+
46
+ end
@@ -0,0 +1,219 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{phocoder-rails}
8
+ s.version = "0.0.33"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = [%q{Jeremy Green}]
12
+ s.date = %q{2011-11-15}
13
+ s.description = %q{Rails engine for easy integration with phocoder.com}
14
+ s.email = %q{jagthedrummer@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".autotest",
21
+ ".document",
22
+ ".rspec",
23
+ "Gemfile",
24
+ "LICENSE.txt",
25
+ "MIT-LICENSE",
26
+ "README.rdoc",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "app/controllers/phocoder_controller.rb",
30
+ "app/helpers/phocoder_helper.rb",
31
+ "app/models/encodable_job.rb",
32
+ "app/views/phocoder/_offline_video_embed.html.erb",
33
+ "app/views/phocoder/_thumbnail_update.html.erb",
34
+ "app/views/phocoder/_video_embed.html.erb",
35
+ "app/views/phocoder/multi_thumbnail_update.json.erb",
36
+ "app/views/phocoder/thumbnail_update.js.erb",
37
+ "config/routes.rb",
38
+ "lib/generators/phocoder_rails/model_update_generator.rb",
39
+ "lib/generators/phocoder_rails/scaffold_generator.rb",
40
+ "lib/generators/phocoder_rails/setup_generator.rb",
41
+ "lib/generators/phocoder_rails/templates/controller.rb",
42
+ "lib/generators/phocoder_rails/templates/helper.rb",
43
+ "lib/generators/phocoder_rails/templates/migration.rb",
44
+ "lib/generators/phocoder_rails/templates/model.rb",
45
+ "lib/generators/phocoder_rails/templates/model_migration.rb",
46
+ "lib/generators/phocoder_rails/templates/model_thumbnail.rb",
47
+ "lib/generators/phocoder_rails/templates/model_update_migration.rb",
48
+ "lib/generators/phocoder_rails/templates/phocodable.yml",
49
+ "lib/generators/phocoder_rails/templates/views/_form.html.erb.tt",
50
+ "lib/generators/phocoder_rails/templates/views/index.html.erb.tt",
51
+ "lib/generators/phocoder_rails/templates/views/new.html.erb.tt",
52
+ "lib/generators/phocoder_rails/templates/views/show.html.erb.tt",
53
+ "lib/phocoder_rails.rb",
54
+ "lib/phocoder_rails/acts_as_phocodable.rb",
55
+ "lib/phocoder_rails/engine.rb",
56
+ "lib/phocoder_rails/errors.rb",
57
+ "phocoder-rails.gemspec",
58
+ "public/images/building.gif",
59
+ "public/images/error.png",
60
+ "public/images/play_small.png",
61
+ "public/images/storing.gif",
62
+ "public/images/waiting.gif",
63
+ "public/javascripts/phocodable.js",
64
+ "public/javascripts/video-js-2.0.2/.DS_Store",
65
+ "public/javascripts/video-js-2.0.2/LICENSE.txt",
66
+ "public/javascripts/video-js-2.0.2/README.markdown",
67
+ "public/javascripts/video-js-2.0.2/demo-subtitles.srt",
68
+ "public/javascripts/video-js-2.0.2/demo.html",
69
+ "public/javascripts/video-js-2.0.2/skins/hu.css",
70
+ "public/javascripts/video-js-2.0.2/skins/tube.css",
71
+ "public/javascripts/video-js-2.0.2/skins/vim.css",
72
+ "public/javascripts/video-js-2.0.2/video-js.css",
73
+ "public/javascripts/video-js-2.0.2/video.js",
74
+ "public/stylesheets/phocodable.css",
75
+ "spec/controllers/phocoder_controller_spec.rb",
76
+ "spec/dummy/Rakefile",
77
+ "spec/dummy/app/controllers/application_controller.rb",
78
+ "spec/dummy/app/controllers/images_controller.rb",
79
+ "spec/dummy/app/helpers/application_helper.rb",
80
+ "spec/dummy/app/helpers/images_helper.rb",
81
+ "spec/dummy/app/models/image.rb",
82
+ "spec/dummy/app/models/image_thumbnail.rb",
83
+ "spec/dummy/app/models/image_upload.rb",
84
+ "spec/dummy/app/views/images/_form.html.erb",
85
+ "spec/dummy/app/views/images/index.html.erb",
86
+ "spec/dummy/app/views/images/new.html.erb",
87
+ "spec/dummy/app/views/images/show.html.erb",
88
+ "spec/dummy/app/views/layouts/application.html.erb",
89
+ "spec/dummy/config.ru",
90
+ "spec/dummy/config/application.rb",
91
+ "spec/dummy/config/boot.rb",
92
+ "spec/dummy/config/database.yml",
93
+ "spec/dummy/config/environment.rb",
94
+ "spec/dummy/config/environments/development.rb",
95
+ "spec/dummy/config/environments/production.rb",
96
+ "spec/dummy/config/environments/test.rb",
97
+ "spec/dummy/config/initializers/backtrace_silencers.rb",
98
+ "spec/dummy/config/initializers/inflections.rb",
99
+ "spec/dummy/config/initializers/mime_types.rb",
100
+ "spec/dummy/config/initializers/secret_token.rb",
101
+ "spec/dummy/config/initializers/session_store.rb",
102
+ "spec/dummy/config/locales/en.yml",
103
+ "spec/dummy/config/routes.rb",
104
+ "spec/dummy/db/migrate/001_create_image_uploads.rb",
105
+ "spec/dummy/db/migrate/20110523165213_add_parent_type_to_image_uploads.rb",
106
+ "spec/dummy/db/migrate/20110523165522_create_encodable_jobs.rb",
107
+ "spec/dummy/db/migrate/20111101024507_create_images.rb",
108
+ "spec/dummy/db/schema.rb",
109
+ "spec/dummy/public/404.html",
110
+ "spec/dummy/public/422.html",
111
+ "spec/dummy/public/500.html",
112
+ "spec/dummy/public/favicon.ico",
113
+ "spec/dummy/public/index.html",
114
+ "spec/dummy/public/javascripts/application.js",
115
+ "spec/dummy/public/javascripts/controls.js",
116
+ "spec/dummy/public/javascripts/dragdrop.js",
117
+ "spec/dummy/public/javascripts/effects.js",
118
+ "spec/dummy/public/javascripts/jquery-1.6.4.js",
119
+ "spec/dummy/public/javascripts/prototype.js",
120
+ "spec/dummy/public/javascripts/rails.js",
121
+ "spec/dummy/public/stylesheets/.gitkeep",
122
+ "spec/dummy/script/rails",
123
+ "spec/engine_spec.rb",
124
+ "spec/fixtures/big_eye_tiny.jpg",
125
+ "spec/fixtures/octologo.png",
126
+ "spec/fixtures/test.txt",
127
+ "spec/fixtures/video-test.mov",
128
+ "spec/helpers/phocoder_helper_spec.rb",
129
+ "spec/integration/navigation_spec.rb",
130
+ "spec/models/acts_as_phocodable_spec.rb",
131
+ "spec/models/encodable_job_spec.rb",
132
+ "spec/phocoder_rails_spec.rb",
133
+ "spec/routing/phocoder_routing_spec.rb",
134
+ "spec/spec_helper.rb"
135
+ ]
136
+ s.homepage = %q{http://github.com/jagthedrummer/phocoder-rails}
137
+ s.licenses = [%q{MIT}]
138
+ s.require_paths = [%q{lib}]
139
+ s.rubygems_version = %q{1.8.5}
140
+ s.summary = %q{Rails engine for easy integration with phocoder.com}
141
+ s.test_files = [
142
+ "spec/controllers/phocoder_controller_spec.rb",
143
+ "spec/dummy/app/controllers/application_controller.rb",
144
+ "spec/dummy/app/controllers/images_controller.rb",
145
+ "spec/dummy/app/helpers/application_helper.rb",
146
+ "spec/dummy/app/helpers/images_helper.rb",
147
+ "spec/dummy/app/models/image.rb",
148
+ "spec/dummy/app/models/image_thumbnail.rb",
149
+ "spec/dummy/app/models/image_upload.rb",
150
+ "spec/dummy/config/application.rb",
151
+ "spec/dummy/config/boot.rb",
152
+ "spec/dummy/config/environment.rb",
153
+ "spec/dummy/config/environments/development.rb",
154
+ "spec/dummy/config/environments/production.rb",
155
+ "spec/dummy/config/environments/test.rb",
156
+ "spec/dummy/config/initializers/backtrace_silencers.rb",
157
+ "spec/dummy/config/initializers/inflections.rb",
158
+ "spec/dummy/config/initializers/mime_types.rb",
159
+ "spec/dummy/config/initializers/secret_token.rb",
160
+ "spec/dummy/config/initializers/session_store.rb",
161
+ "spec/dummy/config/routes.rb",
162
+ "spec/dummy/db/migrate/001_create_image_uploads.rb",
163
+ "spec/dummy/db/migrate/20110523165213_add_parent_type_to_image_uploads.rb",
164
+ "spec/dummy/db/migrate/20110523165522_create_encodable_jobs.rb",
165
+ "spec/dummy/db/migrate/20111101024507_create_images.rb",
166
+ "spec/dummy/db/schema.rb",
167
+ "spec/engine_spec.rb",
168
+ "spec/helpers/phocoder_helper_spec.rb",
169
+ "spec/integration/navigation_spec.rb",
170
+ "spec/models/acts_as_phocodable_spec.rb",
171
+ "spec/models/encodable_job_spec.rb",
172
+ "spec/phocoder_rails_spec.rb",
173
+ "spec/routing/phocoder_routing_spec.rb",
174
+ "spec/spec_helper.rb"
175
+ ]
176
+
177
+ if s.respond_to? :specification_version then
178
+ s.specification_version = 3
179
+
180
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
181
+ s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
182
+ s.add_runtime_dependency(%q<capybara>, [">= 0.3.9"])
183
+ s.add_runtime_dependency(%q<webrat>, [">= 0"])
184
+ s.add_runtime_dependency(%q<phocoder-rb>, [">= 0"])
185
+ s.add_runtime_dependency(%q<zencoder>, [">= 0"])
186
+ s.add_runtime_dependency(%q<aws-s3>, [">= 0"])
187
+ s.add_runtime_dependency(%q<spawn>, [">= 0"])
188
+ s.add_development_dependency(%q<rspec-rails>, ["= 2.4.1"])
189
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
190
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
191
+ s.add_development_dependency(%q<rcov>, [">= 0"])
192
+ else
193
+ s.add_dependency(%q<rails>, [">= 3.0.0"])
194
+ s.add_dependency(%q<capybara>, [">= 0.3.9"])
195
+ s.add_dependency(%q<webrat>, [">= 0"])
196
+ s.add_dependency(%q<phocoder-rb>, [">= 0"])
197
+ s.add_dependency(%q<zencoder>, [">= 0"])
198
+ s.add_dependency(%q<aws-s3>, [">= 0"])
199
+ s.add_dependency(%q<spawn>, [">= 0"])
200
+ s.add_dependency(%q<rspec-rails>, ["= 2.4.1"])
201
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
202
+ s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
203
+ s.add_dependency(%q<rcov>, [">= 0"])
204
+ end
205
+ else
206
+ s.add_dependency(%q<rails>, [">= 3.0.0"])
207
+ s.add_dependency(%q<capybara>, [">= 0.3.9"])
208
+ s.add_dependency(%q<webrat>, [">= 0"])
209
+ s.add_dependency(%q<phocoder-rb>, [">= 0"])
210
+ s.add_dependency(%q<zencoder>, [">= 0"])
211
+ s.add_dependency(%q<aws-s3>, [">= 0"])
212
+ s.add_dependency(%q<spawn>, [">= 0"])
213
+ s.add_dependency(%q<rspec-rails>, ["= 2.4.1"])
214
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
215
+ s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
216
+ s.add_dependency(%q<rcov>, [">= 0"])
217
+ end
218
+ end
219
+
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,110 @@
1
+ var Phocodable = {};
2
+
3
+
4
+
5
+ Phocodable.JQueryUpdater = function(){
6
+ _self = this;
7
+ this.img_selector = "img[data-phocoder-waiting]";
8
+
9
+ this.init = function(options){
10
+ //console.log("Phocodable.Updater.init()");
11
+ if(options == null){ options = {}; }
12
+ this.jslib = options.jslib || "jquery";
13
+ setTimeout(this.update,200);
14
+ };
15
+
16
+ this.update = function(){
17
+ params = _self.build_update_params();
18
+ //console.debug(params);
19
+ if(params.length == 0){
20
+ //console.debug("ending because params are blank")
21
+
22
+ return;
23
+ }
24
+ $.ajax({ type: 'POST',
25
+ url : '/phocoder/multi_thumbnail_update.json',
26
+ dataType : 'json',
27
+ data : { encodables : params },
28
+ success : _self.update_response
29
+ });
30
+ }
31
+
32
+ this.update_response = function(data, textStatus, jqXHR){
33
+ $.each(data,function(key,value){
34
+ $("#"+key).replaceWith(value);
35
+ });
36
+ setTimeout(_self.update,15000);
37
+ }
38
+
39
+
40
+ this.build_update_params = function(){
41
+ params = [];
42
+ elements = _self.select_elements();
43
+ $.each(elements,function(index,elem){
44
+ // Format is : Image_1_medium_db0ce8ba5d55c25eee7c767220d654fe
45
+ // Format is : class_id_thumbnail_random
46
+ //match = $(elem).attr("id").match(/^(.*)_(.*)_(.*)_(.*)$/)
47
+ //hash = {
48
+ // class_name : match[1],
49
+ // id : match[2],
50
+ // thumbnail : match[3],
51
+ // random : match[4]
52
+ //}
53
+ params.push( $(elem).attr("id") );
54
+ });
55
+ return params;
56
+ }
57
+
58
+ this.select_elements = function(){
59
+ return $(this.img_selector);
60
+ }
61
+
62
+
63
+ }; // Phocodable.JQueryUpdater
64
+
65
+
66
+
67
+
68
+
69
+ Phocodable.Updater = function(){
70
+ _self = this;
71
+ this.img_selector = "img[data-phocoder-waiting]";
72
+
73
+ this.init = function(options){
74
+ //console.log("Phocodable.Updater.init()");
75
+ if(options == null){ options = {}; }
76
+ this.jslib = options.jslib || "jquery";
77
+ setTimeout(this.update,2000);
78
+ };
79
+
80
+ this.update = function(){
81
+ params = _self.build_update_params();
82
+ //console.debug(params);
83
+ }
84
+
85
+ this.build_update_params = function(){
86
+ params = {};
87
+ elements = _self.select_elements();
88
+
89
+ return params;
90
+ }
91
+
92
+ this.select_elements = function(){
93
+ if(this.jslib == "jquery"){
94
+ return this.select_elements_jquery();
95
+ }else if(this.jslib == "prototype"){
96
+ return this.select_elements_prototype();
97
+ }
98
+ }
99
+
100
+ this.select_elements_jquery = function(){
101
+ return $(this.img_selector);
102
+ };
103
+
104
+ this.select_elements_prototype = function(){
105
+ return $$(this.img_selector);
106
+ };
107
+
108
+ }; // Phocodable.PrototypeUpdater
109
+
110
+
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.