ymdp 0.4.8 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.8
1
+ 0.4.9
@@ -122,6 +122,7 @@ Authorize = {
122
122
  YAHOO.oib.verifyUser(function(user) {
123
123
  Debug.log("inside YAHOO.oib.verifyUser callback", user);
124
124
 
125
+ YAHOO.oib.user = user;
125
126
  YAHOO.oib.login = user.login;
126
127
  YAHOO.init.switchOnState(user);
127
128
  }, function(response) {
@@ -21,6 +21,7 @@ LAUNCHER = {
21
21
 
22
22
  YAHOO.namespace("launcher");
23
23
 
24
+ Launcher = YAHOO.launcher;
24
25
 
25
26
  YAHOO.launcher.launch = function(view, title, type) {
26
27
  openmail.Application.getParameters(function(response) {
@@ -44,6 +45,38 @@ YAHOO.launcher.launch = function(view, title, type) {
44
45
  };
45
46
 
46
47
 
48
+ YAHOO.launcher.launchView = function(launch_view) {
49
+ var user;
50
+
51
+ user = YAHOO.oib.user || {"state": "active"};
52
+
53
+ switch(user.state) {
54
+ case "scanning":
55
+ // formerly known as 'inspect'
56
+ YAHOO.launcher.launchScanning();
57
+ break;
58
+ case "summary":
59
+ YAHOO.launcher.launchSummary();
60
+ break;
61
+ case "authorized":
62
+ // authorized but not yet 'signed in'
63
+ YAHOO.oib.signInUser();
64
+ break;
65
+ case "new_active":
66
+ // no messages processed yet
67
+ case "processing":
68
+ // activated but we have synced fewer than 80% of their messages
69
+ case "active":
70
+ // active, launch the view this method was intended for
71
+ launch_view();
72
+ break;
73
+ default:
74
+ // other
75
+ YAHOO.launcher.launchAuthorize();
76
+ }
77
+ };
78
+
79
+
47
80
  YAHOO.launcher.launchTab = function(view, title) {
48
81
  YAHOO.launcher.launch(view, title, "tab");
49
82
  };
@@ -87,4 +120,43 @@ YAHOO.launcher.launchReauthorize = function() {
87
120
  YAHOO.launcher.launchTab("reauthorize", "Reauthorize");
88
121
  };
89
122
 
90
- Launcher = YAHOO.launcher;
123
+ Launcher.launchView = function(launch_view) {
124
+ // get Yahoo! user's guid and ymail_wssid
125
+ YAHOO.oib.getGuidAndYmailWssid(function(guid, ymail_wssid) {
126
+
127
+ // call /ymdp/verify and return data about the user
128
+ YAHOO.oib.verifyUser(function(user) {
129
+
130
+ YAHOO.oib.login = user.login;
131
+
132
+ switch(user.state) {
133
+ case "scanning":
134
+ // formerly known as 'inspect'
135
+ YAHOO.launcher.launchScanning();
136
+ break;
137
+ case "summary":
138
+ YAHOO.launcher.launchSummary();
139
+ break;
140
+ case "authorized":
141
+ // authorized but not yet 'signed in'
142
+ YAHOO.oib.signInUser();
143
+ break;
144
+ case "new_active":
145
+ // no messages processed yet
146
+ case "processing":
147
+ // activated but we have synced fewer than 80% of their messages
148
+ case "active":
149
+ // active, launch the view this method was intended for
150
+ launch_view();
151
+ break;
152
+ default:
153
+ // other
154
+ YAHOO.launcher.launchAuthorize();
155
+ }
156
+ });
157
+ });
158
+ };
159
+
160
+ Launcher.launchMain = function() {
161
+ Launcher.launchView(Launcher.launchFolders);
162
+ };
@@ -31,7 +31,7 @@ Reporter = {
31
31
  params["view"] = view;
32
32
 
33
33
  Debug.log("Reporting guid " + guid + ", view " + view);
34
- // Reporter.post(params);
34
+ Reporter.post(params);
35
35
  },
36
36
 
37
37
  // Post data back to OIB, to the URL /ymdp/report.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ymdp}
8
- s.version = "0.4.8"
8
+ s.version = "0.4.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeff Coleman"]
12
- s.date = %q{2011-04-06}
12
+ s.date = %q{2011-04-11}
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 8
10
- version: 0.4.8
9
+ - 9
10
+ version: 0.4.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Coleman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-06 00:00:00 -05:00
18
+ date: 2011-04-11 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency