Skip to content

Commit

Permalink
- tossed spazcore submodule and now track a single combined file spaz…
Browse files Browse the repository at this point in the history
…core-webos.js
  • Loading branch information
funkatron committed Aug 6, 2009
1 parent 0657ce4 commit dd6ffc8
Show file tree
Hide file tree
Showing 48 changed files with 7,819 additions and 174 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
@@ -1,3 +1,3 @@
[submodule "spazcore"]
path = spazcore
url = git://github.com/funkatron/spaz-webos.git
#[submodule "spazcore"]
# path = spazcore
# url = git://github.com/funkatron/spaz-webos.git
200 changes: 98 additions & 102 deletions app/assistants/post-assistant.js
Expand Up @@ -14,11 +14,13 @@ function PostAssistant(args) {

PostAssistant.prototype.setup = function() {

var thisA = this;

this.initTwit();

this.postMode = 'normal'; // 'normal' or 'email'


this.postTextField = $('post-textfield');

this.Users = new Users(sc.app.prefs);

Expand Down Expand Up @@ -111,24 +113,67 @@ PostAssistant.prototype.setup = function() {
jQuery('#post-buttons-image').hide();
jQuery('#post-panel-attachment').hide();


};

PostAssistant.prototype.activate = function(args) {

dump('Activation args');
dump(args);

dump('this.model');
dump(this.model);


var thisA = this;

/*
Bind listeners for UI stuff
*/
Mojo.Event.listen($('post-send-button'), Mojo.Event.tap, this.sendPost.bindAsEventListener(this));
Mojo.Event.listen($('attach-image-button'), Mojo.Event.tap, this.attachImage.bindAsEventListener(this));
Mojo.Event.listen($('post-shorten-text-button'), Mojo.Event.tap, this.shortenText.bindAsEventListener(this));
Mojo.Event.listen($('post-shorten-urls-button'), Mojo.Event.tap, this.shortenURLs.bindAsEventListener(this));
this.listenForEnter('post-textfield', function() {
this.controller.get('post-send-button').mojo.activate();
this.sendPost();
});
Mojo.Event.listen($('image-uploader'), Mojo.Event.propertyChange, this.changeImageUploader.bindAsEventListener(this));
Mojo.Event.listen($('image-uploader-email'), Mojo.Event.propertyChange, this.setImageUploaderEmail.bindAsEventListener(this));



/*
if update succeeds
*/
jQuery().bind('update_succeeded', { thisAssistant:this }, function(e, data) {
e.data.thisAssistant.renderSuccessfulPost(e, data);
});

/*
if update fails
*/
jQuery().bind('update_failed', { thisAssistant:this }, function(e, error_obj) {
e.data.thisAssistant.reportFailedPost(error_obj);
});


// jQuery('#post-textfield').bind('keyup', function(e) {
// thisA._updateCharCount();
// });
// jQuery('#post-textfield').bind('blur', function(e) {
// thisA._updateCharCount();
// });
// jQuery('#post-textfield').bind('focus', function(e) {
// thisA._updateCharCount();
// });

Mojo.Event.listen($('post-textfield'), Mojo.Event.propertyChange, this._updateCharCount.bindAsEventListener(this));

this.postTextField = $('post-textfield');

jQuery('#post-panel-irt-dismiss').bind(Mojo.Event.tap, function(e) {
thisA.clearPostIRT();
});



};

PostAssistant.prototype.activate = function(args) {

var thisA = this;

if (this.args) {

if (this.args.text) { this.postTextField.mojo.setText(this.args.text); }
Expand All @@ -143,85 +188,10 @@ PostAssistant.prototype.activate = function(args) {

}



function activateBind() {
Mojo.Event.listen($('post-send-button'), Mojo.Event.tap, this.sendPost.bindAsEventListener(this));
Mojo.Event.listen($('attach-image-button'), Mojo.Event.tap, this.attachImage.bindAsEventListener(this));
Mojo.Event.listen($('post-shorten-text-button'), Mojo.Event.tap, this.shortenText.bindAsEventListener(this));
Mojo.Event.listen($('post-shorten-urls-button'), Mojo.Event.tap, this.shortenURLs.bindAsEventListener(this));
this.listenForEnter('post-textfield', function() {
this.controller.get('post-send-button').mojo.activate();
this.sendPost();
});
Mojo.Event.listen($('image-uploader'), Mojo.Event.propertyChange, this.changeImageUploader.bindAsEventListener(this));
Mojo.Event.listen($('image-uploader-email'), Mojo.Event.propertyChange, this.setImageUploaderEmail.bindAsEventListener(this));



/*
if update succeeds
*/
jQuery().bind('update_succeeded', { thisAssistant:this }, function(e, data) {
e.data.thisAssistant.renderSuccessfulPost(e, data);
});

/*
if update fails
*/
jQuery().bind('update_failed', { thisAssistant:this }, function(e, error_obj) {
e.data.thisAssistant.reportFailedPost(error_obj);
});


jQuery('#post-textfield').bind('keyup', function(e) {
thisA._updateCharCount();
});
jQuery('#post-textfield').bind('keydown', function(e) {
thisA._updateCharCount();
});
jQuery('#post-textfield').bind('blur', function(e) {
thisA._updateCharCount();
});
jQuery('#post-textfield').bind('focus', function(e) {
thisA._updateCharCount();
});

jQuery('#post-panel-irt-dismiss').bind(Mojo.Event.tap, function(e) {
thisA.clearPostIRT();
});


jQuery('#post-image-lookup-email').bind(Mojo.Event.tap, function(e) {
var api_label = thisA.imageUploaderModel['image-uploader'];
var help_text = $L(thisA.spm.apis[api_label].help_text);
var email_info_url = $L(thisA.spm.apis[api_label].email_info_url);

thisA.showAlert(
$L(help_text),
$('Look-Up Posting Email Address'),
function(choice) {
if (choice === 'Open Browser') {
thisA.openInBrowser(email_info_url);
}
},
[{label:$L('Open')+' '+api_label, value:"Open Browser", type:'affirmative'}]
);
});

jQuery('#post-image-choose').bind(Mojo.Event.tap, function(e) {
thisA.chooseImage();
});
}




if (this.returningFromFilePicker === true) {
this.onReturnFromFilePicker();
this.returningFromFilePicker = false;
} else {
activateBind.call(this);
}


Expand All @@ -235,6 +205,12 @@ PostAssistant.prototype.activate = function(args) {


PostAssistant.prototype.deactivate = function(event) {



};

PostAssistant.prototype.cleanup = function(event) {
Mojo.Event.stopListening($('post-send-button'), Mojo.Event.tap, this.sendPost);
Mojo.Event.stopListening($('attach-image-button'), Mojo.Event.tap, this.attachImage);
Mojo.Event.stopListening($('post-shorten-text-button'), Mojo.Event.tap, this.shortenText);
Expand All @@ -245,24 +221,14 @@ PostAssistant.prototype.deactivate = function(event) {

this.stopListeningForEnter('post-textfield');

jQuery('#post-textfield').unbind('keyup');
jQuery('#post-textfield').unbind('keydown');
jQuery('#post-textfield').unbind('blur');
jQuery('#post-textfield').unbind('focus');
Mojo.Event.stopListening($('post-textfield'), Mojo.Event.propertyChange, this._updateCharCount.bindAsEventListener(this));

jQuery('#post-panel-irt-dismiss').unbind(Mojo.Event.tap);
jQuery('#post-image-lookup-email').unbind(Mojo.Event.tap);
jQuery('#post-image-choose').unbind(Mojo.Event.tap);

jQuery().unbind('update_succeeded');
jQuery().unbind('update_failed');


};

PostAssistant.prototype.cleanup = function(event) {
/* this function should do any cleanup needed before the scene is destroyed as
a result of being popped off the scene stack */
};


Expand All @@ -272,9 +238,10 @@ PostAssistant.prototype.cleanup = function(event) {
PostAssistant.prototype._updateCharCount = function() {
var thisA = this;

if (thisA._updateCharCountTimeout) {
clearTimeout(thisA._updateCharCountTimeout);
}
_updateCharCountNow();
// if (thisA._updateCharCountTimeout) {
// clearTimeout(thisA._updateCharCountTimeout);
// }

function _updateCharCountNow() {
var numchars = thisA.postTextFieldModel.value.length;
Expand All @@ -295,7 +262,7 @@ PostAssistant.prototype._updateCharCount = function() {
}
}

this._updateCharCountTimeout = setTimeout(_updateCharCountNow, 250);
// this._updateCharCountTimeout = setTimeout(_updateCharCountNow, 250);


};
Expand Down Expand Up @@ -498,20 +465,49 @@ PostAssistant.prototype.sendPost = function(event) {
*/
PostAssistant.prototype.attachImage = function() {

var thisA = this;

jQuery('#post-buttons-standard').slideUp('200', function() {
jQuery('#post-buttons-image').slideDown('200');
});

this.loadImageUploaderEmail();

jQuery('#post-image-lookup-email').bind(Mojo.Event.tap, function(e) {
var api_label = thisA.imageUploaderModel['image-uploader'];
var help_text = $L(thisA.spm.apis[api_label].help_text);
var email_info_url = $L(thisA.spm.apis[api_label].email_info_url);

thisA.showAlert(
$L(help_text),
$('Look-Up Posting Email Address'),
function(choice) {
if (choice === 'Open Browser') {
thisA.openInBrowser(email_info_url);
}
},
[{label:$L('Open')+' '+api_label, value:"Open Browser", type:'affirmative'}]
);
});

jQuery('#post-image-choose').bind(Mojo.Event.tap, function(e) {
thisA.chooseImage();
});
jQuery('#post-image-cancel').one('click', this.cancelAttachImage);


};

/**
* Go back to the "normal" posting scene controls
*/
PostAssistant.prototype.cancelAttachImage = function() {

jQuery('#post-image-lookup-email').unbind(Mojo.Event.tap);

jQuery('#post-image-choose').unbind(Mojo.Event.tap);


if ( jQuery('#post-buttons-image').is(':visible') ) {
jQuery('#post-buttons-image').slideUp('200', function() {
jQuery('#post-buttons-standard').slideDown('200');
Expand Down
2 changes: 1 addition & 1 deletion appinfo.json
@@ -1,6 +1,6 @@
{
"title": "Spaz",
"version": "0.5.3",
"version": "0.5.4",
"type": "web",
"main": "index.html",
"id": "com.funkatron.app.spaz",
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added images/dreadnaught/spaz-view-menu-button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified images/theme/spaz-view-menu-button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/whiteknight/command-menu-gradient.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/whiteknight/entry-gradient-bg_short.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/whiteknight/page-bg-darkgreen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/whiteknight/page-bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/whiteknight/palm-divider-arrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/whiteknight/palm-divider-collapse-left.png
Binary file added images/whiteknight/palm-group.png
Binary file added images/whiteknight/palm-page-header.png
Binary file added images/whiteknight/spaz-button-bg-active.png
Binary file added images/whiteknight/spaz-button-bg.png
Binary file added images/whiteknight/spaz-button-large-bg.png
Binary file added images/whiteknight/spaz-button-reveal-active.png
Binary file added images/whiteknight/spaz-button-reveal.png
Binary file added images/whiteknight/spaz-roundeditem-darker-bg.png
Binary file added images/whiteknight/spaz-view-menu-button.png
Binary file added images/whiteknight/spaz-viewmenu-button-bg.png
Binary file added images/whiteknight/spaz-viewmenu-label-bg.png
Binary file added images/whiteknight/spaz-viewmenu-separator.png
Binary file added images/whiteknight/tiny-lock-icon.png
35 changes: 3 additions & 32 deletions index.html
Expand Up @@ -21,41 +21,12 @@
jQuery.noConflict();
</script>


<!--
We don't use the usual JSON2.js parser here because
of problems with non-ascii characters on webOS
-->
<script src="spazcore/vendors/webtoolkit.base64.js" type="text/javascript" charset="utf-8"></script>


<!-- Load SC first -->
<script src="spazcore/libs/spazcore.js" type="text/javascript" charset="utf-8"></script>

<!-- Load SC helpers -->
<script src="spazcore/helpers/datetime.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/helpers/event.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/helpers/javascript.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/helpers/json.js" type="text/javascript" charset="utf-8"></script>
<!-- // <script src="spazcore/helpers/location.js" type="text/javascript" charset="utf-8"></script> -->
<script src="spazcore/helpers/string.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/helpers/sys.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/helpers/view.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/helpers/xml.js" type="text/javascript" charset="utf-8"></script>

<!-- SpazCore -->
<script src="spazcore/spazcore-full.js" type="text/javascript" charset="utf-8"></script>
<!-- SC Platform files -->
<script src="spazcore/platforms/webOS/helpers/location.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/platforms/webOS/helpers/sys.js" type="text/javascript" charset="utf-8"></script>

<!-- Load SC Twitter library -->
<script src="spazcore/libs/spaztwit.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/libs/spazprefs.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/libs/spaztemplate.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/libs/spazshorttext.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/libs/spazshorturl.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/libs/spazphotomailer.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/libs/spaztimeline.js" type="text/javascript" charset="utf-8"></script>


<!-- Template methods for SpazTemplates -->
<script src="app/views/templates.js" type="text/javascript" charset="utf-8"></script>
Expand Down Expand Up @@ -93,7 +64,7 @@


<!-- application stylesheet should come in after the one loaded by the framework -->
<link href="stylesheets/Dreadnaught.css" media="screen" rel="stylesheet" type="text/css" />
<link href="stylesheets/Dreadnaught.css" media="screen" title="apptheme" rel="stylesheet" type="text/css" />

<script type="text/javascript" charset="utf-8">
/*
Expand Down

0 comments on commit dd6ffc8

Please sign in to comment.