From 50ac8799fe13b72d96f0400ad345e7ef1e82b087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ad=C3=A1n=20S=C3=A1nchez=20de=20Pedro=20Crespo?= Date: Sun, 9 Mar 2014 15:16:18 +0100 Subject: [PATCH] Better activities. EPIC message forward functionality --- chungo.js | 26 +++++++++-- index.html | 15 ++++--- l10n/en.ini | 2 + scripts/loqui/account.js | 29 +++++++------ scripts/loqui/activity.js | 88 +++++++++++++++++++++++++++----------- scripts/loqui/bindings.js | 4 -- scripts/loqui/menu.js | 5 ++- scripts/loqui/message.js | 3 ++ scripts/loqui/providers.js | 2 +- style/loqui/index.css | 62 ++++++++++++++++++++++----- 10 files changed, 174 insertions(+), 62 deletions(-) diff --git a/chungo.js b/chungo.js index 76a01d51..6f5ba7ca 100644 --- a/chungo.js +++ b/chungo.js @@ -16,7 +16,7 @@ var Chungo = { Chungo.Router._stack = [$$('section').first().attr('id')]; - setTimeout(function(){ + setTimeout(function() { var sections = $$('section'); sections.each(function () { $$(this).children('article').first().addClass('show'); @@ -44,8 +44,26 @@ var Chungo = { var image = this.dataset.image; $$(this).style('backgroundImage', 'url(' + image + ')'); }); + $$('[data-control="groupbar"]').each(function () { + var links = $$(this).children('[data-view-article]'); + links.first().addClass('selected').siblings().removeClass('selected'); + links.each(function () { + $$(this).on('click', function (e) { + $$(this).addClass('selected').siblings().removeClass('selected'); + }); + }); + }); }); + setTimeout(function () { + $$('header[data-title]').each(function () { + var title = $$(this).data('l10n-title') && '_' in window ? _($$(this).data('l10n-title')) : $$(this).data('title'); + $$(this).append( + $$('

').text(title) + ); + }); + }, 1000); + $$('body').append( $$('
').addClass('chungo').append( $$('
').addClass('shader') @@ -105,7 +123,6 @@ var Chungo = { _stack: [], section: function (to) { - console.log(to); if (to == 'back') { var from = this._stack.pop(); var to = this._stack[this._stack.length - 1]; @@ -145,16 +162,17 @@ var Chungo = { .addClass('forth'); } } - console.log(from, to); + console.log('SECTION', from, to); setTimeout(function () { Chungo.Aside.hide(); - }, 300); + }, to != from ? 300 : 0); }, article: function (section, article) { this.section(section); var to = $$('section#' + section).children('article#' + article); to.addClass('show').siblings('article').removeClass('show'); + console.log('ARTICLE', to); } }, diff --git a/index.html b/index.html index 3e968f52..ec508b36 100644 --- a/index.html +++ b/index.html @@ -47,14 +47,14 @@

Congratulations!

-
+
-
+
+
diff --git a/l10n/en.ini b/l10n/en.ini index 22b61875..d621614b 100644 --- a/l10n/en.ini +++ b/l10n/en.ini @@ -130,6 +130,8 @@ Geolocating=Geolocating LocationDenied=We were not authorized to locate you. Please allow Geolocation for this app under the "App permissions" menu in the phone settings. LocationTimedout=The location request timed out. Maybe the GPS signal is too weak. LocationUnavailable=Your location is unavailable. Please check your phone Geolocation settings. +Actionchat=New chat +Actionfile=Send file # SHOWS showchat=Talkative diff --git a/scripts/loqui/account.js b/scripts/loqui/account.js index f54e43f1..c3cf8a13 100644 --- a/scripts/loqui/account.js +++ b/scripts/loqui/account.js @@ -145,7 +145,6 @@ var Account = function (core) { this.allRender = function () { this.accountRender(); this.chatsRender(); - //this.contactsRender(); this.presenceRender(); this.avatarsRender(); } @@ -183,13 +182,15 @@ var Account = function (core) { } // List all chats for this account - this.chatsRender = function () { + this.chatsRender = function (f, click, hold) { var account = this; var oldUl = $('section#main article#chats ul[data-jid="' + this.core.fullJid + '"]'); var ul = $("