Skip to content

Commit

Permalink
0.1.2
Browse files Browse the repository at this point in the history
* Improved compatibility with <IE8
  • Loading branch information
brewster1134 committed Mar 20, 2014
1 parent db37326 commit 75613c5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
group :development do
gem 'guard'
gem 'guard-coffeescript'
gem 'json', '~> 1.7.7'
gem 'json'
end

# Platform specific gems (set `require: false`)
Expand Down
21 changes: 13 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,44 @@ GEM
specs:
celluloid (0.15.2)
timers (~> 1.1.0)
celluloid-io (0.15.0)
celluloid (>= 0.15.0)
nio4r (>= 0.5.0)
coderay (1.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.6.3)
coffee-script-source (1.7.0)
execjs (2.0.2)
ffi (1.9.3)
formatador (0.2.4)
growl (1.0.3)
guard (2.3.0)
guard (2.5.1)
formatador (>= 0.2.4)
listen (~> 2.1)
listen (~> 2.6)
lumberjack (~> 1.0)
pry (>= 0.9.12)
thor (>= 0.18.1)
guard-coffeescript (1.3.4)
guard-coffeescript (1.4.0)
coffee-script (>= 2.2.0)
guard (>= 1.1.0)
json (1.7.7)
listen (2.4.0)
json (1.8.1)
listen (2.7.1)
celluloid (>= 0.15.2)
celluloid-io (>= 0.15.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.4)
method_source (0.8.2)
nio4r (1.0.0)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
ffi (>= 0.5.0)
slop (3.4.7)
slop (3.5.0)
terminal-notifier-guard (1.5.3)
thor (0.18.1)
timers (1.1.0)
Expand All @@ -47,6 +52,6 @@ DEPENDENCIES
growl
guard
guard-coffeescript
json (~> 1.7.7)
json
rb-fsevent
terminal-notifier-guard
21 changes: 2 additions & 19 deletions lib/atrackt.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Atrackt Tracking Library
https://github.com/brewster1134/atrackt
@version 0.1.1
@version 0.1.2
@author Ryan Brewster
*/

Expand All @@ -21,7 +21,6 @@ https://github.com/brewster1134/atrackt
plugins: {},
registerPlugin: function(pluginName, attrs) {
var _this = this;

if (typeof (attrs != null ? attrs.send : void 0) !== 'function') {
return console.log('NO SEND METHOD DEFINED');
}
Expand All @@ -32,7 +31,6 @@ https://github.com/brewster1134/atrackt
attrs.excludeElements || (attrs.excludeElements = {});
attrs.bind = function(eventsObject) {
var currentElements, currentSelectors, data, eventType, _results;

if (eventsObject == null) {
return console.log('NOTHING TO BIND. YOU MUST PASS AN EVENT OBJECT CALLING BIND');
}
Expand All @@ -52,7 +50,6 @@ https://github.com/brewster1134/atrackt
};
attrs.unbind = function(eventsObject) {
var currentElements, currentSelectors, data, eventType, _results;

if (eventsObject != null) {
_results = [];
for (eventType in eventsObject) {
Expand All @@ -78,7 +75,6 @@ https://github.com/brewster1134/atrackt
};
attrs.setOptions = function(options) {
var pluginOptions;

pluginOptions = attrs.options || {};
return attrs.options = $.extend(true, pluginOptions, options);
};
Expand All @@ -97,7 +93,6 @@ https://github.com/brewster1134/atrackt
},
setGlobalData: function(object) {
var pluginData, pluginName, _ref, _results;

_ref = this.plugins;
_results = [];
for (pluginName in _ref) {
Expand All @@ -108,7 +103,6 @@ https://github.com/brewster1134/atrackt
},
setCallback: function(name, callback) {
var pluginData, pluginName, _ref, _results;

_ref = this.plugins;
_results = [];
for (pluginName in _ref) {
Expand All @@ -119,7 +113,6 @@ https://github.com/brewster1134/atrackt
},
bind: function(eventsObject) {
var pluginData, pluginName, _ref, _results;

_ref = this.plugins;
_results = [];
for (pluginName in _ref) {
Expand All @@ -130,7 +123,6 @@ https://github.com/brewster1134/atrackt
},
unbind: function(eventsObject) {
var pluginData, pluginName, _ref, _results;

_ref = this.plugins;
_results = [];
for (pluginName in _ref) {
Expand All @@ -141,7 +133,6 @@ https://github.com/brewster1134/atrackt
},
refresh: function() {
var eventType, pluginData, pluginName, selectors, _ref, _ref1;

this._debugConsoleReset();
_ref = this.plugins;
for (pluginName in _ref) {
Expand All @@ -156,7 +147,6 @@ https://github.com/brewster1134/atrackt
},
track: function(data, options, event) {
var pluginData, pluginName, trackObject, trackingData, _ref, _ref1, _ref2;

if (options == null) {
options = {};
}
Expand Down Expand Up @@ -197,7 +187,6 @@ https://github.com/brewster1134/atrackt
_cleanup: function() {},
_collectElements: function(pluginName, eventType) {
var allElements, excludeElements, excludeSelectors, includeElements, includeSelectors, plugin, _ref, _ref1;

this._cleanup(pluginName, eventType);
plugin = this.plugins[pluginName];
includeSelectors = $((_ref = plugin.includeSelectors[eventType]) != null ? _ref.join(',') : void 0);
Expand All @@ -216,7 +205,6 @@ https://github.com/brewster1134/atrackt
},
_bind: function(pluginName, eventType, data) {
var selectors;

this._collectElements(pluginName, eventType);
this._unbind(pluginName, eventType, data);
selectors = $(this.plugins[pluginName].elements[eventType]);
Expand All @@ -237,7 +225,6 @@ https://github.com/brewster1134/atrackt
},
_unbind: function(pluginName, eventType, data) {
var eventName, selectors;

eventName = '.atrackt';
selectors = $('*', 'body');
if (eventType != null) {
Expand All @@ -259,8 +246,7 @@ https://github.com/brewster1134/atrackt
},
_getTrackObject: function(data, event) {
var $el, _base;

if (data instanceof HTMLElement) {
if (data.nodeType === 1) {
data = $(data);
}
if (data instanceof jQuery) {
Expand Down Expand Up @@ -289,7 +275,6 @@ https://github.com/brewster1134/atrackt
},
_getCategories: function($el) {
var catArray;

catArray = [];
if ($el.data('track-cat')) {
catArray.unshift($el.data('track-cat'));
Expand All @@ -304,15 +289,13 @@ https://github.com/brewster1134/atrackt
},
_urlParams: function(key) {
var paramString, params;

if (key == null) {
key = null;
}
params = {};
paramString = window.location.search.substring(1);
$.each(paramString.split('&'), function(i, param) {
var paramObject;

paramObject = param.split('=');
return params[paramObject[0]] = paramObject[1];
});
Expand Down
3 changes: 3 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
### CHANGE LOG
###### 0.1.2
* Improved compatibility with <IE8

###### 0.1.1
* Tracking objects was being polluted with event data

Expand Down
4 changes: 2 additions & 2 deletions src/atrackt.js.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###
Atrackt Tracking Library
https://github.com/brewster1134/atrackt
@version 0.1.1
@version 0.1.2
@author Ryan Brewster
###

Expand Down Expand Up @@ -249,7 +249,7 @@ unless String::trim
_getTrackObject: (data, event) ->

# Convert HTML element to a jquery object
data = $(data) if data instanceof HTMLElement
data = $(data) if data.nodeType == 1

if data instanceof jQuery
$el = data
Expand Down

0 comments on commit 75613c5

Please sign in to comment.