Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'develop'

  • Loading branch information...
commit 8c59957250d7aed0463c20f6f1b46b7fc93f1a10 2 parents 3bf7f6d + 96a79a0
Harry Brundage authored
View
3  Resources/app/models/actions/facebook/publish_stream_action.coffee
@@ -5,11 +5,10 @@ class PublishStreamAction extends Citrus.FacebookAction
buttonText: "Share"
action: (account, success, failure) ->
- Titanium.Facebook.publishStream(@title, @data, @target, (e) =>
+ Titanium.Facebook.publishStream @title, @data, @target, (e) =>
if e.success
success(e)
else
failure(e)
- )
Citrus.Actions.Facebook.PublishStreamAction = PublishStreamAction
View
43 Resources/app/models/actions/facebook/publish_stream_action.js
@@ -1,26 +1,31 @@
(function() {
var PublishStreamAction;
- var __bind = function(func, context) {
- return function(){ return func.apply(context, arguments); };
- }, __extends = function(child, parent) {
- var ctor = function(){};
+ var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
+ for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
+ function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.prototype.constructor = child;
- if (typeof parent.extended === "function") parent.extended(child);
+ child.prototype = new ctor;
child.__super__ = parent.prototype;
- };
+ return child;
+ }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
PublishStreamAction = function() {
- return Citrus.FacebookAction.apply(this, arguments);
- };
- __extends(PublishStreamAction, Citrus.FacebookAction);
- PublishStreamAction.declares = ["title", "data", "target"];
- PublishStreamAction.prototype.type = "FacebookPublishStreamAction";
- PublishStreamAction.prototype.buttonText = "Share";
- PublishStreamAction.prototype.action = function(account, success, failure) {
- return Titanium.Facebook.publishStream(this.title, this.data, this.target, __bind(function(e) {
- return e.success ? success(e) : failure(e);
- }, this));
- };
+ function PublishStreamAction() {
+ PublishStreamAction.__super__.constructor.apply(this, arguments);
+ }
+ __extends(PublishStreamAction, Citrus.FacebookAction);
+ PublishStreamAction.declares = ["title", "data", "target"];
+ PublishStreamAction.prototype.type = "FacebookPublishStreamAction";
+ PublishStreamAction.prototype.buttonText = "Share";
+ PublishStreamAction.prototype.action = function(account, success, failure) {
+ return Titanium.Facebook.publishStream(this.title, this.data, this.target, __bind(function(e) {
+ if (e.success) {
+ return success(e);
+ } else {
+ return failure(e);
+ }
+ }, this));
+ };
+ return PublishStreamAction;
+ }();
Citrus.Actions.Facebook.PublishStreamAction = PublishStreamAction;
}).call(this);
View
11 Resources/app/models/actions/mailchimp/subscribe_action.coffee
@@ -23,12 +23,15 @@ class SubscribeAction extends Citrus.MailchimpAction
apikey: @apiKey
email_address: account.email
id: @listId
- merge_vars:
- OPTINIP: Titanium.Platform.address
success: (data, status, xhr) ->
if data.error?
- e("Error subscribing to list!")
- failure(xhr, status, data)
+ if data.error.match(/is already subscribed/)
+ alert(data.error+"!")
+ success({})
+ else
+ er("Error subscribing to list!")
+ er(data, status, xhr)
+ failure(xhr, status, data)
else
d("Success subscribing", data, "Status:", status, "Code", xhr.status, "Response", xhr.responseText)
success(data)
View
15 Resources/app/models/actions/mailchimp/subscribe_action.js
@@ -24,15 +24,18 @@
data: {
apikey: this.apiKey,
email_address: account.email,
- id: this.listId,
- merge_vars: {
- OPTINIP: Titanium.Platform.address
- }
+ id: this.listId
},
success: function(data, status, xhr) {
if (data.error != null) {
- e("Error subscribing to list!");
- return failure(xhr, status, data);
+ if (data.error.match(/is already subscribed/)) {
+ alert(data.error + "!");
+ return success({});
+ } else {
+ er("Error subscribing to list!");
+ er(data, status, xhr);
+ return failure(xhr, status, data);
+ }
} else {
d("Success subscribing", data, "Status:", status, "Code", xhr.status, "Response", xhr.responseText);
return success(data);
Please sign in to comment.
Something went wrong with that request. Please try again.