Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Apr 23, 2015
1 parent 506cd94 commit ce067ee
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 21 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
v1.2.0 - April 23, 2015

* 1.2.0 (Nicholas C. Zakas)
* Change karma to use mocha reporter (Jeff Tan)
* Fix embedded sourcemap URL (fixes #31) (Nicholas C. Zakas)
* Add wrapper to T3 for CommonJS (Jeff Tan)
* Remove event delegation on detached nodes (Jeff Tan)
* Update: Fire event when broadcast() is called (fixes #43) (Nicholas C. Zakas)
* Reverting dist changes (Priyajeet Hora)
* Prevent event-target.js duplicate handlers. Fixes #35. (Priyajeet Hora)
* Clean up duplicated assign code (fixes #29) (azu)
* Todo example fails to update completed items. Fixes #25 (Priyajeet Hora)
* Firefox innerText fixes as well as switching the select all checkbox logic to use the model data instead of view elements Fixes #21 (Priyajeet Hora)
* readme grammar (Matthew Hadley)
* Apply or remove completed class when select all is clicked. Fixes #18. (Priyajeet Hora)
* Adding missing doctype Fixes #14 (Priyajeet Hora)

v1.1.1 - April 14, 2015

* 1.1.1 (Nicholas C. Zakas)
Expand Down
48 changes: 43 additions & 5 deletions dist/t3-testing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! t3 v 1.1.1*/
/*! t3 v 1.2.0*/
/*!
Copyright 2015 Box, Inc. All rights reserved.
Expand All @@ -14,16 +14,23 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Start wrapper
// We use this to make sure we don't assign globals unless we actually want to
(function(window) {

/**
* @fileoverview Base namespaces for Box JavaScript.
* @author Box
*/

/* eslint-disable no-unused-vars */

/**
* The one global object for Box JavaScript.
* @namespace
*/
window.Box = window.Box || {};
var Box = {};
/* eslint-enable no-unused-vars */

/**
* @fileoverview Definition of a custom event type. This is used as a utility
Expand Down Expand Up @@ -64,11 +71,23 @@ Box.EventTarget = (function() {
* @returns {void}
*/
on: function(type, handler) {
if (typeof this._handlers[type] === 'undefined') {
this._handlers[type] = [];

var handlers = this._handlers[type],
i,
len;

if (typeof handlers === 'undefined') {
handlers = this._handlers[type] = [];
}

this._handlers[type].push(handler);
for (i = 0, len = handlers.length; i < len; i++) {
if (handlers[i] === handler) {
// prevent duplicate handlers
return;
}
}

handlers.push(handler);
},

/**
Expand Down Expand Up @@ -348,3 +367,22 @@ Box.EventTarget = (function() {

}());

// CommonJS/npm, we want to export Box instead of assigning to global Window
if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = Box;
} else {
// Make sure not to override Box namespace
window.Box = window.Box || {};

// Copy all properties onto namespace (ES3 safe for loop)
for (var key in Box) {
if (Box.hasOwnProperty(key)) {
window.Box[key] = Box[key];
}
}
}

// Potentially window is not defined yet, so bind to 'this' instead
}(typeof window !== 'undefined' ? window : this));
// End Wrapper

68 changes: 57 additions & 11 deletions dist/t3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! t3 v 1.1.1*/
/*! t3 v 1.2.0*/
/*!
Copyright 2015 Box, Inc. All rights reserved.
Expand All @@ -14,16 +14,23 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Start wrapper
// We use this to make sure we don't assign globals unless we actually want to
(function(window) {

/**
* @fileoverview Base namespaces for Box JavaScript.
* @author Box
*/

/* eslint-disable no-unused-vars */

/**
* The one global object for Box JavaScript.
* @namespace
*/
window.Box = window.Box || {};
var Box = {};
/* eslint-enable no-unused-vars */

/**
* @fileoverview Definition of a custom event type. This is used as a utility
Expand Down Expand Up @@ -64,11 +71,23 @@ Box.EventTarget = (function() {
* @returns {void}
*/
on: function(type, handler) {
if (typeof this._handlers[type] === 'undefined') {
this._handlers[type] = [];

var handlers = this._handlers[type],
i,
len;

if (typeof handlers === 'undefined') {
handlers = this._handlers[type] = [];
}

for (i = 0, len = handlers.length; i < len; i++) {
if (handlers[i] === handler) {
// prevent duplicate handlers
return;
}
}

this._handlers[type].push(handler);
handlers.push(handler);
},

/**
Expand Down Expand Up @@ -579,7 +598,13 @@ Box.Application = (function() {
function getNearestTypeElement(element) {
var found = isTypeElement(element);

while (!found && !isModuleElement(element)) {

// We need to check for the existence of 'element' since occasionally we call this on a detached element node.
// For example:
// 1. event handlers like mouseout may sometimes detach nodes from the DOM
// 2. event handlers like mouseleave will still fire on the detached node
// Without checking the existence of a parentNode and returning null, we would throw errors
while (!found && element && !isModuleElement(element)) {
element = element.parentNode;
found = isTypeElement(element);
}
Expand Down Expand Up @@ -1047,6 +1072,12 @@ Box.Application = (function() {
}

}

// also fire an event so non-T3 code can listen for the message
this.fire('message', {
message: name,
messageData: data
});
},

//----------------------------------------------------------------------
Expand Down Expand Up @@ -1093,11 +1124,7 @@ Box.Application = (function() {
return;
}

for (var prop in config) {
if (config.hasOwnProperty(prop)) {
globalConfig[prop] = config[prop];
}
}
assign(globalConfig, config);
},

//----------------------------------------------------------------------
Expand All @@ -1115,3 +1142,22 @@ Box.Application = (function() {

}());

// CommonJS/npm, we want to export Box instead of assigning to global Window
if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = Box;
} else {
// Make sure not to override Box namespace
window.Box = window.Box || {};

// Copy all properties onto namespace (ES3 safe for loop)
for (var key in Box) {
if (Box.hasOwnProperty(key)) {
window.Box[key] = Box[key];
}
}
}

// Potentially window is not defined yet, so bind to 'this' instead
}(typeof window !== 'undefined' ? window : this));
// End Wrapper

Loading

0 comments on commit ce067ee

Please sign in to comment.