bootsy 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,27 @@
2
2
 
3
3
  window.Bootsy = (function(){
4
4
 
5
- var Bootsy = {unsavedChanges: false, editor: false, editorOptions: {}};
5
+ var Bootsy = {unsavedChanges: false, editor: false, editorOptions: {}, eventCallbacks: {'loaded': []}, triggeredEvents: []};
6
6
 
7
+ Bootsy.on = function(eventName, callback){
8
+ Bootsy.eventCallbacks[eventName].push(callback);
9
+ };
10
+
11
+ Bootsy.trigger = function(eventName){
12
+ var callbacks = Bootsy.eventCallbacks[eventName];
13
+ for(i in callbacks){
14
+ callbacks[i]();
15
+ }
16
+ Bootsy.triggeredEvents.push(eventName);
17
+ };
18
+
19
+ Bootsy.after = function(eventName, callback){
20
+ if(Bootsy.triggeredEvents.indexOf(eventName) != -1){
21
+ callback();
22
+ }else{
23
+ Bootsy.on(eventName, callback);
24
+ }
25
+ };
7
26
 
8
27
  Bootsy.progressBar = function(element){
9
28
  element.find('div.modal-body').html('<div class="progress progress-striped active"><div class="bar" style="width: 100%;"></div></div>');
@@ -118,6 +137,8 @@ window.Bootsy = (function(){
118
137
  Bootsy.unsavedChanges = false;
119
138
  return true;
120
139
  });
140
+
141
+ Bootsy.trigger('loaded');
121
142
  }
122
143
  };
123
144
 
@@ -1,3 +1,3 @@
1
1
  module Bootsy
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -218,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  segments:
220
220
  - 0
221
- hash: 1343926653393299360
221
+ hash: -500388282163322188
222
222
  required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  none: false
224
224
  requirements:
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  segments:
229
229
  - 0
230
- hash: 1343926653393299360
230
+ hash: -500388282163322188
231
231
  requirements: []
232
232
  rubyforge_project:
233
233
  rubygems_version: 1.8.24