Skip to content

Commit

Permalink
1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Brewster committed Mar 12, 2015
1 parent c7b4619 commit b063700
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
source 'https://rubygems.org'
gem 'sass', '~> 3.4.6'
gem 'sass', '~> 3.4'
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GEM
remote: https://rubygems.org/
specs:
sass (3.4.6)
sass (3.4.13)

PLATFORMS
ruby

DEPENDENCIES
sass (~> 3.4.6)
sass (~> 3.4)
14 changes: 7 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "atrackt",
"dependencies": {
"jquery": "~2.1.1",
"jquery.scrollTo": "~1.4.13"
"jquery": "~2",
"jquery.scrollTo": "~1"
},
"devDependencies": {
"chai": "~1.9.1",
"chai-as-promised": "~4.1.1",
"mocha": "~1.21.4",
"sinon": "~1.10.3",
"sinon-chai": "~2.5.0"
"chai": "~1",
"chai-as-promised": "~4",
"mocha": "~1",
"sinon": "~1",
"sinon-chai": "~2"
}
}
2 changes: 1 addition & 1 deletion demo/atrackt_demo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions lib/atrackt.console.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions lib/atrackt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/plugins/atrackt.localytics.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions lib/plugins/atrackt.omniture.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions spec/atrackt_spec.coffee
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Setup plugin
#

# create plugin to test with
Atrackt.setPlugin 'Foo Plugin',
send: ->
_plugin = Atrackt.plugins['foo-plugin']

describe 'Atrackt', ->
before ->
# make sure the foo plugin is the only registered plugin
Atrackt.plugins =
'foo-plugin': _plugin

it 'should set the Atrackt object on window', ->
expect(window.Atrackt).to.exist

Expand Down
104 changes: 60 additions & 44 deletions spec/index.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,61 @@
<html>
<head>
<title>Atrackt Test</title>
<link type="text/css" rel="stylesheet" href="/vendor/mocha/mocha.css">
<link type="text/css" rel="stylesheet" href="/lib/atrackt.console.css">
<link type="text/css" rel="stylesheet" href="/.tmp/atrackt.console_spec.css">
</head>

<body data-atrackt-location="Atrackt Test">
<div id='mocha'></div>
</body>

<!-- Testing Dependencies -->
<script type="text/javascript" src="/vendor/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="/vendor/jquery.scrollTo/jquery.scrollTo.js"></script>
<script type="text/javascript" src="/vendor/mocha/mocha.js"></script>
<script type="text/javascript" src="/vendor/chai/chai.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/behavior.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/call.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/spy.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/stub.js"></script>
<script type="text/javascript" src="/vendor/sinon-chai/lib/sinon-chai.js"></script>
<script type="text/javascript" src="/testem.js"></script>
<script type="text/javascript">
mocha.setup('bdd');
window.expect = chai.expect;
</script>

<!-- Footer Libraries -->
<script type="text/javascript" src="/lib/atrackt.js"></script>
<script type="text/javascript" src="/lib/atrackt.console.js"></script>
<script type="text/javascript" src="/lib/plugins/atrackt.localytics.js"></script>
<script type="text/javascript" src="/lib/plugins/atrackt.omniture.js"></script>

<!-- Specs -->
<script type="text/javascript" src="/.tmp/spec_helper.js"></script>
<script type="text/javascript" src="/.tmp/atrackt_spec.js"></script>
<script type="text/javascript" src="/.tmp/plugins/atrackt.localytics_spec.js"></script>
<script type="text/javascript" src="/.tmp/plugins/atrackt.omniture_spec.js"></script>

<script type="text/javascript">
mocha.run()
</script>
<html>
<head>
<link type="text/css" rel="stylesheet" href="/vendor/mocha/mocha.css">
<link type="text/css" rel="stylesheet" href="/lib/atrackt.console.css">
<link type="text/css" rel="stylesheet" href="/.tmp/atrackt.console_spec.css">
</head>

<body data-atrackt-location="Atrackt Test">
<div id='mocha'></div>
</body>

<!-- Testing Dependencies -->
<script type="text/javascript" src="/vendor/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="/vendor/jquery.scrollTo/jquery.scrollTo.js"></script>
<script type="text/javascript" src="/vendor/mocha/mocha.js"></script>
<script type="text/javascript" src="/vendor/chai/chai.js"></script>

<!-- Sinon -->
<script type="text/javascript" src="/vendor/sinon/lib/sinon.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/util/core.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/extend.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/typeOf.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/times_in_words.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/spy.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/call.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/behavior.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/stub.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/mock.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/collection.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/assert.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/sandbox.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/test.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/test_case.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/match.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/format.js"></script>
<script type="text/javascript" src="/vendor/sinon/lib/sinon/log_error.js"></script>

<script type="text/javascript" src="/vendor/sinon-chai/lib/sinon-chai.js"></script>
<script type="text/javascript" src="/testem.js"></script>

<script>
mocha.setup('bdd');
window.expect = chai.expect;
</script>

<!-- Footer Libraries -->
<script type="text/javascript" src="/lib/atrackt.js"></script>
<script type="text/javascript" src="/lib/atrackt.console.js"></script>
<script type="text/javascript" src="/lib/plugins/atrackt.localytics.js"></script>
<script type="text/javascript" src="/lib/plugins/atrackt.omniture.js"></script>

<!-- Specs -->
<script type="text/javascript" src="/.tmp/spec_helper.js"></script>
<script type="text/javascript" src="/.tmp/atrackt_spec.js"></script>
<script type="text/javascript" src="/.tmp/plugins/atrackt.localytics_spec.js"></script>
<script type="text/javascript" src="/.tmp/plugins/atrackt.omniture_spec.js"></script>

<script type="text/javascript">
mocha.run()
</script>
</html>
10 changes: 10 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
### CHANGE LOG


##### Core
###### 1.0.8
* proper error throwing

###### 1.0.7
* removed polyfill
* moved plugin scoped option logic
Expand Down Expand Up @@ -38,3 +44,7 @@

###### 0.0.12
* Added setCallback


##### Console
###### 1.0.0
12 changes: 6 additions & 6 deletions src/atrackt.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###
Atrackt Tracking Library
https://github.com/brewster1134/atrackt
@version 1.0.2
@version 1.0.8
@author Ryan Brewster
###

Expand All @@ -28,8 +28,8 @@ https://github.com/brewster1134/atrackt
# PUBLIC METHODS
#
setPlugin: (pluginName, plugin) ->
throw 'ATRACKT ERROR: `setPlugin` - No plugin name defined' unless pluginName
throw "ATRACKT ERROR: `setPlugin` - No send method was defined for `#{pluginName}`." unless typeof plugin?.send == 'function'
throw new Error 'ATRACKT ERROR: `setPlugin` - No plugin name defined' unless pluginName
throw new Error "ATRACKT ERROR: `setPlugin` - No send method was defined for `#{pluginName}`." unless plugin && typeof plugin.send == 'function'

# Add plugin to global plugins object
pluginName = pluginName.toLowerCase().replace(/[^a-z]/g, '-')
Expand All @@ -56,7 +56,7 @@ https://github.com/brewster1134/atrackt
# Actual event binding is done from _registerElement
#
setEvent: (eventsObject, context = @) ->
throw 'ATRACKT ERROR: `setEvent` - You must pass a valid event object.' unless eventsObject
throw new Error 'ATRACKT ERROR: `setEvent` - You must pass a valid event object.' unless eventsObject

for eventType, objects of eventsObject

Expand Down Expand Up @@ -114,7 +114,7 @@ https://github.com/brewster1134/atrackt
allowedCallbacks = [ 'before', 'after' ]

if allowedCallbacks.indexOf(name) == -1
throw "ATRACKT ERROR: `setCallback` - `#{name}` is not a valid callback. Only callbacks allowed are: #{allowedCallbacks.join(', ')}"
throw new Error "ATRACKT ERROR: `setCallback` - `#{name}` is not a valid callback. Only callbacks allowed are: #{allowedCallbacks.join(', ')}"

context._callbacks[name] ||= []
context._callbacks[name].push callback
Expand Down Expand Up @@ -180,7 +180,7 @@ https://github.com/brewster1134/atrackt
#
_track: (plugin, data, options, event) ->
metaData = @_getTrackObject data, event
throw 'ATRACKT ERROR: `track` - Only valid selectors, jquery objects, or html nodes are supported.' unless metaData
throw new Error 'ATRACKT ERROR: `track` - Only valid selectors, jquery objects, or html nodes are supported.' unless metaData

# prepare tracking data
trackingData = $.extend true, {}, @_data, plugin._data, options['_data'] || {}, metaData
Expand Down
2 changes: 1 addition & 1 deletion src/atrackt.console.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###
Atrackt Tracking Library
https://github.com/brewster1134/atrackt
@version 1.0.5
@version 1.0.0
@author Ryan Brewster
###

Expand Down
6 changes: 6 additions & 0 deletions src/plugins/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
### CHANGE LOG


##### Localytics Plugin
###### 1.0.0
* updated to new api
Expand All @@ -13,7 +15,11 @@
###### 0.0.1
* Just a simple send method!


##### Omniture Plugin
###### 1.0.6
* removed console logs

###### 1.0.5
* options bugfix

Expand Down
Loading

0 comments on commit b063700

Please sign in to comment.