From 509abc96e44102158bb3ba546d44f128ee441b1d Mon Sep 17 00:00:00 2001 From: Phoebe Pan Date: Mon, 1 Aug 2016 18:16:16 +0800 Subject: [PATCH 1/5] create & compile cap_empty_trm.coffee --- out/cap_empty_trm.js | 34 ++++++++++++++++++++++++++++++++++ package.json | 10 +++++----- src/cap_empty_trm.coffee | 29 +++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 out/cap_empty_trm.js create mode 100644 src/cap_empty_trm.coffee diff --git a/out/cap_empty_trm.js b/out/cap_empty_trm.js new file mode 100644 index 0000000..c0ca1d7 --- /dev/null +++ b/out/cap_empty_trm.js @@ -0,0 +1,34 @@ +/* +# record, user data +*/ + +var TRM, global, _lodash; + +_lodash = require("lodash"); + +_lodash = _lodash.noConflict(); + +TRM = (function() { + function TRM() { + return this; + } + + TRM.prototype.setNGo = function(info) {}; + + return TRM; + +})(); + +global = window || module.exports; + +global.analytics = global.analytics || []; + +global.analytics = _lodash.merge(global.analytics, new TRM()); + +global.console = global.console || { + log: function(msg) { + return msg; + } +}; + +module.exports = TRM; diff --git a/package.json b/package.json index cb14726..64e4439 100644 --- a/package.json +++ b/package.json @@ -21,18 +21,18 @@ "uglify-js": "~2.4.14" }, "devDependencies": { - "grunt": "~0.4.1", + "chai": "~1.9.1", + "coffee-script": "~1.7.1", + "finalhandler": "^0.3.3", + "grunt": "^0.4.5", "grunt-contrib-clean": "~0.4.1", "grunt-contrib-coffee": "~0.7.0", "grunt-contrib-jshint": "~0.6.4", "grunt-contrib-watch": "~0.4.4", "grunt-mocha-test": "~0.9.0", "mocha": "*", - "chai": "~1.9.1", - "should": "~4.0.4", - "coffee-script": "~1.7.1", "serve-static": "^1.8.1", - "finalhandler": "^0.3.3", + "should": "~4.0.4", "supertest": "^0.15.0" }, "author": "clonn", diff --git a/src/cap_empty_trm.coffee b/src/cap_empty_trm.coffee new file mode 100644 index 0000000..820a0d8 --- /dev/null +++ b/src/cap_empty_trm.coffee @@ -0,0 +1,29 @@ +### +# record, user data +### +_lodash = require("lodash") +_lodash = _lodash.noConflict() + + + +class TRM + + constructor: () -> + return @ + + + + setNGo: (info) -> + return + + + +global = window || module.exports +global.analytics = global.analytics || [] +global.analytics = _lodash.merge(global.analytics, new TRM()) +global.console = global.console || { + log: (msg) -> + return msg +} + +module.exports = TRM \ No newline at end of file From c75ea6f117276385354feb790ec19a086c33affe Mon Sep 17 00:00:00 2001 From: Phoebe Pan Date: Mon, 1 Aug 2016 18:25:07 +0800 Subject: [PATCH 2/5] Reset package.json. --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 64e4439..cb14726 100644 --- a/package.json +++ b/package.json @@ -21,18 +21,18 @@ "uglify-js": "~2.4.14" }, "devDependencies": { - "chai": "~1.9.1", - "coffee-script": "~1.7.1", - "finalhandler": "^0.3.3", - "grunt": "^0.4.5", + "grunt": "~0.4.1", "grunt-contrib-clean": "~0.4.1", "grunt-contrib-coffee": "~0.7.0", "grunt-contrib-jshint": "~0.6.4", "grunt-contrib-watch": "~0.4.4", "grunt-mocha-test": "~0.9.0", "mocha": "*", - "serve-static": "^1.8.1", + "chai": "~1.9.1", "should": "~4.0.4", + "coffee-script": "~1.7.1", + "serve-static": "^1.8.1", + "finalhandler": "^0.3.3", "supertest": "^0.15.0" }, "author": "clonn", From aecedf508f32fe34e8c0eb6f552e9801be423d29 Mon Sep 17 00:00:00 2001 From: Phoebe Pan Date: Mon, 1 Aug 2016 18:28:57 +0800 Subject: [PATCH 3/5] modify trm_empty_trm.js --- src/cap_import.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cap_import.coffee b/src/cap_import.coffee index c65a511..fffb5e0 100644 --- a/src/cap_import.coffee +++ b/src/cap_import.coffee @@ -46,7 +46,7 @@ module.exports = exports = { self = @ {domain, destPath, srcPath, minify} = config - filepath = srcPath || path.join(__dirname, "./cap_trm.js") + filepath = srcPath || path.join(__dirname, "./cap_empty_trm.js") # will return a promise module return new Promise (resolve, reject) -> From aee831672ad0cfd06fab6841b63a3bbefa23bf67 Mon Sep 17 00:00:00 2001 From: Phoebe Pan Date: Tue, 2 Aug 2016 10:35:24 +0800 Subject: [PATCH 4/5] add cap_import.js --- out/cap_import.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/out/cap_import.js b/out/cap_import.js index 69100d2..196ae07 100644 --- a/out/cap_import.js +++ b/out/cap_import.js @@ -43,7 +43,7 @@ module.exports = exports = { var destPath, domain, filepath, minify, self, srcPath; self = this; domain = config.domain, destPath = config.destPath, srcPath = config.srcPath, minify = config.minify; - filepath = srcPath || path.join(__dirname, "./cap_trm.js"); + filepath = srcPath || path.join(__dirname, "./cap_empty_trm.js"); return new Promise(function(resolve, reject) { var b; b = browserify(); From c6877ad708526b8aa80b719100910092ea09e0ec Mon Sep 17 00:00:00 2001 From: Phoebe Pan Date: Tue, 2 Aug 2016 11:47:02 +0800 Subject: [PATCH 5/5] [hotfix] trm: compile cap_import.coffee --- out/cap_import.js | 2 +- src/cap_import.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/out/cap_import.js b/out/cap_import.js index 196ae07..69100d2 100644 --- a/out/cap_import.js +++ b/out/cap_import.js @@ -43,7 +43,7 @@ module.exports = exports = { var destPath, domain, filepath, minify, self, srcPath; self = this; domain = config.domain, destPath = config.destPath, srcPath = config.srcPath, minify = config.minify; - filepath = srcPath || path.join(__dirname, "./cap_empty_trm.js"); + filepath = srcPath || path.join(__dirname, "./cap_trm.js"); return new Promise(function(resolve, reject) { var b; b = browserify(); diff --git a/src/cap_import.coffee b/src/cap_import.coffee index fffb5e0..c65a511 100644 --- a/src/cap_import.coffee +++ b/src/cap_import.coffee @@ -46,7 +46,7 @@ module.exports = exports = { self = @ {domain, destPath, srcPath, minify} = config - filepath = srcPath || path.join(__dirname, "./cap_empty_trm.js") + filepath = srcPath || path.join(__dirname, "./cap_trm.js") # will return a promise module return new Promise (resolve, reject) ->