Skip to content

Commit

Permalink
removed usage of Redux
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierlacot committed Mar 24, 2011
1 parent f9dbd6e commit 563eef3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
7 changes: 3 additions & 4 deletions Resources/app.js
@@ -1,9 +1,8 @@
Ti.include('redux.js');
includeGlobal('js/lib/vendor/joli.js/joli.js');
includeGlobal('js/lib/model/models.js');
Ti.include('js/lib/vendor/joli.js/joli.js');
Ti.include('js/lib/model/models.js');
Ti.include('js/lib/initialize.js');
Ti.include('js/lib/install.js');
includeGlobal('js/lib/xavcc.js');
Ti.include('js/lib/xavcc.js');

if (Titanium.Platform.name != 'android') {
Titanium.UI.iPhone.statusBarHidden = false;
Expand Down
10 changes: 4 additions & 6 deletions Resources/js/lib/xavcc.js
Expand Up @@ -18,15 +18,15 @@ var xavcc = (function() {
.execute();

if (result.length != 0) {
log('found in history');
Titanium.API.log('debug', 'found in history');
Ti.App.fireEvent('xavcc.decode.result', { result: result[0].longurl });
return;
}

var escapedUrl = api.encodeUrl(alias);
var url = Titanium.App.Properties.getString('api_url', 'http://api.xav.cc/');
url = url + 'simple/decode?alias=' + escapedUrl;
log('decode using: ' + url);
Titanium.API.log('debug', 'decode using: ' + url);

// create http client
var client = api.createClient();
Expand Down Expand Up @@ -64,7 +64,7 @@ var xavcc = (function() {
var result = query.execute();

if (result.length != 0) {
log('found in history');
Titanium.API.log('debug', 'found in history');
Ti.App.fireEvent('xavcc.encode.result', { result: result[0].shorturl });
return;
}
Expand All @@ -73,7 +73,7 @@ var xavcc = (function() {
var escapedUrl = api.encodeUrl(longurl);
var url = Titanium.App.Properties.getString('api_url', 'http://api.xav.cc/');
url = url + 'simple/encode?url=' + escapedUrl;
log('encode using: ' + url);
Titanium.API.log('debug', 'encode using: ' + url);

if (alias) {
url = url + '&alias=' + api.encodeUrl(alias);
Expand Down Expand Up @@ -166,9 +166,7 @@ var xavcc = (function() {

api.showResponse = function(label, response) {
var length = Math.max(8, Math.min(30, response.length));
log('length: ' + length);
var size = Math.ceil(15 + (30 - length) * (13 / 10));
log('size: ' + size);
label.font = {'fontSize':size};
label.text = response;
};
Expand Down
5 changes: 4 additions & 1 deletion Resources/js/views/decode.js
@@ -1,4 +1,7 @@
Ti.include('../../redux.js');
Ti.include('../lib/vendor/joli.js/joli.js');
Ti.include('../lib/model/models.js');
Ti.include('../lib/xavcc.js');

var win = Titanium.UI.currentWindow;
win.backgroundImage = '../../images/background.png';

Expand Down
5 changes: 4 additions & 1 deletion Resources/js/views/encode.js
@@ -1,4 +1,7 @@
Ti.include('../../redux.js');
Ti.include('../lib/vendor/joli.js/joli.js');
Ti.include('../lib/model/models.js');
Ti.include('../lib/xavcc.js');

var win = Titanium.UI.currentWindow;
win.backgroundImage = '../../images/background.png';

Expand Down
5 changes: 4 additions & 1 deletion Resources/js/views/history.details.js
@@ -1,4 +1,7 @@
Ti.include('../../redux.js');
Ti.include('../lib/vendor/joli.js/joli.js');
Ti.include('../lib/model/models.js');
Ti.include('../lib/xavcc.js');

var win = Titanium.UI.currentWindow;

// load url from db
Expand Down
7 changes: 5 additions & 2 deletions Resources/js/views/history.js
@@ -1,10 +1,13 @@
Ti.include('../../redux.js');
Ti.include('../lib/vendor/joli.js/joli.js');
Ti.include('../lib/model/models.js');
Ti.include('../lib/xavcc.js');

var win = Titanium.UI.currentWindow;
win.backgroundImage = '../../images/background.png';

// add the tableview
var tableview = Titanium.UI.createTableView({
editable:true, moveable:true
editable:true, moveable:true, backgroundColor: '#fff'
});

// display short url screen
Expand Down
5 changes: 4 additions & 1 deletion Resources/js/views/settings.js
@@ -1,4 +1,7 @@
Ti.include('../../redux.js');
Ti.include('../lib/vendor/joli.js/joli.js');
Ti.include('../lib/model/models.js');
Ti.include('../lib/xavcc.js');

var win = Titanium.UI.currentWindow;
win.backgroundImage = '../../images/background.png';

Expand Down

0 comments on commit 563eef3

Please sign in to comment.