Merge pull request #2368 from jaywink/mobile-bookmarklet

Mobile bookmarklet
This commit is contained in:
Daniel Grippi 2011-11-09 16:07:07 -08:00
commit 5696c8979f
2 changed files with 23 additions and 1 deletions

View file

@ -34,7 +34,9 @@ class StatusMessagesController < ApplicationController
@aspects = current_user.aspects
@selected_contacts = @aspects.map { |aspect| aspect.contacts }.flatten.uniq
@aspect_ids = @aspects.map{|x| x.id}
render :layout => nil
if ! is_mobile_device?
render :layout => nil
end
end
def create

View file

@ -0,0 +1,20 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= include_javascripts :mobile
:javascript
$(document).ready(function()
{
var contents = "#{params[:title]} - #{params[:url]}";
if ("#{params[:notes]}".length > 0){
contents = contents + " - #{params[:notes]}";
}
if (contents.length > 0) {
$("#status_message_text").val(contents);
}
});
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids }