Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
eaedfc98
Commit
eaedfc98
authored
May 07, 2012
by
Maxwell Salzberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create a new publisher using the new composer. only for beta users
parent
a46e16cb
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
52 additions
and
10 deletions
+52
-10
app/assets/javascripts/app/pages/framer.js
app/assets/javascripts/app/pages/framer.js
+8
-3
app/controllers/posts_controller.rb
app/controllers/posts_controller.rb
+1
-1
app/controllers/status_messages_controller.rb
app/controllers/status_messages_controller.rb
+4
-0
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+18
-1
app/models/user.rb
app/models/user.rb
+1
-1
app/views/shared/_right_sections.html.haml
app/views/shared/_right_sections.html.haml
+1
-1
app/views/status_messages/new_bookmarklet.haml
app/views/status_messages/new_bookmarklet.haml
+9
-0
config/locales/diaspora/en.yml
config/locales/diaspora/en.yml
+2
-3
config/routes.rb
config/routes.rb
+1
-0
spec/controllers/status_messages_controller_spec.rb
spec/controllers/status_messages_controller_spec.rb
+7
-0
No files found.
app/assets/javascripts/app/pages/framer.js
View file @
eaedfc98
...
...
@@ -48,9 +48,14 @@ app.views.framerControls = app.views.Base.extend({
// this is gross hack to make this action work in the iframe version and not iframe version.
var
callback
=
{}
var
parentDoc
=
parent
;
var
parentPath
=
parentDoc
.
location
.
pathname
if
(
parentDoc
.
location
.
pathname
!=
'
/framer
'
){
callback
=
{
success
:
function
(){
parentDoc
.
closeIFrame
()
}}
if
(
parentPath
==
'
/new_bookmarklet
'
){
callback
.
success
=
function
(){
parentDoc
.
close
()
}
}
else
if
(
parentPath
!=
'
/framer
'
){
callback
.
success
=
function
(){
parentDoc
.
goToCurrentUserProfile
()
}
}
else
{
// do nothing, and let the navigate event fire
}
this
.
model
.
save
({},
callback
)
...
...
@@ -58,6 +63,6 @@ app.views.framerControls = app.views.Base.extend({
});
//crazy hack for model publisher.
function
closeIFram
e
(){
function
goToCurrentUserProfil
e
(){
location
=
"
/people/
"
+
app
.
currentUser
.
get
(
"
guid
"
)
};
\ No newline at end of file
app/controllers/posts_controller.rb
View file @
eaedfc98
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
...
...
app/controllers/status_messages_controller.rb
View file @
eaedfc98
...
...
@@ -39,6 +39,10 @@ class StatusMessagesController < ApplicationController
end
end
def
new_bookmarklet
render
:layout
=>
nil
end
def
create
params
[
:status_message
][
:aspect_ids
]
=
[
*
params
[
:aspect_ids
]]
normalize_public_flag!
...
...
app/helpers/application_helper.rb
View file @
eaedfc98
...
...
@@ -13,7 +13,24 @@ module ApplicationHelper
end
def
bookmarklet
"javascript:(function(){f='
#{
AppConfig
[
:pod_url
]
}
bookmarklet?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'¬es='+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=620,height=250'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"
raw_bookmarklet
end
def
new_bookmarklet
raw_bookmarklet
(
520
,
720
,
true
)
end
def
raw_bookmarklet
(
height
=
250
,
width
=
620
,
new
=
false
)
route
=
new
?
'new_bookmarklet'
:
'bookmarklet'
"javascript:(function(){f='
#{
AppConfig
[
:pod_url
]
}#{
route
}
?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'¬es='+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
if
user_signed_in?
&&
current_user
.
beta?
new_bookmarklet
else
bookmarklet
end
end
def
contacts_link
...
...
app/models/user.rb
View file @
eaedfc98
...
...
@@ -107,7 +107,7 @@ class User < ActiveRecord::Base
end
def
beta?
Role
.
is_beta?
(
self
.
person
)
@beta
||=
Role
.
is_beta?
(
self
.
person
)
end
#@deprecated
...
...
app/views/shared/_right_sections.html.haml
View file @
eaedfc98
...
...
@@ -74,7 +74,7 @@
%h5
=
t
(
'bookmarklet.heading'
)
.content
!=
t
(
'bookmarklet.explanation'
,
:link
=>
link_to
(
t
(
'bookmarklet.
explanation_link_text'
),
bookmarklet
))
!=
t
(
'bookmarklet.explanation'
,
:link
=>
link_to
(
t
(
'bookmarklet.
post_something'
),
magic_bookmarklet_link
))
.section
.title
...
...
app/views/status_messages/new_bookmarklet.haml
0 → 100644
View file @
eaedfc98
-# 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
%body
%iframe
{
:src
=>
"/posts/new"
,
:height
=>
500
,
:width
=>
700
,
:style
=>
"border:none;"
}
\ No newline at end of file
config/locales/diaspora/en.yml
View file @
eaedfc98
...
...
@@ -234,9 +234,8 @@ en:
bookmarklet
:
heading
:
"
Bookmarklet"
post_success
:
"
Posted!
Closing!"
post_something
:
"
Post
something
to
Diaspora"
explanation
:
"
Post
to
Diaspora
from
anywhere
by
bookmarking
%{link}."
explanation_link_text
:
"
this
link"
post_something
:
"
Post
to
Diaspora"
explanation
:
"
Post
to
Diaspora
from
anywhere
by
bookmarking
this
link
=>
%{link}."
comments
:
zero
:
"
no
comments"
...
...
config/routes.rb
View file @
eaedfc98
...
...
@@ -51,6 +51,7 @@ Diaspora::Application.routes.draw do
end
get
'bookmarklet'
=>
'status_messages#bookmarklet'
get
'new_bookmarklet'
=>
'status_messages#new_bookmarklet'
resources
:photos
,
:except
=>
[
:index
]
do
put
:make_profile_photo
...
...
spec/controllers/status_messages_controller_spec.rb
View file @
eaedfc98
...
...
@@ -53,6 +53,13 @@ describe StatusMessagesController do
end
end
describe
'#new_bookmarklet'
do
it
'works'
do
get
:new_bookmarklet
response
.
should
be_success
end
end
describe
'#new'
do
it
'succeeds'
do
get
:new
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment