Permalink
Browse files

- v1.0.0

- cleaned up App menus in many scenes
- Added Accounts… App menu option
- added check in post scene to change image uploader pref if still set to Tweetphoto
- updated About info
- removed Status Text from displayed error info
- 'yfrog' is now image uploader default
  • Loading branch information...
1 parent f93798b commit d68eb1b208483a7f317d25a15d79f52b771792cc @funkatron funkatron committed Dec 18, 2009
View
@@ -1,6 +1,3 @@
-PLEASE NOTE: THIS APPLICATION CONTAINS NO PALM-PROVIDED CODE, INCLUDING
-ANY CODE CONTAINED IN THE WEBOS SDK
-
Spaz for webOS is a full rewrite of the Spaz codebase. It's based on
SpazCore, a component library for web runtime applications.
@@ -8,7 +8,15 @@ function AboutAssistant() {
AboutAssistant.prototype.setup = function() {
this.scroller = this.controller.getSceneScroller();
- this.initAppMenu();
+
+ this.initAppMenu({ 'items':[
+ Mojo.Menu.editItem,
+ { label: $L('New Search Card'), command: 'new-search-card' },
+ { label: $L('Accounts...'), command:'accounts' },
+ { label: $L('Preferences...'), command:Mojo.Menu.prefsCmd },
+ { label: $L('Help...'), command:Mojo.Menu.helpCmd }
+ ]});
+
this.setupCommonMenus({
viewMenuItems: [
{
@@ -5,6 +5,7 @@ var loggedin_appmenu_items = [
Mojo.Menu.editItem,
{ label: $L('Update Location...'), command: 'update-location' },
{ label: $L('New Search Card'), command: 'new-search-card' },
+ { label: $L('Accounts...'), command:'accounts' },
{ label: $L('Preferences...'), command:Mojo.Menu.prefsCmd },
{ label: $L('About Spaz'), command: 'appmenu-about' },
{ label: $L('Help...'), command:Mojo.Menu.helpCmd }
@@ -7,7 +7,15 @@ function HelpAssistant() {
}
HelpAssistant.prototype.setup = function(){
-
+
+ this.initAppMenu({ 'items':[
+ Mojo.Menu.editItem,
+ { label: $L('New Search Card'), command: 'new-search-card' },
+ { label: $L('Accounts...'), command:'accounts' },
+ { label: $L('Preferences...'), command:Mojo.Menu.prefsCmd },
+ { label: $L('About Spaz'), command: 'appmenu-about' },
+ ]});
+
this.setupCommonMenus({
viewMenuItems: [
{
@@ -18,6 +18,8 @@ PostAssistant.prototype.setup = function() {
this.initTwit();
+ this.initAppMenu({ 'items':loggedin_appmenu_items });
+
this.postMode = 'normal'; // 'normal' or 'email'
this.postTextField = $('post-textfield');
@@ -181,8 +183,21 @@ PostAssistant.prototype.setup = function() {
};
PostAssistant.prototype.activate = function(args) {
-
+
var thisA = this;
+
+ /*
+ Tweetphoto is no longer valid, so we need to change that
+ */
+ if (this.imageUploaderModel['image-uploader'] == 'tweetphoto') {
+ this.imageUploaderModel['image-uploader'] = 'yfrog';
+ sc.app.prefs.set('image-uploader', 'yfrog');
+ this.showAlert(
+ $L('Tweetphoto is no longer supported by Spaz, so I\'ve changed your image hosting preference to yfrog. You can pick a different service under the App menu in Preferences.'),
+ $L('Change in image hosting service')
+ );
+ }
+
if (this.args) {
@@ -13,7 +13,13 @@ PreferencesAssistant.prototype.setup = function() {
this.scroller = this.controller.getSceneScroller();
- this.initAppMenu();
+ this.initAppMenu({ 'items':[
+ Mojo.Menu.editItem,
+ { label: $L('New Search Card'), command: 'new-search-card' },
+ { label: $L('Accounts...'), command:'accounts' },
+ { label: $L('About Spaz'), command: 'appmenu-about' },
+ { label: $L('Help...'), command:Mojo.Menu.helpCmd }
+ ]});
this.setupCommonMenus({
viewMenuItems: [
@@ -78,7 +78,7 @@ StageAssistant.prototype.handleCommand = function(event){
/*
Navigation
*/
- case 'home':
+ case 'accounts':
Spaz.findAndSwapScene("startlogin", active_scene);
break;
case 'my-timeline':
@@ -7,11 +7,11 @@
<div id="about-content" class="palm-text-wrapper">
- You are currently running a preview release of Spaz for webOS, an <strong><a href="http://www.opensource.org/">open source</a></strong> microblogging client for Twitter, Idenit.ca, and StatusNet hosts.<br><br>
+ You're running <a href="http://getspaz.com">Spaz for webOS</a>, an <strong><a href="http://www.opensource.org/">open source</a></strong> microblogging client for Twitter, Idenit.ca, and StatusNet hosts.<br><br>
If you find bugs or have ideas for features, <a href="http://funkatron.com/spaz-webos/issues">let us know</a>!<br><br>
- Our plan is to charge $2 for the 1.0 version. This money will be used to cover hosting costs and compensate our contributors when possible.<br><br>
+ Spaz is created by volunteers. Any revenue generated by Spaz is used to cover hosting costs and compensate our contributors when possible.<br><br>
Spaz is <strong><a href="http://www.opensource.org/">open source software</a></strong> with a New BSD-style license. We need volunteers to participate in the development process. If you're interested in helping, please join the <a href="http://groups.google.com/group/spaz-mobile">Spaz Mobile Google Group</a>.<br><br>
View
@@ -350,7 +350,7 @@ sc.app.tpl.addTemplateMethod('error_info_text', function(d) {
* twitter_msg':
*/
- dump(d);
+ sch.debug(d);
var html = '';
@@ -359,8 +359,10 @@ sc.app.tpl.addTemplateMethod('error_info_text', function(d) {
html += $L('Twitter error')+ ':'+d.twitter_msg+"\n"
+ $L('Twitter request')+':'+d.twitter_request+"\n";
}
+ // html += $L('Status code')+':'+d.status+"\n"
+ // + $L('Status text')+':'+d.statusText+"\n"
+ // + $L('URL') +':'+d.url+"\n";
html += $L('Status code')+':'+d.status+"\n"
- + $L('Status text')+':'+d.statusText+"\n"
+ $L('URL') +':'+d.url+"\n";
return html;
View
@@ -1,6 +1,6 @@
{
"title": "Spaz",
- "version": "0.5.9999",
+ "version": "1.0.0",
"type": "web",
"main": "index.html",
"id": "com.funkatron.app.spaz",
View
@@ -34,7 +34,7 @@ var default_preferences = {
'url-shortener': 'bitly',
- 'image-uploader': 'tweetphoto',
+ 'image-uploader': 'yfrog',
'services-twitpic-sharepassword': false,
View
@@ -1,4 +1,4 @@
-/*********** Built 2009-12-07 13:38:56 EST ***********/
+/*********** Built 2009-12-16 11:05:23 EST ***********/
/*jslint
browser: true,
nomen: false,
@@ -4280,13 +4280,49 @@ sc.helpers.autolink = function(str, type, extra_code, maxlen) {
type = 'both';
}
+ var re_nohttpurl = /((^|\s)(www\.)?([a-zA-Z_\-]+\.)(com|net|org)($|\s))/gi;
+
var re_noemail = /(^|\s|\(|:)((http(s?):\/\/)|(www\.))(\w+[^\s\)<]+)/gi;
var re_nourl = /(^|\s|\()([a-zA-Z0-9_\.\-\+]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)([^\s\)<]+)/gi;
var x, ms, period = '';
if (type !== 'email')
- {
+ {
+ while ((ms = re_nohttpurl.exec(str))) { // look for URLs without a preceding "http://"
+ // if ( /\.$/.test(ms[4]) ) {
+ // period = '.';
+ // ms[5] = ms[5].slice(0, -1);
+ // }
+
+ /*
+ sometimes we can end up with a null instead of a blank string,
+ so we need to force the issue in javascript.
+ */
+ for (x=0; x<ms.length; x++) {
+ if (!ms[x]) {
+ ms[x] = '';
+ }
+ }
+
+ if (extra_code) {
+ extra_code = ' '+extra_code;
+ } else {
+ extra_code = '';
+ }
+
+ var desc = ms[3]+ms[4]+ms[5];
+
+ if (maxlen && maxlen > 0 && desc.length > maxlen) {
+ desc = desc.substr(0, maxlen)+'...';
+ }
+
+ var newstr = ms[2]+'<a href="http://'+ms[3]+ms[4]+ms[5]+'"'+extra_code+'>'+desc+'</a>'+ms[6];
+ sch.error(newstr);
+ str = str.replace(ms[0], newstr);
+ }
+
+
while ((ms = re_noemail.exec(str))) {
if ( /\.$/.test(ms[6]) ) {
@@ -5261,7 +5297,7 @@ SpazImageURL.prototype.initAPIs = function() {
'url_regex' : /http:\/\/(?:pikchur\.com|pk\.gd)\/([a-zA-Z0-9]+)/gi,
'getThumbnailUrl' : function(id) {
// http://img.pikchur.com/pic_GPT_t.jpg
- var url = 'http://img.pikchur.com/pic_'+id+'_m.jpg';
+ var url = 'http://img.pikchur.com/pic_'+id+'_s.jpg';
return url;
},
'getImageUrl' : function(id) {
@@ -5635,6 +5671,32 @@ SpazFileUploader.prototype.getAPIs = function() {
return returnobj;
}
},
+ 'posterous' : {
+ 'upload_url' : 'http://posterous.com/api/upload',
+ 'post_url' : 'http://posterous.com/api/uploadAndPost',
+ 'processResult': function(event, apiobj) {
+ var loader = event.target;
+
+ sch.debug('PROCESSING: EVENT');
+ sch.debug(event);
+
+ var parser=new DOMParser();
+ var xmldoc = parser.parseFromString(event.data,"text/xml");
+
+ var rspAttr = xmldoc.getElementsByTagName("rsp")[0].attributes;
+ if (rspAttr.getNamedItem("stat").nodeValue === 'ok')
+ {
+ returnobj['mediaurl'] = jQuery(xmldoc).find('mediaurl').text();
+ }
+ else
+ {
+ returnobj['errAttributes'] = xmldoc.getElementsByTagName("err")[0].attributes;
+ returnobj['errMsg'] = errAttributes.getNamedItem("msg").nodeValue;
+ }
+ sch.debug(returnobj);
+ return returnobj;
+ }
+ },
'twitgoo' : {
'upload_url' : 'http://twitgoo.com/api/upload',
'post_url' : 'http://twitgoo.com/api/uploadAndPost',
@@ -6985,8 +7047,9 @@ var sc, jQuery;
* Constants to refer to services
*/
var SPAZCORE_SHORTURL_SERVICE_SHORTIE = 'short.ie';
-var SPAZCORE_SHORTURL_SERVICE_ISGD = 'is.gd';
-var SPAZCORE_SHORTURL_SERVICE_BITLY = 'bit.ly';
+var SPAZCORE_SHORTURL_SERVICE_ISGD = 'is.gd';
+var SPAZCORE_SHORTURL_SERVICE_BITLY = 'bit.ly';
+var SPAZCORE_SHORTURL_SERVICE_JMP = 'j.mp';
var SPAZCORE_EXPANDABLE_DOMAINS = [
'ad.vu',
@@ -7068,6 +7131,38 @@ SpazShortURL.prototype.getAPIObj = function(service) {
};
+ apis[SPAZCORE_SHORTURL_SERVICE_JMP] = {
+ 'url' : 'http://j.mp/api',
+ 'getData' : function(longurl, opts){
+
+ /*
+ use the api if we're doing multiple URLs
+ */
+ if (sc.helpers.isArray(longurl)) {
+ apis[SPAZCORE_SHORTURL_SERVICE_JMP].processing_multiple = true;
+ apis[SPAZCORE_SHORTURL_SERVICE_JMP].url = 'http://api.j.mp/shorten';
+ opts.longUrl = longurl;
+ return opts;
+ } else {
+ apis[SPAZCORE_SHORTURL_SERVICE_JMP].processing_multiple = false;
+ return { 'url':longurl };
+ }
+ },
+ 'processResult' : function(data) {
+ if (apis[SPAZCORE_SHORTURL_SERVICE_JMP].processing_multiple === true) {
+ var result = sc.helpers.deJSON(data);
+ var rs = {};
+ for (var i in result.results) {
+ rs[i] = result.results[i].shortUrl;
+ }
+ return rs;
+ } else {
+ return data;
+ }
+ }
+
+ };
+
apis[SPAZCORE_SHORTURL_SERVICE_SHORTIE] = {
'url' : 'http://short.ie/api?',
'getData' : function(longurl, opts){
@@ -7482,6 +7577,16 @@ SpazTimeline.prototype._init = function(opts) {
};
/**
+ * the timeline
+ */
+SpazTimeline.prototype.last_id = -1;
+
+/**
+ * an array of data items that are represented in the timeline
+ */
+SpazTimeline.prototype.model = [];
+
+/**
* call this after initialization
*/
SpazTimeline.prototype.start = function() {
@@ -9092,9 +9197,6 @@ SpazTwit.prototype._getTimeline = function(opts) {
'success_callback':null,
'failure_callback':null
}, opts);
-
- sch.debug(opts.data);
-
/*
for closure references
@@ -9181,6 +9283,7 @@ SpazTwit.prototype._getTimeline = function(opts) {
opts.process_callback.call(stwit, data, opts, opts.processing_opts);
} else {
if (opts.success_callback) {
+ sch.error('CALLING SUCCESS CALLBACK');
opts.success_callback(data);
}
// jQuery().trigger(opts.success_event_type, [data]);
@@ -10198,7 +10301,7 @@ SpazTwit.prototype.removeSavedSearch = function(search_id) {
/**
* retrieves the list of lists
*/
-SpazTwit.prototype.getLists = function(user) {
+SpazTwit.prototype.getLists = function(user, onSuccess, onFailure) {
if (!user && !this.username) {
return false;
} else if (!user) {
@@ -10215,6 +10318,8 @@ SpazTwit.prototype.getLists = function(user) {
'password':this.password,
'success_event_type':'get_lists_succeeded',
'failure_event_type':'get_lists_failed',
+ 'success_callback':onSuccess,
+ 'failure_callback':onFailure,
'method':'GET'
};
@@ -10314,8 +10419,11 @@ SpazTwit.prototype.getListInfo = function(list, user) {
/**
* retrieves a given list timeline
* @param {string} list
+ * @param {string} user the user who owns this list
+ * @param {function} [onSuccess] function to call on success
+ * @param {function} [onFailure] function to call on failure
*/
-SpazTwit.prototype.getListTimeline = function(list, user) {
+SpazTwit.prototype.getListTimeline = function(list, user, onSuccess, onFailure) {
if (!user && !this.username) {
sch.error('must pass a username or have one set to get list');
return false;
@@ -10334,6 +10442,8 @@ SpazTwit.prototype.getListTimeline = function(list, user) {
'password':this.password,
'success_event_type':'get_list_timeline_succeeded',
'failure_event_type':'get_list_timeline_failed',
+ 'success_callback':onSuccess,
+ 'failure_callback':onFailure,
'method':'GET',
'process_callback':this._processListTimeline,
'processing_opts': {
View
@@ -1,6 +1,6 @@
// Required
_APP_Name = 'Spaz';
-_APP_VersionNumber = '0.5.9999';
+_APP_VersionNumber = '1.0.0';
_APP_PublisherName = 'Funkatron.com';
_APP_Copyright = '&copy; Copyright 2009 Funkatron Productions.';

0 comments on commit d68eb1b

Please sign in to comment.