Skip to content

Commit

Permalink
fix: some bugs (#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgithubprofile authored Nov 10, 2023
1 parent 1e99511 commit ee04bee
Show file tree
Hide file tree
Showing 16 changed files with 97 additions and 31 deletions.
2 changes: 1 addition & 1 deletion components/accounts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var accounts = (function(){
}

if (ed.toaccpage) {
h = 'author?address=' + address
h = 'authorn?address=' + address
history = true
}

Expand Down
19 changes: 16 additions & 3 deletions components/authorn/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,39 @@
padding-left: 0.5em;
flex-grow: 2;
}
#authorn .lcolumn .blocking,
#authorn .lcolumn .subscribes,
#authorn .lcolumn .subscribers {
border-radius: 12px;
background: rgba(var(--background-total-theme), 1);
padding: 1em;
display: none;
}
#authorn .lcolumn .blocking .empty,
#authorn .lcolumn .subscribes .empty,
#authorn .lcolumn .subscribers .empty {
text-align: center;
color: rgb(var(--neutral-grad-3));
font-size: 0.9em;
}
#authorn .lcolumn .blocking.active,
#authorn .lcolumn .subscribes.active,
#authorn .lcolumn .subscribers.active {
display: block;
}
#authorn .lcolumn .blocking {
text-align: center;
padding: 1em;
}
#authorn .lcolumn .blocking .showblocking {
font-size: 0.9em;
color: rgb(var(--neutral-grad-3));
cursor: pointer;
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
transition: 0.3s;
}
#authorn .lcolumn .blocking .showblocking:hover {
color: rgb(var(--color-txt-ac));
}
#authorn .uinfo {
border-radius: 12px;
background: rgba(var(--background-total-theme), 1);
Expand Down
35 changes: 29 additions & 6 deletions components/authorn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,14 @@ var authorn = (function(){
})

var blocked = (deep(author, 'data.blocking') || []).concat()

u = _.filter(u, function(a){
return _.indexOf(blocked, a) == -1

if(!a) return false

var address = a.adddress || a.address || a

return _.indexOf(blocked, address) == -1
})


Expand Down Expand Up @@ -532,6 +537,7 @@ var authorn = (function(){
id : 'userslist',
animation : false,
inWnd : true,
history : true,
essenseData : {
addresses : addresses,
empty : empty,
Expand Down Expand Up @@ -1096,7 +1102,7 @@ var authorn = (function(){

lenta : function(){

var hr = 'author?address=' + author.address
var hr = 'authorn?address=' + author.address
var n = app.platform.api.name(author.address)
if (n) hr = n.toLowerCase() + "?"

Expand Down Expand Up @@ -1187,17 +1193,34 @@ var authorn = (function(){
el.blocking.removeClass('active')
}
else{
load.blocking().then(addresses => {


self.shell({
name : 'blockinglabel',
el : el.blocking,
data : {

},
insertimmediately : true,
}, function(p){

el.blocking.addClass('active')

p.el.find('.showblocking').on('click', events.showblocking)

})


/*load.blocking().then(addresses => {
var etext = self.user.isItMe(author.address) ? self.app.localization.e('aynoblocked') : self.app.localization.e('anoblocked')
var ctext = self.app.localization.e('blockedusers')
renders.userslist(el.blocking, addresses, etext, ctext, clbk, 'blocking')
})
})*/
}


},

Expand Down
19 changes: 18 additions & 1 deletion components/authorn/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
}

.lcolumn{
.blocking,
.subscribes,
.subscribers{
border-radius: @rad;
Expand All @@ -202,6 +201,24 @@
display: block;
}
}

.blocking{
text-align: center;
padding : 2 * @rhythm;

.showblocking{
font-size: 0.9em;
color : rgb(var(--neutral-grad-3));
cursor: pointer;
.transition(0.3s);

&:hover{
color : rgb(var(--color-txt-ac));
}
}

}

}

.uinfo{
Expand Down
3 changes: 3 additions & 0 deletions components/authorn/templates/blockinglabel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="showblocking">
<%- e('showblockedusers') %>
</div>
2 changes: 1 addition & 1 deletion components/donations/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
%>

<div class="user">
<a elementsid="author?address=<%-address%>&report=shares" href="author?address=<%-address%>&report=shares">
<a elementsid="authorn?address=<%-address%>&report=shares" href="authorn?address=<%-address%>&report=shares">
<div class="pictureWrapper">

<%
Expand Down
4 changes: 2 additions & 2 deletions components/lenta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2397,7 +2397,7 @@ var lenta = (function(){

self.nav.api.load({
open : true,
href : name ? name : 'author?address=' + address,
href : name ? name : 'authorn?address=' + address,
history : true
})
},
Expand All @@ -2420,7 +2420,7 @@ var lenta = (function(){
self.sdk.registrations.redirect = 'post?s=' + shareId
}
else{
self.sdk.registrations.redirect = 'author?address='+share.address+'&s=' + shareId
self.sdk.registrations.redirect = 'authorn?address='+share.address+'&s=' + shareId
}

self.nav.api.go({
Expand Down
2 changes: 1 addition & 1 deletion components/menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ var menu = (function(){
var name = $(this).attr('name')

self.nav.api.go({
href : name ? name.toLowerCase() : 'author?address=' + r,
href : name ? name.toLowerCase() : 'authorn?address=' + r,
history : true,
open : true
})
Expand Down
2 changes: 1 addition & 1 deletion components/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ var post = (function () {

self.nav.api.load({
open : true,
href : name ? name : 'author?address=' + address,
href : name ? name : 'authorn?address=' + address,
history : true
})
},
Expand Down
2 changes: 1 addition & 1 deletion components/share/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ var share = (function(){

self.app.nav.api.load({
open : true,
href : 'author?address=' + self.app.user.address.value,
href : 'authorn?address=' + self.app.user.address.value,
history : true
})

Expand Down
2 changes: 1 addition & 1 deletion components/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var test = (function(){

_p.ref += name

body += '<p><a elementsid="https://'+self.app.options.url+'/author?address='+self.app.ref+'" href="https://'+self.app.options.url+'/author?address='+self.app.ref+'">Referrer: '+name+'</a></p>'
body += '<p><a elementsid="https://'+self.app.options.url+'/authorn?address='+self.app.ref+'" href="https://'+self.app.options.url+'/authorn?address='+self.app.ref+'">Referrer: '+name+'</a></p>'
}

var r = deep(document, 'referrer')
Expand Down
10 changes: 5 additions & 5 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ Application = function (p) {

var body = ''

body += '<p><a href="https://' + self.options.url + '/author?address=' + address + '">User (' + address + ')</a> contact support (' + template + ')</p>'
body += '<p><a href="https://' + self.options.url + '/authorn?address=' + address + '">User (' + address + ')</a> contact support (' + template + ')</p>'

if (address) {
body += '<p>Address: ' + (address) + '</p>'
Expand Down Expand Up @@ -661,7 +661,7 @@ Application = function (p) {

var body = ''

body += '<p><a href="https://' + self.options.url + '/author?address=' + address + '">User (' + address + ') require PKOIN</a></p>'
body += '<p><a href="https://' + self.options.url + '/authorn?address=' + address + '">User (' + address + ') require PKOIN</a></p>'

if (link1)
body += '<p>Link: <a href="' + link1 + '">' + link1 + '</a></p>'
Expand Down Expand Up @@ -721,7 +721,7 @@ Application = function (p) {
_p.TemplateID = '2002'

var body = ''
body += '<p><a elementsid="https://' + self.options.url + '/author?address=' + s3 + '" href="https://' + self.options.url + '/author?address=' + s3 + '">User(' + s3 + ')</a> complaint post <a elementsid="https://' + self.options.url + '/post?s=' + s2 + '" href="https://' + self.options.url + '/post?s=' + s2 + '">Post (' + s2 + ')</a></p>'
body += '<p><a elementsid="https://' + self.options.url + '/authorn?address=' + s3 + '" href="https://' + self.options.url + '/authorn?address=' + s3 + '">User(' + s3 + ')</a> complaint post <a elementsid="https://' + self.options.url + '/post?s=' + s2 + '" href="https://' + self.options.url + '/post?s=' + s2 + '">Post (' + s2 + ')</a></p>'
body += '<p>Reason: ' + i1 + '</p>'

_p.body = encodeURIComponent(body)
Expand Down Expand Up @@ -769,7 +769,7 @@ Application = function (p) {
_p.TemplateID = '2000'

var body = ''
body += '<p><a href="https://' + self.options.url + '/author?address=' + address1 + '">User(' + address1 + ')</a> complaint another <a href="https://' + self.options.url + '/author?address=' + address2 + '">user(' + address2 + ')</a></p>'
body += '<p><a href="https://' + self.options.url + '/authorn?address=' + address1 + '">User(' + address1 + ')</a> complaint another <a href="https://' + self.options.url + '/authorn?address=' + address2 + '">user(' + address2 + ')</a></p>'
body += '<p>Reason: ' + reason + '</p>'

_p.body = encodeURIComponent(body)
Expand Down Expand Up @@ -852,7 +852,7 @@ Application = function (p) {
_p.TemplateID = '2000'

var body = ''
body += '<p><a elementsid="https://' + self.options.url + '/author?address=' + address1 + '" href="https://' + self.options.url + '/author?address=' + address1 + '">User(' + address1 + ')</a> complaint room (' + roomid + ')</a></p>'
body += '<p><a elementsid="https://' + self.options.url + '/authorn?address=' + address1 + '" href="https://' + self.options.url + '/authorn?address=' + address1 + '">User(' + address1 + ')</a> complaint room (' + roomid + ')</a></p>'

body += '<p>Reason: ' + reason + '</p>'

Expand Down
19 changes: 13 additions & 6 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6978,11 +6978,20 @@ AJAX = function(p) {

var res = JSON.parse(xmlHttp.responseText), auth;
// Set auth header
if (res && res.access_token) auth = 'Bearer ' + res.access_token;
if (res && res.access_token) {
auth = 'Bearer ' + res.access_token;
}

ap.headers = {
Authorization: auth
}
else{
if (p.fail)
p.fail({}, 'network');

return
}

ap.headers = {
Authorization: auth
}

// Prepare image data for request
const mimeType = ap.data.base64.match(/[^:]\w+\/[\w-+\d.]+(?=;|,)/)[0];
Expand All @@ -7000,9 +7009,7 @@ AJAX = function(p) {

}


xmlHttp.onerror = function(e) {

if (p.fail)
p.fail({}, 'network');
};
Expand Down
3 changes: 2 additions & 1 deletion localization/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -2771,4 +2771,5 @@ _l.registration_blocked = _l.lockedaccount
_l.horizontalSearchUsers = "Accounts"
_l.information = "Information"
_l.sendcoins = "Send PKOIN"
_l.notificationsTurnOffQ = 'Are you sure you want to turn off notifications from this user?'
_l.notificationsTurnOffQ = 'Are you sure you want to turn off notifications from this user?'
_l.showblockedusers = "Show blocked users";
1 change: 1 addition & 0 deletions localization/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ _l.anofollowing = "этот пользователь еще ни на кого
_l.aynofollowing = "Вы еще ни на кого не подписаны";

_l.blockedusers = "Заблокированные";
_l.showblockedusers = "Показать заблокированных пользователей";
_l.anoblocked = "Этот пользователь еще никого не заблокировал";
_l.aynoblocked = "Вы еще никого не заблокировали";

Expand Down
3 changes: 2 additions & 1 deletion tpls/index_el.html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@
<script src="js/vendor/mark.js"></script>
<script src="js/vendor/hc-sticky.js"></script>
<script join src="js/vendor/axios.js"></script>
<script join src="js/media.js"></script>
__JSENV__
<script>window.design = true;</script>
Expand Down

0 comments on commit ee04bee

Please sign in to comment.