added scrollbar to bookmark publisher, fixed mention layout bugs

This commit is contained in:
Faldrian 2014-11-07 19:17:54 +01:00
parent ba551f6ac4
commit db13811c2c
8 changed files with 18 additions and 23 deletions

View file

@ -1 +1,2 @@
#bookmarklet { padding:10px 10px 30px 10px; margin-top: 0; } #bookmarklet { padding:10px 10px 30px 10px; margin-top: 0; }
body.page-status_messages.action-bookmarklet { margin-top: 0px }

View file

@ -66,19 +66,22 @@
} }
} }
.mentions-box {
position: absolute;
right: 0px;
bottom: 0px;
left: 0px;
top: 0px;
padding: 4px 6px;
}
.mentions { .mentions {
bottom: 0;
color: white; color: white;
font-size: 14px; font-size: 14px;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
left: 0;
line-height: normal; line-height: normal;
overflow: hidden; overflow: hidden;
padding: 4px; width: 100%;
position: absolute;
right: 0;
top: 0;
width: 445px;
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;

View file

@ -78,9 +78,7 @@
} }
.mentions-input-box .mentions { .mentions-input-box .mentions {
padding: 4px 6px !important;
line-height: 20px !important; line-height: 20px !important;
width: 100% !important;
} }
&.with_attachments .row-fluid#photodropzone_container { &.with_attachments .row-fluid#photodropzone_container {

View file

@ -113,6 +113,7 @@
#status_message_fake_text { #status_message_fake_text {
min-height: 20px; min-height: 20px;
padding: 4px 6px;
} }
.content_creation { .content_creation {

View file

@ -66,7 +66,7 @@
</div> </div>
<!--Since stream-interactions is fixed, we need a double span5 declaration here :(--> <!--Since stream-interactions is fixed, we need a double span6 declaration here :(-->
<div class="span6"> <div class="span6">
<section id="stream-interactions" class="span6"/> <section id="stream-interactions" class="span6"/>
</div> </div>

View file

@ -21,16 +21,8 @@ module ApplicationHelper
timeago_tag(time, options.merge(:class => 'timeago', :title => time.iso8601, :force => true)) if time timeago_tag(time, options.merge(:class => 'timeago', :title => time.iso8601, :force => true)) if time
end end
def bookmarklet def bookmarklet_url( height = 400, width = 620)
raw_bookmarklet "javascript:(function(){f='#{AppConfig.pod_uri.to_s}bookmarklet?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&notes='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=1&';a=function(){if(!window.open(f+'noui=1&jump=doclose','diasporav1','location=yes,links=no,scrollbars=yes,toolbar=no,width=#{width},height=#{height}'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"
end
def raw_bookmarklet( height = 400, width = 620)
"javascript:(function(){f='#{AppConfig.pod_uri.to_s}bookmarklet?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&notes='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=1&';a=function(){if(!window.open(f+'noui=1&jump=doclose','diasporav1','location=yes,links=no,scrollbars=no,toolbar=no,width=#{width},height=#{height}'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"
end
def magic_bookmarklet_link
bookmarklet
end end
def contacts_link def contacts_link

View file

@ -66,7 +66,7 @@
%h5.title-header %h5.title-header
= t('bookmarklet.heading') = t('bookmarklet.heading')
.content .content
!= t('bookmarklet.explanation', :link => link_to(t('bookmarklet.post_something'), magic_bookmarklet_link)) != t('bookmarklet.explanation', :link => link_to(t('bookmarklet.post_something'), bookmarklet_url))
- if AppConfig.settings.paypal_hosted_button_id.present? || AppConfig.bitcoin_donation_address - if AppConfig.settings.paypal_hosted_button_id.present? || AppConfig.bitcoin_donation_address
.section .section

View file

@ -34,7 +34,7 @@
autocompleteListItem : _.template('<li data-ref-id="<%= id %>" data-ref-type="<%= type %>" data-display="<%= display %>"><%= content %></li>'), autocompleteListItem : _.template('<li data-ref-id="<%= id %>" data-ref-type="<%= type %>" data-display="<%= display %>"><%= content %></li>'),
autocompleteListItemAvatar : _.template('<img src="<%= avatar %>" />'), autocompleteListItemAvatar : _.template('<img src="<%= avatar %>" />'),
autocompleteListItemIcon : _.template('<div class="icon <%= icon %>"></div>'), autocompleteListItemIcon : _.template('<div class="icon <%= icon %>"></div>'),
mentionsOverlay : _.template('<div class="mentions"><div></div></div>'), mentionsOverlay : _.template('<div class="mentions-box"><div class="mentions"><div></div></div></div>'),
mentionItemSyntax : _.template('@[<%= value %>](<%= type %>:<%= id %>)'), mentionItemSyntax : _.template('@[<%= value %>](<%= type %>:<%= id %>)'),
mentionItemHighlight : _.template('<strong><span><%= value %></span></strong>') mentionItemHighlight : _.template('<strong><span><%= value %></span></strong>')
} }
@ -139,7 +139,7 @@
mentionText = mentionText.replace(/ {2}/g, '&nbsp; '); mentionText = mentionText.replace(/ {2}/g, '&nbsp; ');
elmInputBox.data('messageText', syntaxMessage); elmInputBox.data('messageText', syntaxMessage);
elmMentionsOverlay.find('div').html(mentionText); elmMentionsOverlay.find('div > div').html(mentionText);
} }
function resetBuffer() { function resetBuffer() {