added minimal layout for bookmarklet popup
This commit is contained in:
parent
50eed641fe
commit
9d11748486
5 changed files with 76 additions and 72 deletions
|
|
@ -11,6 +11,8 @@ class StatusMessagesController < ApplicationController
|
||||||
:mobile,
|
:mobile,
|
||||||
:json
|
:json
|
||||||
|
|
||||||
|
layout 'blank', :only => [ :bookmarklet, :new_bookmarklet ]
|
||||||
|
|
||||||
# Called when a user clicks "Mention" on a profile page
|
# Called when a user clicks "Mention" on a profile page
|
||||||
# @param person_id [Integer] The id of the person to be mentioned
|
# @param person_id [Integer] The id of the person to be mentioned
|
||||||
def new
|
def new
|
||||||
|
|
@ -34,13 +36,9 @@ class StatusMessagesController < ApplicationController
|
||||||
def bookmarklet
|
def bookmarklet
|
||||||
@aspects = current_user.aspects
|
@aspects = current_user.aspects
|
||||||
@aspect_ids = @aspects.map{|x| x.id}
|
@aspect_ids = @aspects.map{|x| x.id}
|
||||||
if ! is_mobile_device?
|
|
||||||
render :layout => nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_bookmarklet
|
def new_bookmarklet
|
||||||
render :layout => nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
||||||
36
app/views/layouts/blank.haml
Normal file
36
app/views/layouts/blank.haml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
-# Copyright (c) 2010-2012, Diaspora Inc. This file is
|
||||||
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
!!!
|
||||||
|
%html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'}
|
||||||
|
%head
|
||||||
|
%meta{:charset => 'utf-8'}
|
||||||
|
%meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'}
|
||||||
|
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}
|
||||||
|
|
||||||
|
= csrf_meta_tag
|
||||||
|
|
||||||
|
%link{:rel => 'shortcut icon', :href => "#{image_path('favicon.png')}" }
|
||||||
|
%link{:rel => 'apple-touch-icon', :href => "#{image_path('apple-touch-icon.png')}"}
|
||||||
|
|
||||||
|
%title
|
||||||
|
= page_title yield(:page_title)
|
||||||
|
|
||||||
|
= include_base_css_framework
|
||||||
|
= stylesheet_link_tag 'application', 'default'
|
||||||
|
= translation_missing_warnings
|
||||||
|
:css
|
||||||
|
body { padding: 0; margin: 0; }
|
||||||
|
|
||||||
|
= jquery_include_tag
|
||||||
|
= javascript_include_tag :main, :templates, :home
|
||||||
|
= load_javascript_locales
|
||||||
|
= set_asset_host
|
||||||
|
= set_current_user_in_javascript
|
||||||
|
|
||||||
|
= yield(:head)
|
||||||
|
|
||||||
|
%body
|
||||||
|
|
||||||
|
= yield
|
||||||
|
|
@ -2,61 +2,35 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
!!!
|
#new_status_message_pane
|
||||||
%html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'}
|
|
||||||
%head
|
|
||||||
%meta{:charset => 'utf-8'}
|
|
||||||
|
|
||||||
%title
|
|
||||||
= page_title yield(:page_title)
|
|
||||||
|
|
||||||
%meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'}
|
|
||||||
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
|
||||||
|
|
||||||
%link{:rel => 'shortcut icon', :href => '/favicon.png'}
|
|
||||||
%link{:rel => 'apple-touch-icon', :href => '/apple-touch-icon.png'}
|
|
||||||
|
|
||||||
= csrf_meta_tag
|
|
||||||
|
|
||||||
= jquery_include_tag
|
|
||||||
= javascript_include_tag :main, :templates, :home
|
|
||||||
:javascript
|
|
||||||
Diaspora.I18n.loadLocale(#{get_javascript_strings_for(I18n.locale).to_json}, "#{I18n.locale}");
|
|
||||||
|
|
||||||
= stylesheet_link_tag "blueprint", :media => 'screen'
|
|
||||||
= stylesheet_link_tag :default, :media => 'all'
|
|
||||||
= stylesheet_link_tag :application, :media => 'all'
|
|
||||||
:css
|
|
||||||
body { margin: 0; padding: 0; }
|
|
||||||
#new_status_message_pane { margin: 1em 0 0; }
|
|
||||||
#new_status_message_pane h4 { margin: 0 0 0 1em; }
|
|
||||||
|
|
||||||
%body
|
|
||||||
#new_status_message_pane
|
|
||||||
.span-15.last
|
.span-15.last
|
||||||
%h4
|
%h4
|
||||||
=t('bookmarklet.post_something')
|
=t('bookmarklet.post_something')
|
||||||
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids }
|
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids }
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
Publisher.bookmarklet = true;
|
Publisher.bookmarklet = true;
|
||||||
app.publisher = new app.views.Publisher();
|
app.publisher = new app.views.Publisher();
|
||||||
|
|
||||||
|
var contents = "#{escape_javascript params[:title]} - #{escape_javascript params[:url]}";
|
||||||
|
var notes = "#{escape_javascript params[:notes]}";
|
||||||
|
if (notes.length > 0){
|
||||||
|
contents = contents + " - " + notes;
|
||||||
|
}
|
||||||
|
|
||||||
$("#publisher").bind('ajax:success', function(){
|
$("#publisher").bind('ajax:success', function(){
|
||||||
$('h4').text("#{t('bookmarklet.post_success')}");
|
$('h4').text("#{t('bookmarklet.post_success')}");
|
||||||
app.publisher.close();
|
app.publisher.close();
|
||||||
window.setTimeout(window.close, 2000, true);
|
window.setTimeout(window.close, 2000, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(function(){
|
||||||
var contents = "#{escape_javascript params[:title]} - #{escape_javascript params[:url]}";
|
|
||||||
var notes = "#{escape_javascript params[:notes]}";
|
|
||||||
if (notes.length > 0){
|
|
||||||
contents = contents + " - " + notes;
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#publisher #status_message_fake_text").val(contents);
|
$("#publisher #status_message_fake_text").val(contents);
|
||||||
$("#publisher #status_message_text").val(contents);
|
$("#publisher #status_message_text").val(contents);
|
||||||
$('input.button')[0].removeAttribute('disabled');
|
$('input.button')[0].removeAttribute('disabled');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
- content_for(:head) do
|
||||||
|
:css
|
||||||
|
#new_status_message_pane { margin: 1em 0 0; }
|
||||||
|
#new_status_message_pane h4 { margin: 0 0 0 1em; }
|
||||||
|
|
@ -2,20 +2,20 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
= javascript_include_tag :jquery
|
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids }
|
||||||
= javascript_include_tag :mobile
|
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready(function()
|
var contents = "#{escape_javascript params[:title]} - #{escape_javascript params[:url]}";
|
||||||
{
|
var notes = "#{escape_javascript params[:notes]}";
|
||||||
var contents = "#{params[:title]} - #{params[:url]}";
|
if (notes.length > 0){
|
||||||
if ("#{params[:notes]}".length > 0){
|
contents = contents + " - " + notes;
|
||||||
contents = contents + " - #{params[:notes]}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
if (contents.length > 0) {
|
if (contents.length > 0) {
|
||||||
$("#status_message_text").val(contents);
|
$("#status_message_text").val(contents);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids }
|
- content_for(:head) do
|
||||||
|
= javascript_include_tag :mobile
|
||||||
|
|
@ -2,8 +2,4 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
!!!
|
%iframe{:src =>"/posts/new", :height => 500, :width => 980, :style => "border:none;"}
|
||||||
%html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'}
|
|
||||||
%head
|
|
||||||
%body
|
|
||||||
%iframe{:src =>"/posts/new", :height => 500, :width => 980, :style => "border:none;"}
|
|
||||||
Loading…
Reference in a new issue