Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions depends.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enyo.depends(
"vendors/jquery.min.js",
"vendors/jquery.embedly.js",
"vendors/showdown.js",
"vendors/oauth-urlencode.js",
"vendors/spazcore.js", // includes underscore, underscore.string
"vendors/spazcore-enyo-webos-network.js",
"vendors/ekl/List/",
Expand Down
Binary file added source/images/icon-unified.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 44 additions & 4 deletions source/javascript/Column.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
enyo.kind({
name: "Spaz.Column",
kind: enyo.VFlexBox,
width: "322px",
//width: "322px",
style: "margin: 3px;",
className: "Column",
events: {
Expand Down Expand Up @@ -88,7 +88,9 @@ enyo.kind({
else {
enyo.asyncMethod(this, this.countUnread);
}

},
destroy: function(){
this.inherited(arguments);
},
checkArrows: function(){
if(this.name === "Column0"){
Expand Down Expand Up @@ -162,6 +164,7 @@ enyo.kind({

function loadStarted() {
if(accountsLoaded === 0){
self.currentTopId = (self.entries && (self.entries.length > self.$.list.$.scroller.top)) ? self.entries[self.$.list.$.scroller.top].service_id : 0;
self.doLoadStarted();
self.$.refresh.addClass("spinning");
self.$.refresh.setShowing(true);
Expand All @@ -178,8 +181,6 @@ enyo.kind({
dataLength = self.entries.length;
}
accountsLoaded++;


}
function loadFinished(data, opts, account_id) {
accountsLoaded--;
Expand Down Expand Up @@ -216,6 +217,19 @@ enyo.kind({
self.$.list.punt();

//self.$.list.refresh();
} else if (dataLength > 0) {
setTimeout(function() {
var sum = 0;
var cnt = 0;
for (var i=0; i<self.entries.length; i++) {
if (!isNaN(self.$.list.$.scroller.heights[i])) {
sum += self.$.list.$.scroller.heights[i];
cnt++;
}
}
self.$.list.$.scroller.$.scroll.y -= (sum / cnt) * Math.max(0, self.entries.length - dataLength);
self.$.list.$.scroller.scroll();
}, 500);
}
}
}
Expand Down Expand Up @@ -251,6 +265,32 @@ enyo.kind({
self.twit.setCredentials(auth);

switch (self.info.type) {
case SPAZ_COLUMN_UNIFIED:
loadStarted();
self.twit.getHomeTimeline(since_id, 50, null, null,
function(data) {
//self.processData(data, opts);
loadFinished(data, opts, account_id);
},
loadFailed
);
loadStarted();
self.twit.getReplies(since_id, 50, null, null,
function(data) {
//self.processData(data, opts);
loadFinished(data, opts, account_id);
},
loadFailed
);
loadStarted();
self.twit.getDirectMessages(since_id, 50, null, null,
function(data) {
//self.processData(data, opts);
loadFinished(data, opts, account_id);
},
loadFailed
);
break;
case SPAZ_COLUMN_HOME:
loadStarted();
self.twit.getHomeTimeline(since_id, 50, null, null,
Expand Down
16 changes: 13 additions & 3 deletions source/javascript/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enyo.kind({

create: function(){
this.inherited(arguments);
this.optWidth = 322;

this.checkForUsers();

Expand Down Expand Up @@ -99,6 +100,14 @@ enyo.kind({

this.checkAccountChanges();

this.optWidth = Math.floor((window.innerWidth - 58) / this.columnData.length);
if (this.optWidth < 322) {
this.optWidth = 322;
}
if (this.optWidth > 644) {
this.optWidth = 644;
}

for (var i = 0; i < this.columnData.length; i++) {
if(!this.columnData[i].id){
this.columnData[i].id = _.uniqueId(new Date().getTime());
Expand All @@ -114,6 +123,7 @@ enyo.kind({
onMoveColumnLeft: "moveColumnLeft",
onMoveColumnRight: "moveColumnRight",
owner: this,
width: this.optWidth + "px",

onToolbarmousehold: "columnMousehold", onToolbarmouserelease: "columnMouserelease",
onToolbardragstart: "columnDragStart", onToolbardrag: "columnDrag", onToolbardragfinish: "columnDragFinish"
Expand Down Expand Up @@ -339,7 +349,7 @@ enyo.kind({
}
}
}));
inSender.applyStyle("width", "322px");
inSender.applyStyle("width", this.optWidth + "px");
//console.error("drug over", inSender.name);
}
},
Expand Down Expand Up @@ -374,7 +384,7 @@ enyo.kind({
this.isHolding = true;
this.activeColumn = inSender;

this.$["ColumnSpacer" + this.activeColumn.name.replace('Column', '')].applyStyle("width", "322px");
this.$["ColumnSpacer" + this.activeColumn.name.replace('Column', '')].applyStyle("width", this.optWidth + "px");

this.activeColumn.addClass("moving");
this.activeColumn.applyStyle("height", window.innerHeight - 12 + "px");
Expand Down Expand Up @@ -419,7 +429,7 @@ enyo.kind({
control.showHideEntries(false);
}
if(control.name.replace("ColumnSpacer", "") === this.activeColumn.name.replace('Column', '')){
control.applyStyle("width", "322px");
control.applyStyle("width", this.optWidth + "px");
setTimeout(function(){
control.addClass("columnSpacer");
}, 300);
Expand Down
6 changes: 5 additions & 1 deletion source/javascript/Entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ enyo.kind({
}

toMacroize += "<span class='small' height = '13px'>";
toMacroize += sch.getRelativeTime(this.entry.publish_date);
if (App.Prefs.get("entry-timestamps") == "absolute") {
toMacroize += sch.getAbsoluteTime(this.entry.publish_date);
} else {
toMacroize += sch.getRelativeTime(this.entry.publish_date);
}
if (this.entry._orig.source) {
toMacroize += " from <span class = 'link'>{$_orig.source}</span>";
}
Expand Down
8 changes: 8 additions & 0 deletions source/javascript/SettingsPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ enyo.kind({
"20px"
]}
]},
{kind: "Item", layoutKind: "HFlexLayout", components: [
{content: "Time Stamp"},
{kind: "Spacer"},
{kind: "ListSelector", value: "", preferenceProperty: "entry-timestamps", onChange: "setPreference", items: [
{caption: "Relative", value: "relative"},
{caption: "Absolute", value: "absolute"}
]}
]},
{kind: "Item", layoutKind: "HFlexLayout", components: [
{content: "Tap"},
{kind: "Spacer"},
Expand Down
1 change: 1 addition & 0 deletions source/javascript/config/default_preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var SPAZ_DEFAULT_PREFS = {
'entry-text-size': '13px',
'entry-tap': 'panel',
'entry-hold': 'popup',
'entry-timestamps': 'relative',

'post-rt-cursor-position': 'beginning', // 'beginning' or 'end'
'post-send-on-enter': true,
Expand Down
6 changes: 3 additions & 3 deletions source/javascript/resources/consts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions vendors/oauth-urlencode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* @license
* jsOAuth version 1.3.6
* Copyright (c) 2010, 2011 Rob Griffiths (http://bytespider.eu)
* jsOAuth is freely distributable under the terms of an MIT-style license.
*/

/**
* rfc3986 compatable encode of a string
*
* @param {String} string
*/
function oAuthUrlEncode(string) {
function hex(code) {
var hex = code.toString(16).toUpperCase();
if (hex.length < 2) {
hex = 0 + hex;
}
return '%' + hex;
}

if (!string) {
return '';
}

string = string + '';
var reserved_chars = /[ \r\n!*"'();:@&=+$,\/?%#\[\]<>{}|`^\\\u0080-\uffff]/,
str_len = string.length, i, string_arr = string.split(''), c;

for (i = 0; i < str_len; i++) {
if (c = string_arr[i].match(reserved_chars)) {
c = c[0].charCodeAt(0);

if (c < 128) {
string_arr[i] = hex(c);
} else if (c < 2048) {
string_arr[i] = hex(192+(c>>6)) + hex(128+(c&63));
} else if (c < 65536) {
string_arr[i] = hex(224+(c>>12)) + hex(128+((c>>6)&63)) + hex(128+(c&63));
} else if (c < 2097152) {
string_arr[i] = hex(240+(c>>18)) + hex(128+((c>>12)&63)) + hex(128+((c>>6)&63)) + hex(128+(c&63));
}
}
}

return string_arr.join('');
};
Loading