keyboard shortcuts
also the new editor removed whitespace in the end of rows...
This commit is contained in:
parent
e3da8af8e2
commit
a13ccd7ca1
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
/* · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
|
||||
/* · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
|
||||
· ·
|
||||
· ·
|
||||
· Q V I T T E R ·
|
||||
|
@ -15,7 +15,7 @@
|
|||
· o> \\\\_\ ·
|
||||
· \\) \____) ·
|
||||
· ·
|
||||
· ·
|
||||
· ·
|
||||
· ·
|
||||
· Qvitter is free software: you can redistribute it and / or modify it ·
|
||||
· under the terms of the GNU Affero General Public License as published by ·
|
||||
|
@ -31,7 +31,7 @@
|
|||
· along with Qvitter. If not, see <http://www.gnu.org/licenses/>. ·
|
||||
· ·
|
||||
· Contact h@nnesmannerhe.im if you have any questions. ·
|
||||
· ·
|
||||
· ·
|
||||
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
|
||||
class QvitterAction extends ApiAction
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ class QvitterAction extends ApiAction
|
|||
protected function handle()
|
||||
{
|
||||
parent::handle();
|
||||
|
||||
|
||||
$this->showQvitter();
|
||||
|
||||
}
|
||||
|
@ -63,13 +63,13 @@ class QvitterAction extends ApiAction
|
|||
|
||||
|
||||
$logged_in_user_nickname = '';
|
||||
$logged_in_user_obj = false;
|
||||
$logged_in_user_obj = false;
|
||||
$logged_in_user = common_current_user();
|
||||
if($logged_in_user) {
|
||||
$logged_in_user_nickname = $logged_in_user->nickname;
|
||||
$logged_in_user_obj = ApiAction::twitterUserArray($logged_in_user->getProfile());
|
||||
}
|
||||
|
||||
|
||||
$registrationsclosed = false;
|
||||
if(common_config('site','closed') == 1 || common_config('site','inviteonly') == 1) {
|
||||
$registrationsclosed = true;
|
||||
|
@ -77,22 +77,22 @@ class QvitterAction extends ApiAction
|
|||
|
||||
// check if the client's ip address is blocked for registration
|
||||
if(is_array(QvitterPlugin::settings("blocked_ips"))) {
|
||||
$client_ip_is_blocked = in_array($_SERVER['REMOTE_ADDR'], QvitterPlugin::settings("blocked_ips"));
|
||||
}
|
||||
|
||||
$client_ip_is_blocked = in_array($_SERVER['REMOTE_ADDR'], QvitterPlugin::settings("blocked_ips"));
|
||||
}
|
||||
|
||||
$sitetitle = common_config('site','name');
|
||||
$siterootdomain = common_config('site','server');
|
||||
$qvitterpath = Plugin::staticPath('Qvitter', '');
|
||||
$apiroot = common_path('api/', StatusNet::isHTTPS());
|
||||
$attachmentroot = common_path('attachment/', StatusNet::isHTTPS());
|
||||
$instanceurl = common_path('', StatusNet::isHTTPS());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
common_set_returnto(''); // forget this
|
||||
|
||||
// if this is a profile we add a link header for LRDD Discovery (see WebfingerPlugin.php)
|
||||
if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
|
||||
if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
|
||||
$nickname = substr($_SERVER['REQUEST_URI'],1);
|
||||
if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
|
||||
$acct = 'acct:'. $nickname .'@'. common_config('site', 'server');
|
||||
|
@ -101,58 +101,58 @@ class QvitterAction extends ApiAction
|
|||
header('Link: <'.$url.'>; rel="'. Discovery::LRDD_REL.'"; type="'.$type.'"');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<head>
|
||||
<title><?php print $sitetitle; ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" type="text/css" href="<?php print $qvitterpath; ?>css/qvitter.css?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/css/qvitter.css')); ?>" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php print $qvitterpath; ?>css/jquery.minicolors.css" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php print $qvitterpath; ?>css/jquery.minicolors.css" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php print $qvitterpath; ?><?php print QvitterPlugin::settings("favicon"); ?>">
|
||||
<?php
|
||||
|
||||
// if qvitter is a webapp and this is a users url we add feeds
|
||||
if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
|
||||
if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
|
||||
$nickname = substr($_SERVER['REQUEST_URI'],1);
|
||||
if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
|
||||
$user = User::getKV('nickname', $nickname);
|
||||
$user = User::getKV('nickname', $nickname);
|
||||
if(!isset($user->id)) {
|
||||
//error_log("QVITTER: Could not get user id for user with nickname: $nickname – REQUEST_URI: ".$_SERVER['REQUEST_URI']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
print '<link title="Notice feed for '.$nickname.' (Activity Streams JSON)" type="application/stream+json" href="'.$instanceurl.'api/statuses/user_timeline/'.$user->id.'.as" rel="alternate">'."\n";
|
||||
print ' <link title="Notice feed for '.$nickname.' (RSS 1.0)" type="application/rdf+xml" href="'.$instanceurl.$nickname.'/rss" rel="alternate">'."\n";
|
||||
print ' <link title="Notice feed for '.$nickname.' (RSS 2.0)" type="application/rss+xml" href="'.$instanceurl.'api/statuses/user_timeline/'.$user->id.'.rss" rel="alternate">'."\n";
|
||||
print ' <link title="Notice feed for '.$nickname.' (Atom)" type="application/atom+xml" href="'.$instanceurl.'api/statuses/user_timeline/'.$user->id.'.atom" rel="alternate">'."\n";
|
||||
print ' <link title="FOAF for '.$nickname.'" type="application/rdf+xml" href="'.$instanceurl.$nickname.'/foaf" rel="meta">'."\n";
|
||||
print ' <link href="'.$instanceurl.$nickname.'/microsummary" rel="microsummary">'."\n";
|
||||
|
||||
print ' <link href="'.$instanceurl.$nickname.'/microsummary" rel="microsummary">'."\n";
|
||||
|
||||
// maybe openid
|
||||
if (array_key_exists('OpenID', StatusNet::getActivePlugins())) {
|
||||
print ' <link rel="openid2.provider" href="'.common_local_url('openidserver').'"/>'."\n";
|
||||
print ' <link rel="openid2.local_id" href="'.$user->getProfile()->profileurl.'"/>'."\n";
|
||||
print ' <link rel="openid2.server" href="'.common_local_url('openidserver').'"/>'."\n";
|
||||
print ' <link rel="openid2.delegate" href="'.$user->getProfile()->profileurl.'"/>'."\n";
|
||||
}
|
||||
}
|
||||
print ' <link rel="openid2.delegate" href="'.$user->getProfile()->profileurl.'"/>'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(substr($_SERVER['REQUEST_URI'],0,7) == '/group/') {
|
||||
$group_id_or_name = substr($_SERVER['REQUEST_URI'],7);
|
||||
if(stristr($group_id_or_name,'/id')) {
|
||||
$group_id_or_name = substr($group_id_or_name, 0, strpos($group_id_or_name,'/id'));
|
||||
$group = User_group::getKV('id', $group_id_or_name);
|
||||
$group = User_group::getKV('id', $group_id_or_name);
|
||||
$group_name = $group->nickname;
|
||||
$group_id = $group_id_or_name;
|
||||
$group_id = $group_id_or_name;
|
||||
}
|
||||
else {
|
||||
$group = Local_group::getKV('nickname', $group_id_or_name);
|
||||
$group_id = $group->group_id;
|
||||
$group_name = $group_id_or_name;
|
||||
$group_name = $group_id_or_name;
|
||||
}
|
||||
if(preg_match("/^[a-zA-Z0-9]+$/", $group_id_or_name) == 1) {
|
||||
?>
|
||||
|
@ -164,15 +164,15 @@ class QvitterAction extends ApiAction
|
|||
<link rel="meta" href="<?php echo htmlspecialchars(common_local_url('foafgroup', array('nickname'=>$group_name))); ?>" type="application/rdf+xml" title="FOAF for '<?php echo htmlspecialchars($group_name); ?>' group" />
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script>
|
||||
|
||||
/*
|
||||
@licstart The following is the entire license notice for the
|
||||
|
||||
/*
|
||||
@licstart The following is the entire license notice for the
|
||||
JavaScript code in this page.
|
||||
|
||||
Copyright (C) 2015 Hannes Mannerheim and other contributors
|
||||
|
@ -188,17 +188,17 @@ class QvitterAction extends ApiAction
|
|||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@licend The above is the entire license notice
|
||||
for the JavaScript code in this page.
|
||||
*/
|
||||
|
||||
|
||||
window.defaultAvatarStreamSize = <?php print json_encode(Avatar::defaultImage(AVATAR_STREAM_SIZE)) ?>;
|
||||
window.textLimit = <?php print json_encode((int)common_config('site','textlimit')) ?>;
|
||||
window.registrationsClosed = <?php print json_encode($registrationsclosed) ?>;
|
||||
window.thisSiteThinksItIsHttpButIsActuallyHttps = <?php
|
||||
|
||||
|
||||
if(isset($_SERVER['HTTPS'])
|
||||
&& $_SERVER['HTTPS'] != 'off'
|
||||
&& substr($instanceurl,0,7) == 'http://') {
|
||||
|
@ -207,67 +207,67 @@ class QvitterAction extends ApiAction
|
|||
else {
|
||||
print 'false';
|
||||
}
|
||||
|
||||
|
||||
?>;
|
||||
window.siteTitle = <?php print json_encode($sitetitle) ?>;
|
||||
window.loggedIn = <?php
|
||||
|
||||
window.loggedIn = <?php
|
||||
|
||||
$logged_in_user_json = json_encode($logged_in_user_obj);
|
||||
$logged_in_user_json = str_replace('http:\/\/quitter.se\/','https:\/\/quitter.se\/',$logged_in_user_json);
|
||||
print $logged_in_user_json;
|
||||
|
||||
$logged_in_user_json = str_replace('http:\/\/quitter.se\/','https:\/\/quitter.se\/',$logged_in_user_json);
|
||||
print $logged_in_user_json;
|
||||
|
||||
?>;
|
||||
window.timeBetweenPolling = <?php print QvitterPlugin::settings("timebetweenpolling"); ?>;
|
||||
window.apiRoot = '<?php print common_path("api/", StatusNet::isHTTPS()); ?>';
|
||||
window.fullUrlToThisQvitterApp = '<?php print $qvitterpath; ?>';
|
||||
window.siteRootDomain = '<?php print $siterootdomain; ?>';
|
||||
window.siteInstanceURL = '<?php print $instanceurl; ?>';
|
||||
window.siteInstanceURL = '<?php print $instanceurl; ?>';
|
||||
window.defaultLinkColor = '<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>';
|
||||
window.defaultBackgroundColor = '<?php print QvitterPlugin::settings("defaultbackgroundcolor"); ?>';
|
||||
window.siteBackground = '<?php print QvitterPlugin::settings("sitebackground"); ?>';
|
||||
window.enableWelcomeText = <?php print json_encode(QvitterPlugin::settings("enablewelcometext")); ?>;
|
||||
window.customWelcomeText = <?php print json_encode(QvitterPlugin::settings("customwelcometext")); ?>;
|
||||
window.urlShortenerAPIURL = '<?php print QvitterPlugin::settings("urlshortenerapiurl"); ?>';
|
||||
window.urlShortenerAPIURL = '<?php print QvitterPlugin::settings("urlshortenerapiurl"); ?>';
|
||||
window.urlShortenerSignature = '<?php print QvitterPlugin::settings("urlshortenersignature"); ?>';
|
||||
window.commonSessionToken = '<?php print common_session_token(); ?>';
|
||||
window.siteMaxThumbnailSize = <?php print common_config('thumbnail', 'maxsize'); ?>;
|
||||
window.siteAttachmentURLBase = '<?php print $attachmentroot; ?>';
|
||||
window.siteEmail = '<?php print common_config('site', 'email'); ?>';
|
||||
window.siteAttachmentURLBase = '<?php print $attachmentroot; ?>';
|
||||
window.siteEmail = '<?php print common_config('site', 'email'); ?>';
|
||||
window.siteLicenseTitle = '<?php print common_config('license', 'title'); ?>';
|
||||
window.siteLicenseURL = '<?php print common_config('license', 'url'); ?>';
|
||||
window.customTermsOfUse = <?php print json_encode(QvitterPlugin::settings("customtermsofuse")); ?>;
|
||||
|
||||
|
||||
// available language files and their last update time
|
||||
window.availableLanguages = {<?php
|
||||
|
||||
|
||||
// scan all files in the locale directory and create a json object with their change date added
|
||||
$available_languages = array_diff(scandir(QVITTERDIR.'/locale'), array('..', '.'));
|
||||
foreach($available_languages as $lankey=>$lan) {
|
||||
|
||||
$lancode = substr($lan,0,strpos($lan,'.'));
|
||||
|
||||
|
||||
// for the paranthesis containing language region to work with rtl in ltr enviroment and vice versa, we add a
|
||||
// special rtl or ltr html char after the paranthesis
|
||||
// this list is incomplete, but if any rtl language gets a regional translation, it will probably be arabic
|
||||
$rtl_or_ltr_special_char = '‎';
|
||||
$base_lancode = substr($lancode,0,strpos($lancode,'_'));
|
||||
if($base_lancode == 'ar'
|
||||
|| $base_lancode == 'fa'
|
||||
|| $base_lancode == 'fa'
|
||||
|| $base_lancode == 'he') {
|
||||
$rtl_or_ltr_special_char = '‏';
|
||||
$rtl_or_ltr_special_char = '‏';
|
||||
}
|
||||
|
||||
|
||||
// also make an array with all language names, to use for generating menu
|
||||
$languagecodesandnames[$lancode]['english_name'] = Locale::getDisplayLanguage($lancode, 'en');
|
||||
$languagecodesandnames[$lancode]['name'] = Locale::getDisplayLanguage($lancode, $lancode);
|
||||
if(Locale::getDisplayRegion($lancode, $lancode)) {
|
||||
$languagecodesandnames[$lancode]['name'] .= ' ('.Locale::getDisplayRegion($lancode, $lancode).')'.$rtl_or_ltr_special_char;
|
||||
$languagecodesandnames[$lancode]['name'] .= ' ('.Locale::getDisplayRegion($lancode, $lancode).')'.$rtl_or_ltr_special_char;
|
||||
}
|
||||
|
||||
|
||||
// ahorita meme only on quitter.es
|
||||
if($lancode == 'es_ahorita') {
|
||||
if($siterootdomain == 'quitter.es') {
|
||||
$languagecodesandnames[$lancode]['name'] = 'español (ahorita)';
|
||||
$languagecodesandnames[$lancode]['name'] = 'español (ahorita)';
|
||||
}
|
||||
else {
|
||||
unset($available_languages[$lankey]);
|
||||
|
@ -277,21 +277,21 @@ class QvitterAction extends ApiAction
|
|||
}
|
||||
|
||||
print "\n".' "'.$lancode.'": "'.$lan.'?changed='.date('YmdHis',filemtime(QVITTERDIR.'/locale/'.$lan)).'",';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
<?php
|
||||
|
||||
|
||||
// event for other plugins to use to add head elements to qvitter
|
||||
Event::handle('QvitterEndShowHeadElements', array($this));
|
||||
|
||||
Event::handle('QvitterEndShowHeadElements', array($this));
|
||||
|
||||
?>
|
||||
</head>
|
||||
<body style="background-color:<?php print QvitterPlugin::settings("defaultbackgroundcolor"); ?>">
|
||||
<input id="upload-image-input" class="upload-image-input" type="file" name="upload-image-input" accept="image/*">
|
||||
<input id="upload-image-input" class="upload-image-input" type="file" name="upload-image-input" accept="image/*">
|
||||
<div class="topbar">
|
||||
<a href="<?php print $instanceurl; ?>"><div id="logo"></div></a>
|
||||
<a id="settingslink">
|
||||
|
@ -307,34 +307,35 @@ class QvitterAction extends ApiAction
|
|||
</li>
|
||||
<li class="fullwidth"><a id="logout"></a></li>
|
||||
<li class="fullwidth dropdown-divider"></li>
|
||||
<li class="fullwidth"><a id="edit-profile-header-link"></a></li>
|
||||
<li class="fullwidth"><a id="settings" href="<?php print $instanceurl; ?>settings/profile" donthijack></a></li>
|
||||
<li class="fullwidth"><a id="faq-link"></a></li>
|
||||
<li class="fullwidth"><a id="edit-profile-header-link"></a></li>
|
||||
<li class="fullwidth"><a id="settings" href="<?php print $instanceurl; ?>settings/profile" donthijack></a></li>
|
||||
<li class="fullwidth"><a id="faq-link"></a></li>
|
||||
<li class="fullwidth"><a id="shortcuts-link"></a></li>
|
||||
<?php if (common_config('invite', 'enabled') && !common_config('site', 'closed')) { ?>
|
||||
<li class="fullwidth"><a id="invite-link" href="<?php print $instanceurl; ?>main/invite"></a></li>
|
||||
<?php } ?>
|
||||
<li class="fullwidth"><a id="classic-link"></a></li>
|
||||
<?php } ?>
|
||||
<li class="fullwidth"><a id="classic-link"></a></li>
|
||||
<li class="fullwidth language dropdown-divider"></li>
|
||||
<?php
|
||||
|
||||
|
||||
// languages
|
||||
foreach($languagecodesandnames as $lancode=>$lan) {
|
||||
print '<li class="language"><a class="language-link" title="'.$lan['english_name'].'" data-lang-code="'.$lancode.'">'.$lan['name'].'</a></li>';
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
|
||||
?>
|
||||
</ul>
|
||||
<div class="global-nav">
|
||||
<div class="global-nav-inner">
|
||||
<div class="container">
|
||||
<div class="container">
|
||||
<div id="search">
|
||||
<input type="text" spellcheck="false" autocomplete="off" name="q" placeholder="Sök" id="search-query" class="search-input">
|
||||
<span class="search-icon">
|
||||
<button class="icon nav-search" type="submit" tabindex="-1">
|
||||
<span> Sök </span>
|
||||
</button>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="language-dropdown">
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle">
|
||||
|
@ -348,31 +349,31 @@ class QvitterAction extends ApiAction
|
|||
<span class="caret-inner"></span>
|
||||
</li>
|
||||
<?php
|
||||
|
||||
|
||||
// languages
|
||||
foreach($languagecodesandnames as $lancode=>$lan) {
|
||||
print '<li><a class="language-link" title="'.$lan['english_name'].'" data-lang-code="'.$lancode.'">'.$lan['name'].'</a></li>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="page-container">
|
||||
<?php
|
||||
|
||||
|
||||
$site_notice = common_config('site', 'notice');
|
||||
if(!empty($site_notice)) {
|
||||
print '<div id="site-notice">'.common_config('site', 'notice').'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?><div class="front-welcome-text <?php if ($registrationsclosed) { print 'registrations-closed'; } ?>">
|
||||
</div>
|
||||
<div id="user-container" style="display:none;">
|
||||
</div>
|
||||
<div id="user-container" style="display:none;">
|
||||
<div id="login-content">
|
||||
<form id="form_login" class="form_settings" action="<?php print common_local_url('qvitterlogin'); ?>" method="post">
|
||||
<div id="username-container">
|
||||
|
@ -390,13 +391,13 @@ class QvitterAction extends ApiAction
|
|||
</tr></tbody></table>
|
||||
<div id="remember-forgot">
|
||||
<input type="checkbox" id="rememberme" name="rememberme" value="yes" tabindex="3" checked="checked"> <span id="rememberme_label"></span> · <a id="forgot-password" href="<?php print $instanceurl ?>main/recoverpassword" ></a>
|
||||
<input type="hidden" id="token" name="token" value="<?php print common_session_token(); ?>">
|
||||
<?php
|
||||
<input type="hidden" id="token" name="token" value="<?php print common_session_token(); ?>">
|
||||
<?php
|
||||
|
||||
if (array_key_exists('OpenID', StatusNet::getActivePlugins())) {
|
||||
print '<a href="'.$instanceurl.'main/openid" id="openid-login" title="OpenID" donthijack>OpenID</a>';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -413,22 +414,22 @@ class QvitterAction extends ApiAction
|
|||
</div><?php } ?>
|
||||
<div id="user-header">
|
||||
<div id="mini-edit-profile-button"></div>
|
||||
<div class="profile-header-inner-overlay"></div>
|
||||
<div class="profile-header-inner-overlay"></div>
|
||||
<div id="user-avatar-container"><img id="user-avatar" src="" /></div>
|
||||
<div id="user-name"></div>
|
||||
<div id="user-screen-name"></div>
|
||||
<div id="user-screen-name"></div>
|
||||
</div>
|
||||
<ul id="user-body">
|
||||
<li><a id="user-queets"><span class="label"></span><strong></strong></a></li>
|
||||
<li><a id="user-following"><span class="label"></span><strong></strong></a></li>
|
||||
<li><a id="user-groups"><span class="label"></span><strong></strong></a></li>
|
||||
</ul>
|
||||
<li><a id="user-groups"><span class="label"></span><strong></strong></a></li>
|
||||
</ul>
|
||||
<div id="user-footer">
|
||||
<div id="user-footer-inner">
|
||||
<div id="queet-box" class="queet-box queet-box-syntax" data-start-text=""></div>
|
||||
<div class="syntax-middle"></div>
|
||||
<div class="syntax-two" contenteditable="true"></div>
|
||||
<div class="mentions-suggestions"></div>
|
||||
<div class="syntax-two" contenteditable="true"></div>
|
||||
<div class="mentions-suggestions"></div>
|
||||
<div class="queet-toolbar">
|
||||
<div class="queet-box-extras">
|
||||
<button class="upload-image"></button>
|
||||
|
@ -437,55 +438,55 @@ class QvitterAction extends ApiAction
|
|||
<div class="queet-button">
|
||||
<span class="queet-counter"></span>
|
||||
<button></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-container">
|
||||
<a class="stream-selection friends-timeline" data-stream-header="" data-stream-name="statuses/friends_timeline.json"><i class="chev-right"></i></a>
|
||||
<a class="stream-selection notifications" data-stream-header="" data-stream-name="qvitter/statuses/notifications.json"><span id="unseen-notifications"></span><i class="chev-right"></i></a>
|
||||
<a class="stream-selection mentions" data-stream-header="" data-stream-name="statuses/mentions.json"><i class="chev-right"></i></a>
|
||||
<a class="stream-selection my-timeline" data-stream-header="@statuses/user_timeline.json" data-stream-name="statuses/user_timeline.json"><i class="chev-right"></i></a>
|
||||
<a class="stream-selection favorites" data-stream-header="" data-stream-name="favorites.json"><i class="chev-right"></i></a>
|
||||
<a class="stream-selection notifications" data-stream-header="" data-stream-name="qvitter/statuses/notifications.json"><span id="unseen-notifications"></span><i class="chev-right"></i></a>
|
||||
<a class="stream-selection mentions" data-stream-header="" data-stream-name="statuses/mentions.json"><i class="chev-right"></i></a>
|
||||
<a class="stream-selection my-timeline" data-stream-header="@statuses/user_timeline.json" data-stream-name="statuses/user_timeline.json"><i class="chev-right"></i></a>
|
||||
<a class="stream-selection favorites" data-stream-header="" data-stream-name="favorites.json"><i class="chev-right"></i></a>
|
||||
<a href="<?php print $instanceurl ?>" class="stream-selection public-timeline" data-stream-header="" data-stream-name="statuses/public_timeline.json"><i class="chev-right"></i></a>
|
||||
<a href="<?php print $instanceurl ?>main/all" class="stream-selection public-and-external-timeline" data-stream-header="" data-stream-name="statuses/public_and_external_timeline.json"><i class="chev-right"></i></a>
|
||||
<a href="<?php print $instanceurl ?>main/all" class="stream-selection public-and-external-timeline" data-stream-header="" data-stream-name="statuses/public_and_external_timeline.json"><i class="chev-right"></i></a>
|
||||
</div>
|
||||
<div class="menu-container" id="history-container"></div>
|
||||
<div id="qvitter-notice"><?php print common_config('site', 'qvitternotice'); ?></div>
|
||||
</div>
|
||||
<div class="menu-container" id="history-container"></div>
|
||||
<div id="qvitter-notice"><?php print common_config('site', 'qvitternotice'); ?></div>
|
||||
</div>
|
||||
<div id="feed">
|
||||
<div id="feed-header">
|
||||
<div id="feed-header-inner">
|
||||
<h2></h2>
|
||||
<div class="reload-stream"></div>
|
||||
<div class="reload-stream"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="new-queets-bar-container" class="hidden"><div id="new-queets-bar"></div></div>
|
||||
<div id="feed-body"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="footer"><div id="footer-spinner-container"></div></div>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery-2.1.4.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery-2.1.4.min.js')); ?>"></script>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery-ui-1.10.3.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery-ui-1.10.3.min.js')); ?>"></script>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery.minicolors.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery.minicolors.min.js')); ?>"></script>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery.jWindowCrop.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery.jWindowCrop.js')); ?>"></script>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery.minicolors.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery.minicolors.min.js')); ?>"></script>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery.jWindowCrop.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery.jWindowCrop.js')); ?>"></script>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/load-image.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/load-image.min.js')); ?>"></script>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/xregexp-all-min-2.0.0.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/xregexp-all-min-2.0.0.js')); ?>"></script>
|
||||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/xregexp-all-min-2.0.0.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/xregexp-all-min-2.0.0.js')); ?>"></script>
|
||||
<script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/dom-functions.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/dom-functions.js')); ?>"></script>
|
||||
<script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/misc-functions.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/misc-functions.js')); ?>"></script>
|
||||
<script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/ajax-functions.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/ajax-functions.js')); ?>"></script>
|
||||
<script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/qvitter.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/qvitter.js')); ?>"></script>
|
||||
<?php
|
||||
|
||||
|
||||
// event for other plugins to add scripts to qvitter
|
||||
Event::handle('QvitterEndShowScripts', array($this));
|
||||
|
||||
|
||||
// we might have custom javascript in the config file that we want to add
|
||||
if(QvitterPlugin::settings('js')) {
|
||||
print '<script type="text/javascript">'.QvitterPlugin::settings('js').'</script>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="dynamic-styles">
|
||||
<style>
|
||||
|
@ -503,7 +504,7 @@ class QvitterAction extends ApiAction
|
|||
.queet:hover .stream-item-expand,
|
||||
.show-full-conversation:hover,
|
||||
#new-queets-bar,
|
||||
.menu-container div,
|
||||
.menu-container div,
|
||||
.cm-mention, .cm-tag, .cm-group, .cm-url, .cm-email,
|
||||
div.syntax-middle span,
|
||||
#user-body strong,
|
||||
|
@ -511,13 +512,13 @@ class QvitterAction extends ApiAction
|
|||
.stream-item:not(.temp-post) ul.queet-actions li .icon:not(.is-mine):hover:before,
|
||||
.show-full-conversation,
|
||||
#user-body #user-queets:hover .label,
|
||||
#user-body #user-groups:hover .label,
|
||||
#user-body #user-groups:hover .label,
|
||||
#user-body #user-following:hover .label,
|
||||
ul.stats a strong,
|
||||
.queet-box-extras button,
|
||||
#openid-login:hover:after {
|
||||
color:/*COLORSTART*/<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>/*COLOREND*/;
|
||||
}
|
||||
}
|
||||
#unseen-notifications,
|
||||
.stream-item.notification .not-seen,
|
||||
#top-compose,
|
||||
|
@ -535,8 +536,9 @@ class QvitterAction extends ApiAction
|
|||
.topbar .global-nav.show-logo:before,
|
||||
.topbar .global-nav.pulse-logo:before {
|
||||
background-color:/*BACKGROUNDCOLORSTART*/<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>/*BACKGROUNDCOLOREND*/;
|
||||
}
|
||||
.queet-box-syntax[contenteditable="true"]:focus {
|
||||
}
|
||||
.queet-box-syntax[contenteditable="true"]:focus,
|
||||
.stream-item.selected-by-keyboard::before {
|
||||
border-color:/*BORDERCOLORSTART*/#999999/*BORDERCOLOREND*/;
|
||||
}
|
||||
#user-footer-inner,
|
||||
|
@ -556,7 +558,7 @@ class QvitterAction extends ApiAction
|
|||
span.inline-reply-caret .caret-inner {
|
||||
border-bottom-color:/*LIGHTERBORDERBOTTOMCOLORSTART*/rgb(205,230,239)/*LIGHTERBORDERBOTTOMCOLOREND*/;
|
||||
}
|
||||
|
||||
|
||||
.modal-close .icon,
|
||||
.chev-right,
|
||||
.close-right,
|
||||
|
@ -572,34 +574,33 @@ class QvitterAction extends ApiAction
|
|||
button.shorten i,
|
||||
.reload-stream,
|
||||
.topbar .global-nav:before,
|
||||
.stream-item.notification.repeat .dogear,
|
||||
.stream-item.notification.repeat .dogear,
|
||||
.stream-item.notification.like .dogear,
|
||||
.ostatus-link,
|
||||
.close-edit-profile-window {
|
||||
background-image: url("<?php print QvitterPlugin::settings("sprite"); ?>");
|
||||
background-size: 500px 1329px;
|
||||
background-image: url("<?php print QvitterPlugin::settings("sprite"); ?>");
|
||||
background-size: 500px 1329px;
|
||||
}
|
||||
@media (max-width: 910px) {
|
||||
@media (max-width: 910px) {
|
||||
#search-query,
|
||||
.menu-container a,
|
||||
.menu-container a.current,
|
||||
.stream-selection.friends-timeline:after,
|
||||
.stream-selection.notifications:after,
|
||||
.stream-selection.my-timeline:after,
|
||||
.stream-selection.public-timeline:after {
|
||||
background-image: url("<?php print QvitterPlugin::settings("sprite"); ?>");
|
||||
.stream-selection.my-timeline:after,
|
||||
.stream-selection.public-timeline:after {
|
||||
background-image: url("<?php print QvitterPlugin::settings("sprite"); ?>");
|
||||
background-size: 500px 1329px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
1756
css/qvitter.css
1756
css/qvitter.css
File diff suppressed because it is too large
Load Diff
13
doc/en/shortcuts.html
Normal file
13
doc/en/shortcuts.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<h3>Actions</h3>
|
||||
<p><span class="shortcut">n</span><span class="description">New Queet</span></p>
|
||||
<p><span class="shortcut">f</span><span class="description">Mark as favorite</span></p>
|
||||
<p><span class="shortcut">r</span><span class="description">Reply</span></p>
|
||||
<p><span class="shortcut">t</span><span class="description">Requeet</span></p>
|
||||
<p><span class="shortcut">Enter</span><span class="description">Expand queet</span></p>
|
||||
<p><span class="shortcut">Ctrl</span><span class="shortcut">Enter</span>or <span class="shortcut">Cmd ⌘</span><span class="shortcut">Enter</span><span class="description">Post Queet</span></p>
|
||||
<p><span class="shortcut">Esc</span><span class="description">Collapse all expanded Queets</span></p>
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<p><span class="shortcut">?</span><span class="description">This menu</span></p>
|
||||
<p><span class="shortcut">j</span><span class="description">Next Queet</span></p>
|
||||
<p><span class="shortcut">k</span><span class="description">Previous Queet</span></p>
|
13
doc/sv/shortcuts.html
Normal file
13
doc/sv/shortcuts.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<h3>Handlingar</h3>
|
||||
<p><span class="shortcut">n</span><span class="description">Nytt qvitter</span></p>
|
||||
<p><span class="shortcut">f</span><span class="description">Favoritmarkera</span></p>
|
||||
<p><span class="shortcut">r</span><span class="description">Svara</span></p>
|
||||
<p><span class="shortcut">t</span><span class="description">Requeeta</span></p>
|
||||
<p><span class="shortcut">Enter</span><span class="description">Öppna och stäng</span></p>
|
||||
<p><span class="shortcut">Ctrl</span><span class="shortcut">Enter</span>or <span class="shortcut">Cmd ⌘</span><span class="shortcut">Enter</span><span class="description">Skicka qvitter</span></p>
|
||||
<p><span class="shortcut">Esc</span><span class="description">Stäng allt öppnat qvitter</span></p>
|
||||
|
||||
<h3>Navigation</h3>
|
||||
<p><span class="shortcut">?</span><span class="description">Denna meny</span></p>
|
||||
<p><span class="shortcut">j</span><span class="description">Nästa qvitter</span></p>
|
||||
<p><span class="shortcut">k</span><span class="description">Föregående qvitter</span></p>
|
|
@ -4,20 +4,20 @@
|
|||
· ·
|
||||
· Q V I T T E R ·
|
||||
· ·
|
||||
· ·
|
||||
· ·
|
||||
· <o) ·
|
||||
· /_//// ·
|
||||
· (____/ ·
|
||||
· (o< ·
|
||||
· o> \\\\_\ ·
|
||||
· \\) \____) ·
|
||||
· \\) \____) ·
|
||||
· ·
|
||||
· ·
|
||||
· ·
|
||||
· @licstart The following is the entire license notice for the ·
|
||||
· JavaScript code in this page. ·
|
||||
· ·
|
||||
· Copyright (C) 2015 Hannes Mannerheim and other contributors ·
|
||||
· ·
|
||||
· ·
|
||||
· ·
|
||||
· This program is free software: you can redistribute it and/or modify ·
|
||||
· it under the terms of the GNU Affero General Public License as ·
|
||||
|
@ -32,19 +32,19 @@
|
|||
· You should have received a copy of the GNU Affero General Public License ·
|
||||
· along with this program. If not, see <http://www.gnu.org/licenses/>. ·
|
||||
· ·
|
||||
· @licend The above is the entire license notice ·
|
||||
· for the JavaScript code in this page. ·
|
||||
· ·
|
||||
· @licend The above is the entire license notice ·
|
||||
· for the JavaScript code in this page. ·
|
||||
· ·
|
||||
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Current time in milliseconds, to send with each request to make sure
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Current time in milliseconds, to send with each request to make sure
|
||||
· we're not getting 304 responses.
|
||||
·
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function timeNow() {
|
||||
return new Date().getTime();
|
||||
|
@ -52,15 +52,15 @@ function timeNow() {
|
|||
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Get a document and replace strings
|
||||
/* ·
|
||||
·
|
||||
· @param doc: the name of the document
|
||||
· @param actionOnSuccess: callback function to run on success
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
· Get a document and replace strings
|
||||
·
|
||||
· @param doc: the name of the document
|
||||
· @param actionOnSuccess: callback function to run on success
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function getDoc(doc, actionOnSuccess) {
|
||||
var timeNow = new Date().getTime();
|
||||
$.get(window.fullUrlToThisQvitterApp + 'doc/' + window.selectedLanguage + '/' + doc + '.html?t=' + timeNow, function(data){
|
||||
|
@ -72,9 +72,9 @@ function getDoc(doc, actionOnSuccess) {
|
|||
if(data) {
|
||||
actionOnSuccess(renderDoc(data));
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
function renderDoc(docHtml) {
|
||||
docHtml = docHtml.replace(/{instance-name}/g,window.siteTitle);
|
||||
docHtml = docHtml.replace(/{instance-url}/g,window.siteRootDomain);
|
||||
|
@ -82,32 +82,32 @@ function renderDoc(docHtml) {
|
|||
docHtml = docHtml.replace(/{nickname}/g,window.loggedIn.screen_name);
|
||||
docHtml = docHtml.replace(/{instance-email}/g,window.siteEmail);
|
||||
docHtml = docHtml.replace(/{instance-license-title}/g,window.siteLicenseTitle);
|
||||
docHtml = docHtml.replace(/{instance-license-url}/g,window.siteLicenseURL);
|
||||
return docHtml;
|
||||
docHtml = docHtml.replace(/{instance-license-url}/g,window.siteLicenseURL);
|
||||
return docHtml;
|
||||
}
|
||||
|
||||
/* ·
|
||||
·
|
||||
/* ·
|
||||
·
|
||||
· Check login credentials with http basic auth
|
||||
·
|
||||
·
|
||||
· @param username: users screen name
|
||||
· @param password: users password
|
||||
· @param actionOnSuccess: callback function on log in success
|
||||
·
|
||||
·
|
||||
· · · · · · · · · */
|
||||
|
||||
function checkLogin(username,password,actionOnSuccess) {
|
||||
$.ajax({ url: window.apiRoot + 'qvitter/checklogin.json',
|
||||
|
||||
function checkLogin(username,password,actionOnSuccess) {
|
||||
$.ajax({ url: window.apiRoot + 'qvitter/checklogin.json',
|
||||
type: 'POST',
|
||||
data: {
|
||||
data: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
dataType: 'json',
|
||||
},
|
||||
dataType: 'json',
|
||||
error: function() {
|
||||
logoutWithoutReload(true);
|
||||
},
|
||||
success: function(data) {
|
||||
success: function(data) {
|
||||
if(typeof data.error == 'undefined' && data !== false) {
|
||||
actionOnSuccess(data);
|
||||
}
|
||||
|
@ -115,189 +115,189 @@ function checkLogin(username,password,actionOnSuccess) {
|
|||
logoutWithoutReload(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Generic API GET request
|
||||
·
|
||||
· @param stream: any api get-request e.g. 'statuses/favs/111111.json'
|
||||
· @param actionOnSuccess: callback function
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function getFromAPI(stream, actionOnSuccess) {
|
||||
$.ajax({ url: window.apiRoot + stream + qOrAmp(stream) + 't=' + timeNow(),
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
statusCode: {
|
||||
401:function() {
|
||||
location.reload(); // we may have been logged out in another tab, reload page
|
||||
},
|
||||
404:function() {
|
||||
// redirect to frontpage when trying to access non-existing users
|
||||
if(stream.indexOf('statuses/user_timeline.json?screen_name=') > -1) {
|
||||
window.location.replace(window.siteInstanceURL);
|
||||
}
|
||||
}
|
||||
},
|
||||
success: function(data, textStatus, request) {
|
||||
· @param actionOnSuccess: callback function
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function getFromAPI(stream, actionOnSuccess) {
|
||||
$.ajax({ url: window.apiRoot + stream + qOrAmp(stream) + 't=' + timeNow(),
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
statusCode: {
|
||||
401:function() {
|
||||
location.reload(); // we may have been logged out in another tab, reload page
|
||||
},
|
||||
404:function() {
|
||||
// redirect to frontpage when trying to access non-existing users
|
||||
if(stream.indexOf('statuses/user_timeline.json?screen_name=') > -1) {
|
||||
window.location.replace(window.siteInstanceURL);
|
||||
}
|
||||
}
|
||||
},
|
||||
success: function(data, textStatus, request) {
|
||||
|
||||
displayOrHideUnreadNotifications(request.getResponseHeader('Qvitter-Notifications'));
|
||||
|
||||
displayOrHideUnreadNotifications(request.getResponseHeader('Qvitter-Notifications'));
|
||||
|
||||
// profile card from user array, also cache it
|
||||
if(request.getResponseHeader('Qvitter-User-Array') !== null) {
|
||||
var qvitterUserArrayHeader = request.getResponseHeader('Qvitter-User-Array');
|
||||
|
||||
|
||||
// quitter.se fix
|
||||
if(window.thisSiteThinksItIsHttpButIsActuallyHttps) {
|
||||
console.log(qvitterUserArrayHeader);
|
||||
qvitterUserArrayHeader = qvitterUserArrayHeader.replace(new RegExp('http:\\\\/\\\\/' + window.siteRootDomain, 'g'), 'https:\/\/' + window.siteRootDomain);
|
||||
}
|
||||
|
||||
|
||||
var userArray = iterateRecursiveReplaceHtmlSpecialChars($.parseJSON(qvitterUserArrayHeader));
|
||||
userArrayCacheStore(userArray);
|
||||
addProfileCardToDOM(buildProfileCard(userArray));
|
||||
}
|
||||
|
||||
data = convertEmptyObjectToEmptyArray(data);
|
||||
|
||||
data = convertEmptyObjectToEmptyArray(data);
|
||||
|
||||
data = iterateRecursiveReplaceHtmlSpecialChars(data);
|
||||
|
||||
|
||||
searchForUserDataToCache(data);
|
||||
|
||||
actionOnSuccess(data);
|
||||
actionOnSuccess(data);
|
||||
},
|
||||
error: function(data) {
|
||||
actionOnSuccess(false);
|
||||
console.log(data);
|
||||
remove_spinner();
|
||||
remove_spinner();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
/* ·
|
||||
·
|
||||
· Post new link color
|
||||
·
|
||||
· @param newLinkColor: the new link color in hex without #
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function postNewLinkColor(newLinkColor) {
|
||||
$.ajax({ url: window.apiRoot + 'qvitter/update_link_color.json?t=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
$.ajax({ url: window.apiRoot + 'qvitter/update_link_color.json?t=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
linkcolor: newLinkColor
|
||||
},
|
||||
dataType:"json",
|
||||
error: function(data){ console.log(data); },
|
||||
success: function(data) {
|
||||
success: function(data) {
|
||||
window.userLinkColor = newLinkColor;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Post new background color
|
||||
·
|
||||
· @param newBackgroundColor: the new background color in hex without #
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function postNewBackgroundColor(newBackgroundColor) {
|
||||
$.ajax({ url: window.apiRoot + 'qvitter/update_background_color.json?t=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
$.ajax({ url: window.apiRoot + 'qvitter/update_background_color.json?t=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
backgroundcolor: newBackgroundColor
|
||||
},
|
||||
dataType:"json",
|
||||
error: function(data){ console.log(data); },
|
||||
success: function(data) {
|
||||
success: function(data) {
|
||||
// unset background image and set new color
|
||||
window.loggedIn.background_image = false;
|
||||
changeDesign({backgroundimage:false,backgroundcolor:newBackgroundColor});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Post follow or unfollow user request
|
||||
·
|
||||
· @param followOrUnfollow: either 'follow' or 'unfollow'
|
||||
· @param user_id: the user id of the user we want to follow
|
||||
· @param actionOnSuccess: callback function, false on error, data on success
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function APIFollowOrUnfollowUser(followOrUnfollow,user_id,this_element,actionOnSuccess) {
|
||||
|
||||
|
||||
if(followOrUnfollow == 'follow') {
|
||||
var postRequest = 'friendships/create.json?t=' + timeNow();
|
||||
}
|
||||
else if (followOrUnfollow == 'unfollow') {
|
||||
var postRequest = 'friendships/destroy.json?t=' + timeNow();
|
||||
}
|
||||
|
||||
$.ajax({ url: window.apiRoot + postRequest,
|
||||
type: "POST",
|
||||
data: {
|
||||
|
||||
$.ajax({ url: window.apiRoot + postRequest,
|
||||
type: "POST",
|
||||
data: {
|
||||
user_id: user_id
|
||||
},
|
||||
dataType:"json",
|
||||
error: function(data){ actionOnSuccess(false,this_element); console.log(data); },
|
||||
success: function(data) { actionOnSuccess(data,this_element);}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Post join or leave group request
|
||||
·
|
||||
· @param joinOrLeave: either 'join' or 'leave'
|
||||
· @param group_id: group's id
|
||||
· @param actionOnSuccess: callback function, false on error, data on success
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function APIJoinOrLeaveGroup(joinOrLeave,group_id,this_element,actionOnSuccess) {
|
||||
$.ajax({ url: window.apiRoot + 'statusnet/groups/' + joinOrLeave + '.json?t=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
$.ajax({ url: window.apiRoot + 'statusnet/groups/' + joinOrLeave + '.json?t=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
id: group_id
|
||||
},
|
||||
dataType:"json",
|
||||
error: function(data){ actionOnSuccess(false,this_element); console.log(data); },
|
||||
success: function(data) { actionOnSuccess(data,this_element);}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/* ·
|
||||
·
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Post queet
|
||||
·
|
||||
· @param queetText_txt: the text to post
|
||||
· @param in_reply_to_status_id: the local id for the queet to reply to
|
||||
· @param actionOnSuccess: callback function, false on error, data on success
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function postQueetToAPI(queetText_txt, in_reply_to_status_id, actionOnSuccess) {
|
||||
$.ajax({ url: window.apiRoot + 'statuses/update.json?t=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
$.ajax({ url: window.apiRoot + 'statuses/update.json?t=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
status: queetText_txt,
|
||||
source: 'Qvitter',
|
||||
in_reply_to_status_id: in_reply_to_status_id
|
||||
|
@ -305,98 +305,98 @@ function postQueetToAPI(queetText_txt, in_reply_to_status_id, actionOnSuccess) {
|
|||
dataType:"json",
|
||||
error: function(data){ actionOnSuccess(false); console.log(data); },
|
||||
success: function(data) { actionOnSuccess(data);}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Generic POST-action
|
||||
·
|
||||
· @param action: the api action, e.q. 'statuses/retweet/1.json'
|
||||
· @param actionOnSuccess: callback function, false on error, data on success
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
function postActionToAPI(action, actionOnSuccess) {
|
||||
$.ajax({ url: window.apiRoot + action + qOrAmp(action) + 't=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
$.ajax({ url: window.apiRoot + action + qOrAmp(action) + 't=' + timeNow(),
|
||||
type: "POST",
|
||||
data: {
|
||||
source: 'Qvitter'
|
||||
},
|
||||
dataType:"json",
|
||||
error: function(data){ actionOnSuccess(false); console.log(data); },
|
||||
success: function(data) {
|
||||
success: function(data) {
|
||||
|
||||
data = convertEmptyObjectToEmptyArray(data);
|
||||
data = convertEmptyObjectToEmptyArray(data);
|
||||
|
||||
actionOnSuccess(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Delete requeet
|
||||
·
|
||||
·
|
||||
· @param this_stream_item: jQuery object for stream-item
|
||||
· @param this_action: JQuery object for the requeet-button
|
||||
· @param my_rq_id: the id for the requeet
|
||||
·
|
||||
·
|
||||
· · · · · · · · · */
|
||||
|
||||
function unRequeet(this_stream_item, this_action, my_rq_id) {
|
||||
this_action.children('.with-icn').removeClass('done');
|
||||
this_action.find('.with-icn b').html(window.sL.requeetVerb);
|
||||
this_stream_item.removeClass('requeeted');
|
||||
this_action.find('.with-icn b').html(window.sL.requeetVerb);
|
||||
this_stream_item.removeClass('requeeted');
|
||||
|
||||
// post unrequeet
|
||||
postActionToAPI('statuses/destroy/' + my_rq_id + '.json', function(data) {
|
||||
if(data) {
|
||||
remove_spinner();
|
||||
this_stream_item.removeAttr('data-requeeted-by-me-id');
|
||||
this_stream_item.removeAttr('data-requeeted-by-me-id');
|
||||
this_stream_item.children('.queet').children('.context').find('.requeet-text').children('a[data-user-id="' + window.myUserID + '"]').remove();
|
||||
if(this_stream_item.children('.queet').children('.context').find('.requeet-text').children('a').length<1) {
|
||||
this_stream_item.children('.queet').children('.context').remove();
|
||||
}
|
||||
getFavsAndRequeetsForQueet(this_stream_item, this_stream_item.attr('data-quitter-id'));
|
||||
getFavsAndRequeetsForQueet(this_stream_item, this_stream_item.attr('data-quitter-id'));
|
||||
}
|
||||
else {
|
||||
remove_spinner();
|
||||
this_action.children('.with-icn').addClass('done');
|
||||
this_action.find('.with-icn b').html(window.sL.requeetedVerb);
|
||||
this_stream_item.addClass('requeeted');
|
||||
this_action.find('.with-icn b').html(window.sL.requeetedVerb);
|
||||
this_stream_item.addClass('requeeted');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
|
||||
/* ·
|
||||
·
|
||||
· Gets favs or requeets for a queet from api
|
||||
·
|
||||
·
|
||||
· @param q: stream item object
|
||||
· @param qid: the queet id
|
||||
·
|
||||
·
|
||||
· · · · · · · · · */
|
||||
|
||||
function getFavsAndRequeetsForQueet(q,qid) {
|
||||
|
||||
function getFavsAndRequeetsForQueet(q,qid) {
|
||||
|
||||
// get immediately from localstorage cache
|
||||
localStorageObjectCache_GET('favsAndRequeets',qid,function(data){
|
||||
if(data) {
|
||||
showFavsAndRequeetsInQueet(q, data);
|
||||
showFavsAndRequeetsInQueet(q, data);
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({ url: window.apiRoot + "qvitter/favs_and_repeats/" + qid + ".json?t=" + timeNow(),
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
|
||||
if(data.favs.length > 0 || data.repeats.length > 0) {
|
||||
localStorageObjectCache_STORE('favsAndRequeets',qid, data); // cache response
|
||||
|
@ -406,11 +406,11 @@ function getFavsAndRequeetsForQueet(q,qid) {
|
|||
localStorageObjectCache_STORE('favsAndRequeets',qid, false);
|
||||
}
|
||||
|
||||
showFavsAndRequeetsInQueet(q,data);
|
||||
},
|
||||
error: function(data) {
|
||||
showFavsAndRequeetsInQueet(q,data);
|
||||
},
|
||||
error: function(data) {
|
||||
remove_spinner();
|
||||
console.log(data);
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
1247
js/dom-functions.js
1247
js/dom-functions.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
2046
js/qvitter.js
2046
js/qvitter.js
File diff suppressed because it is too large
Load Diff
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Més",
|
||||
"blockUser": "Bloca {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Pli",
|
||||
"blockUser": "Bloki {username}",
|
||||
"goToOriginalNotice": "Iri al origina pepo",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Más",
|
||||
"blockUser": "Bloquear {username}",
|
||||
"goToOriginalNotice": "Ir al queet original",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Más",
|
||||
"blockUser": "Bloquear {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Plus",
|
||||
"blockUser": "Bloquer {username}",
|
||||
"goToOriginalNotice": "Aller vers l'avis d'origine",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Máis",
|
||||
"blockUser": "Bloquear a {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "עוד",
|
||||
"blockUser": "חסום את {username}",
|
||||
"goToOriginalNotice": "עבור להודעה מקורית",
|
||||
"clickToDrag":"לחץ כדי לגרור"
|
||||
"clickToDrag":"לחץ כדי לגרור",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Plu multo",
|
||||
"blockUser": "Blokusar {username}",
|
||||
"goToOriginalNotice": "Irar al originala mesajo",
|
||||
"clickToDrag":"Klikez por tranar"
|
||||
"clickToDrag":"Klikez por tranar",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Mer",
|
||||
"blockUser": "Blokker {username}",
|
||||
"goToOriginalNotice": "Gå til den opprinnelige queeten",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "Mer",
|
||||
"blockUser": "Blockera {username}",
|
||||
"goToOriginalNotice": "Gå till den ursprungliga queeten",
|
||||
"clickToDrag":"Klicka och dra för att flytta"
|
||||
}
|
||||
"clickToDrag":"Klicka och dra för att flytta",
|
||||
"keyboardShortcuts":"Kortkommandon"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
|
@ -120,5 +120,6 @@
|
|||
"ellipsisMore": "More",
|
||||
"blockUser": "Block {username}",
|
||||
"goToOriginalNotice": "Go to original notice",
|
||||
"clickToDrag":"Click to drag"
|
||||
}
|
||||
"clickToDrag":"Click to drag",
|
||||
"keyboardShortcuts":"Keyboard shortcuts"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user