foreign_office 0.7.2 → 0.7.3

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: 513b5a3825a665466dc9959be0ea56e5cdd315f7
4
- data.tar.gz: 8c0d22a6225642fe2c38ede9c9e9da476076f0b2
3
+ metadata.gz: 7afe14644b60ec95a4442a4204a4dae4628fde7c
4
+ data.tar.gz: 9d1ea1b26f541c0708f1e7b1a7d02a7fd0e84b98
5
5
  SHA512:
6
- metadata.gz: f0f7217c8d535f68282584d5378d29c55955461a3eba433355ab5edd4ead4cf4f8249f2c7ac7827d715ee6d715a254a8bf7b734073a293a330dbee0d68402ab6
7
- data.tar.gz: cde5d4d1e0eed4c3362484c6d9d54c238026eaa1bcad5d1474d6a73680519a2c7fece3a503dccaa723eaa47633f550fc3cd71494ed7bc5e8935113deb13485b5
6
+ metadata.gz: 8d6d501617b7f061089e4adb08335d51d78f8166ca938b358c6d99626be46c5a1ccb669cfa6db8bc9307cd8119aa179279191e9c9c8b4901b7ba112ecf588cd8
7
+ data.tar.gz: 8b600a36da295e9cb25ba4b80cebd8ce14cc7eda939a763883839442bcdb1d86382f22b829c6131fb8813b9ba36420c781c9ccc99904cd4ec215eb678ea611ca
@@ -2,7 +2,6 @@
2
2
  //= require pubnub_bus
3
3
  //= require pusher_bus
4
4
  //= require test_bus
5
- //= require anytime_manager
6
5
 
7
6
  var ForeignOffice = Class.extend({
8
7
  init: function(){
@@ -189,4 +188,22 @@ var ForeignOfficeColor = ForeignOfficeListener.extend({
189
188
  }
190
189
  });
191
190
 
192
- any_time_manager.register('listener','addListener',foreign_office);
191
+ function loadForeignOfficeClasses(){
192
+ window.any_time_manager.register('listener','addListener',foreign_office);
193
+ window.any_time_manager.load();
194
+ };
195
+ $(document).ready(function(){
196
+ if(typeof window.any_time_manager === "undefined" && typeof window.loading_any_time_manager === "undefined"){
197
+ window.loading_any_time_manager = true;
198
+ $.getScript("https://cdn.rawgit.com/edraut/anytime_manager/9f710d2280e68ea6156551728cb7e2d537a06ee6/anytime_manager.js",function(){
199
+ loadForeignOfficeClasses();
200
+ });
201
+ }else if(typeof window.any_time_manager === "undefined"){
202
+ if(typeof window.any_time_load_functions === 'undefined'){
203
+ window.any_time_load_functions = []
204
+ }
205
+ window.any_time_load_functions.push(loadForeignOfficeClasses);
206
+ }else{
207
+ loadForeignOfficeClasses();
208
+ }
209
+ });
@@ -1,3 +1,3 @@
1
1
  module ForeignOffice
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreign_office
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-29 00:00:00.000000000 Z
12
+ date: 2015-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -78,7 +78,6 @@ extra_rdoc_files: []
78
78
  files:
79
79
  - MIT-LICENSE
80
80
  - Rakefile
81
- - app/assets/javascripts/anytime_manager.js
82
81
  - app/assets/javascripts/debug_logger.js
83
82
  - app/assets/javascripts/foreign_office.js
84
83
  - app/assets/javascripts/pubnub_bus.js
@@ -1,75 +0,0 @@
1
- //Anytime loader, simulates load events for ajax requests
2
- String.prototype.toCapCamel = function(){
3
- camel = this.replace(/[-_]([a-z])/g, function (g) { return g.replace(/[-_]/,'').charAt(0).toUpperCase(); });
4
- return camel.charAt(0).toUpperCase() + camel.slice(1);
5
- };
6
-
7
- var AnyTimeManager = Class.extend({
8
- init: function(){
9
- this.loader_array = []
10
- },
11
- register: function(data_attribute,load_method,base_class){
12
- this.loader_array.push({data_attribute: data_attribute, base_class: base_class, load_method: load_method});
13
- },
14
- registerList: function(list){
15
- var anytime_manager = this;
16
- $.each(list,function(){
17
- anytime_manager.register(this + '','instantiate',null)
18
- })
19
- },
20
- registerListWithClasses: function(list){
21
- var anytime_manager = this;
22
- $.each(list,function(attr,klass){
23
- anytime_manager.register(attr,'instantiate',klass)
24
- })
25
- },
26
- registerRunList: function(list){
27
- var anytime_manager = this;
28
- $.each(list,function(attr,method){
29
- anytime_manager.register(attr,method,null)
30
- })
31
- },
32
- instantiate: function(jq_obj, class_name){
33
- if(!jq_obj.data('anytime_loaded')){
34
- jq_obj.data('anytime_loaded',true);
35
- var this_class = eval(class_name);
36
- new this_class(jq_obj);
37
- }
38
- },
39
- run: function (jq_obj, resource, method_name){
40
- if(!jq_obj.data('anytime_run')){
41
- jq_obj.data('anytime_run',true);
42
- resource[method_name](jq_obj);
43
- }
44
- },
45
- load: function(){
46
- var any_time_manager = this;
47
- $.each(any_time_manager.loader_array,function(){
48
- var data_attribute = this['data_attribute'];
49
- var base_class = this['base_class'];
50
- if(!base_class){
51
- base_class = data_attribute.toCapCamel();
52
- }
53
- var this_method = this['load_method'];
54
- $('[data-' + data_attribute + ']').each(function(){
55
- if('instantiate' == this_method){
56
- var declared_class = $(this).data('sub-type');
57
- var this_class = getSubClass(declared_class,base_class);
58
- any_time_manager.instantiate($(this),this_class);
59
- }else{
60
- any_time_manager.run($(this),base_class,this_method);
61
- }
62
-
63
- });
64
- });
65
- }
66
- });
67
- any_time_manager = new AnyTimeManager();
68
- $(document).ajaxComplete(function(){
69
- any_time_manager.load();
70
- });
71
- $(document).ready(function(){
72
- any_time_manager.load();
73
- });
74
-
75
- // End AnyTime library