Skip to content

Commit

Permalink
Merge pull request #20 from spenceralger/notification_mods
Browse files Browse the repository at this point in the history
small refactor of the notification service
  • Loading branch information
spenceralger committed Mar 13, 2014
2 parents d06d490 + c405860 commit bb3ea35
Show file tree
Hide file tree
Showing 55 changed files with 8,951 additions and 157 deletions.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"jquery": "~2.1.0",
"moment": "~2.5.1",
"require-css": "~0.1.2",
"angular-bootstrap": "~0.10.0"
"angular-bootstrap": "~0.10.0",
"stacktrace.js": "https://github.com/stacktracejs/stacktrace.js.git#~0.6.0"
},
"devDependencies": {}
}
22 changes: 22 additions & 0 deletions src/bower_components/stacktrace.js/.bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "stacktrace.js",
"version": "0.6.0",
"main": "./stacktrace.js",
"dependencies": {},
"ignore": [
"**/.*",
"node_modules",
"components"
],
"homepage": "https://github.com/stacktracejs/stacktrace.js",
"_release": "0.6.0",
"_resolution": {
"type": "version",
"tag": "v0.6.0",
"commit": "02b5def17d157b5e56d2bb0e175e48c5c1272aaa"
},
"_source": "https://github.com/stacktracejs/stacktrace.js.git",
"_target": "~0.6.0",
"_originalSource": "https://github.com/stacktracejs/stacktrace.js.git",
"_direct": true
}
16 changes: 16 additions & 0 deletions src/bower_components/stacktrace.js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## v0.6.0

* Added AMD support using a UMD pattern (thanks @jeffrose)

## v0.5.3

* Fix Chrome 27 detection; Chrome no longer has Error#arguments

## v0.5.1

* Fix Bower integration; Added proper bower.json file

## v0.5.0

* Lots and lots of stuff

16 changes: 16 additions & 0 deletions src/bower_components/stacktrace.js/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Making contributions
When submitting your pull requests, please do the following to make it easier to incorporate your changes:

* Include unit and/or functional tests that validate changes you're making.
* Run unit tests in the latest IE, Firefox, Chrome, Safari and Opera and make sure they pass.
* Rebase your changes onto origin/HEAD if you can do so cleanly.
* If submitting additional functionality, provide an example of how to use it.
* Please keep code style consistent with surrounding code.

## Testing
There are a few ways to run tests:

* You can run tests in PhantomJS by simply running `gradlew test` from your favorite shell.
* Run tests with JSTestDriver using `gradlew jstd`
* Point any browser to `≤project dir>/test/TestStacktrace.html` for unit tests
* Point your browser to `≤project dir>/test/functional/index.html` for more real-world functional tests
6 changes: 6 additions & 0 deletions src/bower_components/stacktrace.js/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Domain Public by Eric Wendelin http://eriwen.com/ (2008)
Luke Smith http://lucassmith.name/ (2008)
Loic Dachary <[email protected]> (2008)
Johan Euphrosine <[email protected]> (2008)
Oyvind Sean Kinsey http://kinsey.no/blog (2010)
Victor Homyakov <[email protected]> (2010)
82 changes: 82 additions & 0 deletions src/bower_components/stacktrace.js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Welcome to stacktrace.js! [![Code Climate](https://codeclimate.com/github/eriwen/javascript-stacktrace.png)](https://codeclimate.com/github/eriwen/javascript-stacktrace)
A JavaScript tool that allows you to debug your JavaScript by giving you a [stack trace](http://en.wikipedia.org/wiki/Stack_trace) of function calls leading to an error (or any condition you specify)

# How do I use stacktrace.js? #
Just include stacktrace.js file on your page, and call it like so:

```html
<script type="text/javascript" src="https://rawgithub.jparrowsec.cn/stacktracejs/stacktrace.js/master/stacktrace.js"></script>
<script type="text/javascript">
// your code...
var trace = printStackTrace();
alert(trace.join('\n\n')); // Output however you want!
// more code of yours...
</script>
```

You can also pass in your own Error to get a stacktrace *not available in IE or Safari 5-*

```html
<script type="text/javascript" src="https://rawgithub.jparrowsec.cn/stacktracejs/stacktrace.js/master/stacktrace.js"></script>
<script type="text/javascript">
try {
// error producing code
} catch(e) {
var trace = printStackTrace({e: e});
alert('Error!\n' + 'Message: ' + e.message + '\nStack trace:\n' + trace.join('\n'));
// do something else with error
}
</script>
```

Note that error message is not included in stack trace.

Bookmarklet available on the [project home page](http://stacktracejs.com).

# Function Instrumentation #
You can now have any (public or privileged) function give you a stacktrace when it is called:

```javascript
function logStackTrace(stack) {
console.log(stack.join('\n'));
}
var p = new printStackTrace.implementation();
p.instrumentFunction(this, 'baz', logStackTrace);

function foo() {
var a = 1;
bar();
}
function bar() {
baz();
}
foo(); //Will log a stacktrace when 'baz()' is called containing 'foo()'!

p.deinstrumentFunction(this, 'baz'); //Remove function instrumentation
```

# What browsers does stacktrace.js support? #
It is currently tested and working on:

- Firefox (and Iceweasel) 0.9+
- Google Chrome 1+
- Safari 3.0+ (including iOS 1+)
- Opera 7+
- IE 5.5+
- Konqueror 3.5+
- Flock 1.0+
- SeaMonkey 1.0+
- K-Meleon 1.5.3+
- Epiphany 2.28.0+
- Iceape 1.1+

## Contributions [![Stories in Ready](http://badge.waffle.io/eriwen/javascript-stacktrace.png)](http://waffle.io/eriwen/javascript-stacktrace)

This project is made possible due to the efforts of these fine people:

* [Eric Wendelin](http://eriwen.com)
* [Luke Smith](http://lucassmith.name/)
* Loic Dachary
* Johan Euphrosine
* Øyvind Sean Kinsey
* Victor Homyakov
11 changes: 11 additions & 0 deletions src/bower_components/stacktrace.js/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "stacktrace.js",
"version": "0.6.0",
"main": "./stacktrace.js",
"dependencies": {},
"ignore": [
"**/.*",
"node_modules",
"components"
]
}
123 changes: 123 additions & 0 deletions src/bower_components/stacktrace.js/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.eriwen:gradle-js-plugin:1.1'
}
}

apply plugin: 'js'

defaultTasks 'all'
buildDir = 'target'

def srcFile = 'stacktrace.js'
def destFile = "${buildDir}/stacktrace-min.js"
def testDir = 'test'

repositories {
mavenRepo url: 'http://repository.springsource.com/maven/bundles/release'
mavenCentral()
}

task clean(type: Delete) {
delete buildDir
}

task init(type: Directory, dependsOn: 'clean', description: 'Creates artifact output directories') {
outputs.dir(buildDir)
doLast {
file(buildDir).mkdirs()
}
}

task wrapper(type: Wrapper) {
gradleVersion = '1.1'
}

task jshintz(dependsOn: 'init', description: 'runs jshint on all non-test and lib JS files') {
doLast {
def command = "jshint ${new File('stacktrace.js').canonicalPath} --config jshint.json --jslint-reporter"
new File("${buildDir}/jshint.xml").write(command.execute().text)
}
}

task jsduck(type: Exec, dependsOn: 'init', description: 'Generates jsduck documentation') {
inputs.file file(srcFile)
outputs.file file("${buildDir}/docs")

commandLine = ['jsduck', srcFile, '--output', "${buildDir}/docs"]
ignoreExitValue = true
}

minifyJs {
dependsOn << 'init'
source = file(srcFile)
dest = file(destFile)
closure {
warningLevel = 'QUIET'
}
}

gzipJs {
source = minifyJs
dest = file(destFile)
}

task test(dependsOn: 'init') << {
description = 'run QUnit tests and create JUnit test reports'

def specs = []
new File(testDir).eachFile {
if (it.name.endsWith('.html')) {
specs << it
}
}

def phantomJsPath = "which phantomjs".execute().text.trim()
def startTime = new Date().time
def numFailures = 0
def testsFailed = false
specs.each { File spec ->
print "Running ${spec.name}..."

def outputFile = "${buildDir}/TEST-${spec.name.replace('-', '').replace('.html', '.xml')}"
ant.exec(outputproperty: 'cmdOut', errorproperty: 'cmdErr',
resultproperty: 'exitCode', failonerror: 'false', executable: phantomJsPath) {
arg(value: 'test/lib/phantomjs-qunit-runner.js')
arg(value: spec.canonicalPath)
}
// Check exit code
if (ant.project.properties.exitCode != '0') {
testsFailed = true
numFailures++
println 'FAILED'
} else {
println 'PASSED'
}

new File(outputFile).write(ant.project.properties.cmdOut)
}

println "QUnit tests completed in ${new Date().time - startTime}ms"
println "QUnit Tests ${testsFailed ? 'FAILED' : 'PASSED'} - view reports in ${buildDir}"
ant.fail(if: testsFailed, message: 'JS Tests Failed')
}

task jstd(type: Exec, dependsOn: 'init', description: 'runs JS tests through JsTestDriver') {
// Default to MacOS and check for other environments
def firefoxPath = '/Applications/Firefox.app/Contents/MacOS/firefox'
if ("uname".execute().text.trim() != 'Darwin') {
firefoxPath = "which firefox".execute().text.trim()
}

commandLine = ['/usr/bin/env', 'DISPLAY=:1', 'java', '-jar', "test/lib/JsTestDriver-1.3.3d.jar", '--config', "test/jsTestDriver.conf", '--port', '4224', '--browser', firefoxPath, '--tests', 'all', '--testOutput', buildDir]
}

task jsCoverage(type: Exec, dependsOn: 'jstd', description: 'JS code coverage with cobertura') {
commandLine = ['python', "${projectDir}/test/lib/lcov-to-cobertura-xml.py", '-e', 'test.lib', '-o', "${buildDir}/coverage.xml", "${buildDir}/jsTestDriver.conf-coverage.dat"]
}

task all(dependsOn: ['clean', 'jshintz', 'test', 'jsduck', 'minifyJs', 'gzipJs']) << {}
10 changes: 10 additions & 0 deletions src/bower_components/stacktrace.js/component.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "stacktrace.js",
"version": "0.6.0",
"repo": "eriwen/javascript-stacktrace",
"main": "stacktrace.js",
"scripts": [
"stacktrace.js"
],
"dependencies": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Tue Aug 21 18:36:49 MDT 2012
zipStorePath=wrapper/dists
distributionPath=wrapper/dists
distributionBase=GRADLE_USER_HOME
zipStoreBase=GRADLE_USER_HOME
distributionUrl=http\://services.gradle.org/distributions/gradle-1.1-bin.zip
Loading

0 comments on commit bb3ea35

Please sign in to comment.