Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stopped work on the splash store to prepare for demo.

  • Loading branch information...
commit 3f84ef26e90515d4ab239fb7bc09c9252d20fa7c 1 parent fee0e94
Harry Brundage authored
21 Resources/app/models/actions/action.coffee
View
@@ -17,18 +17,17 @@ class Action extends Citrus.Object
actionText: ""
constructor: (attributes) ->
- if (_.keys(attributes).length == (this.constructor.declares.length + Citrus.Action.alwaysDeclared.length))
- @valid = true
- for k, v of attributes
- k = k.camelize(true) # Camel case the underscored lowercase Rails text
- if _.isFunction(this[k])
- @valid = (@valid && this[k].call(v))
- else
- this[k] = v
-
- else
+ unless (_.keys(attributes).length == (this.constructor.declares.length + Citrus.Action.alwaysDeclared.length))
Ti.API.debug("Wrong amount of arguments passed to action constructor!")
- @valid = false
+
+ @valid = true
+ for k, v of attributes
+ k = k.camelize(true) # Camel case the underscored lowercase Rails text
+ if _.isFunction(this[k])
+ @valid = (@valid && this[k].call(v))
+ else
+ this[k] = v
+
readyToRun: () ->
return true
26 Resources/app/models/actions/action.js
View
@@ -20,21 +20,19 @@
Action = function() {
function Action(attributes) {
var k, v;
- if (_.keys(attributes).length === (this.constructor.declares.length + Citrus.Action.alwaysDeclared.length)) {
- this.valid = true;
- for (k in attributes) {
- if (!__hasProp.call(attributes, k)) continue;
- v = attributes[k];
- k = k.camelize(true);
- if (_.isFunction(this[k])) {
- this.valid = this.valid && this[k].call(v);
- } else {
- this[k] = v;
- }
- }
- } else {
+ if (!(_.keys(attributes).length === (this.constructor.declares.length + Citrus.Action.alwaysDeclared.length))) {
Ti.API.debug("Wrong amount of arguments passed to action constructor!");
- this.valid = false;
+ }
+ this.valid = true;
+ for (k in attributes) {
+ if (!__hasProp.call(attributes, k)) continue;
+ v = attributes[k];
+ k = k.camelize(true);
+ if (_.isFunction(this[k])) {
+ this.valid = this.valid && this[k].call(v);
+ } else {
+ this[k] = v;
+ }
}
}
__extends(Action, Citrus.Object);
2  Resources/app/models/actions/platform/visit_link_action.coffee
View
@@ -3,7 +3,7 @@ class VisitLinkAction extends Citrus.PlatformAction
type: "PlatformVisitLinkAction"
buttonText: "Safari"
- iconName: "safari"
+ iconName: "go"
action: (success, failure) ->
Titanium.Platform.openURL(@url)
2  Resources/app/models/actions/platform/visit_link_action.js
View
@@ -16,7 +16,7 @@
VisitLinkAction.declares = ["url"];
VisitLinkAction.prototype.type = "PlatformVisitLinkAction";
VisitLinkAction.prototype.buttonText = "Safari";
- VisitLinkAction.prototype.iconName = "safari";
+ VisitLinkAction.prototype.iconName = "go";
VisitLinkAction.prototype.action = function(success, failure) {
return Titanium.Platform.openURL(this.url);
};
10 Resources/app/models/splash_store.coffee
View
@@ -1,22 +1,24 @@
class SplashStore extends Citrus.Object
constructor: () ->
+ return
@db = Titanium.Database.open("citrus")
# Temp reset
if true
names = []
- tables = @db.execute("SELECT name from sqlite_master WHERE type='table';")
+ # tables = @db.execute("SELECT name from sqlite_master WHERE type='table';")
while tables.isValidRow()
names.push tables.fieldByName('name')
tables.next()
tables.close()
- for name in names
- result = @db.execute("DROP TABLE IF EXISTS "+name)
+ #\for name in names
+ # result = @db.execute("DROP TABLE IF EXISTS "+name)
- @db.execute("CREATE TABLE splashes IF NOT EXISTS (id INTEGER PRIMARY KEY, code STRING NOT NULL, name STRING NOT NULL, data TEXT NOT NULL)")
+ # @db.execute("CREATE TABLE splashes IF NOT EXISTS (id INTEGER PRIMARY KEY, code STRING NOT NULL, name STRING NOT NULL, data TEXT NOT NULL)")
addSplash: (data) ->
+ return
if data.persistable?
save = data.persistable()
else
10 Resources/app/models/splash_store.js
View
@@ -10,26 +10,22 @@
};
SplashStore = function() {
function SplashStore() {
- var name, names, result, tables, _i, _len;
+ var names;
+ return;
this.db = Titanium.Database.open("citrus");
if (true) {
names = [];
- tables = this.db.execute("SELECT name from sqlite_master WHERE type='table';");
while (tables.isValidRow()) {
names.push(tables.fieldByName('name'));
tables.next();
}
tables.close();
- for (_i = 0, _len = names.length; _i < _len; _i++) {
- name = names[_i];
- result = this.db.execute("DROP TABLE IF EXISTS " + name);
- }
- this.db.execute("CREATE TABLE splashes IF NOT EXISTS (id INTEGER PRIMARY KEY, code STRING NOT NULL, name STRING NOT NULL, data TEXT NOT NULL)");
}
}
__extends(SplashStore, Citrus.Object);
SplashStore.prototype.addSplash = function(data) {
var existing, save;
+ return;
if (data.persistable != null) {
save = data.persistable();
} else {
BIN  Resources/images/account_icons/go.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.