remove some js assets from mobile
This commit is contained in:
parent
42993de739
commit
bf20e5a9e8
5 changed files with 8 additions and 45 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
/* 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");
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue