ymdp 0.8.6 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.6
1
+ 0.8.7
@@ -1,64 +1,64 @@
1
1
  ###
2
- CALL OIB
2
+ CALL OIB
3
3
 
4
- global to every view. sends Ajax call to OtherInbox.
4
+ global to every view. sends Ajax call to OtherInbox.
5
5
  ###
6
6
 
7
- # send an Ajax call to OtherInbox.
8
- # takes as parameters:
9
- # - the path to call
10
- # - any additional query string params
11
- # - a callback function to run when the Ajax call is a success
12
- # - an optional error function
13
- # - a base URL to use, if you don't want this call going to YMDP.Constants.base_url
14
- # TODO refactor this function to take a second params hash where we could stick success_function, error_function, and base_url
7
+ # send an Ajax call to OtherInbox.
8
+ # takes as parameters:
9
+ # - the path to call
10
+ # - any additional query string params
11
+ # - a callback function to run when the Ajax call is a success
12
+ # - an optional error function
13
+ # - a base URL to use, if you don't want this call going to YMDP.Constants.base_url
14
+ # TODO refactor this function to take a second params hash where we could stick success_function, error_function, and base_url
15
15
 
16
16
  window.OIB =
17
- get: (oib_path, params, success_function, error_function, base_url) ->
18
- params.method = "GET"
19
- OIB.call(oib_path, params, success_function, error_function, base_url)
17
+ get: (oib_path, params, success_function, error_function, base_url) ->
18
+ params.method = "GET"
19
+ OIB.call(oib_path, params, success_function, error_function, base_url)
20
20
 
21
- post: (oib_path, params, success_function, error_function, base_url) ->
22
- params.method = "POST"
23
- OIB.call(oib_path, params, success_function, error_function, base_url)
24
-
25
- call: (oib_path, params, success_function, error_function, base_url) ->
26
- success = (response) ->
21
+ post: (oib_path, params, success_function, error_function, base_url) ->
22
+ params.method = "POST"
23
+ OIB.call(oib_path, params, success_function, error_function, base_url)
24
+
25
+ call: (oib_path, params, success_function, error_function, base_url) ->
26
+ success = (response) ->
27
27
  response = JSON.parse(response.data)
28
- if (response.error)
29
- if (error_function)
28
+ if response.error
29
+ if error_function
30
30
  error_function(response)
31
31
  else
32
32
  YMDP.showError
33
33
  "method": "OIB.call"
34
34
  "description": "error callback"
35
35
  else
36
- if (success_function)
36
+ if success_function
37
37
  success_function(response)
38
38
  else
39
39
  YMDP.showError
40
40
  "method": "OIB.call"
41
41
  "description": "success callback error"
42
42
 
43
- OIB.request(oib_path, params, success, error_function, base_url)
44
-
45
- ajax_response: false
46
-
47
- ajax: (url, method, params, success_function, error_function) ->
48
- params = params || {}
49
- params["application"] = View.application
50
-
51
- debug = !params["_hide_debug"]
52
-
53
- if (debug)
43
+ OIB.request(oib_path, params, success, error_function, base_url)
44
+
45
+ ajax_response: false
46
+
47
+ ajax: (url, method, params, success_function, error_function) ->
48
+ params = params || {}
49
+ params["application"] = View.application
50
+
51
+ debug = !params["_hide_debug"]
52
+
53
+ if debug
54
54
  Debug.log "OIB.ajax: About to call openmail.Application.callWebService: ",
55
55
  "method": method,
56
56
  "url": url + "?" + $.param(params)
57
57
 
58
58
  openmail.Application.callWebService
59
- url: url,
60
- method: method,
61
- parameters: params
59
+ url: url,
60
+ method: method,
61
+ parameters: params
62
62
  , (response) ->
63
63
  # response from Ajax call was a 200 response
64
64
  #
@@ -70,16 +70,16 @@ window.OIB =
70
70
  #
71
71
  if error_function
72
72
  error_function(response)
73
- else if debug
73
+ else if debug
74
74
  OIB.error(url, params, response)
75
75
  else
76
76
  # SUCCESSFUL RESPONSE
77
77
  #
78
78
  # response doesn't have a parameter called "error"
79
79
  #
80
- success_function(response)
81
-
82
- request: (oib_path, params, success_function, error_function, base_url) ->
80
+ success_function(response)
81
+
82
+ request: (oib_path, params, success_function, error_function, base_url) ->
83
83
  debug = !params["_hide_debug"]
84
84
  Debug.log("inside OIB.request: ", {"oib_path": oib_path, "params": JSON.stringify(params)}) if debug
85
85
 
@@ -114,15 +114,15 @@ window.OIB =
114
114
 
115
115
  # overwrite this function locally if you need to
116
116
  #
117
- error: (url, params, response) ->
118
- debug = !params["_hide_debug"]
119
-
120
- if debug
121
- message = "OIB.error: " + JSON.stringify(response) + " calling url: " + url + "?" + $.param(params)
122
- Debug.error(message)
123
-
124
- # advance the user to the next state in the signup process
125
- #
117
+ error: (url, params, response) ->
118
+ debug = !params["_hide_debug"]
119
+
120
+ if debug
121
+ message = "OIB.error: " + JSON.stringify(response) + " calling url: " + url + "?" + $.param(params)
122
+ Debug.error(message)
123
+
124
+ # advance the user to the next state in the signup process
125
+ #
126
126
  advance: (success_function, error_function) ->
127
127
  OIB.post "ymdp/state", {}, (response) ->
128
128
  Debug.log("Scanning.next success", response)
@@ -112,6 +112,13 @@ YMDP.init = ->
112
112
  YMDP.Init.browser = ->
113
113
  if $.browser.webkit
114
114
  $('body').addClass('webkit')
115
+ if $.browser.safari
116
+ $('body').addClass('safari')
117
+ if $.browser.msie
118
+ $('body').addClass('msie')
119
+ if $.browser.mozilla
120
+ $('body').addClass('mozilla')
121
+ $('body').addClass("version_#{$.browser.version}")
115
122
 
116
123
 
117
124
  YMDP.Init.resources = ->
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ymdp}
8
- s.version = "0.8.6"
8
+ s.version = "0.8.7"
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-07-11}
12
+ s.date = %q{2011-08-04}
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: 51
4
+ hash: 49
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 6
10
- version: 0.8.6
9
+ - 7
10
+ version: 0.8.7
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-07-11 00:00:00 -05:00
18
+ date: 2011-08-04 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency