ymdp 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ymdp/javascripts/ab_testing.js +2 -2
- data/lib/ymdp/javascripts/ajax.js +39 -19
- data/lib/ymdp/javascripts/application.js +0 -2
- data/lib/ymdp/javascripts/debug.js +7 -5
- data/lib/ymdp/javascripts/flash.js +0 -1
- data/lib/ymdp/javascripts/init.js +1 -0
- data/lib/ymdp/javascripts/logger.js +27 -64
- data/lib/ymdp/javascripts/reporter.js +4 -4
- data/lib/ymdp/javascripts/user.js +0 -2
- data/ymdp.gemspec +2 -2
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
@@ -83,7 +83,7 @@ ABTesting = {
|
|
83
83
|
error: function(data) {
|
84
84
|
Debug.log("applyError", data);
|
85
85
|
if (data.error !== 3002) {
|
86
|
-
|
86
|
+
Debug.error("Received body contents fetch error on page " + View.name + ": " + data.error + ' - ' + data.errorMsg);
|
87
87
|
}
|
88
88
|
YAHOO.init.showAndFinish();
|
89
89
|
},
|
@@ -117,7 +117,7 @@ ABTesting = {
|
|
117
117
|
try {
|
118
118
|
$(content_id).update(response.html);
|
119
119
|
} catch(omg) {
|
120
|
-
|
120
|
+
Debug.error(omg);
|
121
121
|
}
|
122
122
|
}
|
123
123
|
YAHOO.init.showAndFinish();
|
@@ -33,7 +33,6 @@ OIB = {
|
|
33
33
|
if (error_function) {
|
34
34
|
error_function(response);
|
35
35
|
} else {
|
36
|
-
Debug.error("No error_function", response);
|
37
36
|
YAHOO.oib.showError(
|
38
37
|
{
|
39
38
|
"method": "OIB.call",
|
@@ -45,7 +44,6 @@ OIB = {
|
|
45
44
|
if (success_function) {
|
46
45
|
success_function(response);
|
47
46
|
} else {
|
48
|
-
Debug.error("no success function", response);
|
49
47
|
YAHOO.oib.showError(
|
50
48
|
{
|
51
49
|
"method": "OIB.call",
|
@@ -61,13 +59,19 @@ OIB = {
|
|
61
59
|
ajax_response: false,
|
62
60
|
|
63
61
|
ajax: function(url, method, params, success_function, error_function) {
|
62
|
+
var debug;
|
63
|
+
|
64
64
|
params = params || {};
|
65
65
|
params["application"] = View.application;
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
debug = !params["_hide_debug"];
|
68
|
+
|
69
|
+
if (debug) {
|
70
|
+
Debug.log("OIB.ajax: About to call openmail.Application.callWebService: ", {
|
71
|
+
"method": method,
|
72
|
+
"url": url + "?" + Object.toQueryString(params)
|
73
|
+
});
|
74
|
+
}
|
71
75
|
|
72
76
|
openmail.Application.callWebService(
|
73
77
|
{
|
@@ -78,25 +82,30 @@ OIB = {
|
|
78
82
|
function(response) {
|
79
83
|
// response from Ajax call was a 200 response
|
80
84
|
//
|
81
|
-
|
85
|
+
if (debug) {
|
86
|
+
Debug.log("inside response from openMail.Application.callWebService", response);
|
87
|
+
}
|
82
88
|
if (response.error) {
|
83
89
|
// response has a parameter called "error"
|
84
90
|
//
|
85
91
|
if (error_function) {
|
86
92
|
error_function(response);
|
87
93
|
} else {
|
88
|
-
|
94
|
+
if (debug) {
|
95
|
+
OIB.error(url, params, response);
|
96
|
+
}
|
89
97
|
}
|
90
98
|
} else {
|
91
99
|
// SUCCESSFUL RESPONSE
|
92
100
|
//
|
93
101
|
// response doesn't have a parameter called "error"
|
94
102
|
//
|
95
|
-
Debug.log("success response inside openMail.Application.callWebService", response);
|
96
103
|
try {
|
97
104
|
success_function(response);
|
98
105
|
} catch(e) {
|
99
|
-
|
106
|
+
if (debug) {
|
107
|
+
Debug.log("Error in OIB.request success function", e);
|
108
|
+
}
|
100
109
|
YAHOO.oib.showError({
|
101
110
|
"method": "OIB.request",
|
102
111
|
"description": "exception caught in OIB.request success callback",
|
@@ -108,11 +117,16 @@ OIB = {
|
|
108
117
|
},
|
109
118
|
|
110
119
|
request: function(oib_path, params, success_function, error_function, base_url) {
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
120
|
+
var oib_url, method, debug;
|
121
|
+
|
122
|
+
debug = !params["_hide_debug"];
|
123
|
+
|
124
|
+
if (debug) {
|
125
|
+
Debug.log("inside OIB.request: ", {
|
126
|
+
"oib_path": oib_path,
|
127
|
+
"params": Object.toJSON(params)
|
128
|
+
});
|
129
|
+
}
|
116
130
|
|
117
131
|
oib_url = base_url ? base_url : YAHOO.constants.base_url;
|
118
132
|
|
@@ -134,17 +148,23 @@ OIB = {
|
|
134
148
|
}
|
135
149
|
params.version = params.version || <%= @version %>;
|
136
150
|
|
137
|
-
|
151
|
+
if (debug) {
|
152
|
+
Debug.log("about to call OIB.ajax");
|
153
|
+
}
|
138
154
|
|
139
155
|
OIB.ajax(oib_url, method, params, success_function, error_function);
|
140
156
|
},
|
141
157
|
|
142
158
|
// overwrite this function locally if you need to
|
143
159
|
error: function(url, params, response) {
|
144
|
-
var message;
|
160
|
+
var message, debug;
|
161
|
+
|
162
|
+
debug = !params["_hide_debug"];
|
145
163
|
|
146
|
-
|
147
|
-
|
164
|
+
if (debug) {
|
165
|
+
message = "OIB.error: " + Object.toJSON(response) + " calling url: " + url + "?" + Object.toQueryString(params);
|
166
|
+
Debug.error(message);
|
167
|
+
}
|
148
168
|
},
|
149
169
|
|
150
170
|
// advance the user to the next state in the signup process
|
@@ -35,6 +35,7 @@ Debug = {
|
|
35
35
|
if (this.consoleOn()) {
|
36
36
|
console[level](message);
|
37
37
|
}
|
38
|
+
Logger.observe(message);
|
38
39
|
},
|
39
40
|
|
40
41
|
log: function() {
|
@@ -89,16 +90,17 @@ Debug = {
|
|
89
90
|
},
|
90
91
|
|
91
92
|
timestamp: function() {
|
92
|
-
var time, hour, minute, second, timestamp, checktime;
|
93
|
+
var months, day, year, time, hour, minute, second, timestamp, checktime;
|
93
94
|
|
94
95
|
time = new Date();
|
96
|
+
month = this.checktime(time.getMonth());
|
97
|
+
date = this.checktime(time.getDate());
|
98
|
+
year = this.checktime(time.getFullYear());
|
95
99
|
hour = this.checktime(time.getHours());
|
96
100
|
minute = this.checktime(time.getMinutes());
|
97
101
|
second = this.checktime(time.getSeconds());
|
98
102
|
|
99
|
-
|
100
|
-
|
101
|
-
timestamp = hour + ":" + minute + ":" + second;
|
103
|
+
timestamp = month + "/" + date + "/" + year + " " + hour + ":" + minute + ":" + second;
|
102
104
|
|
103
105
|
return timestamp;
|
104
106
|
},
|
@@ -106,4 +108,4 @@ Debug = {
|
|
106
108
|
generalInfo: function() {
|
107
109
|
return "[<%= @domain %>/<%= @server %>] [<%= @version %> <%= @sprint_name %>]";
|
108
110
|
}
|
109
|
-
};
|
111
|
+
};
|
@@ -1,64 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
YAHOO.logger.write = function(level, message) {
|
29
|
-
if (YAHOO.oib.login) {
|
30
|
-
message = "[login: " + YAHOO.oib.login + "] " + message;
|
31
|
-
}
|
32
|
-
if (YAHOO.oib.guid) {
|
33
|
-
message = "[guid: " + YAHOO.oib.guid + "] " + message;
|
34
|
-
}
|
35
|
-
OIB.post("ymdp/log",
|
36
|
-
{
|
37
|
-
level: level,
|
38
|
-
message: message
|
39
|
-
},
|
40
|
-
function(response) {
|
41
|
-
// log message written successfully
|
42
|
-
});
|
43
|
-
};
|
44
|
-
|
45
|
-
YAHOO.logger.debug = function(message) {
|
46
|
-
YAHOO.logger.write("debug", message);
|
47
|
-
};
|
48
|
-
YAHOO.logger.info = function(message) {
|
49
|
-
YAHOO.logger.write("info", message);
|
50
|
-
};
|
51
|
-
YAHOO.logger.warn = function(message) {
|
52
|
-
YAHOO.logger.write("warn", message);
|
53
|
-
};
|
54
|
-
YAHOO.logger.error = function(message) {
|
55
|
-
YAHOO.logger.write("warn", message);
|
56
|
-
};
|
57
|
-
YAHOO.logger.fatal = function(message) {
|
58
|
-
YAHOO.logger.write("fatal", message);
|
59
|
-
};
|
60
|
-
|
61
|
-
|
62
|
-
Logger = YAHOO.logger;
|
63
|
-
|
64
|
-
// END YMDP LOGGER
|
1
|
+
var Logger;
|
2
|
+
|
3
|
+
Logger = {
|
4
|
+
on: false,
|
5
|
+
|
6
|
+
init: function() {
|
7
|
+
OIB.get("ymdp/state", {}, function(response) {
|
8
|
+
Logger.on = response.observe;
|
9
|
+
});
|
10
|
+
},
|
11
|
+
|
12
|
+
observe: function(message) {
|
13
|
+
if (this.on) {
|
14
|
+
this.log(message);
|
15
|
+
}
|
16
|
+
},
|
17
|
+
|
18
|
+
log: function(message) {
|
19
|
+
// console.log("LOGGING " + message);
|
20
|
+
OIB.post("ymdp/logs", {
|
21
|
+
"_hide_debug": true,
|
22
|
+
"log": message
|
23
|
+
}, function() {
|
24
|
+
|
25
|
+
});
|
26
|
+
}
|
27
|
+
};
|
@@ -14,7 +14,7 @@ var Reporter;
|
|
14
14
|
//
|
15
15
|
Reporter = {
|
16
16
|
error: function(guid, params) {
|
17
|
-
Debug.log("Reporter.error", params);
|
17
|
+
// Debug.log("Reporter.error", params);
|
18
18
|
Reporter.report(guid, "error", params);
|
19
19
|
},
|
20
20
|
|
@@ -30,7 +30,7 @@ Reporter = {
|
|
30
30
|
params["ymail_guid"] = guid;
|
31
31
|
params["view"] = view;
|
32
32
|
|
33
|
-
Debug.log("Reporting guid " + guid + ", view " + view);
|
33
|
+
// Debug.log("Reporting guid " + guid + ", view " + view);
|
34
34
|
Reporter.post(params);
|
35
35
|
},
|
36
36
|
|
@@ -39,9 +39,9 @@ Reporter = {
|
|
39
39
|
post: function(params) {
|
40
40
|
params = params || {};
|
41
41
|
OIB.post("ymdp/report", params, function(response) {
|
42
|
-
Debug.log("Reported page view", params);
|
42
|
+
// Debug.log("Reported page view", params);
|
43
43
|
}, function(response) {
|
44
|
-
Debug.error("Error reporting page view with params", response);
|
44
|
+
// Debug.error("Error reporting page view with params", response);
|
45
45
|
});
|
46
46
|
},
|
47
47
|
};
|
@@ -13,7 +13,6 @@ YAHOO.oib.getUserState = function(success_function, error_function) {
|
|
13
13
|
}
|
14
14
|
},
|
15
15
|
function() {
|
16
|
-
// YAHOO.logger.error("Failed to get user's state");
|
17
16
|
Debug.log("Failed to get user's state");
|
18
17
|
if (error_function) {
|
19
18
|
error_function();
|
@@ -204,7 +203,6 @@ YAHOO.oib.deactivateUser = function() {
|
|
204
203
|
"ymail_wssid": ymail_wssid
|
205
204
|
},
|
206
205
|
function(response) {
|
207
|
-
// YAHOO.logger.info("Finished deactivating user");
|
208
206
|
if (View.name !== "deactivate") {
|
209
207
|
YAHOO.launcher.launchGoodbye();
|
210
208
|
}
|
data/ymdp.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ymdp}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.6.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Isaac Priestley"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-05-06}
|
13
13
|
s.description = %q{Framework for developing applications in the Yahoo! Mail Development Platform.}
|
14
14
|
s.email = %q{progressions@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ymdp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Isaac Priestley
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-05-06 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|