Skip to content
Extraits de code Groupes Projets
Valider bf20e5a9 rédigé par danielvincent's avatar danielvincent
Parcourir les fichiers

remove some js assets from mobile

parent 42993de7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -107,8 +107,11 @@ module ApplicationHelper
end
def how_long_ago(obj)
timeago(obj.created_at)
#I18n.t('ago', :time => time_ago_in_words(obj.created_at, true))
if is_mobile_device?
time_ago_in_words(obj.created_at)
else
timeago(obj.created_at)
end
end
def person_url(person)
......
......@@ -14,7 +14,7 @@
-if current_user
:javascript
Diaspora.widgets.i18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}");
= stylesheet_link_tag 'vendor/jquery.mobile-1.0a3.min', 'mobile'
= csrf_meta_tag
......@@ -80,7 +80,7 @@
= link_to t('people.edit.your_profile'), person_path(current_user.person)
%li
= link_to t('notifications.index.notifications'), notifications_path
.ui-li-count
.ui-li-count
= @notification_count
%h4
......
......@@ -28,15 +28,10 @@ javascripts:
- public/javascripts/search.js
mobile:
- public/javascripts/vendor/jquery144.min.js
- public/javascripts/vendor/jquery-ui-1.8.6.custom.min.js
- public/javascripts/custom-mobile-scripting.js
- public/javascripts/vendor/jquery.mobile-1.0a3.min.js
- public/javascripts/vendor/jquery.infinitescroll.min.js
- public/javascripts/vendor/timeago.js
- public/javascripts/diaspora.js
- public/javascripts/widgets/alert.js
- public/javascripts/widgets/i18n.js
- public/javascripts/widgets/timeago.js
- public/javascripts/mobile.js
- public/javascripts/application.js
- public/javascripts/rails.js
......
......@@ -5,18 +5,12 @@
var Mobile = {
initialize: function() {
$("abbr.timeago").timeago();
$('#main_stream + .pagination').hide();
$('#aspect_picker').change(Mobile.changeAspect);
$('a').live('tap',function(){
$(this).addClass('tapped');
})
},
changeAspect: function() {
Mobile.windowLocation('/aspects/' + $('#aspect_picker option:selected').val());
},
windowLocation: function(url) {
window.location = url;
}
......
/* Copyright (c) 2010, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
describe("mobile interface", function() {
describe("initialize", function() {
it("attaches a change event to the select box", function() {
spyOn($.fn, 'change');
Mobile.initialize();
expect($.fn.change).toHaveBeenCalledWith(Mobile.changeAspect);
expect($.fn.change.mostRecentCall.object.selector).toEqual("#aspect_picker");
});
});
describe("change", function() {
it("changes to the aspect show page", function() {
$('#jasmine_content').html(
'<select id="aspect_picker" name="aspect_picker" tabindex="-1">' +
' <option value="family-aspect-id">Family</option>' +
' <option value="work-aspect-id">Work</option>' +
'</select>');
spyOn(Mobile, "windowLocation");
$.proxy(Mobile.changeAspect, $('#aspect_picker > option').first())()
expect(Mobile.windowLocation).toHaveBeenCalledWith("/aspects/family-aspect-id");
});
});
});
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter