forked from GNUsocial/gnu-social
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
This commit is contained in:
commit
207750e757
11
js/util.js
11
js/util.js
@ -17,17 +17,6 @@
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
$('input#notice_data-attach').toggle();
|
||||
$('label[for=notice_data-attach]').text('Upload a file as an attachment?');
|
||||
$('label[for=notice_data-attach]').click(function () {
|
||||
if ('Upload a file as an attachment?' == $(this).text()) {
|
||||
$(this).text('Upload: ');
|
||||
$('input#notice_data-attach').slideDown('fast');
|
||||
} else {
|
||||
$('input#notice_data-attach').slideUp('fast', function() {$('label[for=notice_data-attach]').text('Upload a file as an attachment?');});
|
||||
}
|
||||
});
|
||||
|
||||
// count character on keyup
|
||||
function counter(event){
|
||||
var maxLength = 140;
|
||||
|
@ -148,11 +148,11 @@ class NoticeForm extends Form
|
||||
$this->out->element('dd', array('id' => 'notice_text-count'),
|
||||
'140');
|
||||
$this->out->elementEnd('dl');
|
||||
$this->out->element('br', array('style' => 'clear:both'));
|
||||
$this->out->element('label', array('for' => 'notice_data-attach'), _('Attach'));
|
||||
$this->out->element('input', array('id' => 'notice_data-attach',
|
||||
'type' => 'file',
|
||||
'name' => 'attach'));
|
||||
'name' => 'attach',
|
||||
'title' => _('Attach a file')));
|
||||
if ($this->action) {
|
||||
$this->out->hidden('notice_return-to', $this->action, 'returnto');
|
||||
}
|
||||
|
73
plugins/FBConnect/FBC_XDReceiver.php
Normal file
73
plugins/FBConnect/FBC_XDReceiver.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
if (!defined('LACONICA')) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Generates the cross domain communication channel file
|
||||
* (xd_receiver.html). By generating it we can add some caching
|
||||
* instructions.
|
||||
*
|
||||
* See: http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel
|
||||
*/
|
||||
class FBC_XDReceiverAction extends Action
|
||||
{
|
||||
|
||||
/**
|
||||
* Do we need to write to the database?
|
||||
*
|
||||
* @return boolean true
|
||||
*/
|
||||
|
||||
function isReadonly()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a request
|
||||
*
|
||||
* @param array $args Arguments from $_REQUEST
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function handle($args)
|
||||
{
|
||||
// Parent handling, including cache check
|
||||
parent::handle($args);
|
||||
$this->showPage();
|
||||
}
|
||||
|
||||
function showPage()
|
||||
{
|
||||
// cache the xd_receiver
|
||||
header('Cache-Control: max-age=225065900');
|
||||
header('Expires:');
|
||||
header('Pragma:');
|
||||
|
||||
$this->startXML('html',
|
||||
'-//W3C//DTD XHTML 1.0 Strict//EN',
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
|
||||
|
||||
$language = $this->getLanguage();
|
||||
|
||||
$this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml',
|
||||
'xml:lang' => $language,
|
||||
'lang' => $language));
|
||||
$this->elementStart('head');
|
||||
$this->element('title', null, 'cross domain receiver page');
|
||||
$this->element('script',
|
||||
array('src' =>
|
||||
'http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js',
|
||||
'type' => 'text/javascript'), '');
|
||||
$this->elementEnd('head');
|
||||
$this->elementStart('body');
|
||||
$this->elementEnd('body');
|
||||
|
||||
$this->elementEnd('html');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,8 +58,6 @@ class FBConnectLoginAction extends Action
|
||||
function showContent() {
|
||||
|
||||
$this->elementStart('fieldset');
|
||||
|
||||
|
||||
$this->element('fb:login-button', array('onlogin' => 'goto_login()',
|
||||
'length' => 'long'));
|
||||
|
||||
|
@ -39,6 +39,7 @@ require_once INSTALLDIR . '/plugins/FBConnect/FBConnectLogin.php';
|
||||
require_once INSTALLDIR . '/plugins/FBConnect/FBConnectSettings.php';
|
||||
require_once INSTALLDIR . '/plugins/FBConnect/FBCLoginGroupNav.php';
|
||||
require_once INSTALLDIR . '/plugins/FBConnect/FBCSettingsNav.php';
|
||||
require_once INSTALLDIR . '/plugins/FBConnect/FBC_XDReceiver.php';
|
||||
|
||||
/**
|
||||
* Plugin to enable Facebook Connect
|
||||
@ -62,27 +63,19 @@ class FBConnectPlugin extends Plugin
|
||||
$m->connect('main/facebookconnect', array('action' => 'FBConnectAuth'));
|
||||
$m->connect('main/facebooklogin', array('action' => 'FBConnectLogin'));
|
||||
$m->connect('settings/facebook', array('action' => 'FBConnectSettings'));
|
||||
$m->connect('xd_receiver.html', array('action' => 'FBC_XDReceiver'));
|
||||
}
|
||||
|
||||
// Add in xmlns:fb
|
||||
function onStartShowHTML($action)
|
||||
{
|
||||
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ?
|
||||
$_SERVER['HTTP_ACCEPT'] : null;
|
||||
|
||||
// XXX: allow content negotiation for RDF, RSS, or XRDS
|
||||
|
||||
$cp = common_accept_to_prefs($httpaccept);
|
||||
$sp = common_accept_to_prefs(PAGE_TYPE_PREFS);
|
||||
|
||||
$type = common_negotiate_type($cp, $sp);
|
||||
|
||||
if (!$type) {
|
||||
throw new ClientException(_('This page is not available in a '.
|
||||
'media type you accept'), 406);
|
||||
}
|
||||
|
||||
header('Content-Type: '.$type);
|
||||
// XXX: Horrible hack to make Safari, FF2, and Chrome work with
|
||||
// Facebook Connect. These browser cannot use Facebook's
|
||||
// DOM parsing routines unless the mime type of the page is
|
||||
// text/html even though Facebook Connect uses XHTML. This is
|
||||
// A bug in Facebook Connect, and this is a temporary solution
|
||||
// until they fix their JavaScript libs.
|
||||
header('Content-Type: text/html');
|
||||
|
||||
$action->extraHeaders();
|
||||
|
||||
@ -101,20 +94,27 @@ class FBConnectPlugin extends Plugin
|
||||
return false;
|
||||
}
|
||||
|
||||
function onEndShowLaconicaScripts($action)
|
||||
{
|
||||
$action->element('script',
|
||||
array('type' => 'text/javascript',
|
||||
'src' => 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php'),
|
||||
' ');
|
||||
// Note: this script needs to appear in the <body>
|
||||
|
||||
function onStartShowHeader($action)
|
||||
{
|
||||
$apikey = common_config('facebook', 'apikey');
|
||||
$plugin_path = common_path('plugins/FBConnect');
|
||||
|
||||
$login_url = common_local_url('FBConnectAuth');
|
||||
$logout_url = common_local_url('logout');
|
||||
|
||||
$html = sprintf('<script type="text/javascript">FB.init("%s", "%s/xd_receiver.htm");
|
||||
// XXX: Facebook says we don't need this FB_RequireFeatures(),
|
||||
// but we actually do, for IE and Safari. Gar.
|
||||
|
||||
$html = sprintf('<script type="text/javascript">
|
||||
window.onload = function () {
|
||||
FB_RequireFeatures(
|
||||
["XFBML"],
|
||||
function() {
|
||||
FB.Facebook.init("%s", "../xd_receiver.html");
|
||||
}
|
||||
); }
|
||||
|
||||
function goto_login() {
|
||||
window.location = "%s";
|
||||
@ -123,13 +123,23 @@ class FBConnectPlugin extends Plugin
|
||||
function goto_logout() {
|
||||
window.location = "%s";
|
||||
}
|
||||
|
||||
</script>', $apikey, $plugin_path, $login_url, $logout_url);
|
||||
|
||||
</script>', $apikey,
|
||||
$login_url, $logout_url);
|
||||
|
||||
$action->raw($html);
|
||||
}
|
||||
|
||||
// Note: this script needs to appear as close as possible to </body>
|
||||
|
||||
function onEndShowFooter($action)
|
||||
{
|
||||
|
||||
$action->element('script',
|
||||
array('type' => 'text/javascript',
|
||||
'src' => 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php'),
|
||||
'');
|
||||
}
|
||||
|
||||
function onEndShowLaconicaStyles($action)
|
||||
{
|
||||
$action->element('link', array('rel' => 'stylesheet',
|
||||
@ -143,7 +153,8 @@ class FBConnectPlugin extends Plugin
|
||||
|
||||
if ($user) {
|
||||
|
||||
$flink = Foreign_link::getByUserId($user->id, FACEBOOK_CONNECT_SERVICE);
|
||||
$flink = Foreign_link::getByUserId($user->id,
|
||||
FACEBOOK_CONNECT_SERVICE);
|
||||
$fbuid = 0;
|
||||
|
||||
if ($flink) {
|
||||
|
@ -1,10 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" >
|
||||
<head>
|
||||
<title>cross domain receiver page</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
@ -452,6 +452,21 @@ float:left;
|
||||
font-size:1.3em;
|
||||
margin-bottom:7px;
|
||||
}
|
||||
#form_notice label[for=notice_data-attach] {
|
||||
text-indent:-9999px;
|
||||
}
|
||||
#form_notice label[for=notice_data-attach],
|
||||
#form_notice #notice_data-attach {
|
||||
position:absolute;
|
||||
top:25px;
|
||||
right:49px;
|
||||
width:16px;
|
||||
height:16px;
|
||||
cursor:pointer;
|
||||
}
|
||||
#form_notice #notice_data-attach {
|
||||
text-indent:-279px;
|
||||
}
|
||||
#form_notice #notice_submit label {
|
||||
display:none;
|
||||
}
|
||||
|
BIN
theme/base/images/icons/twotone/green/clip-01.gif
Normal file
BIN
theme/base/images/icons/twotone/green/clip-01.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 78 B |
@ -446,6 +446,27 @@ float:left;
|
||||
font-size:1.3em;
|
||||
margin-bottom:7px;
|
||||
}
|
||||
#form_notice label {
|
||||
display:block;
|
||||
float:left;
|
||||
font-size:1.3em;
|
||||
margin-bottom:7px;
|
||||
}
|
||||
#form_notice label[for=notice_data-attach] {
|
||||
text-indent:-9999px;
|
||||
}
|
||||
#form_notice label[for=notice_data-attach],
|
||||
#form_notice #notice_data-attach {
|
||||
position:absolute;
|
||||
top:25px;
|
||||
right:49px;
|
||||
width:16px;
|
||||
height:16px;
|
||||
cursor:pointer;
|
||||
}
|
||||
#form_notice #notice_data-attach {
|
||||
text-indent:-279px;
|
||||
}
|
||||
#form_notice #notice_submit label {
|
||||
display:none;
|
||||
}
|
||||
|
@ -102,6 +102,13 @@ color:#333;
|
||||
#form_notice.warning #notice_text-count {
|
||||
color:#000;
|
||||
}
|
||||
#form_notice label[for=notice_data-attach] {
|
||||
background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%;
|
||||
}
|
||||
#form_notice #notice_data-attach {
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
#form_notice.processing #notice_action-submit {
|
||||
background:#fff url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%;
|
||||
cursor:wait;
|
||||
|
@ -82,6 +82,13 @@ color:#333;
|
||||
#form_notice.warning #notice_text-count {
|
||||
color:#000;
|
||||
}
|
||||
#form_notice label[for=notice_data-attach] {
|
||||
background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%;
|
||||
}
|
||||
#form_notice #notice_data-attach {
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
#form_notice.processing #notice_action-submit {
|
||||
background:#fff url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%;
|
||||
cursor:wait;
|
||||
|
@ -82,6 +82,13 @@ color:#333;
|
||||
#form_notice.warning #notice_text-count {
|
||||
color:#000;
|
||||
}
|
||||
#form_notice label[for=notice_data-attach] {
|
||||
background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%;
|
||||
}
|
||||
#form_notice #notice_data-attach {
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
#form_notice.processing #notice_action-submit {
|
||||
background:#fff url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%;
|
||||
cursor:wait;
|
||||
|
Loading…
Reference in New Issue
Block a user