Skip to content
Browse files

Merge branch 'master' of https://github.com/brunschgi/terrificjs

  • Loading branch information...
2 parents be7fd12 + 5b3fd15 commit 228ee0e6ec9292d45ddc160e7da7cceb5eeee860 @MarcDiethelm committed May 9, 2012
Showing with 19 additions and 28 deletions.
  1. +1 −1 build/build.xml
  2. +3 −6 src/core/Tc.Application.js
  3. +9 −15 src/core/Tc.Connector.js
  4. +2 −3 src/core/Tc.Sandbox.js
  5. +1 −1 test/core/index.php
  6. +3 −2 test/core/tests/application.js
View
2 build/build.xml
@@ -2,7 +2,7 @@
<project default="all" basedir=".">
<!-- release variables -->
- <property name="VERSION" value="1.1.0" description="Version"/>
+ <property name="VERSION" value="1.1.1" description="Version"/>
<!-- paths -->
<property name="TERRIFIC_DIR" value="../src/core/" description="Terrific Source Folder"/>
View
9 src/core/Tc.Application.js
@@ -40,7 +40,7 @@
/**
* Contains references to all modules on the page. This can, for
- * xample, be useful when there are interactions between Flash
+ * example, be useful when there are interactions between Flash
* objects and Javascript.
*
* @property modules
@@ -150,8 +150,8 @@
}
}
- if ($this.data('connectors')) {
- connectors = $this.data('connectors').split(',');
+ if ($this.attr('data-connectors')) {
+ connectors = $this.attr('data-connectors').split(',');
for (var i = 0, len = connectors.length; i < len; i++) {
var connector = $.trim(connectors[i]);
if(connector) {
@@ -206,7 +206,6 @@
index = $.inArray(module, wildcardComponents);
if(index > -1) {
delete wildcardComponents[index];
- wildcardComponents.splice(index, 1);
}
// Delete the module instance itself
@@ -401,9 +400,7 @@
var index = $.inArray(component, wildcardComponents);
if(index > -1) {
delete wildcardComponents[index];
- wildcardComponents.splice(index, 1);
}
-
}
});
})(Tc.$);
View
24 src/core/Tc.Connector.js
@@ -54,14 +54,10 @@
unregisterComponent: function(component) {
var components = this.components;
- for (var id in components) {
- if (components.hasOwnProperty(id)) {
- if (components[id].component === component) {
- delete components[id];
- components.splice(id, 1);
- break
- }
- }
+ for (var i = 0, len = components.length; i < len; i++) {
+ if(components[i] && components[i].component === component) {
+ delete components[i];
+ }
}
},
@@ -93,13 +89,11 @@
var proceed = true,
components = this.components;
- for (var id in components) {
- if (components.hasOwnProperty(id)) {
- var component = components[id].component;
- if (component !== origin && component[state]) {
- if (component[state](data, callback) === false) {
- proceed = false;
- }
+ for (var i = 0, len = components.length; i < len; i++) {
+ var component = components[i].component;
+ if (component && component !== origin && component[state]) {
+ if (component[state](data, callback) === false) {
+ proceed = false;
}
}
}
View
5 src/core/Tc.Sandbox.js
@@ -227,7 +227,7 @@
// None indicates that it is not a dependency for a specific phase
phase = phase || 'none';
- type = type || 'plugin';
+ type = type || 'plugin';
if (that.dependencies[dependency] &&
that.dependencies[dependency].state === 'requested') {
@@ -310,8 +310,7 @@
afterBindingCallbacks.push(callback);
// Check whether all modules are ready for the afterBinding phase
- if (this.application.modules.length ==
- afterBindingCallbacks.length) {
+ if (this.application.modules.length == afterBindingCallbacks.length) {
for (var i = 0; i < afterBindingCallbacks.length; i++) {
afterBindingCallbacks[i]();
}
View
2 test/core/index.php
@@ -6,7 +6,7 @@
<link rel="stylesheet" type="text/css" href="css/qunit.css" media="screen" />
<script type="text/javascript" src="../../src/jquery/jquery-1.7.2.min.js"></script>
<!-- terrific js release -->
- <!-- <script type="text/javascript" src="../../release/terrific-1.0.0.min.js"></script> -->
+ <!-- <script type="text/javascript" src="../../release/terrific-1.1.1.min.js"></script> -->
<!-- terrific js sources -->
<script type="text/javascript" src="../../src/core/oo.js"></script>
View
5 test/core/tests/application.js
@@ -269,7 +269,7 @@
});
test('unregister modules (specific module)', function() {
- expect(4);
+ expect(5);
// create fixture
var modules = [
@@ -300,7 +300,8 @@
ok(!application.modules[0], 'module 1 removed');
deepEqual(application.modules[1].$ctx, $node2, 'module 2 still exists');
ok(application.connectors[1], 'connector still exists');
- equals(application.connectors[1].components.length, 1, 'connector component removed');
+ deepEqual(application.connectors[1].components[0], undefined, 'connector component removed');
+ ok(application.connectors[1].components[1], 'other connector component still exists');
});
});
})(Tc.$);

0 comments on commit 228ee0e

Please sign in to comment.
Something went wrong with that request. Please try again.