Merge branch 'master' into jpn: upstream update
36
AUTHORS
Normal file
@ -0,0 +1,36 @@
|
||||
twister-html authors
|
||||
====================
|
||||
|
||||
Miguel Freitas
|
||||
Original javascript code and basic UI functionality
|
||||
|
||||
Lucas Leal
|
||||
Original theme, CSS + artwork
|
||||
|
||||
Msjoinder
|
||||
Polyglot support (internationalization), multiple fixes
|
||||
|
||||
erkan yüksel
|
||||
Image preview, automatic unicode conversion, split long posts, hiding posts with mentions and more.
|
||||
|
||||
Hedgehog
|
||||
Calm theme, CSS + artwork and more.
|
||||
|
||||
Denis Ryabov
|
||||
Tox and bitmessage profile fields, multiple fixes
|
||||
|
||||
Giacomo Lacava
|
||||
i18n branch maintainer, fixes
|
||||
|
||||
BlockTester
|
||||
Secret key button, exit button, fixes
|
||||
|
||||
Dionysis Zindros
|
||||
Several visual fixes
|
||||
|
||||
digital-dreamer
|
||||
Guest mode browsing
|
||||
|
||||
Mylène Bressan
|
||||
Nin theme
|
||||
|
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2014 Miguel Freitas, Lucas Leal and twister project developers.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
@ -1,7 +1,7 @@
|
||||
twister-html
|
||||
============
|
||||
|
||||
HTML interface for [Twister](http://twister.net.co).
|
||||
HTML interface for [Twister](http://twister.net.co) [(github)](https://github.com/miguelfreitas/twister-core).
|
||||
To use it, clone this repo under ~/.twister/html like this:
|
||||
|
||||
git clone https://github.com/miguelfreitas/twister-html.git ~/.twister/html
|
||||
|
31
abort.html
@ -3,21 +3,22 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Aborting...</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<script src="jquery.min.js"></script>
|
||||
<script src="jQueryPlugins.js"></script>
|
||||
<script src="jquery.json-2.4.js"></script>
|
||||
<script src="jquery.jsonrpcclient.js"></script>
|
||||
<script src="jquery.storageapi.js"></script>
|
||||
<script src="mobile_abstract.js"></script>
|
||||
<script src="twister_io.js"></script>
|
||||
<script src="twister_user.js"></script>
|
||||
<script src="twister_formatpost.js"></script>
|
||||
<script src="twister_following.js"></script>
|
||||
<script src="twister_newmsgs.js"></script>
|
||||
<script src="twister_network.js"></script>
|
||||
<script src="interface_common.js"></script>
|
||||
|
||||
<link id="stylecss" rel="stylesheet" href="css/style.css"/>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jQueryPlugins.js"></script>
|
||||
<script src="js/jquery.json-2.4.js"></script>
|
||||
<script src="js/jquery.jsonrpcclient.js"></script>
|
||||
<script src="js/jquery.storageapi.js"></script>
|
||||
<script src="js/options.js"></script>
|
||||
<script src="js/mobile_abstract.js"></script>
|
||||
<script src="js/twister_io.js"></script>
|
||||
<script src="js/twister_user.js"></script>
|
||||
<script src="js/twister_formatpost.js"></script>
|
||||
<script src="js/twister_following.js"></script>
|
||||
<script src="js/twister_newmsgs.js"></script>
|
||||
<script src="js/twister_network.js"></script>
|
||||
<script src="js/interface_common.js"></script>
|
||||
<script>changeStyle();</script>
|
||||
<link rel="icon" type="image/png" href="img/twister_mini.png" />
|
||||
</head>
|
||||
|
||||
|
BIN
css/Symbola.ttf
Normal file
139
css/profile.css
@ -3,7 +3,6 @@
|
||||
***************************************/
|
||||
.profile-card
|
||||
{
|
||||
margin: 0 0 10px 335px;
|
||||
padding: 7px;
|
||||
background: rgba( 255, 255, 255, .5 );
|
||||
border: solid 1px rgba( 69, 71, 77, .05 );
|
||||
@ -11,8 +10,8 @@
|
||||
}
|
||||
.profile-card-main
|
||||
{
|
||||
width: 520px;
|
||||
height: 280px;
|
||||
width: 540px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
transition: all .2s linear;
|
||||
@ -38,10 +37,15 @@
|
||||
{
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
margin: 20px auto 5px auto;
|
||||
border-radius: 15%;
|
||||
border: solid 5px #fff;
|
||||
border: solid 6px #45474d;
|
||||
border-radius: 40%;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
box-sizing: content-box;
|
||||
float:left;
|
||||
top: 50%;
|
||||
background-color: #a12a28;
|
||||
|
||||
}
|
||||
.profile-card-main h1
|
||||
{
|
||||
@ -55,7 +59,8 @@
|
||||
}
|
||||
.profile-card .direct-messages,
|
||||
.profile-card .direct-messages-with-user,
|
||||
.profile-card .follow
|
||||
.profile-card .follow,
|
||||
.profile-card .profileUnfollow
|
||||
{
|
||||
display: block;
|
||||
position: absolute;
|
||||
@ -70,16 +75,25 @@
|
||||
border: none;
|
||||
transition: all .2s linear;
|
||||
}
|
||||
.profile-card .follow
|
||||
.profile-card .follow,
|
||||
.profile-card .profileUnfollow
|
||||
{
|
||||
right: 135px;
|
||||
}
|
||||
.profile-card .profileUnfollow
|
||||
{
|
||||
background-color: rgba( 0, 0, 0, .3 );
|
||||
}
|
||||
.profile-card .direct-messages:hover,
|
||||
.profile-card .direct-messages-with-user:hover,
|
||||
.profile-card .follow:hover
|
||||
{
|
||||
background: rgba( 0, 0, 0, .3 );
|
||||
}
|
||||
.profile-card .profileUnfollow:hover
|
||||
{
|
||||
background: rgba( 0, 0, 0, .1 );
|
||||
}
|
||||
.profile-card.forEdition
|
||||
{
|
||||
margin: 0 auto;
|
||||
@ -88,6 +102,8 @@
|
||||
.forEdition .profile-card-photo
|
||||
{
|
||||
border: solid 2px #fff;
|
||||
border-radius: 0%;
|
||||
float:none;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
transition: all .2s linear;
|
||||
@ -142,6 +158,12 @@
|
||||
{
|
||||
display: inline-block;
|
||||
}
|
||||
.forEdition .profile-card-main .input-tox,
|
||||
.forEdition .profile-card-main .input-bitmessage
|
||||
{
|
||||
width: 90%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.profile-edition-buttons
|
||||
{
|
||||
padding: 10px;
|
||||
@ -152,24 +174,101 @@
|
||||
**************************************/
|
||||
.profile-modal .modal-wrapper
|
||||
{
|
||||
width: 528px;
|
||||
height: 680px;
|
||||
margin: -340px 0 0 -264px;
|
||||
width: 580px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top:10%;
|
||||
height: 80%;
|
||||
margin-left: -300px;
|
||||
|
||||
}
|
||||
.profile-modal .modal-content
|
||||
{
|
||||
padding: 3px;
|
||||
height: 90%;
|
||||
}
|
||||
#msngrswr {
|
||||
display: none;
|
||||
margin-top: 20px;
|
||||
height: 30px;
|
||||
}
|
||||
.profile-extra-contact {
|
||||
float: left;
|
||||
display: none;
|
||||
margin-right: 35px;
|
||||
}
|
||||
.bitmessage-ctc, .tox-ctc {
|
||||
position: absolute;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
border: 1px solid #d6d8dc;
|
||||
background: #e3e5ea;
|
||||
opacity: .8;
|
||||
-webkit-border-radius: 0 5px 5px 0;
|
||||
-moz-border-radius: 0 5px 5px 0;
|
||||
border-radius: 0 5px 5px 0;
|
||||
-webkit-transition: all 20ms;
|
||||
-moz-transition: all 20ms;
|
||||
-ms-transition: all 20ms;
|
||||
-o-transition: all 20ms;
|
||||
transition: all 20ms;
|
||||
font-size: 18px;
|
||||
}
|
||||
.bitmessage-ctc:hover, .tox-ctc:hover {
|
||||
background-color: #f0f2f8;
|
||||
opacity: 1;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.bitmessage-ctc:active, .tox-ctc:active {
|
||||
background-color: #edfced;
|
||||
}
|
||||
.bitmessage-ctc:after,
|
||||
.tox-ctc:after {
|
||||
content: '📋';
|
||||
}
|
||||
.profile-modal .profile-tox, .profile-modal .profile-bitmessage {
|
||||
display: inline-block;
|
||||
width: 70px;
|
||||
height: 30px;
|
||||
border: 1px solid #c0c2c6;
|
||||
opacity: .8;
|
||||
-webkit-border-radius: 5px 0 0 5px;
|
||||
-moz-border-radius: 5px 0 0 5px;
|
||||
border-radius: 5px 0 0 5px;
|
||||
-webkit-transition: all 200ms;
|
||||
-moz-transition: all 200ms;
|
||||
-ms-transition: all 200ms;
|
||||
-o-transition: all 200ms;
|
||||
transition: all 200ms;
|
||||
}
|
||||
.profile-modal .profile-tox:hover, .profile-modal .profile-bitmessage:hover {
|
||||
opacity: 1;
|
||||
background-color: #f0f2f8;
|
||||
}
|
||||
.profile-modal .profile-tox:active, .profile-modal .profile-bitmessage:active {
|
||||
background-color: #edfced;
|
||||
}
|
||||
.profile-modal .profile-tox {
|
||||
background: #e3e5ea url(../img/tox.png) center no-repeat;
|
||||
}
|
||||
.profile-modal .profile-bitmessage {
|
||||
background: #e3e5ea url(../img/bm.png) center no-repeat;
|
||||
}
|
||||
.profile-modal .profile-data
|
||||
{
|
||||
display: inline-block;
|
||||
margin-left: -4px;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.profile-modal .postboard
|
||||
{
|
||||
margin-left: 0;
|
||||
padding: 5px 0 5px 0;
|
||||
height: 75%;
|
||||
}
|
||||
.profile-modal .postboard h2
|
||||
{
|
||||
@ -177,13 +276,15 @@
|
||||
}
|
||||
.profile-modal .postboard-posts
|
||||
{
|
||||
height: 240px;
|
||||
display: block;
|
||||
height: 90%;
|
||||
overflow: auto;
|
||||
}
|
||||
.profile-modal .profile-card-main
|
||||
{
|
||||
background: #45474d;
|
||||
color: white;
|
||||
width:100%;
|
||||
}
|
||||
.profile-modal .profile-card-main a {
|
||||
color: #8bb9e0;
|
||||
@ -209,7 +310,19 @@
|
||||
*/
|
||||
.profile-modal .direct-messages,
|
||||
.profile-modal .direct-messages-with-user,
|
||||
.profile-modal .follow
|
||||
.profile-modal .follow,
|
||||
.profile-modal .profileUnfollow
|
||||
{
|
||||
bottom: 10px;
|
||||
}
|
||||
|
||||
h1.profile-name {
|
||||
display: inline;
|
||||
}
|
||||
h2.profile-screen-name {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.profile-modal .modal-buttons {
|
||||
display: none;
|
||||
}
|
||||
|
330
css/style.css
@ -9,6 +9,11 @@
|
||||
src: url("OpenSans-Bold.ttf");
|
||||
font-weight: bold;
|
||||
}
|
||||
@font-face
|
||||
{
|
||||
font-family: "Symbola";
|
||||
src: url("Symbola.ttf");
|
||||
}
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
@ -30,7 +35,7 @@ time, mark, audio, video, textarea
|
||||
font: inherit;
|
||||
vertical-align: baseline;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-family: 'Open Sans', sans-serif, Symbola;
|
||||
}
|
||||
textarea, input
|
||||
{
|
||||
@ -74,6 +79,17 @@ h3
|
||||
font-size: 14px;
|
||||
color: rgba( 0, 0, 0, .5 );
|
||||
}
|
||||
.clearfix:before,
|
||||
.clearfix:after
|
||||
{
|
||||
display: block;
|
||||
content: "";
|
||||
clear: both;
|
||||
}
|
||||
.isFollowing:after {
|
||||
color: #1a1;
|
||||
content: '\2714';
|
||||
}
|
||||
/*************************************
|
||||
**************************** BUTTONS **
|
||||
**************************************/
|
||||
@ -110,6 +126,10 @@ button.disabled:hover
|
||||
background: #45474d;
|
||||
z-index: 2;
|
||||
}
|
||||
.userMenu.w1200 {
|
||||
width: 1200px;
|
||||
margin-left: -600px;
|
||||
}
|
||||
.userMenu:after
|
||||
{
|
||||
content: "";
|
||||
@ -257,17 +277,31 @@ button.disabled:hover
|
||||
z-index: 1;
|
||||
min-height: 100%;
|
||||
}
|
||||
.dashboard
|
||||
{
|
||||
.wrapper.w1200 {
|
||||
width: 1200px;
|
||||
padding: 55px 7px 15px 7px;
|
||||
}
|
||||
.dashboard.left {
|
||||
width: 320px;
|
||||
position: fixed;
|
||||
top: 55px;
|
||||
}
|
||||
.dashboard.right {
|
||||
width: 320px;
|
||||
position: fixed;
|
||||
top: 55px;
|
||||
margin-left: 864px;
|
||||
}
|
||||
.module
|
||||
{
|
||||
border: solid 1px rgba( 69, 71, 77, .1 );
|
||||
background: #fff;
|
||||
}
|
||||
.options .module
|
||||
{
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
}
|
||||
.messages-qtd
|
||||
{
|
||||
position: absolute;
|
||||
@ -419,16 +453,19 @@ button.disabled:hover
|
||||
}
|
||||
.profile-data
|
||||
{
|
||||
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
height: 60px;
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
.profile-data li
|
||||
{
|
||||
border-right: solid 1px rgba( 69, 71, 77, .1 );
|
||||
padding: 10px 15px 2px 10px;
|
||||
float: left;
|
||||
height: 100%;
|
||||
display: table-cell;
|
||||
}
|
||||
.profile-data li:last-child
|
||||
{
|
||||
@ -506,6 +543,28 @@ button.disabled:hover
|
||||
{
|
||||
text-decoration: none;
|
||||
}
|
||||
.who-follow
|
||||
{
|
||||
height: auto;
|
||||
background-color: rgba(69, 71, 77, 0.1);
|
||||
overflow: hidden;
|
||||
font-size: 12px;
|
||||
}
|
||||
.show-more-followers {
|
||||
color: #f11;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
}
|
||||
.mini-follower-link
|
||||
{
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.mini-follower-link:before
|
||||
{
|
||||
content: " \2027";
|
||||
}
|
||||
/***********************************
|
||||
********************* POST AREA ****
|
||||
***********************************/
|
||||
@ -518,6 +577,10 @@ button.disabled:hover
|
||||
width: 445px;
|
||||
display: block;
|
||||
transition: all .3s linear;
|
||||
-webkit-transition: height 0.3s linear;
|
||||
-moz-transition: height 0.3s linear;
|
||||
-o-transition: height 0.3s linear;
|
||||
-ms-transition: height 0.3s linear;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
border: solid 1px rgba(0, 0, 0, .3 );
|
||||
@ -541,6 +604,17 @@ button.disabled:hover
|
||||
border: solid 1px rgba( 227, 79, 66, .5 );
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, .3 );
|
||||
}
|
||||
textarea.splited-post {
|
||||
box-shadow: none!important;
|
||||
height: 28px;
|
||||
}
|
||||
.splited-post-counter {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
font-weight: bold;
|
||||
}
|
||||
.splited-post-counter:before {
|
||||
content: '\2026';
|
||||
}
|
||||
.post-area-extras
|
||||
{
|
||||
overflow: hidden;
|
||||
@ -557,7 +631,11 @@ button.disabled:hover
|
||||
display: inline-block;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.post-area-new.open textarea + .post-area-extras
|
||||
.undo-unicode
|
||||
{
|
||||
font-family: sans-serif, Symbola;
|
||||
}
|
||||
.post-area-new.open > .post-area-extras
|
||||
{
|
||||
height: 35px;
|
||||
transition: all .6s linear;
|
||||
@ -570,12 +648,22 @@ button.disabled:hover
|
||||
{
|
||||
color: #ff0000;
|
||||
}
|
||||
.post .show-more {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
margin-left: 60px;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.post .show-more:before {
|
||||
content: '💭';
|
||||
}
|
||||
/***********************************
|
||||
********************* WHO TO FOLLOW
|
||||
***********************************/
|
||||
.who-to-follow
|
||||
{
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.who-to-follow h3
|
||||
{
|
||||
@ -641,8 +729,7 @@ button.disabled:hover
|
||||
display: inline-block;
|
||||
letter-spacing: 0px;
|
||||
}
|
||||
.twister-user-remove
|
||||
{
|
||||
.twister-user-remove{
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
margin: 5px;
|
||||
@ -650,16 +737,19 @@ button.disabled:hover
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
font-size: 120%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
font-size: 120%;
|
||||
display: none;
|
||||
}
|
||||
.twister-user-remove:hover
|
||||
{
|
||||
opacity: 1;
|
||||
.twister-user:hover .twister-user-remove{
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
}
|
||||
.twister-user-remove:hover{
|
||||
opacity: 1;
|
||||
}
|
||||
.follow
|
||||
{
|
||||
background: none;
|
||||
@ -677,9 +767,23 @@ button.disabled:hover
|
||||
color: #e34f42;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
border-left: solid 1px rgba( 69, 71, 77, .1 );
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
/***********************************
|
||||
**********TOP TRENDS****************
|
||||
***********************************/
|
||||
ol.toptrends-list {
|
||||
margin: 0% 5% 5% 5%;
|
||||
padding: 5px;
|
||||
border-bottom: solid 1px rgba( 69, 71, 77, .1 );
|
||||
border-top: solid 1px rgba( 69, 71, 77, .1 );
|
||||
}
|
||||
|
||||
.toptrends h3
|
||||
{
|
||||
margin: 5% 5% 2% 5%;
|
||||
}
|
||||
|
||||
/***********************************
|
||||
********************* POST BOARD ***
|
||||
***********************************/
|
||||
@ -691,6 +795,10 @@ button.disabled:hover
|
||||
border: solid 1px rgba( 69, 71, 77, .05 );
|
||||
padding: 10px;
|
||||
}
|
||||
.w1200 .postboard {
|
||||
margin-left: 327px;
|
||||
width: 530px;
|
||||
}
|
||||
.postboard h2
|
||||
{
|
||||
font-weight: bold;
|
||||
@ -705,8 +813,6 @@ button.disabled:hover
|
||||
}
|
||||
.postboard h2.fixed
|
||||
{
|
||||
position: fixed;
|
||||
top: 40px;
|
||||
z-index: 2;
|
||||
border-top: solid 4px #fbf9f6;
|
||||
}
|
||||
@ -771,7 +877,7 @@ button.disabled:hover
|
||||
.postboard-posts > .post.open:after
|
||||
{
|
||||
width: 5px;
|
||||
right: -5px;
|
||||
/*right: -5px;*/
|
||||
}
|
||||
.post:hover,
|
||||
.post .post
|
||||
@ -953,6 +1059,21 @@ button.disabled:hover
|
||||
display: none;
|
||||
padding: 5px 5px 0 5px;
|
||||
}
|
||||
.image-preview
|
||||
{
|
||||
max-height: 500px;
|
||||
max-width: 495px;
|
||||
width: auto;
|
||||
display: block;
|
||||
margin: 0 auto 10px auto;
|
||||
}
|
||||
.preview-container
|
||||
{
|
||||
max-height: 500px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.post-stats
|
||||
{
|
||||
margin: 0 10px 0 55px;
|
||||
@ -1017,6 +1138,10 @@ button.disabled:hover
|
||||
{
|
||||
display: inline-block;
|
||||
}
|
||||
.post-replies .sub-replies {
|
||||
border-left: solid 3px #E34F42;
|
||||
margin-left: 2px;
|
||||
}
|
||||
/***********************************
|
||||
******** LOGIN AND NETWORK PAGES ***
|
||||
***********************************/
|
||||
@ -1156,6 +1281,24 @@ button.disabled:hover
|
||||
color: #fff;
|
||||
background: rgba( 0, 0, 0, .1 );
|
||||
}
|
||||
.modal-back,
|
||||
.mark-all-as-read {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 0;
|
||||
padding: 3px 10px;
|
||||
cursor: pointer;
|
||||
color: rgba( 255, 255, 255, .7 );
|
||||
font-weight: bold;
|
||||
border-left: solid 1px rgba( 255, 255, 255, .3 );
|
||||
transition: all .1s linear;
|
||||
display: none;
|
||||
}
|
||||
.modal-back:hover,
|
||||
.mark-all-as-read:hover {
|
||||
color: #fff;
|
||||
background: rgba( 0, 0, 0, .1 );
|
||||
}
|
||||
.modal-buttons
|
||||
{
|
||||
padding: 10px;
|
||||
@ -1287,6 +1430,12 @@ button.disabled:hover
|
||||
right: -65px;
|
||||
left: auto;
|
||||
}
|
||||
.mark-all-as-read {
|
||||
right: 60px;
|
||||
}
|
||||
.mark-all-as-read:before {
|
||||
content: '\2714';
|
||||
}
|
||||
/*************************************
|
||||
****************** NEW USER MODAL
|
||||
**************************************/
|
||||
@ -1345,6 +1494,31 @@ button.disabled:hover
|
||||
margin-left: 0;
|
||||
}
|
||||
/*************************************
|
||||
****************** CONVERSATION MODAL
|
||||
**************************************/
|
||||
.conversation-modal .modal-wrapper
|
||||
{
|
||||
position: absolute;
|
||||
width: 560px;
|
||||
height: 80%;
|
||||
top: 10%;
|
||||
margin: 0 0 0 -330px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.conversation-modal .modal-content
|
||||
{
|
||||
overflow-y: auto;
|
||||
height: 90%;
|
||||
}
|
||||
.conversation-modal .modal-buttons
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.conversation-modal .postboard
|
||||
{
|
||||
margin-left: 0;
|
||||
}
|
||||
/*************************************
|
||||
****************** FOLLOWING MODAL
|
||||
**************************************/
|
||||
.following-modal .modal-wrapper
|
||||
@ -1357,6 +1531,7 @@ button.disabled:hover
|
||||
.following-modal .modal-content
|
||||
{
|
||||
padding: 15px;
|
||||
height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.following-modal .modal-buttons
|
||||
@ -1384,6 +1559,56 @@ button.disabled:hover
|
||||
text-decoration: underline;
|
||||
}
|
||||
/*************************************
|
||||
******************* WHO TO FOLLOW MODAL
|
||||
**************************************/
|
||||
.who-to-follow-modal .modal-wrapper
|
||||
{
|
||||
width: 560px;
|
||||
height: 470px;
|
||||
margin: -200px 0 0 -280px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.who-to-follow-modal .modal-content
|
||||
{
|
||||
padding: 15px;
|
||||
height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.who-to-follow-modal .modal-buttons
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.who-to-follow-modal ol
|
||||
{
|
||||
margin: 5px;
|
||||
}
|
||||
.who-to-follow-modal .open-profile-modal:hover
|
||||
{
|
||||
text-decoration: none;
|
||||
}
|
||||
.who-to-follow-modal .open-profile-modal span
|
||||
{
|
||||
vertical-align: middle;
|
||||
}
|
||||
.who-to-follow-modal .open-profile-modal span:hover
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
.who-to-follow-modal .follow
|
||||
{
|
||||
float: right;
|
||||
margin: -30px 10px 0 10px;
|
||||
}
|
||||
.who-to-follow-modal .twister-user-info span
|
||||
{
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.who-to-follow-modal .bio
|
||||
{
|
||||
font-size: 12px;
|
||||
color: rgba( 0, 0, 0, .6 );
|
||||
}
|
||||
/*************************************
|
||||
****************** LOADER ************
|
||||
**************************************/
|
||||
.postboard-loading
|
||||
@ -1500,3 +1725,70 @@ button.disabled:hover
|
||||
left: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Options */
|
||||
#playerVol {
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.volValue {
|
||||
float: right;
|
||||
margin-right: -163px;
|
||||
font: 12px "Open Sans", sans-serif;
|
||||
}
|
||||
#notifyForm p, #choseLanguage p, #keysOpt p {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.suboptions {
|
||||
margin: 5px 30px;
|
||||
border: double 2px rgba( 69, 71, 77, .1 );
|
||||
height: 0px;
|
||||
overflow: hidden;
|
||||
transition: height 1s linear;
|
||||
-webkit-transition: height 1s linear;
|
||||
-moz-transition: height 1s linear;
|
||||
-o-transition: height 1s linear;
|
||||
-ms-transition: height 1s linear;
|
||||
}
|
||||
|
||||
/* Autocomplite*/
|
||||
.textcomplete-wrapper textarea {
|
||||
display: inline;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
position: absolute;
|
||||
top: 23px;
|
||||
left: 170px;
|
||||
z-index: 100;
|
||||
display: block;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
padding: 5px 0;
|
||||
margin: 2px 0 0;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
border: 1px solid rgba(0,0,0, .2);
|
||||
border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
-webkit-box-shadow: 0 5px 10px rgba(0,0,0, .2);
|
||||
-moz-box-shadow: 0 5px 10px rgba(0,0,0, .2);
|
||||
box-shadow: 0 5px 10px rgba(0,0,0, .2);
|
||||
|
||||
}
|
||||
ul.dropdown-menu li {
|
||||
line-height: 20px;
|
||||
|
||||
}
|
||||
ul.dropdown-menu > li > a {
|
||||
display: block;
|
||||
padding: 3px 20px;
|
||||
clear: both;
|
||||
font: 13px/20px "Open Sans", sans-serif;
|
||||
white-space: nowrap;
|
||||
-webkit-transition: all 200ms;
|
||||
-moz-transition: all 200ms;
|
||||
-ms-transition: all 200ms;
|
||||
-o-transition: all 200ms;
|
||||
transition: all 200ms;
|
||||
}
|
||||
|
145
following.html
@ -3,30 +3,32 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Following</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="css/profile.css" type="text/css"/>
|
||||
<script src="jquery.min.js"></script>
|
||||
<script src="jQueryPlugins.js"></script>
|
||||
<script src="jquery.json-2.4.js"></script>
|
||||
<script src="jquery.jsonrpcclient.js"></script>
|
||||
<script src="jquery.storageapi.js"></script>
|
||||
<script src="mobile_abstract.js"></script>
|
||||
<script src="twister_io.js"></script>
|
||||
<script src="polyglot.min.js"></script>
|
||||
<script src="interface_localization.js"></script>
|
||||
<script src="twister_network.js"></script>
|
||||
<script src="twister_user.js"></script>
|
||||
<script src="twister_formatpost.js"></script>
|
||||
<script src="twister_newmsgs.js"></script>
|
||||
<script src="twister_following.js"></script>
|
||||
<script src="twister_directmsg.js"></script>
|
||||
<script src="twister_actions.js"></script>
|
||||
<script src="interface_common.js"></script>
|
||||
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<link id="profilecss" rel="stylesheet" href="css/profile.css" type="text/css"/>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jQueryPlugins.js"></script>
|
||||
<script src="js/jquery.json-2.4.js"></script>
|
||||
<script src="js/jquery.jsonrpcclient.js"></script>
|
||||
<script src="js/jquery.storageapi.js"></script>
|
||||
<script src="js/options.js"></script>
|
||||
<script src="js/mobile_abstract.js"></script>
|
||||
<script src="js/twister_io.js"></script>
|
||||
<script src="js/polyglot.min.js"></script>
|
||||
<script src="js/interface_localization.js"></script>
|
||||
<script src="js/twister_network.js"></script>
|
||||
<script src="js/twister_user.js"></script>
|
||||
<script src="js/twister_formatpost.js"></script>
|
||||
<script src="js/twister_newmsgs.js"></script>
|
||||
<script src="js/twister_following.js"></script>
|
||||
<script src="js/twister_directmsg.js"></script>
|
||||
<script src="js/twister_actions.js"></script>
|
||||
<script src="js/interface_common.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function()
|
||||
{
|
||||
initInterfaceFollowing();
|
||||
changeStyle();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -38,35 +40,37 @@
|
||||
<!-- MENU SUPERIOR INIT -->
|
||||
<nav class="userMenu">
|
||||
<ul>
|
||||
<li class="userMenu-home"><a href="home.html">Home</a></li>
|
||||
<li class="userMenu-network"><a href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile"><a href="profile-edit.html">Profile</a></li>
|
||||
<li class="userMenu-home"><a href="home.html"><span class="selectable_theme theme_original label">Home</span></a></li>
|
||||
<li class="userMenu-network selectable_theme theme_original theme_nin"><a class="label" href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile selectable_theme theme_original theme_nin"><a class="label" href="profile-edit.html">Profile</a></li>
|
||||
<li class="userMenu-config current">
|
||||
<a class="userMenu-config-dropdown" href="#">
|
||||
<div class="config-menu dialog-modal">
|
||||
<div class="mini-profile-info">
|
||||
<div class="mini-profile-info selectable_theme theme_original">
|
||||
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
|
||||
<a href="#" class="mini-profile-name">Fulano da Silva</a>
|
||||
<span class="mini-profile-view">View</span>
|
||||
</div>
|
||||
<a class="dropdown-menu-item" href="options.html">Options</a>
|
||||
<a class="dropdown-menu-item" href="profile-edit.html">Setup account</a>
|
||||
<a class="dropdown-menu-item" href="following.html">Following users</a>
|
||||
<a class="dropdown-menu-item" href="network.html">Network config</a>
|
||||
<a class="dropdown-menu-item" href="login.html">Change user</a>
|
||||
<a class="direct-messages" href="#">Direct Messages</a>
|
||||
<a class="direct-messages selectable_theme theme_original" href="#">Direct Messages</a>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-connections">
|
||||
<a href="#">
|
||||
<span class="messages-qtd" style="display:none;">12</span>
|
||||
<span class="messages-qtd" style="display:none;">0</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-messages">
|
||||
<a href="#">
|
||||
<span class="messages-qtd" style="display:none;">12</span>
|
||||
<span class="messages-qtd" style="display:none;">0</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-dhtindicator selectable_theme theme_calm"><a href="network.html"></a></li>
|
||||
|
||||
<!-- BUSCA -->
|
||||
<li class="userMenu-search">
|
||||
@ -101,10 +105,47 @@
|
||||
|
||||
|
||||
<div class="wrapper">
|
||||
<!-- LADO ESQUERDO DE MÓDULOS INIT -->
|
||||
<div class="dashboard left">
|
||||
|
||||
<!-- PROFILE MODULE INIT -->
|
||||
<div class="module mini-profile selectable_theme theme_nin">
|
||||
<div class="mini-profile-info">
|
||||
|
||||
|
||||
|
||||
<!-- THEME NIN added user menu (mentions, messages and edit profile) -->
|
||||
<ul class="mini-profile-indicators selectable_theme theme_nin">
|
||||
<li class="userMenu-connections">
|
||||
<a href="#" title="Mentions"><span class="messages-qtd" style="display:none;">0</span><span>Mentions</span></a>
|
||||
</li>
|
||||
<li class="userMenu-messages">
|
||||
<a href="#" title="Direct Messages"><span class="messages-qtd" style="display:none;">0</span><span>Messages</span></a>
|
||||
</li>
|
||||
<li class="userMenu-user">
|
||||
<a href="profile-edit.html" title="Edit profile"><span>Edit profile</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
|
||||
<a href="#" class="mini-profile-name open-profile-modal"></a>
|
||||
<span class="mini-profile-view">View</span>
|
||||
</div>
|
||||
<ul class="module profile-data">
|
||||
<li><a href="#" class="open-profile-modal"><span class="posts-count"> </span><span class="label">Posts</span></a></li>
|
||||
<li class="current"><a href="following.html" class="open-following-page"><span class="following-count"> </span><span class="label">Following</span></a></li>
|
||||
<li><a href="#" class="open-followers"><span class="followers-count"> </span><span class="label">Followers</span> *</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<!-- PROFILE MODULE INIT -->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- LADO ESQUERDO DE MÓDULOS INIT -->
|
||||
<div class="following">
|
||||
<h2> Following </h2>
|
||||
<h2><span>Following</span></h2>
|
||||
|
||||
<div class="postboard-loading" style="display: none;">
|
||||
<div></div>
|
||||
@ -198,16 +239,15 @@
|
||||
<p class="post-text"></p>
|
||||
<div class="post-context" style="display: none;">
|
||||
<i class="post-retransmited-icon"></i>
|
||||
<span>Retransmitted by
|
||||
<a class="post-retransmited-by open-profile-modal" href=""></a>
|
||||
</span>
|
||||
<span>twisted again by</span>
|
||||
<a class="post-retransmited-by open-profile-modal" href=""></a>
|
||||
</div>
|
||||
<span class="post-expand">Expand</span>
|
||||
<!-- elementos de interação com o post que são exibidos no hover -->
|
||||
<div class="post-interactions">
|
||||
<span class="post-reply">Reply</span>
|
||||
<span class="post-propagate">Retransmit</span>
|
||||
<span class="post-favorite">Favorite</span>
|
||||
<!--span class="post-favorite">Favorite</span-->
|
||||
</div>
|
||||
<div class="expanded-content" style="display: none;">
|
||||
<ul class="post-stats" style="display: none;">
|
||||
@ -219,15 +259,19 @@
|
||||
<!-- use "avatar-row-template" here -->
|
||||
</li>
|
||||
</ul>
|
||||
<div class="preview-container">
|
||||
</div>
|
||||
<div class="post-reply-content" style="display: block;">
|
||||
<form class="post-area-new">
|
||||
<textarea placeholder="Reply..."></textarea>
|
||||
<div class="post-area-extras">
|
||||
<span class="post-area-remaining">140</span>
|
||||
<button class="undo-unicode disabled" disabled="true">undo</button>
|
||||
<button class="post-submit disabled" disabled="true">post</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<span class="show-more label">Show more in this conversation...</span>
|
||||
</div> <!-- expanded-content -->
|
||||
</div> <!-- post-data -->
|
||||
</li> <!-- post-template -->
|
||||
@ -252,11 +296,13 @@
|
||||
<!-- TEMPLATE INVÓLUCRO DO POST EXPANDIDO END -->
|
||||
|
||||
<!-- TEMPLATE DO MODAL GENÉRICO INIT -->
|
||||
<div class="modal-blackout">
|
||||
<div class="modal-blackout cancel">
|
||||
<div class="modal-wrapper">
|
||||
<div class="modal-header">
|
||||
<h3></h3>
|
||||
<span id="closeModal" class="modal-close cancel">×</span>
|
||||
<span class="modal-back"><</span>
|
||||
<span class="mark-all-as-read"></span>
|
||||
</div>
|
||||
<div class="modal-content"></div>
|
||||
<div class="modal-buttons">
|
||||
@ -277,6 +323,7 @@
|
||||
<textarea placeholder="New Post..."></textarea>
|
||||
<div class="post-area-extras">
|
||||
<span class="post-area-remaining">140</span>
|
||||
<button class="undo-unicode disabled" disabled="true">undo</button>
|
||||
<button class="post-submit disabled" disabled="true">post</button>
|
||||
</div>
|
||||
</form>
|
||||
@ -324,6 +371,7 @@
|
||||
<textarea placeholder="New direct message..."></textarea>
|
||||
<div class="post-area-extras">
|
||||
<span class="post-area-remaining">140</span>
|
||||
<button class="undo-unicode disabled" disabled="true">undo</button>
|
||||
<button class="dm-submit disabled" disabled="true">send</button>
|
||||
</div>
|
||||
</form>
|
||||
@ -346,24 +394,35 @@
|
||||
<span class="profile-location"></span>
|
||||
<a class="profile-url" rel="nofollow" target="_blank"></a>
|
||||
</div>
|
||||
<div class="profile-bio">
|
||||
<div class="profile-bio"></div>
|
||||
<div id="msngrswr">
|
||||
<div id="toxbtnwr" class="profile-extra-contact">
|
||||
<a class="profile-tox"><span class="selectable_theme theme_nin">TOX</span></a><a class="tox-ctc"></a>
|
||||
</div>
|
||||
<div id="bmbtnwr" class="profile-extra-contact">
|
||||
<a class="profile-bitmessage"><span class="selectable_theme theme_nin">BM</span></a><a class="bitmessage-ctc"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="module profile-data">
|
||||
<li><a href="#"><span class="posts-count"> </span><span class="label">Posts</span></a></li>
|
||||
<li><a href="#" class="open-following-modal"><span class="following-count"> </span><span class="label">Following</span></a></li>
|
||||
<li><a href="#"><span class="followers-count"> </span><span class="label">Followers</span></a></li>
|
||||
</ul>
|
||||
<button class="follow" href="#">Follow</button>
|
||||
<button class="direct-messages-with-user" href="#">Direct Messages</button>
|
||||
|
||||
<div class="twister-user-info">
|
||||
<div class="clearfix">
|
||||
<ul class="module profile-data">
|
||||
<li><a href="#"><span class="posts-count"> </span><span class="label">Posts</span></a></li>
|
||||
<li><a href="#" class="open-following-modal"><span class="following-count"> </span><span class="label">Following</span></a></li>
|
||||
<li><a href="#"><span class="followers-count"> </span><span class="label">Followers</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<button class="followButton follow" href="#">Follow</button>
|
||||
<button class="direct-messages-with-user" href="#">Direct Messages</button>
|
||||
</div>
|
||||
<div class="who-follow"></div>
|
||||
</div>
|
||||
<!-- ÁREA DE POSTS END -->
|
||||
|
||||
<!-- ÁREA DE POSTS INIT -->
|
||||
<div class="postboard">
|
||||
<h2>
|
||||
Posts
|
||||
<span>Posts</span>
|
||||
<!-- o botão de novas postagens deve ser ocultado quando o usuário clicá-lo via javascript -->
|
||||
<button class="postboard-news" style="display:none;"></button>
|
||||
</h2>
|
||||
@ -403,7 +462,7 @@
|
||||
<!-- ÁREA DE PROFILE END -->
|
||||
|
||||
<!-- ÁREA DE FOLLOWING INIT -->
|
||||
<ol class="following-list">
|
||||
<ol class="">
|
||||
<li id="following-by-user-template" style="display: none;">
|
||||
<div class="mini-following-info" data-screen-name="">
|
||||
<a href="#" class="open-profile-modal">
|
||||
|
193
home.html
@ -3,27 +3,33 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>twister</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="css/profile.css" type="text/css"/>
|
||||
<script src="jquery.min.js"></script>
|
||||
<script src="jQueryPlugins.js"></script>
|
||||
<script src="jquery.json-2.4.js"></script>
|
||||
<script src="jquery.jsonrpcclient.js"></script>
|
||||
<script src="jquery.storageapi.js"></script>
|
||||
<script src="mobile_abstract.js"></script>
|
||||
<script src="twister_io.js"></script>
|
||||
<script src="polyglot.min.js"></script>
|
||||
<script src="interface_localization.js"></script>
|
||||
<script src="twister_network.js"></script>
|
||||
<script src="twister_user.js"></script>
|
||||
<script src="twister_formatpost.js"></script>
|
||||
<script src="twister_following.js"></script>
|
||||
<script src="twister_timeline.js"></script>
|
||||
<script src="twister_newmsgs.js"></script>
|
||||
<script src="twister_actions.js"></script>
|
||||
<script src="twister_directmsg.js"></script>
|
||||
<script src="interface_common.js"></script>
|
||||
<script src="interface_home.js"></script>
|
||||
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<link id="profilecss" rel="stylesheet" href="css/profile.css" type="text/css"/>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jQueryPlugins.js"></script>
|
||||
<script src="js/jquery.json-2.4.js"></script>
|
||||
<script src="js/jquery.jsonrpcclient.js"></script>
|
||||
<script src="js/jquery.storageapi.js"></script>
|
||||
<script src="js/options.js"></script>
|
||||
<script src="js/mobile_abstract.js"></script>
|
||||
<script src="js/twister_io.js"></script>
|
||||
<script src="js/polyglot.min.js"></script>
|
||||
<script src="js/interface_localization.js"></script>
|
||||
<script src="js/twister_network.js"></script>
|
||||
<script src="js/twister_user.js"></script>
|
||||
<script src="js/twister_formatpost.js"></script>
|
||||
<script src="js/twister_following.js"></script>
|
||||
<script src="js/twister_timeline.js"></script>
|
||||
<script src="js/twister_newmsgs.js"></script>
|
||||
<script src="js/twister_actions.js"></script>
|
||||
<script src="js/twister_directmsg.js"></script>
|
||||
<script src="js/interface_common.js"></script>
|
||||
<script src="js/interface_home.js"></script>
|
||||
<script src="js/jquery.textcomplete.js"></script>
|
||||
<script>
|
||||
$(function(){setTimeout(mensAutocomplete, 800);})
|
||||
changeStyle();
|
||||
</script> <!-- calm init for autocomplete -->
|
||||
|
||||
<link rel="icon" type="image/png" href="img/twister_mini.png" />
|
||||
</head>
|
||||
@ -33,35 +39,41 @@
|
||||
<!-- MENU SUPERIOR INIT -->
|
||||
<nav class="userMenu">
|
||||
<ul>
|
||||
<li class="userMenu-home current"><a href="#">Home</a></li>
|
||||
<li class="userMenu-network"><a href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile"><a href="profile-edit.html">Profile</a></li>
|
||||
<li class="userMenu-home current"><a href="home.html">
|
||||
<span class="selectable_theme theme_original label">Home</span>
|
||||
<span class="menu-news"></span>
|
||||
</a></li>
|
||||
<li class="userMenu-network selectable_theme theme_original theme_nin"><a class="label" href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile selectable_theme theme_original theme_nin"><a class="label" href="profile-edit.html">Profile</a></li>
|
||||
<li class="userMenu-config">
|
||||
<a class="userMenu-config-dropdown" href="#">
|
||||
<div class="config-menu dialog-modal">
|
||||
<div class="mini-profile-info">
|
||||
<div class="mini-profile-info selectable_theme theme_original">
|
||||
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
|
||||
<a href="#" class="mini-profile-name">Fulano da Silva</a>
|
||||
<span class="mini-profile-view">View</span>
|
||||
</div>
|
||||
<a class="dropdown-menu-item" href="profile-edit.html">Setup account</a>
|
||||
<a class="dropdown-menu-item" href="following.html">Following users</a>
|
||||
<a class="dropdown-menu-item" href="options.html">Options</a>
|
||||
<a class="dropdown-menu-item" href="network.html">Network config</a>
|
||||
<a class="dropdown-menu-item" href="profile-edit.html">Setup account</a>
|
||||
<a class="dropdown-menu-item dropdown-menu-following" href="following.html">Following users</a>
|
||||
<a class="dropdown-menu-item" href="login.html">Change user</a>
|
||||
<a class="direct-messages" href="#">Direct Messages</a>
|
||||
<a class="dropdown-menu-item promoted-posts-only selectable_theme theme_original" href="#">Switch to Promoted posts</a>
|
||||
<a class="direct-messages dropdown-menu-item selectable_theme theme_original" href="#">Direct Messages</a>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-connections">
|
||||
<a href="#">
|
||||
<span class="messages-qtd" style="display:none;">12</span>
|
||||
<span class="messages-qtd" style="display:none;">0</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-messages">
|
||||
<a href="#">
|
||||
<span class="messages-qtd" style="display:none;">12</span>
|
||||
<span class="messages-qtd" style="display:none;">0</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-dhtindicator selectable_theme theme_calm"><a href="network.html"></a></li>
|
||||
|
||||
<!-- BUSCA -->
|
||||
<li class="userMenu-search">
|
||||
@ -98,19 +110,32 @@
|
||||
<div class="wrapper">
|
||||
|
||||
<!-- LADO ESQUERDO DE MÓDULOS INIT -->
|
||||
<div class="dashboard">
|
||||
<div class="dashboard left">
|
||||
|
||||
<!-- PROFILE MODULE INIT -->
|
||||
<div class="module mini-profile">
|
||||
<div class="mini-profile-info">
|
||||
<!-- THEME NIN added sub-menu (mentions, messages and edit profile) -->
|
||||
<ul class="mini-profile-indicators selectable_theme theme_nin">
|
||||
<li class="userMenu-connections">
|
||||
<a href="#" title="Mentions"><span class="messages-qtd" style="display:none;">0</span><span>Mentions</span></a>
|
||||
</li>
|
||||
<li class="userMenu-messages">
|
||||
<a href="#" title="Direct Messages"><span class="messages-qtd" style="display:none;">0</span><span>Messages</span></a>
|
||||
</li>
|
||||
<li class="userMenu-user">
|
||||
<a href="profile-edit.html" title="Edit profile"><span>Edit profile</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
<!--/sub-menu -->
|
||||
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
|
||||
<a href="#" class="mini-profile-name open-profile-modal"></a>
|
||||
<span class="mini-profile-view">View</span>
|
||||
</div>
|
||||
<ul class="module profile-data">
|
||||
<li><a href="#" class="open-profile-modal"><span class="posts-count"> </span><span class="label">Posts</span></a></li>
|
||||
<li><a href="following.html"><span class="following-count"> </span><span class="label">Following</span></a></li>
|
||||
<li><a href="#"><span class="followers-count"> </span><span class="label">Followers</span> *</a></li>
|
||||
<li><a href="following.html" class="open-following-page"><span class="following-count"> </span><span class="label">Following</span></a></li>
|
||||
<li><a href="#" class="open-followers"><span class="followers-count"> </span><span class="label">Followers</span> *</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="post-area">
|
||||
@ -118,6 +143,7 @@
|
||||
<textarea placeholder="New Post..."></textarea>
|
||||
<div class="post-area-extras">
|
||||
<span class="post-area-remaining">140</span>
|
||||
<button class="undo-unicode disabled" disabled="true">undo</button>
|
||||
<button class="post-submit disabled" disabled="true">post</button>
|
||||
</div>
|
||||
</form>
|
||||
@ -128,7 +154,9 @@
|
||||
<!-- WHO TO FOLLOW MODULE INIT -->
|
||||
<div class="module who-to-follow">
|
||||
<h3>Who to Follow</h3>
|
||||
<small>.</small>
|
||||
<a class="refresh-users">Refresh</a>
|
||||
<small>.</small>
|
||||
<a class="view-all-users">View All</a>
|
||||
<ol class="follow-suggestions">
|
||||
<!-- use "follow-suggestion-template" here -->
|
||||
@ -136,6 +164,14 @@
|
||||
</div>
|
||||
<!-- WHO TO FOLLOW MODULE END -->
|
||||
|
||||
<!-- WHO TO FOLLOW MODULE INIT -->
|
||||
<div class="module toptrends">
|
||||
<h3><span>Top Trends</span></h3>
|
||||
<ol class="toptrends-list">
|
||||
<!-- use "follow-suggestion-template" here -->
|
||||
</ol>
|
||||
</div>
|
||||
<!-- WHO TO FOLLOW MODULE END -->
|
||||
|
||||
</div>
|
||||
<!-- LADO ESQUERDO DE MÓDULOS END -->
|
||||
@ -143,10 +179,33 @@
|
||||
<!-- ÁREA DE POSTS INIT -->
|
||||
<div class="postboard">
|
||||
<h2>
|
||||
Postboard
|
||||
<span>Postboard</span>
|
||||
<!-- o botão de novas postagens deve ser ocultado quando o usuário clicá-lo via javascript -->
|
||||
<button class="postboard-news" style="display: none;"></button>
|
||||
<button class="postboard-news selectable_theme theme_original theme_calm" style="display: none;"></button>
|
||||
</h2>
|
||||
<!-- Tabs to switch between promoted post and normal posts-->
|
||||
<ul class="promoted-posts-only promoted selectable_theme theme_nin">
|
||||
<li class="normal-posts active"><span>Normal posts</span></li>
|
||||
<li class="promoted-posts disabled"><span>Promoted posts</span></li>
|
||||
</ul>
|
||||
<!-- Post area on top of postboard -->
|
||||
<div id="postboard-top" class=" selectable_theme theme_nin">
|
||||
<div class="post-area">
|
||||
<form class="post-area-new">
|
||||
<textarea placeholder="New Post..."></textarea>
|
||||
<div class="post-area-extras">
|
||||
<span class="post-area-remaining">140</span>
|
||||
<button class="undo-unicode disabled" disabled="true">undo</button>
|
||||
<button class="post-submit disabled" disabled="true">post</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- User's pic -->
|
||||
<div class="profile-photo"><img src="img/genericPerson.png" alt="user-photo"/></div>
|
||||
</div>
|
||||
<div class="postboard-news" style="display:none"></div>
|
||||
<!-- END postboard-top -->
|
||||
|
||||
|
||||
<ol id="posts" class="postboard-posts">
|
||||
<!-- use "post-template" here -->
|
||||
@ -159,6 +218,7 @@
|
||||
</div>
|
||||
<!-- ÁREA DE POSTS END -->
|
||||
|
||||
<div class="dashboard right"></div>
|
||||
</div>
|
||||
|
||||
<!-- TEMPLATES INIT -->
|
||||
@ -173,8 +233,10 @@
|
||||
</div>
|
||||
<div class="twister-user-info" data-screen-name="">
|
||||
<a href="#" class="twister-user-name open-profile-modal">
|
||||
<span class="twister-user-full"></span>
|
||||
<span class="twister-user-tag"></span>
|
||||
</a>
|
||||
<div class="bio"></div>
|
||||
<div class="followers">
|
||||
<span class="label">Followed by</span>
|
||||
<a href="#" class="twister-by-user-name open-profile-modal">
|
||||
@ -207,16 +269,15 @@
|
||||
<p class="post-text"></p>
|
||||
<div class="post-context" style="display: none;">
|
||||
<i class="post-retransmited-icon"></i>
|
||||
<span>Retransmitted by
|
||||
<a class="post-retransmited-by open-profile-modal" href=""></a>
|
||||
</span>
|
||||
<span>twisted again by</span>
|
||||
<a class="post-retransmited-by open-profile-modal" href=""></a>
|
||||
</div>
|
||||
<span class="post-expand">Expand</span>
|
||||
<!-- elementos de interação com o post que são exibidos no hover -->
|
||||
<div class="post-interactions">
|
||||
<span class="post-reply">Reply</span>
|
||||
<span class="post-propagate">Retransmit</span>
|
||||
<span class="post-favorite">Favorite</span>
|
||||
<!--span class="post-favorite">Favorite</span-->
|
||||
</div>
|
||||
<div class="expanded-content" style="display: none;">
|
||||
<ul class="post-stats" style="display: none;">
|
||||
@ -228,15 +289,19 @@
|
||||
<!-- use "avatar-row-template" here -->
|
||||
</li>
|
||||
</ul>
|
||||
<div class="preview-container">
|
||||
</div>
|
||||
<div class="post-reply-content" style="display: block;">
|
||||
<form class="post-area-new">
|
||||
<textarea placeholder="Reply..."></textarea>
|
||||
<div class="post-area-extras">
|
||||
<span class="post-area-remaining">140</span>
|
||||
<button class="undo-unicode disabled" disabled="true">undo</button>
|
||||
<button class="post-submit disabled" disabled="true">post</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<span class="show-more label">Show more in this conversation...</span>
|
||||
</div> <!-- expanded-content -->
|
||||
</div> <!-- post-data -->
|
||||
</li> <!-- post-template -->
|
||||
@ -261,11 +326,13 @@
|
||||
<!-- TEMPLATE INVÓLUCRO DO POST EXPANDIDO END -->
|
||||
|
||||
<!-- TEMPLATE DO MODAL GENÉRICO INIT -->
|
||||
<div class="modal-blackout">
|
||||
<div class="modal-blackout cancel">
|
||||
<div class="modal-wrapper">
|
||||
<div class="modal-header">
|
||||
<h3></h3>
|
||||
<span id="closeModal" class="modal-close cancel">×</span>
|
||||
<span class="modal-back"><</span>
|
||||
<span class="mark-all-as-read"></span>
|
||||
</div>
|
||||
<div class="modal-content"></div>
|
||||
<div class="modal-buttons">
|
||||
@ -286,6 +353,7 @@
|
||||
<textarea placeholder="New Post..."></textarea>
|
||||
<div class="post-area-extras">
|
||||
<span class="post-area-remaining">140</span>
|
||||
<button class="undo-unicode disabled" disabled="true">undo</button>
|
||||
<button class="post-submit disabled" disabled="true">post</button>
|
||||
</div>
|
||||
</form>
|
||||
@ -333,7 +401,8 @@
|
||||
<textarea placeholder="New direct message..."></textarea>
|
||||
<div class="post-area-extras">
|
||||
<span class="post-area-remaining">140</span>
|
||||
<button class="dm-submit disabled" disabled="true">send</button>
|
||||
<button class="undo-unicode disabled" disabled="true">undo</button>
|
||||
<button title="Direct messages are encrypted, only you and receiver can read them" style="margin-right:7.5%;" class="dm-submit disabled" disabled="true">send</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -355,24 +424,35 @@
|
||||
<span class="profile-location"></span>
|
||||
<a class="profile-url" rel="nofollow" target="_blank"></a>
|
||||
</div>
|
||||
<div class="profile-bio">
|
||||
<div class="profile-bio"></div>
|
||||
<div id="msngrswr">
|
||||
<div id="toxbtnwr" class="profile-extra-contact">
|
||||
<a class="profile-tox"><span class="selectable_theme theme_nin">TOX</span></a><a class="tox-ctc"></a>
|
||||
</div>
|
||||
<div id="bmbtnwr" class="profile-extra-contact">
|
||||
<a class="profile-bitmessage"><span class="selectable_theme theme_nin">BitMessage</span></a><a class="bitmessage-ctc"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="module profile-data">
|
||||
<li><a href="#"><span class="posts-count"> </span><span class="label">Posts</span></a></li>
|
||||
<li><a href="#" class="open-following-modal"><span class="following-count"> </span><span class="label">Following</span></a></li>
|
||||
<li><a href="#"><span class="followers-count"> </span><span class="label">Followers</span></a></li>
|
||||
</ul>
|
||||
<button class="follow" href="#">Follow</button>
|
||||
<button class="direct-messages-with-user" href="#">Direct Messages</button>
|
||||
|
||||
<div class="twister-user-info">
|
||||
<div class="clearfix">
|
||||
<ul class="module profile-data">
|
||||
<li><a href="#"><span class="posts-count"> </span><span class="label">Posts</span></a></li>
|
||||
<li><a href="#" class="open-following-modal"><span class="following-count"> </span><span class="label">Following</span></a></li>
|
||||
<li><a href="#"><span class="followers-count"> </span><span class="label">Followers</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<button class="followButton follow" href="#">Follow</button>
|
||||
<button class="direct-messages-with-user" href="#">Direct Messages</button>
|
||||
</div>
|
||||
<div class="who-follow"></div>
|
||||
</div>
|
||||
<!-- ÁREA DE POSTS END -->
|
||||
|
||||
<!-- ÁREA DE POSTS INIT -->
|
||||
<div class="postboard">
|
||||
<h2>
|
||||
Posts
|
||||
<span>Posts</span>
|
||||
<!-- o botão de novas postagens deve ser ocultado quando o usuário clicá-lo via javascript -->
|
||||
<button class="postboard-news" style="display:none;"></button>
|
||||
</h2>
|
||||
@ -392,11 +472,12 @@
|
||||
<!-- ÁREA DE POSTS INIT -->
|
||||
<div class="postboard">
|
||||
<h2>
|
||||
Posts
|
||||
<span class="selectable_theme theme_original theme_calm">Posts</span>
|
||||
<!-- o botão de novas postagens deve ser ocultado quando o usuário clicá-lo via javascript -->
|
||||
<button class="postboard-news" style="display:none;"></button>
|
||||
</h2>
|
||||
|
||||
<span class="no-posts-found-message" style="display:none;">There aren't any posts with this hashtag.</span>
|
||||
<ol id="profile-posts" class="postboard-posts">
|
||||
</ol>
|
||||
|
||||
@ -408,11 +489,11 @@
|
||||
<!-- MODAL DE FOLLOWING -->
|
||||
<div id="following-modal-template">
|
||||
<!-- ÁREA DE PROFILE PHOTO INIT -->
|
||||
<h2><span class="label">All users publicly followed by</span><span class="following-screen-name">@<b></b></span></h2>
|
||||
<h2>All users publicly followed by <span class="following-screen-name">@<b></b></span></h2>
|
||||
<!-- ÁREA DE PROFILE END -->
|
||||
|
||||
<!-- ÁREA DE FOLLOWING INIT -->
|
||||
<ol class="following-list">
|
||||
<ol class="">
|
||||
<li id="following-by-user-template" style="display: none;">
|
||||
<div class="mini-following-info" data-screen-name="">
|
||||
<a href="#" class="open-profile-modal">
|
||||
@ -432,6 +513,8 @@
|
||||
|
||||
</div>
|
||||
<!-- TEMPLATES END -->
|
||||
|
||||
<audio id="player"></audio>
|
||||
<audio id="playerSec"></audio>
|
||||
<!-- hide elements -->
|
||||
</body>
|
||||
</html>
|
||||
|
BIN
img/bm.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
img/tox.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
@ -1,5 +1,4 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@ -10,8 +9,8 @@
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no"/>
|
||||
|
||||
<link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css" />
|
||||
<script src="jquery-1.9.1.min.js"></script>
|
||||
<script src="jquery.mobile.router.min.js"></script>
|
||||
<script src="js/jquery-1.9.1.min.js"></script>
|
||||
<script src="js/jquery.mobile.router.min.js"></script>
|
||||
<script>
|
||||
$(document).bind('mobileinit', function () {
|
||||
$.mobile.allowCrossDomainPages = true;
|
||||
@ -21,7 +20,7 @@
|
||||
$.mobile.defaultPageTransition = 'none';
|
||||
});
|
||||
</script>
|
||||
<script src="jquery.mobile-1.3.2.min.js"></script>
|
||||
<script src="js/jquery.mobile-1.3.2.min.js"></script>
|
||||
|
||||
<link rel="icon" type="image/png" href="img/twister_mini.png" />
|
||||
</head>
|
||||
|
@ -1,463 +0,0 @@
|
||||
// interface_common.js
|
||||
// 2013 Lucas Leal, Miguel Freitas
|
||||
//
|
||||
// Common interface functions to all pages, modal manipulation, button manipulation etc
|
||||
// Profile, mentions and hashtag modal
|
||||
// Post actions: submit, count characters
|
||||
|
||||
//dispara o modal genérico
|
||||
//o modalClass me permite fazer tratamentos específicos de CSS para cada modal
|
||||
function openModal( modalClass )
|
||||
{
|
||||
var $oldModal = $("body").children(".modal-blackout");
|
||||
var $template = $( "#templates" );
|
||||
var $templateModal = $template.find( ".modal-blackout" ).clone(true);
|
||||
|
||||
$templateModal.addClass( modalClass );
|
||||
if( $oldModal.length ) {
|
||||
$templateModal.show();
|
||||
$oldModal.replaceWith($templateModal);
|
||||
} else {
|
||||
$templateModal.prependTo( "body" ).fadeIn( "fast" );
|
||||
}
|
||||
|
||||
//escondo o overflow da tela
|
||||
var $body = $( "body" );
|
||||
$body.css({
|
||||
"overflow": "hidden",
|
||||
})
|
||||
}
|
||||
|
||||
//fecha o modal removendo o conteúdo por detach
|
||||
function closeModal($this)
|
||||
{
|
||||
var $body = $( "body" );
|
||||
var $modalWindows = $( "body" ).children( ".modal-blackout" );
|
||||
|
||||
$modalWindows.fadeOut( "fast", function()
|
||||
{
|
||||
$modalWindows.detach();
|
||||
});
|
||||
$body.css({
|
||||
"overflow": "auto",
|
||||
"margin-right": "0"
|
||||
});
|
||||
}
|
||||
|
||||
function checkNetworkStatusAndAskRedirect(cbFunc, cbArg) {
|
||||
networkUpdate(function(args) {
|
||||
if( !twisterdConnectedAndUptodate ) {
|
||||
var redirect =
|
||||
window.confirm(polyglot.t("switch_to_network"));
|
||||
if( redirect )
|
||||
$.MAL.goNetwork();
|
||||
} else {
|
||||
if( args.cbFunc )
|
||||
args.cbFunc(args.cbArg);
|
||||
}
|
||||
}, {cbFunc:cbFunc,cbArg:cbArg});
|
||||
}
|
||||
|
||||
function timeGmtToText(t) {
|
||||
var d = new Date(0);
|
||||
d.setUTCSeconds(t);
|
||||
return d.toString().replace(/GMT.*/g,"");
|
||||
}
|
||||
|
||||
function timeSincePost(t) {
|
||||
var d = new Date(0);
|
||||
d.setUTCSeconds(t);
|
||||
var now = new Date();
|
||||
var t_delta = Math.ceil((now - d) / 1000);
|
||||
var expression = "";
|
||||
if(t_delta < 60) {
|
||||
expression = polyglot.t("seconds", t_delta);
|
||||
}
|
||||
else if(t_delta < 60 * 60) {
|
||||
expression = polyglot.t("minutes", Math.floor(t_delta/60));
|
||||
}
|
||||
else if(t_delta < 24 * 60 * 60) {
|
||||
expression = polyglot.t("hours", Math.floor(t_delta/60/60));
|
||||
}
|
||||
else {
|
||||
expression = polyglot.t("days", Math.floor(t_delta/24/60/60));
|
||||
}
|
||||
return polyglot.t("time_ago", { time: expression });
|
||||
}
|
||||
|
||||
//
|
||||
// Profile, mentions, hashtag, and following modal
|
||||
// -----------------------------------
|
||||
|
||||
function newProfileModal(username) {
|
||||
var profileModalContent = $( "#profile-modal-template" ).children().clone(true);
|
||||
|
||||
updateProfileData(profileModalContent, username);
|
||||
|
||||
return profileModalContent;
|
||||
}
|
||||
|
||||
function openProfileModal(e)
|
||||
{
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var $this = $( this );
|
||||
var username = $.MAL.urlToUser( $this.attr("href") );
|
||||
|
||||
var profileModalClass = "profile-modal";
|
||||
openModal( profileModalClass );
|
||||
|
||||
var profileModalContent = newProfileModal( username );
|
||||
profileModalContent.appendTo("." +profileModalClass + " .modal-content");
|
||||
|
||||
//título do modal
|
||||
$( "."+profileModalClass + " h3" ).text( polyglot.t("users_profile", { username: username }) );
|
||||
}
|
||||
|
||||
function newHashtagModal(hashtag) {
|
||||
var hashtagModalContent = $( "#hashtag-modal-template" ).children().clone(true);
|
||||
hashtagModalContent.find( ".postboard-news").click(function (){
|
||||
$(this).hide();
|
||||
displayHashtagPending($(".hashtag-modal .postboard-posts"));
|
||||
});
|
||||
|
||||
clearHashtagProcessed();
|
||||
updateHashtagModal( hashtagModalContent.find(".postboard-posts"), hashtag );
|
||||
|
||||
return hashtagModalContent;
|
||||
}
|
||||
|
||||
function openHashtagModal(e)
|
||||
{
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var $this = $( this );
|
||||
var hashtag = $this.text().substring(1);
|
||||
|
||||
var hashtagModalClass = "hashtag-modal";
|
||||
openModal( hashtagModalClass );
|
||||
$( "."+hashtagModalClass ).attr("data-resource","hashtag");
|
||||
|
||||
var hashtagModalContent = newHashtagModal( hashtag );
|
||||
hashtagModalContent.appendTo("." +hashtagModalClass + " .modal-content");
|
||||
|
||||
//título do modal
|
||||
$( "."+hashtagModalClass + " h3" ).text( "#" + hashtag );
|
||||
}
|
||||
|
||||
function updateHashtagModal(postboard,hashtag) {
|
||||
var $hashtagModalClass = $(".hashtag-modal");
|
||||
if( !$hashtagModalClass.length || $hashtagModalClass.css("display") == 'none' )
|
||||
return;
|
||||
|
||||
var resource = $hashtagModalClass.attr("data-resource");
|
||||
|
||||
requestHashtag(postboard,hashtag,resource);
|
||||
setTimeout( function() {updateHashtagModal(postboard,hashtag);}, 5000);
|
||||
}
|
||||
|
||||
function openMentionsModal(e)
|
||||
{
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
// reuse the same hashtag modal to show mentions
|
||||
var hashtagModalClass = "hashtag-modal";
|
||||
openModal( hashtagModalClass );
|
||||
$( "."+hashtagModalClass ).attr("data-resource","mention");
|
||||
|
||||
var username;
|
||||
var $userInfo = $(this).closest("[data-screen-name]");
|
||||
if( $userInfo.length )
|
||||
username = $userInfo.attr("data-screen-name");
|
||||
else
|
||||
username = defaultScreenName;
|
||||
|
||||
var hashtagModalContent = newHashtagModal( username );
|
||||
hashtagModalContent.appendTo("." +hashtagModalClass + " .modal-content");
|
||||
|
||||
//título do modal
|
||||
$( "."+hashtagModalClass + " h3" ).text( polyglot.t("users_mentions", { username: username }) );
|
||||
|
||||
// obtain already cached mention posts from twister_newmsgs.js
|
||||
processHashtag(hashtagModalContent.find(".postboard-posts"), defaultScreenName, getMentionsData() );
|
||||
resetMentionsCount();
|
||||
}
|
||||
|
||||
function newFollowingModal(username) {
|
||||
var followingModalContent = $( "#following-modal-template" ).children().clone(true);
|
||||
|
||||
updateFollowingData(followingModalContent, username);
|
||||
|
||||
return followingModalContent;
|
||||
}
|
||||
|
||||
function openFollowingModal(e)
|
||||
{
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var $this = $( this );
|
||||
var username = $.MAL.followingUrlToUser( $this.attr("href") );
|
||||
|
||||
var followingModalClass = "following-modal";
|
||||
openModal( followingModalClass );
|
||||
|
||||
var followingModalContent = newFollowingModal( username );
|
||||
followingModalContent.appendTo("." +followingModalClass + " .modal-content");
|
||||
|
||||
//título do modal
|
||||
$( "."+followingModalClass + " h3" ).text( polyglot.t("followed_by", { username: username }) );
|
||||
}
|
||||
|
||||
//
|
||||
// Post actions, submit, count characters
|
||||
// --------------------------------------
|
||||
//dispara o modal de retweet
|
||||
var reTwistPopup = function( e )
|
||||
{
|
||||
var reTwistClass = "reTwist";
|
||||
openModal( reTwistClass );
|
||||
|
||||
//título do modal
|
||||
$( ".reTwist h3" ).text( polyglot.t("retransmit_this") );
|
||||
|
||||
var postdata = $(this).parents(".post-data").attr("data-userpost");
|
||||
var postElem = postToElem($.evalJSON(postdata),"");
|
||||
postElem.appendTo( ".reTwist .modal-content" );
|
||||
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
//Expande Área do Novo post
|
||||
var replyInitPopup = function(e, post)
|
||||
{
|
||||
var replyClass = "reply";
|
||||
openModal( replyClass );
|
||||
|
||||
//título do modal
|
||||
var fullname = post.find(".post-info-name").text();
|
||||
$( ".reply h3" ).text( polyglot.t("reply_to", { fullname: fullname }) );
|
||||
|
||||
//para poder exibir a thread selecionada...
|
||||
var replyModalContent = $(".reply .modal-content").hide();
|
||||
var retweetContent = $( "#reply-modal-template" ).children().clone(true);
|
||||
retweetContent.appendTo(replyModalContent);
|
||||
|
||||
var postdata = post.find(".post-data").attr("data-userpost");
|
||||
var postElem = postToElem($.evalJSON(postdata),"");
|
||||
postElem.appendTo(replyModalContent);
|
||||
|
||||
var replyArea = $(".reply .post-area .post-area-new");
|
||||
replyArea.addClass("open");
|
||||
var replyText = replyArea.find("textarea");
|
||||
var postInlineReplyText = $(".reply .post .post-area-new textarea");
|
||||
|
||||
var attrToCopy = ["placeholder", "data-reply-to"];
|
||||
$.each(attrToCopy, function( i, attribute ) {
|
||||
replyText.attr( attribute, postInlineReplyText.attr(attribute) );
|
||||
});
|
||||
composeNewPost(e, replyArea);
|
||||
|
||||
replyModalContent.fadeIn( "fast" );
|
||||
}
|
||||
|
||||
//abre o menu dropdown de configurações
|
||||
var dropDownMenu = function( e )
|
||||
{
|
||||
var $configMenu = $( ".config-menu" );
|
||||
$configMenu.slideToggle( "fast" );
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
//fecha o config menu ao clicar em qualquer lugar da tela
|
||||
var closeThis = function()
|
||||
{
|
||||
$( this ).slideUp( "fast" );
|
||||
};
|
||||
|
||||
var postExpandFunction = function( e, postLi )
|
||||
{
|
||||
if( !postLi.hasClass( "original" ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var originalPost = postLi.find(".post-data.original");
|
||||
var $postInteractionText = originalPost.find( ".post-expand" );
|
||||
var $postExpandedContent = originalPost.find( ".expanded-content" );
|
||||
var $postsRelated = postLi.find(".related");
|
||||
|
||||
var openClass = "open";
|
||||
if( !postLi.hasClass( openClass ) ) {
|
||||
originalPost.detach();
|
||||
postLi.empty();
|
||||
postLi.addClass( openClass );
|
||||
$postInteractionText.text( polyglot.t("Collapse") );
|
||||
|
||||
var itemOl = $("<ol/>", {class:"expanded-post"}).appendTo(postLi);
|
||||
var originalLi = $("<li/>", {class: "module post original"}).appendTo(itemOl);
|
||||
originalLi.append(originalPost);
|
||||
|
||||
$postExpandedContent.slideDown( "fast" );
|
||||
|
||||
// insert "reply_to" before
|
||||
requestRepliedBefore(originalLi);
|
||||
// insert replies to this post after
|
||||
requestRepliesAfter(originalLi);
|
||||
// RTs faces and counter
|
||||
requestRTs(originalLi);
|
||||
}
|
||||
else
|
||||
{
|
||||
postLi.removeClass( openClass );
|
||||
$postInteractionText.text( polyglot.t("Expand") );
|
||||
|
||||
if( $postsRelated ) $postsRelated.slideUp( "fast" );
|
||||
$postExpandedContent.slideUp( "fast", function()
|
||||
{
|
||||
originalPost.detach();
|
||||
postLi.empty();
|
||||
postLi.append(originalPost);
|
||||
});
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
var postReplyClick = function( e )
|
||||
{
|
||||
var post = $(this).closest(".post");
|
||||
if( !post.hasClass( "original" ) ) {
|
||||
replyInitPopup(e, post);
|
||||
} else {
|
||||
var postLiOpen = post.parents(".post.open");
|
||||
if( !postLiOpen.length ) {
|
||||
postExpandFunction(e, post);
|
||||
}
|
||||
var postAreaNew = post.find(".post-area-new")
|
||||
composeNewPost(e, postAreaNew);
|
||||
}
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
//Expande Área do Novo post
|
||||
var composeNewPost = function( e, postAreaNew )
|
||||
{
|
||||
e.stopPropagation();
|
||||
if( !postAreaNew.hasClass("open") ) {
|
||||
postAreaNew.addClass( "open" );
|
||||
//se o usuário clicar fora é pra fechar
|
||||
postAreaNew.clickoutside( unfocusThis )
|
||||
}
|
||||
|
||||
var textArea = postAreaNew.find("textarea");
|
||||
textArea.focus();
|
||||
if( textArea.attr("data-reply-to") && !textArea.val().length ) {
|
||||
textArea.val(textArea.attr("data-reply-to"));
|
||||
}
|
||||
}
|
||||
|
||||
//Reduz Área do Novo post
|
||||
var unfocusThis = function()
|
||||
{
|
||||
var $this = $( this );
|
||||
$this.removeClass( "open" );
|
||||
}
|
||||
|
||||
function replyTextKeypress(e) {
|
||||
e = e || event;
|
||||
var $this = $( this );
|
||||
var tweetForm = $this.parents("form");
|
||||
if( tweetForm != undefined ) {
|
||||
var c = 140 - $this.val().length;
|
||||
var remainingCount = tweetForm.find(".post-area-remaining");
|
||||
remainingCount.text(c);
|
||||
if( c < 0 ) remainingCount.addClass("warn");
|
||||
else remainingCount.removeClass("warn");
|
||||
|
||||
var tweetAction = tweetForm.find(".post-submit");
|
||||
if( !tweetAction.length ) tweetAction = tweetForm.find(".dm-submit");
|
||||
if( c >= 0 && c < 140 &&
|
||||
$this.val() != $this.attr("data-reply-to") ) {
|
||||
$.MAL.enableButton(tweetAction);
|
||||
} else {
|
||||
$.MAL.disableButton(tweetAction);
|
||||
}
|
||||
|
||||
if (e.keyCode === 13) {
|
||||
if (!e.ctrlKey) {
|
||||
$this.val($this.val().trim());
|
||||
if( !tweetAction.hasClass("disabled") ) {
|
||||
tweetAction.click();
|
||||
}
|
||||
} else {
|
||||
$this.val($this.val() + "\r");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var postSubmit = function(e)
|
||||
{
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var $this = $( this );
|
||||
var $replyText = $this.closest(".post-area-new").find("textarea");
|
||||
|
||||
var $postOrig = $this.closest(".post-data");
|
||||
|
||||
if (!$postOrig.length) {
|
||||
$postOrig = $this.closest(".modal-content").find(".post-data");
|
||||
}
|
||||
|
||||
newPostMsg($replyText.val(), $postOrig);
|
||||
|
||||
$replyText.val("");
|
||||
$replyText.attr("placeholder", polyglot.t("Your message was sent!"));
|
||||
var tweetForm = $this.parents("form");
|
||||
var remainingCount = tweetForm.find(".post-area-remaining");
|
||||
remainingCount.text(140);
|
||||
$replyText.attr("placeholder", "Your message was sent!");
|
||||
closeModal($this);
|
||||
}
|
||||
|
||||
|
||||
var retweetSubmit = function(e)
|
||||
{
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var $this = $( this );
|
||||
|
||||
var $postOrig = $this.closest(".modal-wrapper").find(".post-data");
|
||||
|
||||
newRtMsg($postOrig);
|
||||
|
||||
closeModal($this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function initInterfaceCommon() {
|
||||
$( "body" ).on( "click", ".cancel" , function() { closeModal($(this)); } );
|
||||
$( ".post-reply" ).bind( "click", postReplyClick );
|
||||
$( ".post-propagate" ).bind( "click", reTwistPopup );
|
||||
$( ".userMenu-config-dropdown" ).bind( "click", dropDownMenu );
|
||||
$( ".config-menu" ).clickoutside( closeThis );
|
||||
$( ".module.post" ).bind( "click", function(e) {
|
||||
postExpandFunction(e,$(this)); });
|
||||
$( ".post-area-new" ).bind( "click", function(e) {
|
||||
composeNewPost(e,$(this));} );
|
||||
$( ".post-area-new" ).clickoutside( unfocusThis );
|
||||
$( ".post-submit").click( postSubmit );
|
||||
$( ".modal-propagate").click( retweetSubmit );
|
||||
|
||||
var $replyText = $( ".post-area-new textarea" );
|
||||
$replyText.keyup( replyTextKeypress );
|
||||
|
||||
$( ".open-profile-modal").bind( "click", openProfileModal );
|
||||
$( ".open-hashtag-modal").bind( "click", openHashtagModal );
|
||||
$( ".open-following-modal").bind( "click", openFollowingModal );
|
||||
$( ".userMenu-connections a").bind( "click", openMentionsModal );
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
// interface_home.js
|
||||
// 2013 Lucas Leal, Miguel Freitas
|
||||
//
|
||||
// Specific interface functions for home.html
|
||||
|
||||
//***********************************************
|
||||
//******************* DECLARATIONS **************
|
||||
//***********************************************
|
||||
var InterfaceFunctions = function()
|
||||
{
|
||||
//faço os binds no init
|
||||
this.init = function()
|
||||
{
|
||||
$( ".wrapper .postboard-news").click(function() {
|
||||
requestTimelineUpdate("latest",postsPerRefresh,followingUsers);});
|
||||
|
||||
initInterfaceCommon();
|
||||
initUserSearch();
|
||||
initInterfaceDirectMsg();
|
||||
|
||||
initUser(initHome);
|
||||
}
|
||||
|
||||
function initHome(cbFunc, cbArg) {
|
||||
if( !defaultScreenName ) {
|
||||
alert(polyglot.t("username_undefined"));
|
||||
$.MAL.goLogin();
|
||||
return;
|
||||
}
|
||||
checkNetworkStatusAndAskRedirect();
|
||||
|
||||
//$("span.screen-name").text('@' + user);
|
||||
var $miniProfile = $(".mini-profile");
|
||||
$miniProfile.find("a.mini-profile-name").attr("href",$.MAL.userUrl(defaultScreenName));
|
||||
$miniProfile.find("a.open-profile-modal").attr("href",$.MAL.userUrl(defaultScreenName));
|
||||
$miniProfile.find(".mini-profile-name").text(defaultScreenName);
|
||||
getFullname( defaultScreenName, $miniProfile.find(".mini-profile-name") );
|
||||
getAvatar( defaultScreenName, $miniProfile.find(".mini-profile-photo").find("img") );
|
||||
getPostsCount( defaultScreenName, $miniProfile.find(".posts-count") );
|
||||
getFollowers( defaultScreenName, $miniProfile.find(".followers-count") );
|
||||
|
||||
loadFollowing( function(args) {
|
||||
$(".mini-profile .following-count").text(followingUsers.length-1);
|
||||
requestLastHave();
|
||||
setInterval("requestLastHave()", 1000);
|
||||
initMentionsCount();
|
||||
initDMsCount();
|
||||
requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers);
|
||||
|
||||
// install scrollbottom handler to load more posts as needed
|
||||
$(window).scroll(function(){
|
||||
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 20){
|
||||
if( timelineLoaded ) {
|
||||
requestTimelineUpdate("older", postsPerRefresh, followingUsers);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000);
|
||||
setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000);
|
||||
setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000);
|
||||
if( args.cbFunc )
|
||||
args.cbFunc(args.cbArg);
|
||||
}, {cbFunc:cbFunc, cbArg:cbArg});
|
||||
}
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
//******************* INIT **************
|
||||
//***********************************************
|
||||
var interfaceFunctions = new InterfaceFunctions;
|
||||
$( document ).ready( interfaceFunctions.init );
|
||||
|
||||
|
||||
//função no window que fixa o header das postagens
|
||||
function fixDiv()
|
||||
{
|
||||
var $cache = $('.postboard h2');
|
||||
if ($(window).scrollTop() > 26)
|
||||
$cache.addClass( "fixed" );
|
||||
else
|
||||
$cache.removeClass( "fixed" );
|
||||
}
|
||||
|
||||
$(window).scroll(fixDiv);
|
35
js/calm.js
Normal file
@ -0,0 +1,35 @@
|
||||
$(function(){
|
||||
$('#showqr').on('click', function(){
|
||||
if($('#qrcode img')[0]) return;
|
||||
var skey = document.getElementById('skey').innerText;
|
||||
new QRCode(document.getElementById("qrcode"), skey);
|
||||
});
|
||||
$('.tox-ctc').on('click', function(){
|
||||
window.prompt('Press Ctrl/Cmd+C to copy then Enter to close', $(this).attr('data'))
|
||||
})
|
||||
$('.bitmessage-ctc').on('click', function(){
|
||||
window.prompt('Press Ctrl/Cmd+C to copy then Enter to close', $(this).attr('data'))
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
function dhtIndicatorBg(){
|
||||
var bgcolor = '';
|
||||
if(twisterDhtNodes <= 20){bgcolor = '#770900'
|
||||
}else if(twisterDhtNodes <= 60){bgcolor = '#773400'
|
||||
}else if(twisterDhtNodes <= 90){bgcolor = '#774c00'
|
||||
}else if(twisterDhtNodes <= 120){bgcolor = '#776400'
|
||||
}else if(twisterDhtNodes <= 150){bgcolor = '#707500'
|
||||
}else if(twisterDhtNodes <= 180){bgcolor = '#3f6900'
|
||||
}else if(twisterDhtNodes <= 210){bgcolor = '#005f15'
|
||||
}else if(twisterDhtNodes >= 250){bgcolor = '#009922'
|
||||
}
|
||||
$('.userMenu-dhtindicator').animate({'background-color': bgcolor });
|
||||
};
|
||||
setTimeout(dhtIndicatorBg, 300);
|
||||
setTimeout(function() {setInterval(dhtIndicatorBg, 2000)}, 400);
|
||||
|
||||
|
||||
function homeIntInit () {
|
||||
setTimeout(mensAutocomplete, 800);
|
||||
}
|
1340
js/interface_common.js
Normal file
177
js/interface_home.js
Normal file
@ -0,0 +1,177 @@
|
||||
// interface_home.js
|
||||
// 2013 Lucas Leal, Miguel Freitas
|
||||
//
|
||||
// Specific interface functions for home.html
|
||||
|
||||
var promotedPostsOnly = false;
|
||||
|
||||
//***********************************************
|
||||
//******************* DECLARATIONS **************
|
||||
//***********************************************
|
||||
var InterfaceFunctions = function()
|
||||
{
|
||||
//faço os binds no init
|
||||
this.init = function()
|
||||
{
|
||||
$( ".wrapper .postboard-news").click(function() {
|
||||
requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly);});
|
||||
|
||||
|
||||
/*$( ".promoted-posts-only").click(function() {
|
||||
promotedPostsOnly = !promotedPostsOnly;
|
||||
$(this).text( promotedPostsOnly ? "Switch to Normal posts" : "Switch to Promoted posts" );
|
||||
timelineChangedUser();
|
||||
$.MAL.getStreamPostsParent().empty();
|
||||
requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly);
|
||||
});*/
|
||||
|
||||
|
||||
// Add refresh posts for home link in menu
|
||||
$( ".userMenu-home.current a").click(function() {
|
||||
requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly);});
|
||||
|
||||
// modified the way promoted posts are shown
|
||||
$( ".promoted-posts-only").click(function() {
|
||||
promotedPostsOnly = !promotedPostsOnly;
|
||||
//active promoted posts tab
|
||||
$(this).children('.promoted-posts').addClass(promotedPostsOnly ? "active" : "disabled");
|
||||
$(this).children('.normal-posts').addClass(promotedPostsOnly ? "disabled" : "active");
|
||||
$('#postboard-top').removeClass(promotedPostsOnly ? "show" : "hide");
|
||||
//active normal posts
|
||||
$(this).children('.promoted-posts').removeClass(promotedPostsOnly ? "disabled" : "active");
|
||||
$(this).children('.normal-posts').removeClass(promotedPostsOnly ? "active" : "disabled");
|
||||
$('#postboard-top').addClass(promotedPostsOnly ? "hide" : "show");
|
||||
|
||||
timelineChangedUser();
|
||||
$.MAL.getStreamPostsParent().empty();
|
||||
requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly);
|
||||
});
|
||||
|
||||
initInterfaceCommon();
|
||||
initUserSearch();
|
||||
initInterfaceDirectMsg();
|
||||
|
||||
initUser(initHome);
|
||||
};
|
||||
|
||||
function initHome(cbFunc, cbArg) {
|
||||
checkNetworkStatusAndAskRedirect();
|
||||
|
||||
//$("span.screen-name").text('@' + user);
|
||||
var $miniProfile = $(".mini-profile");
|
||||
if(!defaultScreenName)
|
||||
{
|
||||
$(".userMenu-profile > a").text(polyglot.t("Login"));
|
||||
$(".userMenu-profile > a").attr("href","login.html");
|
||||
$(".post-area-new > textarea").attr("placeholder",polyglot.t("You have to log in to post messages."));
|
||||
$(".post-area-new > textarea").attr("disabled","true");
|
||||
$miniProfile.find(".mini-profile-name").text("guest");
|
||||
$miniProfile.find(".posts-count").text("0");
|
||||
$miniProfile.find(".following-count").text("0");
|
||||
$miniProfile.find(".followers-count").text("0");
|
||||
$miniProfile.find("a.open-following-page").attr("href","#");
|
||||
$miniProfile.find("a.open-following-page").bind("click", function()
|
||||
{ alert(polyglot.t("You are not following anyone because you are not logged in."))} );
|
||||
$miniProfile.find("a.open-followers").bind("click", function()
|
||||
{ alert(polyglot.t("You don't have any followers because you are not logged in."))} );
|
||||
$(".dropdown-menu-following").attr("href","#");
|
||||
$(".dropdown-menu-following").bind("click", function()
|
||||
{ alert(polyglot.t("You are not following anyone because you are not logged in."))} );
|
||||
twisterRpc("gettrendinghashtags", [10],
|
||||
function(args, ret) {
|
||||
for( var i = 0; i < ret.length; i++ ) {
|
||||
|
||||
var $li = $("<li>");
|
||||
var hashtagLinkTemplate = $("#hashtag-link-template").clone(true);
|
||||
hashtagLinkTemplate.removeAttr("id");
|
||||
hashtagLinkTemplate.attr("href",$.MAL.hashtagUrl(ret[i]));
|
||||
hashtagLinkTemplate.text("#"+ret[i]);
|
||||
$li.append(hashtagLinkTemplate);
|
||||
$(".toptrends-list").append($li);
|
||||
}
|
||||
}, {},
|
||||
function(args, ret) {
|
||||
console.log("Error with gettrendinghashtags. Older twister daemon?");
|
||||
}, {});
|
||||
}
|
||||
else
|
||||
{
|
||||
$miniProfile.find("a.mini-profile-name").attr("href",$.MAL.userUrl(defaultScreenName));
|
||||
$miniProfile.find("a.open-profile-modal").attr("href",$.MAL.userUrl(defaultScreenName));
|
||||
$miniProfile.find(".mini-profile-name").text(defaultScreenName);
|
||||
getFullname( defaultScreenName, $miniProfile.find(".mini-profile-name") );
|
||||
getAvatar( defaultScreenName, $miniProfile.find(".mini-profile-photo").find("img") );
|
||||
// add avatar in postboard-top
|
||||
getAvatar( defaultScreenName, $("#postboard-top").find("img") );
|
||||
getPostsCount( defaultScreenName, $miniProfile.find(".posts-count") );
|
||||
getFollowers( defaultScreenName, $miniProfile.find(".followers-count") );
|
||||
|
||||
loadFollowing( function(args) {
|
||||
$(".mini-profile .following-count").text(followingUsers.length-1);
|
||||
requestLastHave();
|
||||
setInterval("requestLastHave()", 1000);
|
||||
initMentionsCount();
|
||||
initDMsCount();
|
||||
requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly);
|
||||
|
||||
// install scrollbottom handler to load more posts as needed
|
||||
$(window).scroll(function(){
|
||||
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 20){
|
||||
if( timelineLoaded ) {
|
||||
requestTimelineUpdate("older", postsPerRefresh, followingUsers, promotedPostsOnly);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
twisterFollowingO = TwisterFollowing(defaultScreenName);
|
||||
|
||||
setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000);
|
||||
setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000);
|
||||
setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000);
|
||||
|
||||
twisterRpc("gettrendinghashtags", [10],
|
||||
function(args, ret) {
|
||||
for( var i = 0; i < ret.length; i++ ) {
|
||||
|
||||
var $li = $("<li>");
|
||||
var hashtagLinkTemplate = $("#hashtag-link-template").clone(true);
|
||||
hashtagLinkTemplate.removeAttr("id");
|
||||
hashtagLinkTemplate.attr("href",$.MAL.hashtagUrl(ret[i]));
|
||||
hashtagLinkTemplate.text("#"+ret[i]);
|
||||
$li.append(hashtagLinkTemplate);
|
||||
$(".toptrends-list").append($li);
|
||||
}
|
||||
}, {},
|
||||
function(args, ret) {
|
||||
console.log("Error with gettrendinghashtags. Older twister daemon?");
|
||||
}, {});
|
||||
|
||||
if( args.cbFunc )
|
||||
args.cbFunc(args.cbArg);
|
||||
}, {cbFunc:cbFunc, cbArg:cbArg});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//***********************************************
|
||||
//******************* INIT **************
|
||||
//***********************************************
|
||||
var interfaceFunctions = new InterfaceFunctions;
|
||||
$( document ).ready( interfaceFunctions.init );
|
||||
$( window ).resize(replaceDashboards);
|
||||
|
||||
//função no window que fixa o header das postagens
|
||||
function fixDiv()
|
||||
{
|
||||
var $cache = $('.postboard h2');
|
||||
if ($(window).scrollTop() > 26)
|
||||
$cache.addClass( "fixed" );
|
||||
else
|
||||
$cache.removeClass( "fixed" );
|
||||
}
|
||||
$(window).scroll(fixDiv);
|
||||
|
@ -10,7 +10,7 @@ function initProfileEdit() {
|
||||
if (window.File && window.FileReader && window.FileList && window.Blob) {
|
||||
// Great success! All the File APIs are supported.
|
||||
} else {
|
||||
alert(polyglot.t("The File APIs are not fully supported in this browser."));
|
||||
alert('The File APIs are not fully supported in this browser.');
|
||||
}
|
||||
|
||||
initInterfaceCommon();
|
||||
@ -39,14 +39,21 @@ function initProfileEdit() {
|
||||
loadAvatarForEdit();
|
||||
loadProfileForEdit();
|
||||
|
||||
dumpPrivkey(defaultScreenName, function(args, key) {
|
||||
$(".secret-key-container").hide();
|
||||
$(".secret-key").text(key);
|
||||
$(".secret-key-container").hide();
|
||||
|
||||
$(".toggle-priv-key").click(function () {
|
||||
$(".secret-key-container").fadeToggle();
|
||||
});
|
||||
}, {});
|
||||
$(".toggle-priv-key").click(function () {
|
||||
if ($(".secret-key-container").is(":visible")) {
|
||||
$(".secret-key-container").fadeOut(function () {
|
||||
$(".secret-key").text('');
|
||||
});
|
||||
} else {
|
||||
dumpPrivkey(defaultScreenName, function(args, key) {
|
||||
$(".secret-key").text(key);
|
||||
$(".secret-key-container").fadeIn();
|
||||
}, {});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -103,3 +110,15 @@ function verifyUserAlreadyInBlockchain()
|
||||
}
|
||||
}, {} );
|
||||
}
|
||||
|
||||
function localizePlaceholders()
|
||||
{
|
||||
$(".input-name").attr("placeholder",polyglot.t("Full name here"));
|
||||
$(".input-description").attr("placeholder",polyglot.t("Describe yourself"));
|
||||
$(".input-city").attr("placeholder",polyglot.t("Location"));
|
||||
$(".input-website").attr("placeholder",polyglot.t("website"));
|
||||
$(".input-tox").attr("placeholder",polyglot.t("Tox address"));
|
||||
$(".input-bitmessage").attr("placeholder",polyglot.t("Bitmessage address"));
|
||||
}
|
||||
|
||||
$(document).ready(localizePlaceholders);
|
12
js/jquery.animate-colors-min.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
Color animation 1.6.0
|
||||
http://www.bitstorm.org/jquery/color-animation/
|
||||
Copyright 2011, 2013 Edwin Martin <edwin@bitstorm.org>
|
||||
Released under the MIT and GPL licenses.
|
||||
*/
|
||||
'use strict';(function(d){function h(a,b,e){var c="rgb"+(d.support.rgba?"a":"")+"("+parseInt(a[0]+e*(b[0]-a[0]),10)+","+parseInt(a[1]+e*(b[1]-a[1]),10)+","+parseInt(a[2]+e*(b[2]-a[2]),10);d.support.rgba&&(c+=","+(a&&b?parseFloat(a[3]+e*(b[3]-a[3])):1));return c+")"}function f(a){var b;return(b=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(a))?[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16),1]:(b=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(a))?[17*parseInt(b[1],16),17*parseInt(b[2],
|
||||
16),17*parseInt(b[3],16),1]:(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))?[parseInt(b[1]),parseInt(b[2]),parseInt(b[3]),1]:(b=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(a))?[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),parseFloat(b[4])]:l[a]}d.extend(!0,d,{support:{rgba:function(){var a=d("script:first"),b=a.css("color"),e=!1;if(/^rgba/.test(b))e=!0;else try{e=b!=a.css("color","rgba(0, 0, 0, 0.5)").css("color"),
|
||||
a.css("color",b)}catch(c){}return e}()}});var k="color backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor outlineColor".split(" ");d.each(k,function(a,b){d.Tween.propHooks[b]={get:function(a){return d(a.elem).css(b)},set:function(a){var c=a.elem.style,g=f(d(a.elem).css(b)),m=f(a.end);a.run=function(a){c[b]=h(g,m,a)}}}});d.Tween.propHooks.borderColor={set:function(a){var b=a.elem.style,e=[],c=k.slice(2,6);d.each(c,function(b,c){e[c]=f(d(a.elem).css(c))});var g=f(a.end);
|
||||
a.run=function(a){d.each(c,function(d,c){b[c]=h(e[c],g,a)})}}};var l={aqua:[0,255,255,1],azure:[240,255,255,1],beige:[245,245,220,1],black:[0,0,0,1],blue:[0,0,255,1],brown:[165,42,42,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgrey:[169,169,169,1],darkgreen:[0,100,0,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkviolet:[148,0,211,1],fuchsia:[255,
|
||||
0,255,1],gold:[255,215,0,1],green:[0,128,0,1],indigo:[75,0,130,1],khaki:[240,230,140,1],lightblue:[173,216,230,1],lightcyan:[224,255,255,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],magenta:[255,0,255,1],maroon:[128,0,0,1],navy:[0,0,128,1],olive:[128,128,0,1],orange:[255,165,0,1],pink:[255,192,203,1],purple:[128,0,128,1],violet:[128,0,128,1],red:[255,0,0,1],silver:[192,192,192,1],white:[255,255,255,1],yellow:[255,255,
|
||||
0,1],transparent:[255,255,255,0]}})(jQuery);
|
0
jquery.min.js → js/jquery.min.js
vendored
554
js/jquery.textcomplete.js
Normal file
@ -0,0 +1,554 @@
|
||||
/*!
|
||||
* jQuery.textcomplete.js
|
||||
*
|
||||
* Repositiory: https://github.com/yuku-t/jquery-textcomplete
|
||||
* License: MIT
|
||||
* Author: Yuku Takahashi
|
||||
*/
|
||||
|
||||
;(function ($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Exclusive execution control utility.
|
||||
*/
|
||||
var lock = function (func) {
|
||||
var free, locked;
|
||||
free = function () { locked = false; };
|
||||
return function () {
|
||||
var args;
|
||||
if (locked) return;
|
||||
locked = true;
|
||||
args = toArray(arguments);
|
||||
args.unshift(free);
|
||||
func.apply(this, args);
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert arguments into a real array.
|
||||
*/
|
||||
var toArray = function (args) {
|
||||
var result;
|
||||
result = Array.prototype.slice.call(args);
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the styles of any element from property names.
|
||||
*/
|
||||
var getStyles = (function () {
|
||||
var color;
|
||||
color = $('<div></div>').css(['color']).color;
|
||||
if (typeof color !== 'undefined') {
|
||||
return function ($el, properties) {
|
||||
return $el.css(properties);
|
||||
};
|
||||
} else { // for jQuery 1.8 or below
|
||||
return function ($el, properties) {
|
||||
var styles;
|
||||
styles = {};
|
||||
$.each(properties, function (i, property) {
|
||||
styles[property] = $el.css(property);
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
/**
|
||||
* Default template function.
|
||||
*/
|
||||
var identity = function (obj) { return obj; };
|
||||
|
||||
/**
|
||||
* Memoize a search function.
|
||||
*/
|
||||
var memoize = function (func) {
|
||||
var memo = {};
|
||||
return function (term, callback) {
|
||||
if (memo[term]) {
|
||||
callback(memo[term]);
|
||||
} else {
|
||||
func.call(this, term, function (data) {
|
||||
memo[term] = (memo[term] || []).concat(data);
|
||||
callback.apply(null, arguments);
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine if the array contains a given value.
|
||||
*/
|
||||
var include = function (array, value) {
|
||||
var i, l;
|
||||
if (array.indexOf) return array.indexOf(value) != -1;
|
||||
for (i = 0, l = array.length; i < l; i++) {
|
||||
if (array[i] === value) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Textarea manager class.
|
||||
*/
|
||||
var Completer = (function () {
|
||||
var html, css, $baseWrapper, $baseList, _id;
|
||||
|
||||
html = {
|
||||
wrapper: '<div class="textcomplete-wrapper"></div>',
|
||||
list: '<ul class="dropdown-menu"></ul>'
|
||||
};
|
||||
css = {
|
||||
wrapper: {
|
||||
position: 'relative'
|
||||
},
|
||||
list: {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
zIndex: '100',
|
||||
display: 'none'
|
||||
}
|
||||
};
|
||||
$baseWrapper = $(html.wrapper).css(css.wrapper);
|
||||
$baseList = $(html.list).css(css.list);
|
||||
_id = 0;
|
||||
|
||||
function Completer($el) {
|
||||
var focus;
|
||||
this.el = $el.get(0); // textarea element
|
||||
focus = this.el === document.activeElement;
|
||||
// Cannot wrap $el at initialize method lazily due to Firefox's behavior.
|
||||
this.$el = wrapElement($el); // Focus is lost
|
||||
this.id = 'textComplete' + _id++;
|
||||
this.strategies = [];
|
||||
if (focus) {
|
||||
this.initialize();
|
||||
this.$el.focus();
|
||||
} else {
|
||||
this.$el.one('focus.textComplete', $.proxy(this.initialize, this));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Completer's public methods
|
||||
*/
|
||||
$.extend(Completer.prototype, {
|
||||
|
||||
/**
|
||||
* Prepare ListView and bind events.
|
||||
*/
|
||||
initialize: function () {
|
||||
var $list, globalEvents;
|
||||
$list = $baseList.clone();
|
||||
this.listView = new ListView($list, this);
|
||||
this.$el
|
||||
.before($list)
|
||||
.on({
|
||||
'keyup.textComplete': $.proxy(this.onKeyup, this),
|
||||
'keydown.textComplete': $.proxy(this.listView.onKeydown,
|
||||
this.listView)
|
||||
});
|
||||
globalEvents = {};
|
||||
globalEvents['click.' + this.id] = $.proxy(this.onClickDocument, this);
|
||||
globalEvents['keyup.' + this.id] = $.proxy(this.onKeyupDocument, this);
|
||||
$(document).on(globalEvents);
|
||||
},
|
||||
|
||||
/**
|
||||
* Register strategies to the completer.
|
||||
*/
|
||||
register: function (strategies) {
|
||||
this.strategies = this.strategies.concat(strategies);
|
||||
},
|
||||
|
||||
/**
|
||||
* Show autocomplete list next to the caret.
|
||||
*/
|
||||
renderList: function (data) {
|
||||
if (this.clearAtNext) {
|
||||
this.listView.clear();
|
||||
this.clearAtNext = false;
|
||||
}
|
||||
if (data.length) {
|
||||
if (!this.listView.shown) {
|
||||
this.listView
|
||||
.setPosition(this.getCaretPosition())
|
||||
.clear()
|
||||
.activate();
|
||||
this.listView.strategy = this.strategy;
|
||||
}
|
||||
data = data.slice(0, this.strategy.maxCount);
|
||||
this.listView.render(data);
|
||||
}
|
||||
|
||||
if (!this.listView.data.length && this.listView.shown) {
|
||||
this.listView.deactivate();
|
||||
}
|
||||
},
|
||||
|
||||
searchCallbackFactory: function (free) {
|
||||
var self = this;
|
||||
return function (data, keep) {
|
||||
self.renderList(data);
|
||||
if (!keep) {
|
||||
// This is the last callback for this search.
|
||||
free();
|
||||
self.clearAtNext = true;
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Keyup event handler.
|
||||
*/
|
||||
onKeyup: function (e) {
|
||||
var searchQuery, term;
|
||||
if (this.skipSearch(e)) { return; }
|
||||
|
||||
searchQuery = this.extractSearchQuery(this.getTextFromHeadToCaret());
|
||||
if (searchQuery.length) {
|
||||
term = searchQuery[1];
|
||||
if (this.term === term) return; // Ignore shift-key or something.
|
||||
this.term = term;
|
||||
this.search(searchQuery);
|
||||
} else {
|
||||
this.term = null;
|
||||
this.listView.deactivate();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Suppress searching if it returns true.
|
||||
*/
|
||||
skipSearch: function (e) {
|
||||
if (this.skipNextKeyup) {
|
||||
this.skipNextKeyup = false;
|
||||
return true;
|
||||
}
|
||||
switch (e.keyCode) {
|
||||
case 40:
|
||||
case 38:
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
onSelect: function (value) {
|
||||
var pre, post, newSubStr;
|
||||
pre = this.getTextFromHeadToCaret();
|
||||
post = this.el.value.substring(this.el.selectionEnd);
|
||||
|
||||
newSubStr = this.strategy.replace(value);
|
||||
if ($.isArray(newSubStr)) {
|
||||
post = newSubStr[1] + post;
|
||||
newSubStr = newSubStr[0];
|
||||
}
|
||||
pre = pre.replace(this.strategy.match, newSubStr);
|
||||
this.$el.val(pre + post)
|
||||
.trigger('change')
|
||||
.trigger('textComplete:select', value);
|
||||
this.el.focus();
|
||||
this.el.selectionStart = this.el.selectionEnd = pre.length;
|
||||
this.skipNextKeyup = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Global click event handler.
|
||||
*/
|
||||
onClickDocument: function (e) {
|
||||
if (e.originalEvent && !e.originalEvent.keepTextCompleteDropdown) {
|
||||
this.listView.deactivate();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Global keyup event handler.
|
||||
*/
|
||||
onKeyupDocument: function (e) {
|
||||
if (this.listView.shown && e.keyCode === 27) { // ESC
|
||||
this.listView.deactivate();
|
||||
this.$el.focus();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all event handlers and the wrapper element.
|
||||
*/
|
||||
destroy: function () {
|
||||
var $wrapper;
|
||||
this.$el.off('.textComplete');
|
||||
$(document).off('.' + this.id);
|
||||
if (this.listView) { this.listView.destroy(); }
|
||||
$wrapper = this.$el.parent();
|
||||
$wrapper.after(this.$el).remove();
|
||||
this.$el.data('textComplete', void 0);
|
||||
this.$el = null;
|
||||
},
|
||||
|
||||
// Helper methods
|
||||
// ==============
|
||||
|
||||
/**
|
||||
* Returns caret's relative coordinates from textarea's left top corner.
|
||||
*/
|
||||
getCaretPosition: function () {
|
||||
// Browser native API does not provide the way to know the position of
|
||||
// caret in pixels, so that here we use a kind of hack to accomplish
|
||||
// the aim. First of all it puts a div element and completely copies
|
||||
// the textarea's style to the element, then it inserts the text and a
|
||||
// span element into the textarea.
|
||||
// Consequently, the span element's position is the thing what we want.
|
||||
|
||||
if (this.el.selectionEnd === 0) return;
|
||||
var properties, css, $div, $span, position, dir;
|
||||
|
||||
dir = this.$el.attr('dir') || this.$el.css('direction');
|
||||
properties = ['border-width', 'font-family', 'font-size', 'font-style',
|
||||
'font-variant', 'font-weight', 'height', 'letter-spacing',
|
||||
'word-spacing', 'line-height', 'text-decoration', 'text-align',
|
||||
'width', 'padding-top', 'padding-right', 'padding-bottom',
|
||||
'padding-left', 'margin-top', 'margin-right', 'margin-bottom',
|
||||
'margin-left'
|
||||
];
|
||||
css = $.extend({
|
||||
position: 'absolute',
|
||||
overflow: 'auto',
|
||||
'white-space': 'pre-wrap',
|
||||
top: 0,
|
||||
left: -9999,
|
||||
direction: dir
|
||||
}, getStyles(this.$el, properties));
|
||||
|
||||
$div = $('<div></div>').css(css).text(this.getTextFromHeadToCaret());
|
||||
$span = $('<span></span>').text('.').appendTo($div);
|
||||
this.$el.before($div);
|
||||
position = $span.position();
|
||||
position.top += $span.height() - this.$el.scrollTop();
|
||||
if (dir === 'rtl') { position.left -= this.listView.$el.width(); }
|
||||
$div.remove();
|
||||
return position;
|
||||
},
|
||||
|
||||
getTextFromHeadToCaret: function () {
|
||||
var text, selectionEnd, range;
|
||||
selectionEnd = this.el.selectionEnd;
|
||||
if (typeof selectionEnd === 'number') {
|
||||
text = this.el.value.substring(0, selectionEnd);
|
||||
} else if (document.selection) {
|
||||
range = this.el.createTextRange();
|
||||
range.moveStart('character', 0);
|
||||
range.moveEnd('textedit');
|
||||
text = range.text;
|
||||
}
|
||||
return text;
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse the value of textarea and extract search query.
|
||||
*/
|
||||
extractSearchQuery: function (text) {
|
||||
// If a search query found, it returns used strategy and the query
|
||||
// term. If the caret is currently in a code block or search query does
|
||||
// not found, it returns an empty array.
|
||||
|
||||
var i, l, strategy, match;
|
||||
for (i = 0, l = this.strategies.length; i < l; i++) {
|
||||
strategy = this.strategies[i];
|
||||
match = text.match(strategy.match);
|
||||
if (match) { return [strategy, match[strategy.index]]; }
|
||||
}
|
||||
return [];
|
||||
},
|
||||
|
||||
search: lock(function (free, searchQuery) {
|
||||
var term;
|
||||
this.strategy = searchQuery[0];
|
||||
term = searchQuery[1];
|
||||
this.strategy.search(term, this.searchCallbackFactory(free));
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* Completer's private functions
|
||||
*/
|
||||
var wrapElement = function ($el) {
|
||||
return $el.wrap($baseWrapper.clone().css('display', $el.css('display')));
|
||||
};
|
||||
|
||||
return Completer;
|
||||
})();
|
||||
|
||||
/**
|
||||
* Dropdown menu manager class.
|
||||
*/
|
||||
var ListView = (function () {
|
||||
|
||||
function ListView($el, completer) {
|
||||
this.data = [];
|
||||
this.$el = $el;
|
||||
this.index = 0;
|
||||
this.completer = completer;
|
||||
|
||||
this.$el.on('click.textComplete', 'li.textcomplete-item',
|
||||
$.proxy(this.onClick, this));
|
||||
}
|
||||
|
||||
$.extend(ListView.prototype, {
|
||||
shown: false,
|
||||
|
||||
render: function (data) {
|
||||
var html, i, l, index, val;
|
||||
|
||||
html = '';
|
||||
for (i = 0, l = data.length; i < l; i++) {
|
||||
val = data[i];
|
||||
if (include(this.data, val)) continue;
|
||||
index = this.data.length;
|
||||
this.data.push(val);
|
||||
html += '<li class="textcomplete-item" data-index="' + index + '"><a>';
|
||||
html += this.strategy.template(val);
|
||||
html += '</a></li>';
|
||||
if (this.data.length === this.strategy.maxCount) break;
|
||||
}
|
||||
this.$el.append(html);
|
||||
if (!this.data.length) {
|
||||
this.deactivate();
|
||||
} else {
|
||||
this.activateIndexedItem();
|
||||
}
|
||||
},
|
||||
|
||||
clear: function () {
|
||||
this.data = [];
|
||||
this.$el.html('');
|
||||
this.index = 0;
|
||||
return this;
|
||||
},
|
||||
|
||||
activateIndexedItem: function () {
|
||||
this.$el.find('.active').removeClass('active');
|
||||
this.getActiveItem().addClass('active');
|
||||
},
|
||||
|
||||
getActiveItem: function () {
|
||||
return $(this.$el.children().get(this.index));
|
||||
},
|
||||
|
||||
activate: function () {
|
||||
if (!this.shown) {
|
||||
this.$el.show();
|
||||
this.completer.$el.trigger('textComplete:show');
|
||||
this.shown = true;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
deactivate: function () {
|
||||
if (this.shown) {
|
||||
this.$el.hide();
|
||||
this.completer.$el.trigger('textComplete:hide');
|
||||
this.shown = false;
|
||||
this.data = this.index = null;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setPosition: function (position) {
|
||||
this.$el.css(position);
|
||||
return this;
|
||||
},
|
||||
|
||||
select: function (index) {
|
||||
var self = this;
|
||||
this.completer.onSelect(this.data[index]);
|
||||
// Deactive at next tick to allow other event handlers to know whether
|
||||
// the dropdown has been shown or not.
|
||||
setTimeout(function () { self.deactivate(); }, 0);
|
||||
},
|
||||
|
||||
onKeydown: function (e) {
|
||||
if (!this.shown) return;
|
||||
if (e.keyCode === 38) { // UP
|
||||
e.preventDefault();
|
||||
if (this.index === 0) {
|
||||
this.index = this.data.length-1;
|
||||
} else {
|
||||
this.index -= 1;
|
||||
}
|
||||
this.activateIndexedItem();
|
||||
} else if (e.keyCode === 40) { // DOWN
|
||||
e.preventDefault();
|
||||
if (this.index === this.data.length - 1) {
|
||||
this.index = 0;
|
||||
} else {
|
||||
this.index += 1;
|
||||
}
|
||||
this.activateIndexedItem();
|
||||
} else if (e.keyCode === 13 || e.keyCode === 9) { // ENTER or TAB
|
||||
e.preventDefault();
|
||||
|
||||
this.select(parseInt(this.getActiveItem().data('index'), 10));
|
||||
}
|
||||
},
|
||||
|
||||
onClick: function (e) {
|
||||
var $e = $(e.target);
|
||||
e.originalEvent.keepTextCompleteDropdown = true;
|
||||
if (!$e.hasClass('textcomplete-item')) {
|
||||
$e = $e.parents('li.textcomplete-item');
|
||||
}
|
||||
this.select(parseInt($e.data('index'), 10));
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
this.deactivate();
|
||||
this.$el.off('click.textComplete').remove();
|
||||
this.$el = null;
|
||||
}
|
||||
});
|
||||
|
||||
return ListView;
|
||||
})();
|
||||
|
||||
$.fn.textcomplete = function (strategies) {
|
||||
var i, l, strategy, dataKey;
|
||||
|
||||
dataKey = 'textComplete';
|
||||
|
||||
if (strategies === 'destroy') {
|
||||
return this.each(function () {
|
||||
var completer = $(this).data(dataKey);
|
||||
if (completer) { completer.destroy(); }
|
||||
});
|
||||
}
|
||||
|
||||
for (i = 0, l = strategies.length; i < l; i++) {
|
||||
strategy = strategies[i];
|
||||
if (!strategy.template) {
|
||||
strategy.template = identity;
|
||||
}
|
||||
if (strategy.index == null) {
|
||||
strategy.index = 2;
|
||||
}
|
||||
if (strategy.cache) {
|
||||
strategy.search = memoize(strategy.search);
|
||||
}
|
||||
strategy.maxCount || (strategy.maxCount = 10);
|
||||
}
|
||||
|
||||
return this.each(function () {
|
||||
var $this, completer;
|
||||
$this = $(this);
|
||||
completer = $this.data(dataKey);
|
||||
if (!completer) {
|
||||
completer = new Completer($this);
|
||||
$this.data(dataKey, completer);
|
||||
}
|
||||
completer.register(strategies);
|
||||
});
|
||||
};
|
||||
|
||||
})(window.jQuery || window.Zepto);
|
@ -94,13 +94,18 @@ var MAL = function()
|
||||
newTweetsBar.text("Refresh");
|
||||
}
|
||||
} else {
|
||||
var newTweetsBar = $(".postboard-news");
|
||||
var newTweetsBar = $(".wrapper").find(".postboard-news");
|
||||
var newTweetsBarMenu = $(".userMenu").find(".menu-news"); // added for home menu entry
|
||||
if( newPosts ) {
|
||||
document.title = "(" + String(newPosts) + ") twister";
|
||||
newTweetsBar.text(String(newPosts) + " new posts");
|
||||
newTweetsBar.text(polyglot.t("new_posts", newPosts));
|
||||
newTweetsBar.fadeIn("slow");
|
||||
newTweetsBarMenu.text(String(newPosts));
|
||||
newTweetsBarMenu.addClass("show");
|
||||
} else {
|
||||
newTweetsBar.hide();
|
||||
newTweetsBar.text("");
|
||||
newTweetsBarMenu.removeClass("show");
|
||||
document.title = "twister";
|
||||
}
|
||||
}
|
||||
@ -350,6 +355,52 @@ var MAL = function()
|
||||
window.location.href = "home.html";
|
||||
}
|
||||
}
|
||||
|
||||
this.soundNotifyMentions = function() {
|
||||
if( $.hasOwnProperty("mobile") ) {
|
||||
} else {
|
||||
$.Options.mensNotif();
|
||||
}
|
||||
}
|
||||
|
||||
this.soundNotifyDM = function() {
|
||||
if( $.hasOwnProperty("mobile") ) {
|
||||
} else {
|
||||
$.Options.DMsNotif();
|
||||
}
|
||||
}
|
||||
|
||||
this.reqRepAfterCB = function(postLi, postsFromJson) {
|
||||
if ($.hasOwnProperty("mobile")) {
|
||||
for( var i = 0; i < postsFromJson.length; i++) {
|
||||
var newStreamPost = postToElem(postsFromJson[i], "related");
|
||||
newStreamPost.hide();
|
||||
postLi.after(newStreamPost);
|
||||
newStreamPost.slideDown("fast");
|
||||
}
|
||||
} else {
|
||||
var $replist = $('<ol class="sub-replies"></ol>');
|
||||
var $newli = $('<li class="post-replies"></li>');
|
||||
postLi.after($newli);
|
||||
$newli.append($replist);
|
||||
for (var i = 0; i < postsFromJson.length && $.MAL.getExpandedPostsCount(postLi) < maxExpandPost; i++) {
|
||||
var newStreamPost = postToElem(postsFromJson[i], "related");
|
||||
newStreamPost.hide();
|
||||
$replist.prepend(newStreamPost);
|
||||
newStreamPost.slideDown("fast");
|
||||
requestRepliesAfter(newStreamPost);
|
||||
}
|
||||
}
|
||||
$.MAL.relatedPostLoaded();
|
||||
};
|
||||
|
||||
this.getExpandedPostsCount = function(postLi) {
|
||||
if ($.hasOwnProperty('mobile')) {
|
||||
return postLi.siblings().length;
|
||||
} else {
|
||||
return postLi.parents('.module.post.original.open').find('.post.related').length;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
jQuery.MAL = new MAL;
|
361
js/options.js
Normal file
@ -0,0 +1,361 @@
|
||||
$(function() {
|
||||
|
||||
});
|
||||
|
||||
var TwisterOptions = function()
|
||||
{
|
||||
this.getOption = function(optionName, defaultValue) {
|
||||
var keyName = "options:" + optionName;
|
||||
if( $.localStorage.isSet(keyName) )
|
||||
return $.localStorage.get(keyName);
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
this.setOption = function(optionName, value) {
|
||||
var keyName = "options:" + optionName;
|
||||
$.localStorage.set(keyName, value);
|
||||
}
|
||||
|
||||
this.soundNotifOptions = function() {
|
||||
$('#notifyForm select').each(function(){
|
||||
this.value = $.Options.getOption(this.id, "false");
|
||||
});
|
||||
|
||||
var player = $('#player');
|
||||
player[0].pause();
|
||||
$('#player').empty();
|
||||
|
||||
$('form#notifyForm').on('change','select',function(){
|
||||
$.Options.setOption(this.id, this.value);
|
||||
|
||||
if(this.value == false) {player[0].pause(); return;}
|
||||
if (player[0].canPlayType('audio/mpeg;')) {
|
||||
player.attr('type', 'audio/mpeg');
|
||||
player.attr('src', 'sound/'+this.value+'.mp3');
|
||||
} else {
|
||||
player.attr('type', 'audio/ogg');
|
||||
player.attr('src', 'sound/'+this.value+'.ogg');
|
||||
}
|
||||
|
||||
player[0].play();
|
||||
});
|
||||
}
|
||||
|
||||
this.volumeControl = function() {
|
||||
var playerVol = $('#playerVol');
|
||||
playerVol[0].value = $.Options.getOption(playerVol[0].id, 100);
|
||||
$('.volValue').text((playerVol[0].value * 100).toFixed());
|
||||
|
||||
playerVol.on('change',function(){
|
||||
$.Options.setOption(this.id, this.value);
|
||||
$('#player')[0].volume = (this.value);
|
||||
$('.volValue').text((this.value * 100).toFixed());
|
||||
});
|
||||
}
|
||||
|
||||
this.DMsNotif = function() {
|
||||
var sndDM = $.Options.getOption('sndDM', "false");
|
||||
if( sndDM == "false") return;
|
||||
var player = $('#player');
|
||||
$('#player').empty();
|
||||
|
||||
if (player[0].canPlayType('audio/mpeg;')) {
|
||||
player.attr('type', 'audio/mpeg');
|
||||
player.attr('src', 'sound/'+sndDM+'.mp3');
|
||||
} else {
|
||||
player.attr('type', 'audio/ogg');
|
||||
player.attr('src', 'sound/'+sndDM+'.ogg');
|
||||
}
|
||||
player[0].volume = $.Options.getOption('playerVol',100);
|
||||
player[0].play();
|
||||
}
|
||||
|
||||
this.mensNotif = function() {
|
||||
var sndMention = $.Options.getOption('sndMention', "false");
|
||||
if(sndMention == "false") return;
|
||||
var player = $('#player');
|
||||
$('#playerSec').empty();
|
||||
|
||||
if (player[0].canPlayType('audio/mpeg;')) {
|
||||
player.attr('type', 'audio/mpeg');
|
||||
player.attr('src', 'sound/'+sndMention+'.mp3');
|
||||
} else {
|
||||
player.attr('type', 'audio/ogg');
|
||||
player.attr('src', 'sound/'+sndMention+'.ogg');
|
||||
}
|
||||
player[0].volume = $.Options.getOption('playerVol',100);
|
||||
player[0].play();
|
||||
}
|
||||
|
||||
this.keysSendDefault = "ctrlenter";
|
||||
this.keysSend = function() {
|
||||
$('#keysOpt select')[0].value = $.Options.getOption('keysSend',this.keysSendDefault);
|
||||
|
||||
$('#keysOpt select').on('change', function(){
|
||||
$.Options.setOption(this.id, this.value);
|
||||
})
|
||||
}
|
||||
|
||||
this.keyEnterToSend = function() {
|
||||
return $.Options.getOption('keysSend',this.keysSendDefault) == "enter";
|
||||
}
|
||||
|
||||
this.setLang = function() {
|
||||
$('#language').val($.Options.getOption('locLang','auto'))
|
||||
$('#language').on('change', function(){
|
||||
$.Options.setOption('locLang', $(this).val());
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
|
||||
this.getTheme = function() {
|
||||
return $.Options.getOption('theme','original');
|
||||
}
|
||||
|
||||
this.setTheme = function() {
|
||||
$('#theme').val(this.getTheme())
|
||||
$('#theme').on('change', function(){
|
||||
$.Options.setOption('theme', $(this).val());
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
this.getLineFeedsOpt = function() {
|
||||
return $.Options.getOption('displayLineFeeds',"disable");
|
||||
}
|
||||
|
||||
this.setLineFeedsOpt = function() {
|
||||
$('#lineFeedsOpt select')[0].value = this.getLineFeedsOpt();
|
||||
|
||||
$('#lineFeedsOpt select').on('change', function(){
|
||||
$.Options.setOption(this.id, this.value);
|
||||
})
|
||||
}
|
||||
|
||||
this.getShowPreviewOpt = function() {
|
||||
return $.Options.getOption('displayPreview',"disable");
|
||||
}
|
||||
|
||||
this.setShowPreviewOpt = function () {
|
||||
$('#showPreviewOpt select')[0].value = this.getShowPreviewOpt();
|
||||
|
||||
$('#showPreviewOpt select').on('change', function(){
|
||||
$.Options.setOption(this.id, this.value);
|
||||
});
|
||||
}
|
||||
|
||||
this.getUnicodeConversionOpt = function () {
|
||||
return $.Options.getOption('unicodeConversion', "disable");
|
||||
}
|
||||
|
||||
this.setUnicodeConversionOpt = function () {
|
||||
$("#unicodeConversion")[0].value = this.getUnicodeConversionOpt();
|
||||
|
||||
if (this.getUnicodeConversionOpt() === "custom")
|
||||
$("#unicodeConversionOpt .suboptions")[0].style.height = "230px";
|
||||
|
||||
$("#unicodeConversion").on('change', function () {
|
||||
$.Options.setOption(this.id, this.value);
|
||||
if (this.value === "custom")
|
||||
$("#unicodeConversionOpt .suboptions")[0].style.height = "230px";
|
||||
else
|
||||
$("#unicodeConversionOpt .suboptions")[0].style.height = "0px";
|
||||
});
|
||||
}
|
||||
|
||||
this.getConvertPunctuationsOpt = function() {
|
||||
return $.Options.getOption('convertPunctuationsOpt', false);
|
||||
}
|
||||
|
||||
this.setConvertPunctuationsOpt = function () {
|
||||
$('#convertPunctuationsOpt')[0].checked = this.getConvertPunctuationsOpt();
|
||||
|
||||
$('#convertPunctuationsOpt').on('change', function(){
|
||||
$.Options.setOption(this.id, this.checked);
|
||||
});
|
||||
}
|
||||
|
||||
this.getConvertEmotionsOpt = function() {
|
||||
return $.Options.getOption('convertEmotionsOpt', false);
|
||||
}
|
||||
|
||||
this.setConvertEmotionsOpt = function () {
|
||||
$('#convertEmotionsOpt')[0].checked = this.getConvertEmotionsOpt();
|
||||
|
||||
$('#convertEmotionsOpt').on('change', function(){
|
||||
$.Options.setOption(this.id, this.checked);
|
||||
});
|
||||
}
|
||||
|
||||
this.getConvertSignsOpt = function() {
|
||||
return $.Options.getOption('convertSignsOpt', false);
|
||||
}
|
||||
|
||||
this.setConvertSignsOpt = function () {
|
||||
$('#convertSignsOpt')[0].checked = this.getConvertSignsOpt();
|
||||
|
||||
$('#convertSignsOpt').on('change', function(){
|
||||
$.Options.setOption(this.id, this.checked);
|
||||
});
|
||||
}
|
||||
|
||||
this.getConvertFractionsOpt = function() {
|
||||
return $.Options.getOption('convertFractionsOpt', false);
|
||||
}
|
||||
|
||||
this.setConvertFractionsOpt = function () {
|
||||
$('#convertFractionsOpt')[0].checked = this.getConvertFractionsOpt();
|
||||
|
||||
$('#convertFractionsOpt').on('change', function(){
|
||||
$.Options.setOption(this.id, this.checked);
|
||||
});
|
||||
}
|
||||
|
||||
this.getUseProxyOpt = function () {
|
||||
return $.Options.getOption('useProxy', 'disable');
|
||||
}
|
||||
|
||||
this.setUseProxyOpt = function () {
|
||||
$('#useProxy')[0].value = this.getUseProxyOpt();
|
||||
|
||||
if (this.getUseProxyOpt() === 'disable')
|
||||
$('#useProxyForImgOnly').attr('disabled','disabled');
|
||||
|
||||
$('#useProxy').on('change', function () {
|
||||
$.Options.setOption(this.id, this.value);
|
||||
|
||||
if (this.value === 'disable')
|
||||
$('#useProxyForImgOnly').attr('disabled','disabled');
|
||||
else
|
||||
$('#useProxyForImgOnly').removeAttr('disabled');
|
||||
});
|
||||
}
|
||||
|
||||
this.getUseProxyForImgOnlyOpt = function () {
|
||||
return $.Options.getOption('useProxyForImgOnly', false);
|
||||
}
|
||||
|
||||
this.setUseProxyForImgOnlyOpt = function () {
|
||||
$('#useProxyForImgOnly')[0].checked = this.getUseProxyForImgOnlyOpt();
|
||||
|
||||
$('#useProxyForImgOnly').on('change', function () {
|
||||
$.Options.setOption(this.id, this.checked);
|
||||
});
|
||||
}
|
||||
|
||||
this.getSplitPostsOpt = function (){
|
||||
return $.Options.getOption('splitPosts', 'disable');
|
||||
}
|
||||
|
||||
this.setSplitPostsOpt = function () {
|
||||
$('#splitPosts')[0].value = this.getSplitPostsOpt();
|
||||
|
||||
$('#splitPosts').on('change', function () {
|
||||
$.Options.setOption(this.id, this.value);
|
||||
});
|
||||
}
|
||||
|
||||
this.getHideRepliesOpt = function () {
|
||||
return $.Options.getOption('hideReplies', 'following');
|
||||
}
|
||||
|
||||
this.setHideRepliesOpt = function () {
|
||||
$('#hideReplies')[0].value = this.getHideRepliesOpt();
|
||||
|
||||
$('#hideReplies').on('change', function () {
|
||||
$.Options.setOption(this.id, this.value);
|
||||
});
|
||||
}
|
||||
|
||||
this.getHideCloseRTsOpt = function () {
|
||||
return $.Options.getOption('hideCloseRTs', 'disable');
|
||||
};
|
||||
|
||||
this.setHideCloseRTsOpt = function () {
|
||||
$('#hideCloseRTs')[0].value = this.getHideCloseRTsOpt();
|
||||
|
||||
if (this.getHideCloseRTsOpt() === 'disable') {
|
||||
$('#hideCloseRTsDesc')[0].style.display = 'none';
|
||||
} else {
|
||||
$('#hideCloseRTsDesc')[0].style.display = 'inline';
|
||||
}
|
||||
|
||||
$('#hideCloseRTs').on('change', function () {
|
||||
$.Options.setOption(this.id, this.value);
|
||||
|
||||
if (this.value === 'disable') {
|
||||
$('#hideCloseRTsDesc')[0].style.display = 'none';
|
||||
} else {
|
||||
$('#hideCloseRTsDesc')[0].style.display = 'inline';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.getHideCloseRTsHourOpt = function () {
|
||||
return parseInt($.Options.getOption('hideCloseRtsHour', '1'));
|
||||
};
|
||||
|
||||
this.setHideCloseRTsHourOpt = function () {
|
||||
$('#hideCloseRtsHour')[0].value = this.getHideCloseRTsHourOpt().toString();
|
||||
|
||||
$('#hideCloseRtsHour').on('keyup', function () {
|
||||
if (/^\d+$/.test(this.value)) {
|
||||
this.style.backgroundColor = '';
|
||||
$.Options.setOption(this.id, this.value);
|
||||
$(this).next('span').text(polyglot.t('hour(s)'));
|
||||
} else {
|
||||
this.style.backgroundColor = '#f00';
|
||||
$(this).next('span').text(polyglot.t('only numbers are allowed!'));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.getIsFollowingMeOpt = function () {
|
||||
return $.Options.getOption('isFollowingMe');
|
||||
};
|
||||
|
||||
this.setIsFollowingMeOpt = function () {
|
||||
$('#isFollowingMe')[0].value = this.getIsFollowingMeOpt();
|
||||
|
||||
$('#isFollowingMe').on('change', function () {
|
||||
$.Options.setOption(this.id, this.value);
|
||||
});
|
||||
};
|
||||
|
||||
this.InitOptions = function() {
|
||||
this.soundNotifOptions();
|
||||
this.volumeControl();
|
||||
this.keysSend();
|
||||
this.setLang();
|
||||
this.setTheme();
|
||||
this.setLineFeedsOpt();
|
||||
this.setShowPreviewOpt();
|
||||
this.setUnicodeConversionOpt();
|
||||
this.setConvertPunctuationsOpt();
|
||||
this.setConvertEmotionsOpt();
|
||||
this.setConvertSignsOpt();
|
||||
this.setConvertFractionsOpt();
|
||||
this.setUseProxyOpt();
|
||||
this.setUseProxyForImgOnlyOpt();
|
||||
this.setSplitPostsOpt();
|
||||
this.setHideRepliesOpt();
|
||||
this.setHideCloseRTsHourOpt();
|
||||
this.setHideCloseRTsOpt();
|
||||
this.setIsFollowingMeOpt();
|
||||
}
|
||||
}
|
||||
|
||||
jQuery.Options = new TwisterOptions;
|
||||
|
||||
function localizeLabels()
|
||||
{
|
||||
$("label[for=tab_language]").text(polyglot.t("Language"));
|
||||
$("label[for=t-2]").text(polyglot.t("Theme"));
|
||||
$("label[for=t-3]").text(polyglot.t("Sound"));
|
||||
$("label[for=t-4]").text(polyglot.t("Keys"));
|
||||
$("label[for=t-5]").text(polyglot.t("Postboard"));
|
||||
$("label[for=t-6]").text(polyglot.t("Users"));
|
||||
}
|
||||
|
||||
$(document).ready(localizeLabels);
|
0
polyglot.min.js → js/polyglot.min.js
vendored
@ -52,6 +52,7 @@ function initializeTwister( redirectNetwork, redirectLogin, cbFunc, cbArg ) {
|
||||
requestLastHave();
|
||||
initMentionsCount();
|
||||
initDMsCount();
|
||||
twisterFollowingO = TwisterFollowing(defaultScreenName);
|
||||
|
||||
twisterInitialized = true;
|
||||
if( cbFunc )
|
@ -10,7 +10,8 @@
|
||||
// global variables
|
||||
|
||||
var postsPerRefresh = 10;
|
||||
var maxExpandPost = 20;
|
||||
var maxExpandPost = 8;
|
||||
var maxExpandPostTop = 4;
|
||||
var _hashtagProcessedMap = {};
|
||||
var _hashtagPendingPosts = [];
|
||||
var autoUpdateHashtag = false;
|
||||
@ -19,7 +20,7 @@ var autoUpdateHashtag = false;
|
||||
|
||||
function requestRepliedBefore(postLi)
|
||||
{
|
||||
if(postLi.siblings().length >= maxExpandPost)
|
||||
if(postLi.siblings().length >= maxExpandPostTop)
|
||||
return;
|
||||
|
||||
var originalPost = postLi.find(".post-data");
|
||||
@ -41,7 +42,7 @@ function requestRepliedBefore(postLi)
|
||||
|
||||
function requestRepliesAfter(postLi)
|
||||
{
|
||||
if(postLi.siblings().length >= maxExpandPost)
|
||||
if($.MAL.getExpandedPostsCount(postLi) >= maxExpandPost)
|
||||
return;
|
||||
|
||||
var originalPost = postLi.find(".post-data");
|
||||
@ -49,16 +50,56 @@ function requestRepliesAfter(postLi)
|
||||
var original_k = originalPost.attr('data-id');
|
||||
|
||||
if( original_n != undefined && original_k != undefined ) {
|
||||
dhtget( original_n, "replies" + original_k, "m",
|
||||
function(postLi, postsFromJson) {
|
||||
for( var i = 0; i < postsFromJson.length; i++) {
|
||||
var newStreamPost = postToElem(postsFromJson[i], "related");
|
||||
newStreamPost.hide();
|
||||
postLi.after(newStreamPost);
|
||||
newStreamPost.slideDown("fast");
|
||||
}
|
||||
$.MAL.relatedPostLoaded();
|
||||
}, postLi);
|
||||
dhtget( original_n, "replies" + original_k, "m", $.MAL.reqRepAfterCB, postLi);
|
||||
}
|
||||
}
|
||||
|
||||
function getTopPostOfConversation(postLi, post, postboard) {
|
||||
var reply_n;
|
||||
var reply_k;
|
||||
|
||||
if (post && typeof(post) !== 'undefined' && "reply" in post["userpost"]) {
|
||||
reply_k = post["userpost"]["reply"]["k"];
|
||||
reply_n = post["userpost"]["reply"]["n"];
|
||||
} else if (postLi && typeof(postLi) !== 'undefined') {
|
||||
var originalPost = postLi.find(".post-data");
|
||||
reply_n = originalPost.attr('data-replied-to-screen-name');
|
||||
reply_k = originalPost.attr('data-replied-to-id');
|
||||
}
|
||||
|
||||
if( reply_n != undefined && reply_k != undefined ) {
|
||||
dhtget( reply_n, "post" + reply_k, "s",
|
||||
function(postLi, postFromJson) {
|
||||
getTopPostOfConversation(null, postFromJson, postboard);
|
||||
}, postLi);
|
||||
} else {
|
||||
var newStreamPost;
|
||||
if (post)
|
||||
newStreamPost = postToElem(post, "related");
|
||||
else {
|
||||
newStreamPost = postLi.clone(true);
|
||||
newStreamPost.removeClass('original');
|
||||
newStreamPost.addClass('related');
|
||||
newStreamPost.find('.expanded-content').hide();
|
||||
newStreamPost.find('.show-more').hide();
|
||||
}
|
||||
requestRepliesAfterAll(newStreamPost);
|
||||
newStreamPost.find('.post-expand').remove();
|
||||
newStreamPost.unbind('click');
|
||||
newStreamPost.hide();
|
||||
postboard.append(newStreamPost);
|
||||
newStreamPost.slideDown("fast");
|
||||
}
|
||||
}
|
||||
|
||||
function requestRepliesAfterAll(postLi)
|
||||
{
|
||||
var originalPost = postLi.find(".post-data");
|
||||
var original_n = originalPost.attr('data-screen-name');
|
||||
var original_k = originalPost.attr('data-id');
|
||||
|
||||
if( original_n != undefined && original_k != undefined ) {
|
||||
dhtget( original_n, "replies" + original_k, "m", $.MAL.reqRepAfterCB, postLi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,16 +136,52 @@ function requestRTs(postLi)
|
||||
}
|
||||
}
|
||||
|
||||
function requestPostRecursively(containerToAppend,username,resource,count)
|
||||
function appendPostToContainer(postFromJson, containerToAppend)
|
||||
{
|
||||
dhtget( username, resource, "s",
|
||||
var newStreamPost = postToElem(postFromJson, "original");
|
||||
newStreamPost.hide();
|
||||
containerToAppend.append( newStreamPost );
|
||||
newStreamPost.slideDown("fast");
|
||||
$.MAL.postboardLoaded();
|
||||
}
|
||||
|
||||
var profilePostsLoading = false;
|
||||
|
||||
function requestPostRecursively(containerToAppend,username,resource,count,useGetposts)
|
||||
{
|
||||
var max_id = -1;
|
||||
if( !resource ) {
|
||||
var streamItems = containerToAppend.children();
|
||||
if( streamItems.length != 0 ) {
|
||||
var lastItem = streamItems.eq(streamItems.length-1);
|
||||
resource = "post" + lastItem.find(".post-data").attr("data-lastk");
|
||||
max_id = parseInt(lastItem.find(".post-data").attr("data-id"))-1;
|
||||
}
|
||||
}
|
||||
|
||||
profilePostsLoading = true;
|
||||
|
||||
if( useGetposts ) {
|
||||
req = {username: username}
|
||||
if( max_id != -1 ) {
|
||||
req.max_id = max_id;
|
||||
}
|
||||
|
||||
twisterRpc("getposts", [count,[req]],
|
||||
function(args, posts) {
|
||||
for( var i = 0; i < posts.length; i++ ) {
|
||||
appendPostToContainer(posts[i],args.containerToAppend);
|
||||
}
|
||||
profilePostsLoading = false;
|
||||
}, {containerToAppend:containerToAppend},
|
||||
function(args, ret) {
|
||||
profilePostsLoading = false;
|
||||
}, {});
|
||||
} else {
|
||||
dhtget( username, resource, "s",
|
||||
function(args, postFromJson) {
|
||||
if( postFromJson ) {
|
||||
var newStreamPost = postToElem(postFromJson, "original");
|
||||
newStreamPost.hide();
|
||||
args.containerToAppend.append( newStreamPost );
|
||||
newStreamPost.slideDown("fast");
|
||||
$.MAL.postboardLoaded();
|
||||
appendPostToContainer(postFromJson,args.containerToAppend);
|
||||
|
||||
if( args.count > 1 ) {
|
||||
var userpost = postFromJson["userpost"];
|
||||
@ -114,9 +191,15 @@ function requestPostRecursively(containerToAppend,username,resource,count)
|
||||
lastk = userpost["k"] - 1; // not true with directmsgs in stream
|
||||
|
||||
requestPostRecursively(args.containerToAppend, n, "post"+lastk, count-1);
|
||||
} else {
|
||||
profilePostsLoading = false;
|
||||
args.containerToAppend.scroll();
|
||||
}
|
||||
} else {
|
||||
profilePostsLoading = false;
|
||||
}
|
||||
}, {containerToAppend:containerToAppend, count:count} );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -170,14 +253,39 @@ function updateProfileData(profileModalContent, username) {
|
||||
getLocation( username, profileModalContent.find(".profile-location") );
|
||||
getWebpage( username, profileModalContent.find(".profile-url") );
|
||||
getBio( username, profileModalContent.find(".profile-bio") );
|
||||
getTox( username, profileModalContent.find(".profile-tox") );
|
||||
getBitmessage( username, profileModalContent.find(".profile-bitmessage") );
|
||||
getAvatar( username, profileModalContent.find(".profile-card-photo") );
|
||||
getPostsCount( username, profileModalContent.find(".posts-count") );
|
||||
getFollowers( username, profileModalContent.find(".followers-count") );
|
||||
getNumFollowing( username, profileModalContent.find(".following-count") );
|
||||
getWhoFollows ( username, profileModalContent.find(".who-follow") );
|
||||
|
||||
profileModalContent.find(".following-count").parent().attr("href", $.MAL.followingUrl(username));
|
||||
|
||||
requestPostRecursively(profileModalContent.find(".postboard-posts"),username,"status",10);
|
||||
var postsView = profileModalContent.find(".postboard-posts");
|
||||
|
||||
// try using getposts first. fallback to dht.
|
||||
twisterRpc("getposts", [1,[{username: username}]],
|
||||
function(args, posts) {
|
||||
updateProfilePosts(postsView, username, posts.length);
|
||||
}, {},
|
||||
function(args, ret) {
|
||||
updateProfilePosts(postsView, username, false);
|
||||
}, {});
|
||||
}
|
||||
|
||||
function updateProfilePosts(postsView, username, useGetposts) {
|
||||
requestPostRecursively(postsView,username,"status",postsPerRefresh, useGetposts);
|
||||
|
||||
postsView.scroll(function(){
|
||||
if (!profilePostsLoading) {
|
||||
var $this = $(this);
|
||||
if ($this.scrollTop() >= this.scrollHeight - $this.height() - 20) {
|
||||
requestPostRecursively($this,username,"",postsPerRefresh, useGetposts);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateFollowingData(followingModalContent, username) {
|
||||
@ -194,7 +302,8 @@ function requestHashtag(postboard,hashtag,resource) {
|
||||
dhtget( hashtag, resource, "m",
|
||||
function(args, data) {
|
||||
processHashtag(args.postboard, args.hashtag, data);
|
||||
}, {postboard:postboard,hashtag:hashtag} );
|
||||
}, {postboard:postboard,hashtag:hashtag},
|
||||
[10000,2000,3]); // use extended timeout parameters (requires twister_core >= 0.9.14)
|
||||
|
||||
}
|
||||
|
||||
@ -208,6 +317,9 @@ function processHashtag(postboard, hashtag, data) {
|
||||
_hashtagPendingPosts.push(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!postboard.children().length&&!_hashtagPendingPosts.length)
|
||||
postboard.closest("div").find(".no-posts-found-message").show();
|
||||
|
||||
if( _hashtagPendingPosts.length ) {
|
||||
if( !postboard.children().length || autoUpdateHashtag ) {
|
||||
@ -217,6 +329,7 @@ function processHashtag(postboard, hashtag, data) {
|
||||
newTweetsBar.text(polyglot.t("new_posts", _hashtagPendingPosts.length));
|
||||
newTweetsBar.fadeIn("slow");
|
||||
}
|
||||
postboard.closest("div").find(".no-posts-found-message").hide();
|
||||
}
|
||||
}
|
||||
}
|
@ -19,8 +19,24 @@ function processDMsnippet(dmUsers, dmThreadList) {
|
||||
|
||||
for( var u in dmUsers ) {
|
||||
if( dmUsers.hasOwnProperty(u) ) {
|
||||
// convert snipped to html and add it to date-sorted list
|
||||
var dmItem = dmDataToSnippetItem(dmUsers[u][0], u);
|
||||
dmThreadList.append(dmItem);
|
||||
var timeDmItem = parseInt(dmItem.attr("data-time"));
|
||||
var existingItems = dmThreadList.children();
|
||||
var j = 0;
|
||||
for( j = 0; j < existingItems.length; j++) {
|
||||
var streamItem = existingItems.eq(j);
|
||||
var timeExisting = streamItem.attr("data-time");
|
||||
if( timeExisting == undefined ||
|
||||
timeDmItem > parseInt(timeExisting) ) {
|
||||
// this post in stream is older, so post must be inserted above
|
||||
streamItem.before(dmItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( j == existingItems.length ) {
|
||||
dmThreadList.append(dmItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
$.MAL.dmThreadListLoaded();
|
||||
@ -110,6 +126,11 @@ function newDirectMsg(msg, dm_screenname) {
|
||||
//dispara o modal de direct messages
|
||||
function directMessagesPopup()
|
||||
{
|
||||
if(!defaultScreenName)
|
||||
{
|
||||
alert(polyglot.t("You have to log in to use direct messages."));
|
||||
return;
|
||||
}
|
||||
var directMessagesClass = "directMessages";
|
||||
openModal( directMessagesClass );
|
||||
|
||||
@ -120,6 +141,17 @@ function directMessagesPopup()
|
||||
$( ".directMessages h3" ).text( polyglot.t("Direct Messages") );
|
||||
|
||||
requestDMsnippetList($(".directMessages").find(".direct-messages-list"));
|
||||
$('.modal-back').css('display','inline');
|
||||
$('.mark-all-as-read').css('display', 'inline');
|
||||
$('.mark-all-as-read').attr('title', polyglot.t("Mark all as read"));
|
||||
|
||||
$('.mark-all-as-read').on('click', function() {
|
||||
for (var k in _newDMsPerUser) {
|
||||
_newDMsPerUser[k] = 0;
|
||||
}
|
||||
saveDMsToStorage();
|
||||
$.MAL.updateNewDMsUI(getNewDMsCount());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -139,6 +171,11 @@ function hideDmSnippetShowDmThread()
|
||||
|
||||
function directMessagesWithUserPopup()
|
||||
{
|
||||
if(!defaultScreenName)
|
||||
{
|
||||
alert(polyglot.t("You have to log in to use direct messages."));
|
||||
return;
|
||||
}
|
||||
var $userInfo = $(this).closest("[data-screen-name]");
|
||||
var dm_screenname = $userInfo.attr("data-screen-name");
|
||||
openDmWithUserModal( dm_screenname );
|
@ -15,6 +15,162 @@ var _searchKeypressTimer = undefined;
|
||||
var _lastSearchUsersResults = [];
|
||||
var _lastLoadFromDhtTime = 0;
|
||||
|
||||
var twisterFollowingO = undefined;
|
||||
|
||||
var TwisterFollowing = function (user) {
|
||||
if (!(this instanceof TwisterFollowing))
|
||||
return new TwisterFollowing(user);
|
||||
|
||||
this.init(user);
|
||||
};
|
||||
|
||||
TwisterFollowing.minUpdateInterval = 43200; // 1/2 day
|
||||
TwisterFollowing.maxUpdateInterval = 691200; // 8 days
|
||||
|
||||
TwisterFollowing.prototype = {
|
||||
user: undefined,
|
||||
init: function (user) {
|
||||
this.user = user;
|
||||
this.load();
|
||||
this.update();
|
||||
},
|
||||
knownFollowers: [],
|
||||
knownFollowersResetTime: new Date().getTime() / 1000,
|
||||
notFollowers: [],
|
||||
/*
|
||||
followinsFollowings = {
|
||||
"username": {
|
||||
"lastUpdate": <updatetime>,
|
||||
"updateInterval": <updateinterval>,
|
||||
"following": []
|
||||
}
|
||||
}
|
||||
*/
|
||||
followingsFollowings: {},
|
||||
|
||||
load: function () {
|
||||
var ns = $.initNamespaceStorage(this.user);
|
||||
|
||||
if (ns.localStorage.isSet("followingsFollowings"))
|
||||
this.followingsFollowings = ns.localStorage.get("followingsFollowings");
|
||||
|
||||
if (ns.localStorage.isSet("knownFollowersResetTime"))
|
||||
this.knownFollowersResetTime = ns.localStorage.get("knownFollowersResetTime");
|
||||
|
||||
var ctime = new Date().getTime() / 1000;
|
||||
if (ctime - this.knownFollowersResetTime < TwisterFollowing.maxUpdateInterval &&
|
||||
ns.localStorage.isSet("knownFollowers")) {
|
||||
this.knownFollowers = ns.localStorage.get("knownFollowers");
|
||||
} else {
|
||||
this.knownFollowers = [];
|
||||
this.knownFollowersResetTime = ctime;
|
||||
ns.localStorage.set("knownFollowersResetTime", this.knownFollowersResetTime);
|
||||
}
|
||||
|
||||
if (ns.sessionStorage.isSet("notFollowers"))
|
||||
this.notFollowers = ns.sessionStorage.get("notFollowers");
|
||||
},
|
||||
|
||||
save: function () {
|
||||
var ns = $.initNamespaceStorage(this.user);
|
||||
ns.localStorage.set("followingsFollowings", this.followingsFollowings);
|
||||
ns.sessionStorage.set("notFollowers", this.notFollowers);
|
||||
ns.localStorage.set("knownFollowers", this.knownFollowers);
|
||||
ns.localStorage.set("knownFollowersResetTime", this.knownFollowersResetTime);
|
||||
},
|
||||
|
||||
update: function (username) {
|
||||
var oneshot = false;
|
||||
var i = 0;
|
||||
if (typeof(username) !== 'undefined') {
|
||||
//activate updating for only one user...
|
||||
i = followingUsers.indexOf(username);
|
||||
|
||||
if (i > -1)
|
||||
oneshot = true;
|
||||
else if (typeof(this.followingsFollowings[username]) !== 'undefined') {
|
||||
delete this.followingsFollowings[username];
|
||||
this.save();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var updated = false;
|
||||
for (var user in this.followingsFollowings) {
|
||||
if (followingUsers.indexOf(user) < 0) {
|
||||
delete this.followingsFollowings[user];
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
if (updated)
|
||||
this.save();
|
||||
|
||||
for (; i < followingUsers.length; i++) {
|
||||
var ctime = new Date().getTime() / 1000;
|
||||
|
||||
if (typeof(this.followingsFollowings[followingUsers[i]]) === 'undefined' ||
|
||||
ctime - this.followingsFollowings[followingUsers[i]]["lastUpdate"] >= this.followingsFollowings[followingUsers[i]]["updateInterval"]) {
|
||||
loadFollowingFromDht(followingUsers[i], 1, [], 0, function (args, following, seqNum) {
|
||||
if (following.indexOf(args.tf.user) > -1) {
|
||||
if (args.tf.knownFollowers.indexOf(args.fu) < 0) {
|
||||
args.tf.knownFollowers.push(args.fu);
|
||||
}
|
||||
} else {
|
||||
if (args.tf.notFollowers.indexOf(args.fu) < 0) {
|
||||
args.tf.notFollowers.push(args.fu);
|
||||
}
|
||||
var tmpi = args.tf.knownFollowers.indexOf(args.fu);
|
||||
if (tmpi > -1) {
|
||||
args.tf.knownFollowers.splice(tmpi, 1);
|
||||
}
|
||||
}
|
||||
$(".open-followers").attr("title", args.tf.knownFollowers.length.toString());
|
||||
|
||||
var ctime = new Date().getTime() / 1000;
|
||||
if (typeof(args.tf.followingsFollowings[args.fu]) === 'undefined' ||
|
||||
typeof(args.tf.followingsFollowings[args.fu]["following"]) === 'undefined') {
|
||||
args.tf.followingsFollowings[args.fu] = {};
|
||||
args.tf.followingsFollowings[args.fu]["lastUpdate"] = ctime;
|
||||
args.tf.followingsFollowings[args.fu]["updateInterval"] = TwisterFollowing.minUpdateInterval;
|
||||
args.tf.followingsFollowings[args.fu]["following"] = following;
|
||||
} else {
|
||||
var diff = []; //diff for following
|
||||
var difu = []; //diff for unfollowing
|
||||
var ff = args.tf.followingsFollowings[args.fu]["following"];
|
||||
|
||||
//is there any new following?
|
||||
for (var j = 0; j < following.length; j++) {
|
||||
if (ff.indexOf(following[j]) === -1) {
|
||||
diff.push(following[j]);
|
||||
ff.push(following[j]);
|
||||
}
|
||||
}
|
||||
//did user unfollow someone?
|
||||
for (var j = ff.length - 1; j >= 0 && ff.length > following.length; j--) {
|
||||
if (following.indexOf(ff[j]) === -1) {
|
||||
difu.push(ff[j]);
|
||||
ff.splice(j, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (diff.length > 0 || difu.length > 0) {
|
||||
args.tf.followingsFollowings[args.fu]["updateInterval"] = TwisterFollowing.minUpdateInterval;
|
||||
args.tf.followingsFollowings[args.fu]["lastUpdate"] = ctime;
|
||||
} else if (args.tf.followingsFollowings[args.fu]["updateInterval"] < TwisterFollowing.maxUpdateInterval) {
|
||||
args.tf.followingsFollowings[args.fu]["updateInterval"] *= 2;
|
||||
} else {
|
||||
args.tf.followingsFollowings[args.fu]["lastUpdate"] = ctime;
|
||||
}
|
||||
}
|
||||
args.tf.save();
|
||||
}, {"tf": this, "fu": followingUsers[i]});
|
||||
}
|
||||
if (oneshot)
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// load followingUsers from localStorage
|
||||
function loadFollowingFromStorage() {
|
||||
var ns=$.initNamespaceStorage(defaultScreenName);
|
||||
@ -172,8 +328,8 @@ function saveFollowingToDht() {
|
||||
|
||||
// save following to local storage, dht and json rpc
|
||||
function saveFollowing(cbFunc, cbArg) {
|
||||
saveFollowingToStorage();
|
||||
saveFollowingToDht();
|
||||
saveFollowingToStorage();
|
||||
updateFollowing(cbFunc, cbArg);
|
||||
}
|
||||
|
||||
@ -210,6 +366,7 @@ function unfollow(user, cbFunc, cbArg) {
|
||||
var i = followingUsers.indexOf(user);
|
||||
if( i >= 0 ) {
|
||||
followingUsers.splice(i,1);
|
||||
twisterFollowingO.update(user);
|
||||
}
|
||||
delete _isFollowPublic[user];
|
||||
saveFollowing();
|
||||
@ -256,36 +413,90 @@ function getRandomFollowSuggestion(cbFunc, cbArg) {
|
||||
return;
|
||||
}
|
||||
|
||||
var i;
|
||||
do{
|
||||
var i = parseInt( Math.random() * followingUsers.length );
|
||||
} while( i < followingUsers.length && followingUsers[i] == defaultScreenName);
|
||||
var i = parseInt( Math.random() * followingUsers.length );
|
||||
|
||||
if ( (i < followingUsers.length && followingUsers[i] == defaultScreenName) ||
|
||||
typeof(twisterFollowingO.followingsFollowings[followingUsers[i]]) === 'undefined') {
|
||||
|
||||
setTimeout(function() {getRandomFollowSuggestion(cbFunc, cbArg);}, 500);
|
||||
return;
|
||||
}
|
||||
|
||||
if( i < followingUsers.length ) {
|
||||
loadFollowingFromDht( followingUsers[i], 1, [], 0,
|
||||
function(args, following, seqNum) {
|
||||
if( following ) {
|
||||
var suggested = false;
|
||||
var j = parseInt( Math.random() * following.length );
|
||||
for( ; j < following.length; j++ ) {
|
||||
if( followingUsers.indexOf(following[j]) < 0 &&
|
||||
_followSuggestions.indexOf(following[j]) < 0 ) {
|
||||
args.cbFunc(args.cbArg, following[j], args.followedBy);
|
||||
_followSuggestions.push(following[j]);
|
||||
suggested = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( !suggested ) {
|
||||
args.cbFunc(args.cbArg, null, null);
|
||||
}
|
||||
var suggested = false;
|
||||
var j = parseInt( Math.random() * twisterFollowingO.followingsFollowings[followingUsers[i]]["following"].length );
|
||||
for( ; j < twisterFollowingO.followingsFollowings[followingUsers[i]]["following"].length; j++ ) {
|
||||
if( followingUsers.indexOf(twisterFollowingO.followingsFollowings[followingUsers[i]]["following"][j]) < 0 &&
|
||||
_followSuggestions.indexOf(twisterFollowingO.followingsFollowings[followingUsers[i]]["following"][j]) < 0 ) {
|
||||
cbFunc(cbArg, twisterFollowingO.followingsFollowings[followingUsers[i]]["following"][j], followingUsers[i]);
|
||||
_followSuggestions.push(twisterFollowingO.followingsFollowings[followingUsers[i]]["following"][j]);
|
||||
suggested = true;
|
||||
break;
|
||||
}
|
||||
}, {cbFunc:cbFunc, cbArg:cbArg, followedBy:followingUsers[i]});
|
||||
}
|
||||
if( !suggested ) {
|
||||
cbFunc(cbArg, null, null);
|
||||
}
|
||||
} else {
|
||||
cbFunc(cbArg, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
function whoFollows(username) {
|
||||
var list = [];
|
||||
|
||||
for (var following in twisterFollowingO.followingsFollowings) {
|
||||
if (twisterFollowingO.followingsFollowings[following]["following"].indexOf(username) > -1) {
|
||||
list.push(following);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
function fillWhoFollows(list, item, offset, size) {
|
||||
for (var i = offset; i < offset + size; i++) {
|
||||
var follower_link = $( '<a class="mini-follower-link"></a>' );
|
||||
|
||||
// link follower to profile page
|
||||
follower_link.attr("data-screen-name", list[i]);
|
||||
follower_link.attr("href", $.MAL.userUrl(list[i]));
|
||||
follower_link.text(list[i]);
|
||||
follower_link.on("click", openProfileModal);
|
||||
getFullname( list[i], follower_link );
|
||||
|
||||
item.append( follower_link );
|
||||
}
|
||||
}
|
||||
|
||||
function getWhoFollows(username, item) {
|
||||
if (!defaultScreenName || typeof(defaultScreenName) === 'undefined')
|
||||
return;
|
||||
|
||||
var list = whoFollows(username);
|
||||
|
||||
fillWhoFollows(list, item, 0, (list.length > 5 ? 5 : list.length));
|
||||
|
||||
if (list.length > 5) {
|
||||
var more_link = $('<a class="show-more-followers">' + polyglot.t('show_more_count', {'smart_count': list.length - 5}) + '</a>');
|
||||
more_link.on('click', function() {
|
||||
fillWhoFollows(list, item, 5, list.length - 5);
|
||||
|
||||
var $this = $(this);
|
||||
$this.remove();
|
||||
|
||||
$this.text(polyglot.t('hide'));
|
||||
$this.unbind('click');
|
||||
$this.bind('click', function() {
|
||||
item.html('');
|
||||
getWhoFollows(username, item);
|
||||
});
|
||||
|
||||
item.append($this);
|
||||
});
|
||||
item.append(more_link);
|
||||
}
|
||||
}
|
||||
|
||||
// adds following users to the interface (following.html)
|
||||
function showFollowingUsers(){
|
||||
var $notFollowing = $(".not-following-any");
|
||||
@ -302,9 +513,6 @@ function showFollowingUsers(){
|
||||
$followingList.append($template);
|
||||
|
||||
for( var i = 0; i < followingUsers.length; i++ ) {
|
||||
if( followingUsers[i] == defaultScreenName )
|
||||
continue;
|
||||
|
||||
var resItem = $template.clone(true);
|
||||
resItem.removeAttr('id');
|
||||
resItem.show();
|
||||
@ -316,8 +524,11 @@ function showFollowingUsers(){
|
||||
resItem.find(".public-following").prop("checked",isPublicFollowing(followingUsers[i]));
|
||||
getAvatar(followingUsers[i],resItem.find(".mini-profile-photo"));
|
||||
getFullname(followingUsers[i],resItem.find(".mini-profile-name"));
|
||||
|
||||
resItem.appendTo($followingList);
|
||||
if( followingUsers[i] == defaultScreenName ) {
|
||||
resItem.find("button").hide();
|
||||
}
|
||||
|
||||
resItem.prependTo($followingList);
|
||||
}
|
||||
$.MAL.followingListLoaded();
|
||||
}
|
||||
@ -337,11 +548,16 @@ function processSuggestion(arg, suggestion, followedBy) {
|
||||
|
||||
getAvatar(suggestion,item.find(".twister-user-photo"));
|
||||
|
||||
getFullname(suggestion,item.find(".twister-user"));
|
||||
$spanFollowedBy = item.find(".followed-by");
|
||||
//getFullname(suggestion,item.find(".twister-user"));
|
||||
var $spanFollowedBy = item.find(".followed-by");
|
||||
$spanFollowedBy.text(followedBy);
|
||||
getFullname(followedBy,$spanFollowedBy);
|
||||
|
||||
item.find('.twister-user-remove').bind("click", function() {
|
||||
item.remove();
|
||||
getRandomFollowSuggestion(processSuggestion);
|
||||
});
|
||||
|
||||
dashboard.append(item);
|
||||
}
|
||||
}
|
||||
@ -354,8 +570,20 @@ function closeSearchDialog()
|
||||
_lastSearchUsersResults = [];
|
||||
}
|
||||
|
||||
function userSearchKeypress(item) {
|
||||
function userSearchKeypress(event) {
|
||||
var partialName = $(".userMenu-search-field").val().toLowerCase();
|
||||
var searchResults = $(".search-results");
|
||||
|
||||
if ( partialName.substr( 0, 1 ) == '#' ) {
|
||||
|
||||
if(searchResults.is(":visible"))
|
||||
searchResults.slideUp( "fast" );
|
||||
|
||||
if ( event.which == 13 )
|
||||
openHashtagModalFromSearch(partialName.substr(1));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( partialName.substr( 0, 1 ) == '@' ) {
|
||||
partialName = partialName.substr( 1 );
|
||||
@ -437,6 +665,12 @@ function userClickFollow(e) {
|
||||
var $this = $(this);
|
||||
var $userInfo = $this.closest("[data-screen-name]");
|
||||
var username = $userInfo.attr("data-screen-name");
|
||||
|
||||
if(!defaultScreenName)
|
||||
{
|
||||
alert(polyglot.t("You have to log in to follow users."));
|
||||
return;
|
||||
}
|
||||
|
||||
follow(username, true, function() {
|
||||
// delay reload so dhtput may do it's job
|
||||
@ -544,6 +778,8 @@ function initInterfaceFollowing() {
|
||||
|
||||
$(".postboard-loading").fadeIn();
|
||||
loadFollowing( function(args) {
|
||||
twisterFollowingO = TwisterFollowing(defaultScreenName);
|
||||
|
||||
showFollowingUsers();
|
||||
requestSwarmProgress();
|
||||
});
|
||||
@ -551,3 +787,44 @@ function initInterfaceFollowing() {
|
||||
initDMsCount();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var InterfaceFunctions = function()
|
||||
{
|
||||
this.init = function()
|
||||
{
|
||||
initUser(initFollowing_);
|
||||
};
|
||||
|
||||
function initFollowing_(cbFunc, cbArg) {
|
||||
var $miniProfile = $(".left .mini-profile");
|
||||
if(!defaultScreenName)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$miniProfile.find("a.mini-profile-name").attr("href",$.MAL.userUrl(defaultScreenName));
|
||||
$miniProfile.find("a.open-profile-modal").attr("href",$.MAL.userUrl(defaultScreenName));
|
||||
$miniProfile.find(".mini-profile-name").text(defaultScreenName);
|
||||
getFullname( defaultScreenName, $miniProfile.find(".mini-profile-name") );
|
||||
getAvatar( defaultScreenName, $miniProfile.find(".mini-profile-photo").find("img") );
|
||||
getPostsCount( defaultScreenName, $miniProfile.find(".posts-count") );
|
||||
getFollowers( defaultScreenName, $miniProfile.find(".followers-count") );
|
||||
|
||||
loadFollowing( function(args) {
|
||||
$(".left .following-count").text(followingUsers.length-1);
|
||||
initMentionsCount();
|
||||
initDMsCount();
|
||||
}, {cbFunc:cbFunc, cbArg:cbArg});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
//***********************************************
|
||||
//******************* INIT **************
|
||||
//***********************************************
|
||||
var interfaceFunctions = new InterfaceFunctions;
|
||||
$( document ).ready( interfaceFunctions.init );
|
@ -6,7 +6,7 @@
|
||||
|
||||
// format "userpost" to html element
|
||||
// kind = "original"/"ancestor"/"descendant"
|
||||
function postToElem( post, kind ) {
|
||||
function postToElem( post, kind, promoted ) {
|
||||
/*
|
||||
"userpost" :
|
||||
{
|
||||
@ -63,10 +63,18 @@ function postToElem( post, kind ) {
|
||||
postData.attr('data-content_to_sigrt', content_to_sigrt);
|
||||
postData.attr('data-screen-name', n);
|
||||
postData.attr('data-id', k);
|
||||
postData.attr('data-lastk', userpost["lastk"]);
|
||||
postData.attr('data-text', msg);
|
||||
if( "reply" in userpost ) {
|
||||
postData.attr('data-replied-to-screen-name', userpost["reply"]["n"]);
|
||||
postData.attr('data-replied-to-id', userpost["reply"]["k"]);
|
||||
|
||||
postData.find('.post-expand').text(polyglot.t("Show conversation"));
|
||||
} else if ( "rt" in userpost && "reply" in userpost["rt"] ) {
|
||||
postData.attr('data-replied-to-screen-name', userpost["rt"]["reply"]["n"]);
|
||||
postData.attr('data-replied-to-id', userpost["rt"]["reply"]["k"]);
|
||||
|
||||
postData.find('.post-expand').text(polyglot.t("Show conversation"));
|
||||
}
|
||||
|
||||
var postInfoName = elem.find(".post-info-name");
|
||||
@ -90,7 +98,14 @@ function postToElem( post, kind ) {
|
||||
replyTo += "@" + mentions[i] + " ";
|
||||
}
|
||||
}
|
||||
elem.find(".post-area-new textarea").attr("placeholder", polyglot.t("reply_to", { fullname: replyTo })+ "...");
|
||||
if(!defaultScreenName)
|
||||
{
|
||||
elem.find(".post-area-new textarea").attr("placeholder", polyglot.t("You have to log in to post replies."));
|
||||
}
|
||||
else
|
||||
{
|
||||
elem.find(".post-area-new textarea").attr("placeholder", polyglot.t("reply_to", { fullname: replyTo })+ "...");
|
||||
}
|
||||
elem.find(".post-area-new textarea").attr("data-reply-to",replyTo);
|
||||
postData.attr("data-reply-to",replyTo);
|
||||
|
||||
@ -98,9 +113,12 @@ function postToElem( post, kind ) {
|
||||
elem.find(".post-context").show();
|
||||
var retweetedByElem = elem.find(".post-retransmited-by");
|
||||
retweetedByElem.attr("href", $.MAL.userUrl(retweeted_by));
|
||||
retweetedByElem.text(retweeted_by);
|
||||
retweetedByElem.text('@'+retweeted_by);
|
||||
}
|
||||
|
||||
if (typeof(promoted) !== 'undefined' && promoted)
|
||||
elem.find('.post-propagate').remove();
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
@ -110,6 +128,7 @@ function dmDataToSnippetItem(dmData, remoteUser) {
|
||||
dmItem.removeAttr('id');
|
||||
dmItem.attr("data-dm-screen-name",remoteUser);
|
||||
dmItem.attr("data-last_id", dmData.id);
|
||||
dmItem.attr("data-time", dmData.time);
|
||||
|
||||
dmItem.find(".post-info-tag").text("@" + remoteUser);
|
||||
dmItem.find("a.post-info-name").attr("href", $.MAL.userUrl(remoteUser));
|
||||
@ -143,8 +162,13 @@ function htmlFormatMsg( msg, output, mentions ) {
|
||||
var tmp;
|
||||
var match = null;
|
||||
var index;
|
||||
var reAll = new RegExp("(#|@|http[s]?://)");
|
||||
var reHttp = new RegExp("http[s]?://");
|
||||
var strUrlRegexp = "http[s]?://";
|
||||
var strEmailRegexp = "\\S+@\\S+\\.\\S+";
|
||||
var strSplitCounterR = "\\(\\d{1,2}\\/\\d{1,2}\\)$";
|
||||
var reAll = new RegExp("(?:^|[ \\n\\t.,:\\/?!])(#|@|" + strUrlRegexp + "|" + strEmailRegexp + "|" + strSplitCounterR + ")");
|
||||
var reHttp = new RegExp(strUrlRegexp);
|
||||
var reEmail = new RegExp(strEmailRegexp);
|
||||
var reSplitCounter = new RegExp(strSplitCounterR);
|
||||
|
||||
msg = escapeHtmlEntities(msg);
|
||||
|
||||
@ -152,9 +176,10 @@ function htmlFormatMsg( msg, output, mentions ) {
|
||||
|
||||
match = reAll.exec(msg);
|
||||
if( match ) {
|
||||
if( match[0] == "@" ) {
|
||||
output.append(msg.substr(0, match.index));
|
||||
tmp = msg.substr(match.index+1);
|
||||
index = (match[0] === match[1]) ? match.index : match.index + 1;
|
||||
if( match[1] == "@" ) {
|
||||
output.append(_formatText(msg.substr(0, index)));
|
||||
tmp = msg.substr(index+1);
|
||||
var username = _extractUsername(tmp);
|
||||
if( username.length ) {
|
||||
if( mentions.indexOf(username) < 0 )
|
||||
@ -167,48 +192,112 @@ function htmlFormatMsg( msg, output, mentions ) {
|
||||
msg = tmp.substr(String(username).length);
|
||||
continue;
|
||||
}
|
||||
output.append('@');
|
||||
msg = tmp;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( reHttp.exec(match[0]) ) {
|
||||
output.append(msg.substr(0, match.index));
|
||||
tmp = msg.substring(match.index);
|
||||
var space = tmp.indexOf(" ");
|
||||
if( reHttp.exec(match[1]) ) {
|
||||
output.append(_formatText(msg.substr(0, index)));
|
||||
tmp = msg.substring(index);
|
||||
var space = tmp.search(/[ \n\t]/);
|
||||
var url;
|
||||
if( space != -1 ) url = tmp.substring(0,space); else url = tmp;
|
||||
if( url.length ) {
|
||||
msg = tmp.substr(String(url).length);
|
||||
url = url.replace(/&/g, '&');
|
||||
var extLinkTemplate = $("#external-page-link-template").clone(true);
|
||||
extLinkTemplate.removeAttr("id");
|
||||
extLinkTemplate.attr("href",url);
|
||||
|
||||
if ($.Options.getUseProxyOpt() !== 'disable' && !$.Options.getUseProxyForImgOnlyOpt()){
|
||||
//proxy alternatives may be added to options page...
|
||||
if ($.Options.getUseProxyOpt() === 'ssl-proxy-my-addr') {
|
||||
extLinkTemplate.attr('href', 'https://ssl-proxy.my-addr.org/myaddrproxy.php/' +
|
||||
url.substring(0, url.indexOf(':')) +
|
||||
url.substr(url.indexOf('/') + 1));
|
||||
} else if ($.Options.getUseProxyOpt() ==='anonymouse') {
|
||||
extLinkTemplate.attr('href', 'http://anonymouse.org/cgi-bin/anon-www.cgi/' + url);
|
||||
}
|
||||
} else {
|
||||
extLinkTemplate.attr("href",url);
|
||||
}
|
||||
|
||||
extLinkTemplate.text(url);
|
||||
extLinkTemplate.attr("title",url);
|
||||
output.append(extLinkTemplate);
|
||||
msg = tmp.substr(String(url).length);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if( reEmail.exec(match[1]) ) {
|
||||
output.append(_formatText(msg.substr(0, index)));
|
||||
tmp = msg.substring(index);
|
||||
var space = tmp.search(/[ \n\t]/);
|
||||
var email;
|
||||
if( space != -1 ) email = tmp.substring(0,space); else email = tmp;
|
||||
if( email.length ) {
|
||||
var extLinkTemplate = $("#external-page-link-template").clone(true);
|
||||
extLinkTemplate.removeAttr("id");
|
||||
extLinkTemplate.attr("href","mailto:" + email);
|
||||
extLinkTemplate.text(email);
|
||||
extLinkTemplate.attr("title",email);
|
||||
output.append(extLinkTemplate);
|
||||
msg = tmp.substr(String(email).length);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if( match[0] == "#" ) {
|
||||
output.append(msg.substr(0, match.index));
|
||||
tmp = msg.substr(match.index+1);
|
||||
var hashtag = _extractUsername(tmp);
|
||||
if( match[1] == "#" ) {
|
||||
output.append(_formatText(msg.substr(0, index)));
|
||||
tmp = msg.substr(index+1);
|
||||
var hashtag = _extractHashtag(tmp);
|
||||
if( hashtag.length ) {
|
||||
var hashtag_lc='';
|
||||
for( var i = 0; i < hashtag.length; i++ ) {
|
||||
var c = hashtag[i];
|
||||
hashtag_lc += (c >= 'A' && c <= 'Z') ? c.toLowerCase() : c;
|
||||
}
|
||||
var hashtagLinkTemplate = $("#hashtag-link-template").clone(true);
|
||||
hashtagLinkTemplate.removeAttr("id");
|
||||
hashtagLinkTemplate.attr("href",$.MAL.hashtagUrl(hashtag));
|
||||
hashtagLinkTemplate.attr("href",$.MAL.hashtagUrl(hashtag_lc));
|
||||
hashtagLinkTemplate.text("#"+hashtag);
|
||||
output.append(hashtagLinkTemplate);
|
||||
msg = tmp.substr(String(hashtag).length);
|
||||
continue;
|
||||
}
|
||||
output.append('#');
|
||||
msg = tmp;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (reSplitCounter.exec(match[1])) {
|
||||
output.append(_formatText(msg.substr(0, index)));
|
||||
tmp = msg.substring(index);
|
||||
if( tmp.length ) {
|
||||
var splitCounter = $('<span class="splited-post-counter"></span>');
|
||||
splitCounter.text(tmp);
|
||||
output.append(splitCounter);
|
||||
msg = "";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output.append(msg);
|
||||
output.append(_formatText(msg));
|
||||
msg = "";
|
||||
}
|
||||
}
|
||||
|
||||
// internal function for htmlFormatMsg
|
||||
function _formatText(msg)
|
||||
{
|
||||
// TODO: add options for emotions and linefeeds
|
||||
//msg = $.emotions(msg);
|
||||
if( $.Options.getLineFeedsOpt() == "enable" )
|
||||
msg = msg.replace(/\n/g, '<br />');
|
||||
return msg;
|
||||
}
|
||||
|
||||
function _extractUsername(s) {
|
||||
var username = "";
|
||||
for( var i = 0; i < s.length; i++ ) {
|
||||
@ -225,7 +314,35 @@ function _extractUsername(s) {
|
||||
return username.toLowerCase();
|
||||
}
|
||||
|
||||
function escapeHtmlEntities(str) {
|
||||
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
||||
// internal function for htmlFormatMsg
|
||||
function _extractHashtag(s) {
|
||||
var hashtag = "";
|
||||
s = reverseHtmlEntities(s);
|
||||
for( var i = 0; i < s.length; i++ ) {
|
||||
if( " \n\t.,:/?!;'\"()[]{}*".indexOf(s[i]) < 0 ) {
|
||||
hashtag += s[i];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return hashtag;
|
||||
}
|
||||
|
||||
function escapeHtmlEntities(str) {
|
||||
return str
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function reverseHtmlEntities(str) {
|
||||
return str
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
@ -8,7 +8,9 @@
|
||||
|
||||
// main json rpc method. receives callbacks for success and error
|
||||
function twisterRpc(method, params, resultFunc, resultArg, errorFunc, errorArg) {
|
||||
var foo = new $.JsonRpcClient({ ajaxUrl: '/', username: 'user', password: 'pwd'});
|
||||
// removing hardcoded username from javascript: please use url http://user:pwd@localhost:28332 instead
|
||||
//var foo = new $.JsonRpcClient({ ajaxUrl: '/', username: 'user', password: 'pwd'});
|
||||
var foo = new $.JsonRpcClient({ ajaxUrl: '/' });
|
||||
foo.call(method, params,
|
||||
function(ret) { resultFunc(resultArg, ret); },
|
||||
function(ret) { if(ret != null) errorFunc(errorArg, ret); }
|
||||
@ -89,7 +91,7 @@ function _dhtgetAbortPending(locator)
|
||||
// get data from dht resource
|
||||
// the value ["v"] is extracted from response and returned to callback
|
||||
// null is passed to callback in case of an error
|
||||
function dhtget( username, resource, multi, cbFunc, cbArg ) {
|
||||
function dhtget( username, resource, multi, cbFunc, cbArg, timeoutArgs ) {
|
||||
var locator = _dhtgetLocator(username, resource, multi);
|
||||
if( locator in _dhtgetPendingMap) {
|
||||
_dhtgetAddPending(locator, cbFunc, cbArg);
|
||||
@ -98,7 +100,7 @@ function dhtget( username, resource, multi, cbFunc, cbArg ) {
|
||||
// limit the number of simultaneous dhtgets.
|
||||
// this should leave some sockets for other non-blocking daemon requests.
|
||||
if( _dhtgetsInProgress < _maxDhtgets ) {
|
||||
_dhtgetInternal( username, resource, multi );
|
||||
_dhtgetInternal( username, resource, multi, timeoutArgs );
|
||||
} else {
|
||||
// just queue the locator. it will be unqueue when some dhtget completes.
|
||||
_queuedDhtgets.push(locator);
|
||||
@ -106,10 +108,14 @@ function dhtget( username, resource, multi, cbFunc, cbArg ) {
|
||||
}
|
||||
}
|
||||
|
||||
function _dhtgetInternal( username, resource, multi ) {
|
||||
function _dhtgetInternal( username, resource, multi, timeoutArgs ) {
|
||||
var locator = _dhtgetLocator(username, resource, multi);
|
||||
_dhtgetsInProgress++;
|
||||
twisterRpc("dhtget", [username,resource,multi],
|
||||
argsList = [username,resource,multi];
|
||||
if( typeof timeoutArgs !== 'undefined' ) {
|
||||
argsList = argsList.concat(timeoutArgs);
|
||||
}
|
||||
twisterRpc("dhtget", argsList,
|
||||
function(args, ret) {
|
||||
_dhtgetsInProgress--;
|
||||
_dhtgetProcessPending(args.locator, args.multi, ret);
|
||||
@ -200,7 +206,45 @@ function getProfileResource( username, resource, item, cbFunc, cbArg ){
|
||||
function getFullname( username, item ){
|
||||
// Set the username first in case the profile has no fullname
|
||||
item.text(username);
|
||||
getProfileResource( username, "fullname", item);
|
||||
getProfileResource( username, "fullname", undefined,
|
||||
function(args, value) {
|
||||
if( value ) {
|
||||
value.replace(/^\s+|\s+$/g, '');
|
||||
if( value.length )
|
||||
args.item.text(value);
|
||||
}
|
||||
}, {item: item} );
|
||||
if (typeof(twisterFollowingO) !== 'undefined' &&
|
||||
($.Options.getIsFollowingMeOpt() === 'everywhere' || item.hasClass('profile-name'))) {
|
||||
if (twisterFollowingO.knownFollowers.indexOf(username) > -1) {
|
||||
item.addClass('isFollowing');
|
||||
item.attr("title", polyglot.t("follows you"));
|
||||
} else if (twisterFollowingO.notFollowers.indexOf(username) === -1) {
|
||||
if (typeof(twisterFollowingO.followingsFollowings[username]) !== 'undefined' &&
|
||||
typeof(twisterFollowingO.followingsFollowings[username]["following"]) !== 'undefined') {
|
||||
if (twisterFollowingO.followingsFollowings[username]["following"].indexOf(defaultScreenName) > -1) {
|
||||
twisterFollowingO.knownFollowers.push(username);
|
||||
twisterFollowingO.save();
|
||||
item.addClass('isFollowing');
|
||||
item.attr("title", polyglot.t("follows you"));
|
||||
}
|
||||
} else {
|
||||
loadFollowingFromDht(username, 1, [], 0, function (args, following, seqNum) {
|
||||
if (following.indexOf(args.user) > -1) {
|
||||
item.addClass('isFollowing');
|
||||
item.attr("title", polyglot.t("follows you"));
|
||||
if (twisterFollowingO.knownFollowers.indexOf(args.username) < 0)
|
||||
twisterFollowingO.knownFollowers.push(args.username);
|
||||
} else
|
||||
twisterFollowingO.notFollowers.push(args.username);
|
||||
|
||||
twisterFollowingO.save();
|
||||
}, {"user": defaultScreenName, "item": item, "username": username});
|
||||
}
|
||||
}
|
||||
|
||||
$(".open-followers").attr("title", twisterFollowingO.knownFollowers.length.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// get bio and store it in item.text
|
||||
@ -208,6 +252,30 @@ function getBio( username, item ){
|
||||
getProfileResource( username, "bio", item);
|
||||
}
|
||||
|
||||
// get tox address and store it in item.text
|
||||
function getTox( username, item ){
|
||||
getProfileResource( username, "tox", false, function(item, text){
|
||||
//item.empty();
|
||||
if(text) {
|
||||
item.attr('href', 'tox:'+text);
|
||||
item.next().attr('data', text).attr('title', 'Copy to clipboard');
|
||||
item.parent().css('display','inline-block').parent().show();
|
||||
}
|
||||
}, item);
|
||||
}
|
||||
|
||||
// get bitmessage address and store it in item.text
|
||||
function getBitmessage( username, item ){
|
||||
getProfileResource( username, "bitmessage", false, function(item, text){
|
||||
//item.empty();
|
||||
if(text) {
|
||||
item.attr('href', 'bitmsg:'+text+'?action=add&label='+username);
|
||||
item.next().attr('data', text).attr('title', 'Copy to clipboard');
|
||||
item.parent().css('display','inline-block').parent().show();
|
||||
}
|
||||
}, item);
|
||||
}
|
||||
|
||||
// get location and store it in item.text
|
||||
function getLocation( username, item ){
|
||||
getProfileResource( username, "location", item);
|
||||
@ -217,10 +285,12 @@ function getLocation( username, item ){
|
||||
function getWebpage( username, item ){
|
||||
getProfileResource( username, "url", item,
|
||||
function(args, val) {
|
||||
if( val.indexOf("://") < 0 ) {
|
||||
val = "http://" + val;
|
||||
}
|
||||
args.item.attr("href", val);
|
||||
if(typeof(val) !== 'undefined') {
|
||||
if (val.indexOf("://") < 0) {
|
||||
val = "http://" + val;
|
||||
}
|
||||
args.item.attr("href", val);
|
||||
}
|
||||
}, {item:item} );
|
||||
}
|
||||
|
||||
@ -250,8 +320,10 @@ function _putResourceIntoStorage(locator, data) {
|
||||
|
||||
// get avatar and set it in img.attr("src")
|
||||
function getAvatar( username, img ){
|
||||
var theme = $.Options.getTheme();
|
||||
if( username == "nobody" ) {
|
||||
img.attr('src', "img/tornado_avatar.png");
|
||||
if(theme == 'nin') {img.attr('src', "theme_nin/img/tornado_avatar.png");}
|
||||
else {img.attr('src', "img/tornado_avatar.png");}
|
||||
return;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ function requestNetInfo(cbFunc, cbArg) {
|
||||
$(".known-peers").text(twisterdAddrman);
|
||||
$(".blocks").text(twisterdBlocks);
|
||||
$(".dht-nodes").text(twisterDhtNodes);
|
||||
$(".userMenu-dhtindicator a").text(twisterDhtNodes);
|
||||
$(".version").text(twisterDisplayVersion);
|
||||
|
||||
if( !twisterdConnections ) {
|
||||
@ -221,7 +222,7 @@ function setSpamMsg() {
|
||||
}
|
||||
|
||||
function exitDaemon() {
|
||||
if (confirm('Are you sure you want to exit the daemon?\nThe Twister client will stop working.')) {
|
||||
if (confirm(polyglot.t("Are you sure you want to exit the daemon?\nThe Twister client will stop working."))) {
|
||||
$( ".terminate-daemon").text("Exiting...");
|
||||
$( ".terminate-daemon").addClass("disabled");
|
||||
$.MAL.disableButton( $( ".terminate-daemon") );
|
||||
@ -264,6 +265,11 @@ function initInterfaceNetwork() {
|
||||
initDMsCount();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".userMenu-profile > a").text(polyglot.t("Login"));
|
||||
$(".userMenu-profile > a").attr("href","login.html");
|
||||
}
|
||||
});
|
||||
networkUpdate();
|
||||
setInterval("networkUpdate()", 2000);
|
@ -15,19 +15,24 @@ var PURGE_OLD_MENTIONS_TIMEOUT = 3600 * 24 * 30; // one month
|
||||
function processMention(user, mentionTime, data) {
|
||||
var key = user + ";" + mentionTime;
|
||||
var curTime = new Date().getTime() / 1000;
|
||||
if( mentionTime > curTime + 3600 ) {
|
||||
if( mentionTime > curTime + 3600 * 2 ) {
|
||||
console.log("mention from the future will be ignored");
|
||||
} else {
|
||||
var newMentionsUpdated = false;
|
||||
if( !(key in _knownMentions) ) {
|
||||
// mention must be somewhat recent compared to last known one to be considered new
|
||||
if( mentionTime + 3600 > _lastMentionTime ) {
|
||||
if( mentionTime + 3600 * 24 * 3 > _lastMentionTime ) {
|
||||
_newMentions++;
|
||||
newMentionsUpdated = true;
|
||||
_lastMentionTime = mentionTime;
|
||||
}
|
||||
_knownMentions[key] = {mentionTime:mentionTime, data:data};
|
||||
purgeOldMentions();
|
||||
saveMentionsToStorage();
|
||||
}
|
||||
if( newMentionsUpdated ) {
|
||||
$.MAL.soundNotifyMentions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +74,8 @@ function requestMentionsCount() {
|
||||
}
|
||||
$.MAL.updateNewMentionsUI(_newMentions);
|
||||
}
|
||||
}, {});
|
||||
}, {},
|
||||
[10000,2000,3]); // use extended timeout parameters (requires twister_core >= 0.9.14)
|
||||
}
|
||||
|
||||
function resetMentionsCount() {
|
@ -9,6 +9,7 @@
|
||||
|
||||
|
||||
var _idTrackerMap = {};
|
||||
var _idTrackerSpam = new idTrackerObj();
|
||||
var _lastHaveMap = {};
|
||||
var _refreshInProgress = false;
|
||||
var _newPostsPending = 0;
|
||||
@ -72,17 +73,21 @@ function idTrackerObj()
|
||||
/* object to maintain a request state for several users.
|
||||
* each user is tracked by idTrackerObj in global _idTrackerMap.
|
||||
*/
|
||||
function requestObj(users, mode, count)
|
||||
function requestObj(users, mode, count, getspam)
|
||||
{
|
||||
this.users = users;
|
||||
this.mode = mode; // 'latest', 'latestFirstTime' or 'older'
|
||||
this.count = count;
|
||||
this.getspam = getspam;
|
||||
|
||||
// getRequest method returns the list parameter expected by getposts rpc
|
||||
this.getRequest = function() {
|
||||
var req = [];
|
||||
if( this.mode == 'done')
|
||||
return req;
|
||||
if( this.getspam ) {
|
||||
return _idTrackerSpam.getRequest(this.mode);
|
||||
}
|
||||
for( var i = 0; i < this.users.length; i++ ) {
|
||||
var user = this.users[i];
|
||||
if( !(user in _idTrackerMap) )
|
||||
@ -96,7 +101,9 @@ function requestObj(users, mode, count)
|
||||
|
||||
// receiveId method notifies that a post was received (and possibly shown)
|
||||
this.reportProcessedPost = function(user, id, shown) {
|
||||
if( this.users.indexOf(user) >= 0 ) {
|
||||
if( this.getspam ) {
|
||||
_idTrackerSpam.receivedId(this.mode, id, shown);
|
||||
} else if( this.users.indexOf(user) >= 0 ) {
|
||||
_idTrackerMap[user].receivedId(this.mode, id, shown);
|
||||
}
|
||||
}
|
||||
@ -115,10 +122,16 @@ function requestObj(users, mode, count)
|
||||
function requestGetposts(req)
|
||||
{
|
||||
var r = req.getRequest();
|
||||
if( r.length ) {
|
||||
twisterRpc("getposts", [req.count,r],
|
||||
function(req, posts) {processReceivedPosts(req, posts);}, req,
|
||||
function(req, ret) {console.log("ajax error:" + ret);}, req);
|
||||
if( !req.getspam ) {
|
||||
if( r.length ) {
|
||||
twisterRpc("getposts", [req.count,r],
|
||||
function(req, posts) {processReceivedPosts(req, posts);}, req,
|
||||
function(req, ret) {console.log("ajax error:" + ret);}, req);
|
||||
}
|
||||
} else {
|
||||
twisterRpc("getspamposts", [req.count,r.max_id?r.max_id:-1,r.since_id?r.since_id:-1],
|
||||
function(req, posts) {processReceivedPosts(req, posts);}, req,
|
||||
function(req, ret) {console.log("ajax error:" + ret);}, req);
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,9 +140,16 @@ function requestGetposts(req)
|
||||
// request if needed
|
||||
function processReceivedPosts(req, posts)
|
||||
{
|
||||
//hiding posts can cause empty postboard, so we have to track the count...
|
||||
var p2a = posts.length;
|
||||
for( var i = 0; i < posts.length; i++ ) {
|
||||
var post = posts[i];
|
||||
var streamPost = postToElem(post, "original");
|
||||
if (willBeHidden(post)) {
|
||||
p2a--;
|
||||
continue;
|
||||
}
|
||||
|
||||
var streamPost = postToElem(post, "original", req.getspam);
|
||||
var timePost = post["userpost"]["time"];
|
||||
streamPost.attr("data-time",timePost);
|
||||
|
||||
@ -179,24 +199,29 @@ function processReceivedPosts(req, posts)
|
||||
}
|
||||
req.doneReportProcessing(posts.length);
|
||||
|
||||
if( req.mode == "done" ) {
|
||||
//if the count of posts less then 5....
|
||||
if( req.mode == "done" && p2a > 5) {
|
||||
timelineLoaded = true;
|
||||
$.MAL.postboardLoaded();
|
||||
_refreshInProgress = false;
|
||||
$(window).scroll();
|
||||
} else {
|
||||
//we will request more older post...
|
||||
req.count += postsPerRefresh;
|
||||
req.mode = 'older';
|
||||
requestGetposts(req);
|
||||
}
|
||||
}
|
||||
|
||||
// request timeline update for a given list of users
|
||||
function requestTimelineUpdate(mode, count, timelineUsers)
|
||||
function requestTimelineUpdate(mode, count, timelineUsers, getspam)
|
||||
{
|
||||
if( _refreshInProgress )
|
||||
if( _refreshInProgress || !defaultScreenName)
|
||||
return;
|
||||
$.MAL.postboardLoading();
|
||||
_refreshInProgress = true;
|
||||
if( timelineUsers.length ) {
|
||||
var req = new requestObj(timelineUsers, mode, count);
|
||||
var req = new requestObj(timelineUsers, mode, count, getspam);
|
||||
requestGetposts(req);
|
||||
} else {
|
||||
console.log("requestTimelineUpdate: not following any users");
|
||||
@ -253,7 +278,14 @@ function processLastHave(userHaves)
|
||||
// callback for getposts to update the number of new pending posts not shown in timeline
|
||||
function processNewPostsConfirmation(expected, posts)
|
||||
{
|
||||
_newPostsPending += posts.length;
|
||||
//we don't want to produce alert for the posts that won't be displayed
|
||||
var p2h = 0;
|
||||
for( var i = posts.length-1; i >= 0; i-- ) {
|
||||
if (willBeHidden(posts[i])) {
|
||||
p2h++;
|
||||
}
|
||||
}
|
||||
_newPostsPending += posts.length - p2h;
|
||||
if( _newPostsPending ) {
|
||||
$.MAL.reportNewPosts(_newPostsPending);
|
||||
}
|
||||
@ -269,8 +301,42 @@ function processNewPostsConfirmation(expected, posts)
|
||||
function timelineChangedUser()
|
||||
{
|
||||
_idTrackerMap = {};
|
||||
_idTrackerSpam = new idTrackerObj();
|
||||
_lastHaveMap = {};
|
||||
_refreshInProgress = false;
|
||||
_newPostsPending = 0;
|
||||
timelineLoaded = false;
|
||||
}
|
||||
|
||||
function willBeHidden(post){
|
||||
var msg = post['userpost']['msg'];
|
||||
var hidden = false;
|
||||
|
||||
if (post['userpost']['n'] === defaultScreenName)
|
||||
return false;
|
||||
|
||||
if ($.Options.getHideRepliesOpt() !== 'disable' &&
|
||||
/^\@/.test(msg) &&
|
||||
!(new RegExp('@' + defaultScreenName + '( |,|;|\\.|:|\\/|\\?|\\!|\\\\|\'|"|\\n|\\t|$)').test(msg)))
|
||||
{
|
||||
if ($.Options.getHideRepliesOpt() === 'only-me' ||
|
||||
($.Options.getHideRepliesOpt() === 'following' &&
|
||||
followingUsers.indexOf(msg.substring(1, msg.search(/ |,|;|\.|:|\/|\?|\!|\\|'|"|\n|\t|$/))) === -1 ))
|
||||
{
|
||||
hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof(post['userpost']['rt']) !== 'undefined' &&
|
||||
$.Options.getHideCloseRTsOpt() != 'disable' &&
|
||||
followingUsers.indexOf(post['userpost']['rt']['n']) > -1 &&
|
||||
parseInt(post['userpost']['time']) - parseInt(post['userpost']['rt']['time']) < $.Options.getHideCloseRTsHourOpt() * 3600)
|
||||
{
|
||||
if (hidden)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
return hidden;
|
||||
}
|
@ -171,7 +171,7 @@ function sendNewUserTransaction(username, cbFunc) {
|
||||
|
||||
function importSecretKeypress() {
|
||||
var secretKey = $(".secret-key-import").val();
|
||||
var username = $(".username-import").val();
|
||||
var username = $(".username-import").val().toLowerCase();
|
||||
var $importButton = $(".import-secret-key");
|
||||
|
||||
if( secretKey.length == 52 && username.length ) {
|
||||
@ -183,7 +183,7 @@ function importSecretKeypress() {
|
||||
|
||||
function importSecretKeyClick() {
|
||||
var secretKey = $(".secret-key-import").val();
|
||||
var username = $(".username-import").val();
|
||||
var username = $(".username-import").val().toLowerCase();
|
||||
|
||||
twisterRpc("importprivkey", [secretKey,username],
|
||||
function(args, ret) {
|
||||
@ -247,6 +247,10 @@ function loadProfileForEdit() {
|
||||
$(".input-city").val(profile.location);
|
||||
if( "url" in profile)
|
||||
$(".input-website").val(profile.url);
|
||||
if( "tox" in profile)
|
||||
$(".input-tox").val(profile.tox);
|
||||
if( "bitmessage" in profile)
|
||||
$(".input-bitmessage").val(profile.bitmessage);
|
||||
}
|
||||
}, {} );
|
||||
}
|
||||
@ -258,6 +262,12 @@ function saveProfile(e)
|
||||
profile["bio"] = $(".input-description").val();
|
||||
profile["location"] = $(".input-city").val();
|
||||
profile["url"] = $(".input-website").val();
|
||||
var tox = $(".input-tox").val();
|
||||
if( tox.length )
|
||||
profile["tox"] = tox;
|
||||
var bitmessage = $(".input-bitmessage").val();
|
||||
if( bitmessage.length )
|
||||
profile["bitmessage"] = bitmessage;
|
||||
dhtput( defaultScreenName, "profile", "s",
|
||||
profile, defaultScreenName, ++profileSeqNum );
|
||||
var avatarData = $(".profile-card-photo.forEdition").attr("src");
|
48
login.html
@ -3,26 +3,28 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>twister login</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<script src="jquery.min.js"></script>
|
||||
<script src="jQueryPlugins.js"></script>
|
||||
<script src="jquery.json-2.4.js"></script>
|
||||
<script src="jquery.jsonrpcclient.js"></script>
|
||||
<script src="jquery.storageapi.js"></script>
|
||||
<script src="mobile_abstract.js"></script>
|
||||
<script src="twister_io.js"></script>
|
||||
<script src="twister_network.js"></script>
|
||||
<script src="twister_user.js"></script>
|
||||
<script src="interface_common.js"></script>
|
||||
<script src="interface_login.js"></script>
|
||||
<script src="polyglot.min.js"></script>
|
||||
<script src="interface_localization.js"></script>
|
||||
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jQueryPlugins.js"></script>
|
||||
<script src="js/jquery.json-2.4.js"></script>
|
||||
<script src="js/jquery.jsonrpcclient.js"></script>
|
||||
<script src="js/jquery.storageapi.js"></script>
|
||||
<script src="js/options.js"></script>
|
||||
<script src="js/mobile_abstract.js"></script>
|
||||
<script src="js/twister_io.js"></script>
|
||||
<script src="js/twister_network.js"></script>
|
||||
<script src="js/twister_user.js"></script>
|
||||
<script src="js/interface_common.js"></script>
|
||||
<script src="js/interface_login.js"></script>
|
||||
<script src="js/polyglot.min.js"></script>
|
||||
<script src="js/interface_localization.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function()
|
||||
{
|
||||
initInterfaceLogin();
|
||||
});
|
||||
changeStyle();
|
||||
</script>
|
||||
|
||||
<link rel="icon" type="image/png" href="img/twister_mini.png" />
|
||||
@ -33,9 +35,9 @@
|
||||
<!-- MENU SUPERIOR INIT -->
|
||||
<nav class="userMenu">
|
||||
<ul>
|
||||
<li class="userMenu-home"><a href="home.html">Home</a></li>
|
||||
<li class="userMenu-network"><a href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile current"><a href="login.html">Login</a></li>
|
||||
<li class="userMenu-home"><a href="home.html"><span class="selectable_theme theme_original label">Home</span></a></li>
|
||||
<li class="userMenu-network selectable_theme theme_original"><a class="label" href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile current"><a class="label" href="login.html">Login</a></li>
|
||||
<li class="userMenu-config">
|
||||
</li>
|
||||
|
||||
@ -53,7 +55,7 @@
|
||||
<h2> twister login </h2>
|
||||
|
||||
<div class="module">
|
||||
<span> Existing local users </span>
|
||||
<p> <span>Existing local users</span> </p>
|
||||
<div>
|
||||
<select class="local-usernames login-user">
|
||||
</select>
|
||||
@ -61,10 +63,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span> Or... </span>
|
||||
<!-- <span> Or... </span> -->
|
||||
|
||||
<div class="module">
|
||||
<span> Create a new user </span>
|
||||
<p> <span>Create a new user</span> </p>
|
||||
<div>
|
||||
<input class="new-username" type="textbox" placeholder="Type nickname here" cols="16" rows="1"></input>
|
||||
<button class="check-availability">Check availability</button>
|
||||
@ -75,15 +77,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span> Or... </span>
|
||||
<!-- <span> Or... </span> -->
|
||||
|
||||
<div class="module">
|
||||
<div>
|
||||
<span> Import secret key </span>
|
||||
<p> <span>Import secret key</span> </p>
|
||||
<input class="secret-key-import" type="textbox" placeholder="52-characters secret" size="52" rows="1"></input>
|
||||
</div>
|
||||
<div>
|
||||
<span> With nickname </span>
|
||||
<p class="with-nickname"> <span>With nickname</span> </p>
|
||||
<input class="username-import" type="textbox" placeholder="Type nickname here" size="16" rows="1"></input>
|
||||
</div>
|
||||
<div>
|
||||
|
65
network.html
@ -3,28 +3,30 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Network status</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<script src="jquery.min.js"></script>
|
||||
<script src="jQueryPlugins.js"></script>
|
||||
<script src="jquery.json-2.4.js"></script>
|
||||
<script src="jquery.jsonrpcclient.js"></script>
|
||||
<script src="jquery.storageapi.js"></script>
|
||||
<script src="mobile_abstract.js"></script>
|
||||
<script src="twister_io.js"></script>
|
||||
<script src="twister_user.js"></script>
|
||||
<script src="twister_formatpost.js"></script>
|
||||
<script src="twister_following.js"></script>
|
||||
<script src="twister_newmsgs.js"></script>
|
||||
<script src="polyglot.min.js"></script>
|
||||
<script src="interface_localization.js"></script>
|
||||
<script src="twister_network.js"></script>
|
||||
<script src="interface_common.js"></script>
|
||||
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jQueryPlugins.js"></script>
|
||||
<script src="js/jquery.json-2.4.js"></script>
|
||||
<script src="js/jquery.jsonrpcclient.js"></script>
|
||||
<script src="js/jquery.storageapi.js"></script>
|
||||
<script src="js/options.js"></script>
|
||||
<script src="js/mobile_abstract.js"></script>
|
||||
<script src="js/twister_io.js"></script>
|
||||
<script src="js/twister_user.js"></script>
|
||||
<script src="js/twister_formatpost.js"></script>
|
||||
<script src="js/twister_following.js"></script>
|
||||
<script src="js/twister_newmsgs.js"></script>
|
||||
<script src="js/polyglot.min.js"></script>
|
||||
<script src="js/interface_localization.js"></script>
|
||||
<script src="js/twister_network.js"></script>
|
||||
<script src="js/interface_common.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function()
|
||||
{
|
||||
initInterfaceNetwork();
|
||||
});
|
||||
changeStyle();
|
||||
</script>
|
||||
|
||||
<link rel="icon" type="image/png" href="img/twister_mini.png" />
|
||||
@ -35,38 +37,26 @@
|
||||
<!-- MENU SUPERIOR INIT -->
|
||||
<nav class="userMenu">
|
||||
<ul>
|
||||
<li class="userMenu-home"><a href="home.html">Home</a></li>
|
||||
<li class="userMenu-network current"><a href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile"><a href="profile-edit.html">Profile</a></li>
|
||||
<li class="userMenu-home"><a href="home.html"><span class="selectable_theme theme_original label">Home</span></a></li>
|
||||
<li class="userMenu-network current selectable_theme theme_original theme_nin"><a class="label" href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile selectable_theme theme_original theme_nin"><a class="label" href="profile-edit.html">Profile</a></li>
|
||||
<li class="userMenu-config">
|
||||
<a class="userMenu-config-dropdown" href="#">
|
||||
<div class="config-menu dialog-modal">
|
||||
<div class="mini-profile-info">
|
||||
<div class="mini-profile-info selectable_theme theme_original">
|
||||
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
|
||||
<a href="#" class="mini-profile-name">Fulano da Silva</a>
|
||||
<span class="mini-profile-view">View</span>
|
||||
</div>
|
||||
<a class="dropdown-menu-item" href="options.html">Options</a>
|
||||
<a class="dropdown-menu-item" href="profile-edit.html">Setup account</a>
|
||||
<a class="dropdown-menu-item" href="following.html">Following users</a>
|
||||
<a class="dropdown-menu-item" href="network.html">Network config</a>
|
||||
<a class="dropdown-menu-item" href="login.html">Change user</a>
|
||||
<a class="direct-messages" href="#">Direct Messages</a>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-connections">
|
||||
<a href="#">
|
||||
<span class="messages-qtd" style="display:none;">12</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-messages">
|
||||
<a href="#">
|
||||
<span class="messages-qtd" style="display:none;">12</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-search">
|
||||
<input type="text" class="userMenu-search-field" placeholder="search"/>
|
||||
</li>
|
||||
<li class="userMenu-dhtindicator selectable_theme theme_calm"><a href="network.html"></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- MENU SUPERIOR END -->
|
||||
@ -74,9 +64,9 @@
|
||||
<div class="wrapper">
|
||||
|
||||
<div class="network singleBlock">
|
||||
<h2> Network status </h2>
|
||||
|
||||
<h2 class="selectable_theme theme_original theme_calm"> Network status </h2>
|
||||
<div class="module">
|
||||
<h2 class="selectable_theme theme_nin"> Network status </h2>
|
||||
<h3> General information</h3>
|
||||
<ul>
|
||||
<li>
|
||||
@ -136,9 +126,10 @@
|
||||
|
||||
</div>
|
||||
|
||||
<h2>Configure block generation</h2>
|
||||
<h2 class="selectable_theme theme_original theme_calm">Configure block generation</h2>
|
||||
|
||||
<div class="module">
|
||||
<h2 class="selectable_theme theme_nin">Configure block generation</h2>
|
||||
<h3> Generate blocks (send promoted messages)</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
286
options.html
Normal file
@ -0,0 +1,286 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Options</title>
|
||||
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jQueryPlugins.js"></script>
|
||||
<script src="js/jquery.json-2.4.js"></script>
|
||||
<script src="js/jquery.jsonrpcclient.js"></script>
|
||||
<script src="js/jquery.storageapi.js"></script>
|
||||
<script src="js/options.js"></script>
|
||||
<script src="js/mobile_abstract.js"></script>
|
||||
<script src="js/twister_io.js"></script>
|
||||
<script src="js/twister_network.js"></script>
|
||||
<script src="js/twister_user.js"></script>
|
||||
<script src="js/interface_common.js"></script>
|
||||
<script src="js/interface_login.js"></script>
|
||||
<script src="js/polyglot.min.js"></script>
|
||||
<script src="js/interface_localization.js"></script>
|
||||
<script>$(function(){
|
||||
initInterfaceCommon();
|
||||
$.Options.InitOptions();})
|
||||
changeStyle();
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- MENU SUPERIOR INIT -->
|
||||
<nav class="userMenu">
|
||||
<ul>
|
||||
<li class="userMenu-home"><a href="home.html"><span class="selectable_theme theme_original label">Home</span></a></li>
|
||||
<li class="userMenu-options current"><a class="label" href="options.html">Options</a></li>
|
||||
<li class="userMenu-config">
|
||||
<a class="userMenu-config-dropdown" href="#">
|
||||
<div class="config-menu dialog-modal">
|
||||
<a class="dropdown-menu-item" href="options.html">Options</a>
|
||||
<a class="dropdown-menu-item" href="network.html">Network config</a>
|
||||
<a class="dropdown-menu-item" href="profile-edit.html">Setup account</a>
|
||||
<a class="dropdown-menu-item" href="following.html">Following users</a>
|
||||
<a class="dropdown-menu-item" href="login.html">Change user</a>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="options">
|
||||
|
||||
<input id="tab_language" name="option_tab" type="radio" checked="checked" class="selectable_theme theme_nin"/>
|
||||
<label for="tab_language" class="tabs selectable_theme theme_nin">Language</label>
|
||||
<input id="t-2" name="option_tab" type="radio" class="selectable_theme theme_nin"/>
|
||||
<label for="t-2" class="tabs selectable_theme theme_nin">Theme</label>
|
||||
<input id="t-3" name="option_tab" type="radio" class="selectable_theme theme_nin"/>
|
||||
<label for="t-3" class="tabs selectable_theme theme_nin">Sound</label>
|
||||
<input id="t-4" name="option_tab" type="radio" class="selectable_theme theme_nin"/>
|
||||
<label for="t-4" class="tabs selectable_theme theme_nin">Keys</label>
|
||||
<input id="t-5" name="option_tab" type="radio" class="selectable_theme theme_nin"/>
|
||||
<label for="t-5" class="tabs selectable_theme theme_nin">Postboard</label>
|
||||
<input id="t-6" name="option_tab" type="radio" class="selectable_theme theme_nin" />
|
||||
<label for="t-6" class="tabs selectable_theme theme_nin">Users</label>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="language">
|
||||
|
||||
<div class="module">
|
||||
<p class="label"> Use language </p>
|
||||
<div>
|
||||
<form action="" id="selectLanguage">
|
||||
<select name="" id="language">
|
||||
<option value="auto">Auto</option>
|
||||
<option value="pt-BR">Brazilian Portuguese</option>
|
||||
<option value="zh">Chinese</option>
|
||||
<option value="cs">Czech</option>
|
||||
<option value="nl">Dutch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">French</option>
|
||||
<option value="de">German</option>
|
||||
<option value="it">Italian</option>
|
||||
<option value="ja">Japanese</option>
|
||||
<option value="ru">Russian</option>
|
||||
<option value="es">Spanish</option>
|
||||
<option value="tr">Turkish</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="theme">
|
||||
<div class="module">
|
||||
<p class="label"> Theme </p>
|
||||
<div>
|
||||
<form action="" id="selectTheme">
|
||||
<select name="" id="theme">
|
||||
<option value="original">Original</option>
|
||||
<option value="calm">Calm</option>
|
||||
<option value="nin">Nin</option>
|
||||
</select>
|
||||
</form>
|
||||
<span class="selectable_theme theme_calm">
|
||||
For new features check <a href="https://github.com/iHedgehog/twister-calm">twister-calm repository</a>!
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sounds">
|
||||
|
||||
<div class="module">
|
||||
<p class="label"> Sound notifications </p>
|
||||
<div>
|
||||
<form action="" id="notifyForm">
|
||||
<div>
|
||||
<p class="label">Mentions</p>
|
||||
<select name="" id="sndMention" class="sndOpt">
|
||||
<option value="false">none</option>
|
||||
<option value="1">beat</option>
|
||||
<option value="2">pip</option>
|
||||
<option value="3">vibro</option>
|
||||
<option value="4">flip</option>
|
||||
<option value="5">click</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<p class="label">Direct Messages</p>
|
||||
<select name="" id="sndDM" class="sndOpt">
|
||||
<option value="false">none</option>
|
||||
<option value="1">beat</option>
|
||||
<option value="2">pip</option>
|
||||
<option value="3">vibro</option>
|
||||
<option value="4">flip</option>
|
||||
<option value="5">click</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="range" name="playerVol" id="playerVol" min="0" max="1" step="0.01"><span class="volValue">0</span>
|
||||
</form>
|
||||
<audio id="player"></audio>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="keys">
|
||||
<div class="module">
|
||||
<p class="label"> Keys </p>
|
||||
<div>
|
||||
<form action="" id="keysOpt">
|
||||
<p class="label">Send key</p>
|
||||
<select name="" id="keysSend">
|
||||
<option value="enter">Enter</option>
|
||||
<option value="ctrlenter">Ctrl/Cmd+Enter</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="postboard-display">
|
||||
<div class="module">
|
||||
<p class="label"> Postboard displays </p>
|
||||
<div>
|
||||
<form action="" id="hideRepliesOpt">
|
||||
<p class="label">Posts that begin with mention</p>
|
||||
<select name="" id="hideReplies">
|
||||
<option value="disable">Show all</option>
|
||||
<option value="only-me">Show only if I am in</option>
|
||||
<option value="following">Show if it's between users I follow</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<form action="" id="hideCloseRTsOpt">
|
||||
<p class="label">RTs those are close to original twist</p>
|
||||
<select name="" id="hideCloseRTs">
|
||||
<option value="disable">Show all</option>
|
||||
<option value="show-if">Show if the original is older than</option>
|
||||
</select>
|
||||
<div id="hideCloseRTsDesc">
|
||||
<input name="" id="hideCloseRtsHour" maxlength="2" size="3"/> <span class="label">hour(s)</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="module">
|
||||
<p class="label"> Posts display </p>
|
||||
<div>
|
||||
<form action="" id="lineFeedsOpt">
|
||||
<p class="label">Line feeds</p>
|
||||
<select name="" id="displayLineFeeds">
|
||||
<option value="disable">Ignore</option>
|
||||
<option value="enable">Display</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<form action="" id="showPreviewOpt">
|
||||
<p class="label">Inline image preview</p>
|
||||
<select name="" id="displayPreview">
|
||||
<option value="disable">Ignore</option>
|
||||
<option value="enable">Display</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<form action="" id="useProxyOpt">
|
||||
<p class="label">Use external links behind a proxy</p>
|
||||
<select name="" id="useProxy">
|
||||
<option value="disable">none</option>
|
||||
<option value="ssl-proxy-my-addr">ssl-proxy.my-addr.org</option>
|
||||
<option value="anonymouse">anonymouse.org</option>
|
||||
</select>
|
||||
<input name="" id="useProxyForImgOnly" type="checkbox" /> <span class="label">Use proxy for image preview only</span>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-editor">
|
||||
<div class="module">
|
||||
<p class="label"> Post editor</p>
|
||||
<div>
|
||||
<form action="" id="unicodeConversionOpt">
|
||||
<p class="label">Automatic unicode conversion options</p>
|
||||
<select name="" id="unicodeConversion">
|
||||
<option value="disable">Ignore</option>
|
||||
<option value="enable">Convert all</option>
|
||||
<option value="custom">Custom</option>
|
||||
</select>
|
||||
<div class="suboptions unicode-suboptions">
|
||||
<input name="" id="convertPunctuationsOpt" type="checkbox" /> <span class="label">Convert punctuations to unicode</span><br/>
|
||||
<div>
|
||||
<label class="label">Supported punctuations: </label>
|
||||
<span>‥ … ⁇ ⁈ ⁉ ‼ — ⁓</span>
|
||||
</div>
|
||||
<input name="" id="convertEmotionsOpt" type="checkbox" /> <span class="label">Convert emotions codes to unicode symbols</span>
|
||||
<div>
|
||||
<label class="label">Supported emotions: </label>
|
||||
<span>😃 😇 🍺 😈 ❤ 😕 😢 😞 😎 😊 😊 😗 😆 😛 😉 😉 😮 😱 😐</span>
|
||||
</div>
|
||||
<input name="" id="convertSignsOpt" type="checkbox" /> <span class="label">Convert common signs to unicode</span><br/>
|
||||
<div>
|
||||
<label class="label">Supported signs:</label>
|
||||
<span>℡ ℻</span>
|
||||
</div>
|
||||
<input name="" id="convertFractionsOpt" type="checkbox" /> <span class="label">Convert fractions to unicode</span><br/>
|
||||
<div>
|
||||
<label class="label">Supported fractions:</label>
|
||||
<span>½ ⅓ ⅔ ¼ ¾ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅐ ⅛ ⅜ ⅝ ⅞ ⅑ ⅒</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<form action="" id="splitPostsOpt">
|
||||
<p class="label">Split long posts</p>
|
||||
<select name="" id="splitPosts">
|
||||
<option value="disable">Don't split</option>
|
||||
<option value="enable">Split all</option>
|
||||
<option value="only-new">Split only new post</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="users">
|
||||
<div class="module">
|
||||
<form action="" id="isFollowingMeOpt">
|
||||
<p class="label">Show if a user follows me</p>
|
||||
<select name="" id="isFollowingMe">
|
||||
<option value="in-profile">Show at profile modal only</option>
|
||||
<option value="everywhere">Show with every user name</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /tab-content -->
|
||||
</div><!-- /options -->
|
||||
</div><!-- /options -->
|
||||
</body>
|
||||
</html>
|
@ -2,29 +2,31 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Edit profile</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/profile.css" type="text/css">
|
||||
<script src="jquery.min.js"></script>
|
||||
<script src="jQueryPlugins.js"></script>
|
||||
<script src="jquery.json-2.4.js"></script>
|
||||
<script src="jquery.jsonrpcclient.js"></script>
|
||||
<script src="jquery.storageapi.js"></script>
|
||||
<script src="mobile_abstract.js"></script>
|
||||
<script src="twister_io.js"></script>
|
||||
<script src="polyglot.min.js"></script>
|
||||
<script src="interface_localization.js"></script>
|
||||
<script src="twister_user.js"></script>
|
||||
<script src="twister_network.js"></script>
|
||||
<script src="twister_following.js"></script>
|
||||
<script src="twister_newmsgs.js"></script>
|
||||
<script src="interface_common.js"></script>
|
||||
<script src="interface_profile-edit.js"></script>
|
||||
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css">
|
||||
<link id="profilecss" rel="stylesheet" href="css/profile.css" type="text/css">
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jQueryPlugins.js"></script>
|
||||
<script src="js/jquery.json-2.4.js"></script>
|
||||
<script src="js/jquery.jsonrpcclient.js"></script>
|
||||
<script src="js/jquery.storageapi.js"></script>
|
||||
<script src="js/options.js"></script>
|
||||
<script src="js/mobile_abstract.js"></script>
|
||||
<script src="js/twister_io.js"></script>
|
||||
<script src="js/polyglot.min.js"></script>
|
||||
<script src="js/interface_localization.js"></script>
|
||||
<script src="js/twister_user.js"></script>
|
||||
<script src="js/twister_network.js"></script>
|
||||
<script src="js/twister_following.js"></script>
|
||||
<script src="js/twister_newmsgs.js"></script>
|
||||
<script src="js/interface_common.js"></script>
|
||||
<script src="js/interface_profile-edit.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function()
|
||||
{
|
||||
initProfileEdit();
|
||||
});
|
||||
changeStyle()
|
||||
</script>
|
||||
|
||||
<link rel="icon" type="image/png" href="img/twister_mini.png" />
|
||||
@ -35,35 +37,29 @@
|
||||
<!-- MENU SUPERIOR INIT -->
|
||||
<nav class="userMenu">
|
||||
<ul>
|
||||
<li class="userMenu-home"><a href="home.html">Home</a></li>
|
||||
<li class="userMenu-network"><a href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile current"><a href="profile-edit.html">Profile</a></li>
|
||||
<li class="userMenu-config">
|
||||
<li class="userMenu-home"><a href="home.html">
|
||||
<span class="selectable_theme theme_original label">Home</span>
|
||||
<span class="menu-news"></span>
|
||||
</a></li>
|
||||
<li class="userMenu-network selectable_theme theme_original theme_nin"><a class="label" href="network.html">Network</a></li>
|
||||
<li class="userMenu-profile selectable_theme theme_original theme_nin"><a class="label" href="profile-edit.html">Profile</a></li>
|
||||
<li class="userMenu-config current">
|
||||
<a class="userMenu-config-dropdown" href="#">
|
||||
<div class="config-menu dialog-modal">
|
||||
<div class="mini-profile-info">
|
||||
<div class="mini-profile-info selectable_theme theme_original">
|
||||
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
|
||||
<a href="#" class="mini-profile-name">Fulano da Silva</a>
|
||||
<span class="mini-profile-view">View</span>
|
||||
</div>
|
||||
<a class="dropdown-menu-item" href="options.html">Options</a>
|
||||
<a class="dropdown-menu-item" href="profile-edit.html">Setup account</a>
|
||||
<a class="dropdown-menu-item" href="following.html">Following users</a>
|
||||
<a class="dropdown-menu-item" href="network.html">Network config</a>
|
||||
<a class="dropdown-menu-item" href="login.html">Change user</a>
|
||||
<a class="direct-messages" href="#">Direct Messages</a>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-connections">
|
||||
<a href="#">
|
||||
<span class="messages-qtd" style="display:none;">12</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-messages">
|
||||
<a href="#">
|
||||
<span class="messages-qtd" style="display:none;">12</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="userMenu-dhtindicator selectable_theme theme_calm"><a href="network.html"></a></li>
|
||||
<li class="userMenu-search">
|
||||
<input type="text" class="userMenu-search-field" placeholder="search">
|
||||
</li>
|
||||
@ -73,7 +69,6 @@
|
||||
|
||||
|
||||
<div class="wrapper">
|
||||
|
||||
<!-- ÁREA DE PROFILE PHOTO INIT -->
|
||||
<div class="profile-card forEdition">
|
||||
<!-- Coloquei a imagem de fundo do card do usuário como background da div abaixo inline na tag para poder ser alterada dinamicamente -->
|
||||
@ -84,6 +79,8 @@
|
||||
<input type="text" class="input-description" placeholder="Describe yourself"/>
|
||||
<input type="text" class="input-city" placeholder="Location"/>
|
||||
<input type="text" class="input-website" placeholder="website"/>
|
||||
<input type="text" class="input-tox" placeholder="Tox address"/>
|
||||
<input type="text" class="input-bitmessage" placeholder="Bitmessage address"/>
|
||||
</div>
|
||||
<div class="profile-edition-buttons">
|
||||
<button class="toggle-priv-key" style="float: left" href="#">Secret Key</button>
|
||||
|
BIN
sound/1.mp3
Normal file
BIN
sound/1.ogg
Normal file
BIN
sound/2.mp3
Normal file
BIN
sound/2.ogg
Normal file
BIN
sound/3.mp3
Normal file
BIN
sound/3.ogg
Normal file
BIN
sound/4.mp3
Normal file
BIN
sound/4.ogg
Normal file
BIN
sound/5.mp3
Normal file
BIN
sound/5.ogg
Normal file
1
theme_calm/css/OpenSans-Bold.ttf
Symbolic link
@ -0,0 +1 @@
|
||||
../../css/OpenSans-Bold.ttf
|
BIN
theme_calm/css/OpenSans-Italic.ttf
Normal file
1
theme_calm/css/OpenSans-Regular.ttf
Symbolic link
@ -0,0 +1 @@
|
||||
../../css/OpenSans-Regular.ttf
|
BIN
theme_calm/css/OpenSansCondensed300.ttf
Normal file
443
theme_calm/css/profile.css
Normal file
@ -0,0 +1,443 @@
|
||||
/**************************************
|
||||
********************* PROFILE PHOTO ***
|
||||
***************************************/
|
||||
.profile-card
|
||||
{
|
||||
padding: 9px;
|
||||
background: rgba( 255, 255, 255, .5 );
|
||||
border: solid 1px rgba( 69, 71, 77, .05 );
|
||||
position: relative;
|
||||
background: #43464d;
|
||||
}
|
||||
.profile-card-main
|
||||
{
|
||||
width: 520px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
transition: all .2s linear;
|
||||
background: rgba(255,255,255, .1);
|
||||
}
|
||||
/*.profile-card-main:before
|
||||
{
|
||||
content: "";
|
||||
border: solid 0px #fff;
|
||||
transition: all .2s linear;
|
||||
position: absolute;
|
||||
left: 1px;
|
||||
top: 1px;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
z-index: 0;
|
||||
}*/
|
||||
.profile-card-main *
|
||||
{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.profile-card-photo
|
||||
{
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border: solid 3px #45474d;
|
||||
border-radius: 10%;
|
||||
box-sizing: content-box;
|
||||
float:left;
|
||||
top: 50%;
|
||||
background-color: #3b3c41;
|
||||
}
|
||||
.profile-card-main h1
|
||||
{
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
.profile-card-main h2 {
|
||||
color: #7691ce;
|
||||
font-size: 14px;
|
||||
}
|
||||
.forEdition .profile-card-main h2 {
|
||||
left: 20%;
|
||||
top: 19%;
|
||||
color: #f8f8f8;
|
||||
}
|
||||
.profile-card .direct-messages,
|
||||
.profile-card .direct-messages-with-user,
|
||||
.profile-card .follow,
|
||||
.profile-card .profileUnfollow
|
||||
{
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
right: 3px;
|
||||
padding: 10px 3px;
|
||||
font-size: 12px;
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
color: rgba( 0, 0, 0, .7 );
|
||||
background: rgba( 0, 0, 0, .1 );
|
||||
border: none;
|
||||
transition: all .2s linear;
|
||||
}
|
||||
.profile-card .follow,
|
||||
.profile-card .profileUnfollow
|
||||
{
|
||||
right: 128px;
|
||||
}
|
||||
.profile-card .direct-messages:hover,
|
||||
.profile-card .direct-messages-with-user:hover,
|
||||
.profile-card .follow:hover,
|
||||
.profile-card .profileUnfollow:hover
|
||||
{
|
||||
background: rgba( 0, 0, 0, .3 );
|
||||
}
|
||||
.profile-card.forEdition
|
||||
{
|
||||
margin: 0 auto;
|
||||
width: 540px;
|
||||
}
|
||||
.forEdition .profile-card-photo
|
||||
{
|
||||
border: solid 2px #fff;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
transition: all .2s linear;
|
||||
z-index: 10;
|
||||
}
|
||||
.forEdition .profile-card-main:hover:after,
|
||||
.forEdition .profile-card-photo:after
|
||||
{
|
||||
content: "";
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
right: 0px;
|
||||
background: url(../img/edit.png) no-repeat right top;
|
||||
}
|
||||
.forEdition .profile-card-main:hover:before
|
||||
{
|
||||
border: solid 5px #fff;
|
||||
}
|
||||
.forEdition .profile-card-main h2
|
||||
{
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.forEdition .profile-card-main input
|
||||
{
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
background: rgba( 255, 255, 255, .8 );
|
||||
border: none;
|
||||
padding: 6px 4px;
|
||||
margin-bottom: 4px;
|
||||
text-align: center;
|
||||
transition: all .2s linear;
|
||||
}
|
||||
.forEdition .profile-card-main input:hover
|
||||
{
|
||||
background: rgba( 255, 255, 255, .7 );
|
||||
}
|
||||
.forEdition .profile-card-photo:hover{
|
||||
background: #9096a5;
|
||||
}
|
||||
.forEdition .profile-card-main input:focus{
|
||||
background: #fff;
|
||||
color: #4d4d4d;
|
||||
}
|
||||
|
||||
/* inputs placeholders color */
|
||||
.forEdition .profile-card-main input::-webkit-input-placeholder {
|
||||
color: #4d4d4d;
|
||||
}
|
||||
.forEdition .profile-card-main input:-moz-placeholder {
|
||||
color: #4d4d4d;
|
||||
}
|
||||
.forEdition .profile-card-main input::-moz-placeholder {
|
||||
color: #4d4d4d;
|
||||
}
|
||||
.forEdition .profile-card-main input:-ms-input-placeholder {
|
||||
color: #4d4d4d;
|
||||
}
|
||||
.forEdition .profile-card-main input:focus::-webkit-input-placeholder {
|
||||
color: #fff;
|
||||
}
|
||||
.forEdition .profile-card-main input:focus:-moz-placeholder {
|
||||
color: #fff;
|
||||
}
|
||||
.forEdition .profile-card-main input:focus::-moz-placeholder {
|
||||
color: #fff;
|
||||
}
|
||||
.forEdition .profile-card-main input:focus::-ms-input-placeholder {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.profile-card-main input.input-name{
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
right: 20px;
|
||||
}
|
||||
.profile-card-main input.input-description
|
||||
{
|
||||
width: 90%;
|
||||
margin-top: 100px;
|
||||
}
|
||||
.input-name
|
||||
{
|
||||
font-size: 20px;
|
||||
}
|
||||
.forEdition .profile-card-main .input-website,
|
||||
.forEdition .profile-card-main .input-city
|
||||
{
|
||||
display: inline-block;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.forEdition .profile-card-main .input-tox,
|
||||
.forEdition .profile-card-main .input-bitmessage
|
||||
{
|
||||
width: 90%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.profile-edition-buttons
|
||||
{
|
||||
padding: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
.profile-edition-buttons button {
|
||||
background: #f1f1f1;
|
||||
color: #333;
|
||||
}
|
||||
.profile-edition-buttons button:hover {
|
||||
background: #fff;
|
||||
transition: background-color 300ms ease-in;
|
||||
}
|
||||
.secret-key-container .label {
|
||||
color: #9096a5;
|
||||
}
|
||||
.secret-key-container .secret-key {
|
||||
color: #d2dbf1;
|
||||
}
|
||||
/*************************************
|
||||
****************** PROFILE MODAL
|
||||
**************************************/
|
||||
.profile-modal .modal-wrapper
|
||||
{
|
||||
width: 580px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top:5%;
|
||||
height: 90%;
|
||||
margin-left: -300px;
|
||||
|
||||
}
|
||||
.profile-modal .modal-header, .profile-modal .profile-card {
|
||||
z-index: 1;
|
||||
}
|
||||
.profile-modal .modal-content
|
||||
{
|
||||
padding: 3px;
|
||||
height: 100%;
|
||||
}
|
||||
.profile-modal h1.profile-name {
|
||||
color: #43464d;
|
||||
}
|
||||
.profile-modal .profile-location {
|
||||
color: #48577d;
|
||||
}
|
||||
.profile-modal .profile-url {
|
||||
font-size: 14px;
|
||||
font-style: italic;
|
||||
}
|
||||
.profile-modal .profile-bio {
|
||||
text-align: center;
|
||||
}
|
||||
#msngrswr {
|
||||
display: none;
|
||||
margin-top: 20px;
|
||||
height: 30px;
|
||||
}
|
||||
.profile-extra-contact {
|
||||
float: left;
|
||||
display: none;
|
||||
margin-right: 35px;
|
||||
}
|
||||
.bitmessage-ctc, .tox-ctc {
|
||||
position: absolute;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
border: 1px solid #d6d8dc;
|
||||
background: #e3e5ea url(img/clipboard.png) center no-repeat;
|
||||
opacity: .8;
|
||||
-webkit-border-radius: 0 5px 5px 0;
|
||||
-moz-border-radius: 0 5px 5px 0;
|
||||
border-radius: 0 5px 5px 0;
|
||||
-webkit-transition: all 20ms;
|
||||
-moz-transition: all 20ms;
|
||||
-ms-transition: all 20ms;
|
||||
-o-transition: all 20ms;
|
||||
transition: all 20ms;
|
||||
font-size: 18px;
|
||||
}
|
||||
.bitmessage-ctc:hover, .tox-ctc:hover {
|
||||
background-color: #f0f2f8;
|
||||
opacity: 1;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.bitmessage-ctc:active, .tox-ctc:active {
|
||||
background-color: #edfced;
|
||||
}
|
||||
.bitmessage-ctc:after,
|
||||
.tox-ctc:after {
|
||||
content: '📋';
|
||||
}
|
||||
.profile-modal .profile-tox, .profile-modal .profile-bitmessage {
|
||||
display: inline-block;
|
||||
width: 70px;
|
||||
height: 30px;
|
||||
border: 1px solid #c0c2c6;
|
||||
opacity: .8;
|
||||
-webkit-border-radius: 5px 0 0 5px;
|
||||
-moz-border-radius: 5px 0 0 5px;
|
||||
border-radius: 5px 0 0 5px;
|
||||
-webkit-transition: all 200ms;
|
||||
-moz-transition: all 200ms;
|
||||
-ms-transition: all 200ms;
|
||||
-o-transition: all 200ms;
|
||||
transition: all 200ms;
|
||||
}
|
||||
.profile-modal .profile-tox:hover, .profile-modal .profile-bitmessage:hover {
|
||||
opacity: 1;
|
||||
background-color: #f0f2f8;
|
||||
}
|
||||
.profile-modal .profile-tox:active, .profile-modal .profile-bitmessage:active {
|
||||
background-color: #edfced;
|
||||
}
|
||||
.profile-modal .profile-tox {
|
||||
background: #e3e5ea url(../img/tox.png) center no-repeat;
|
||||
}
|
||||
.profile-modal .profile-bitmessage {
|
||||
background: #e3e5ea url(../img/bm.png) center no-repeat;
|
||||
}
|
||||
.profile-modal .profile-data
|
||||
{
|
||||
display: inline-block;
|
||||
margin-left: -4px;
|
||||
border-bottom: 0;
|
||||
}
|
||||
button.follow:hover {
|
||||
background: #b2d67b;
|
||||
color: #fff;
|
||||
}
|
||||
.profile-modal button.follow:hover {
|
||||
background: #b2d67b;
|
||||
color: #fff;
|
||||
}
|
||||
.profile-card .profileUnfollow:hover {
|
||||
background: #e18882;
|
||||
color: #fff;
|
||||
}
|
||||
.profile-modal button.direct-messages-with-user:hover {
|
||||
background: #b2d67b;
|
||||
color: #fff;
|
||||
}
|
||||
.profile-modal .separator {
|
||||
height: 10px;
|
||||
width: 100%;
|
||||
background-color: #000;
|
||||
}
|
||||
.profile-modal .postboard
|
||||
{
|
||||
margin-left: 0;
|
||||
padding: 5px 0 5px 0;
|
||||
height: 60%;
|
||||
}
|
||||
.profile-modal .postboard h2 {
|
||||
width: auto;
|
||||
}
|
||||
.profile-modal .postboard-posts
|
||||
{
|
||||
display: block;
|
||||
height: 90%;
|
||||
overflow: auto;
|
||||
}
|
||||
.profile-modal .postboard h2 span {
|
||||
font: 18px/40px 'Open Sans Condensed', sans-serif;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.profile-modal .postboard-posts-wrapper
|
||||
{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 99%;
|
||||
box-sizing: border-box;
|
||||
border-top: 292px solid transparent;
|
||||
overflow: auto;
|
||||
z-index: 0;
|
||||
}
|
||||
.profile-modal .profile-card-main
|
||||
{
|
||||
background: #f3f5fb;
|
||||
color: #8d8d8d;
|
||||
width:100%;
|
||||
}
|
||||
.profile-modal .profile-card-main a {
|
||||
color: #8bb9e0;
|
||||
}
|
||||
.profile-modal .postboard-posts .post
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
.profile-modal .post-interactions
|
||||
{
|
||||
margin: 2px 10px 3px 60px;
|
||||
}
|
||||
.profile-modal .profile-card
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #f3f5fb;
|
||||
}
|
||||
/*
|
||||
.profile-card-main
|
||||
{
|
||||
height: 200px;
|
||||
}
|
||||
*/
|
||||
.profile-modal .direct-messages,
|
||||
.profile-modal .direct-messages-with-user,
|
||||
.profile-modal .follow,
|
||||
.profile-card .profileUnfollow
|
||||
{
|
||||
bottom: 10px;
|
||||
}
|
||||
|
||||
h1.profile-name {
|
||||
display: inline;
|
||||
}
|
||||
h2.profile-screen-name {
|
||||
display: inline;
|
||||
bottom: 0;
|
||||
color: #8f95a4;
|
||||
}
|
||||
|
||||
.profile-modal .modal-buttons {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.profile-modal h1.profile-name,
|
||||
.profile-modal h2.profile-screen-name,
|
||||
.profile-modal span.profile-location,
|
||||
.profile-modal a.profile-url {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.profile-modal span.profile-location:empty,
|
||||
.profile-modal a.profile-url:empty,
|
||||
.profile-modal a.profile-bio:empty {
|
||||
display: none;
|
||||
}
|
2295
theme_calm/css/style.css
Normal file
BIN
theme_calm/img/ajax-loader.gif
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
theme_calm/img/bm.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
theme_calm/img/config.png
Normal file
After Width: | Height: | Size: 456 B |
BIN
theme_calm/img/connections.png
Normal file
After Width: | Height: | Size: 405 B |
BIN
theme_calm/img/dm.png
Normal file
After Width: | Height: | Size: 394 B |
BIN
theme_calm/img/edit.png
Normal file
After Width: | Height: | Size: 340 B |
BIN
theme_calm/img/ext-link.png
Normal file
After Width: | Height: | Size: 199 B |
BIN
theme_calm/img/following.png
Normal file
After Width: | Height: | Size: 365 B |
BIN
theme_calm/img/form-arrow-down-black.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
theme_calm/img/genericPerson.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
theme_calm/img/grayed_avatar_placeholder_24.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
theme_calm/img/home.png
Normal file
After Width: | Height: | Size: 616 B |
BIN
theme_calm/img/icons-18-black.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
theme_calm/img/icons-18-white.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
theme_calm/img/icons-36-black.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
theme_calm/img/icons-36-white.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
theme_calm/img/loader.gif
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
theme_calm/img/messages.png
Normal file
After Width: | Height: | Size: 254 B |
BIN
theme_calm/img/network.png
Normal file
After Width: | Height: | Size: 691 B |
BIN
theme_calm/img/pen.png
Normal file
After Width: | Height: | Size: 440 B |
BIN
theme_calm/img/profile.png
Normal file
After Width: | Height: | Size: 287 B |
BIN
theme_calm/img/reply.png
Normal file
After Width: | Height: | Size: 299 B |
BIN
theme_calm/img/repost.png
Normal file
After Width: | Height: | Size: 264 B |
BIN
theme_calm/img/screenshot.jpg
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
theme_calm/img/spinner-medium.gif
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
theme_calm/img/spinner-small.gif
Normal file
After Width: | Height: | Size: 452 B |
BIN
theme_calm/img/spinner.gif
Normal file
After Width: | Height: | Size: 452 B |
BIN
theme_calm/img/switch.png
Normal file
After Width: | Height: | Size: 312 B |
BIN
theme_calm/img/tornado_avatar.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
theme_calm/img/tox.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
theme_calm/img/twister_mini.png
Normal file
After Width: | Height: | Size: 564 B |
BIN
theme_calm/img/wash-white-30.png
Normal file
After Width: | Height: | Size: 78 B |
BIN
theme_nin/css/fonts/BemioItalic.otf
Executable file
BIN
theme_nin/css/fonts/DroidSerif-Italic.ttf
Executable file
1
theme_nin/css/fonts/OpenSans-Bold.ttf
Symbolic link
@ -0,0 +1 @@
|
||||
../../../css/OpenSans-Bold.ttf
|
1
theme_nin/css/fonts/OpenSans-Regular.ttf
Symbolic link
@ -0,0 +1 @@
|
||||
../../../css/OpenSans-Regular.ttf
|