diff --git a/components/accounts/index.js b/components/accounts/index.js index 7ffed8783c..25b3ebd61c 100644 --- a/components/accounts/index.js +++ b/components/accounts/index.js @@ -45,7 +45,7 @@ var accounts = (function(){ } if (ed.toaccpage) { - h = 'author?address=' + address + h = 'authorn?address=' + address history = true } diff --git a/components/authorn/index.css b/components/authorn/index.css index 8aa23bf33b..01dea0a321 100644 --- a/components/authorn/index.css +++ b/components/authorn/index.css @@ -136,7 +136,6 @@ padding-left: 0.5em; flex-grow: 2; } -#authorn .lcolumn .blocking, #authorn .lcolumn .subscribes, #authorn .lcolumn .subscribers { border-radius: 12px; @@ -144,18 +143,32 @@ 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); diff --git a/components/authorn/index.js b/components/authorn/index.js index 37905a85fc..6a1134b2c1 100644 --- a/components/authorn/index.js +++ b/components/authorn/index.js @@ -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 }) @@ -532,6 +537,7 @@ var authorn = (function(){ id : 'userslist', animation : false, inWnd : true, + history : true, essenseData : { addresses : addresses, empty : empty, @@ -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() + "?" @@ -1187,7 +1193,25 @@ 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') @@ -1195,9 +1219,8 @@ var authorn = (function(){ renders.userslist(el.blocking, addresses, etext, ctext, clbk, 'blocking') - }) + })*/ } - }, diff --git a/components/authorn/index.less b/components/authorn/index.less index 6cd917c6d9..1b2b0e4761 100644 --- a/components/authorn/index.less +++ b/components/authorn/index.less @@ -184,7 +184,6 @@ } .lcolumn{ - .blocking, .subscribes, .subscribers{ border-radius: @rad; @@ -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{ diff --git a/components/authorn/templates/blockinglabel.html b/components/authorn/templates/blockinglabel.html new file mode 100644 index 0000000000..f24f643190 --- /dev/null +++ b/components/authorn/templates/blockinglabel.html @@ -0,0 +1,3 @@ +
User (' + address + ') contact support (' + template + ')
' + body += 'User (' + address + ') contact support (' + template + ')
' if (address) { body += 'Address: ' + (address) + '
' @@ -661,7 +661,7 @@ Application = function (p) { var body = '' - body += 'User (' + address + ') require PKOIN
' + body += 'User (' + address + ') require PKOIN
' if (link1) body += 'Link: ' + link1 + '
' @@ -721,7 +721,7 @@ Application = function (p) { _p.TemplateID = '2002' var body = '' - body += 'User(' + s3 + ') complaint post Post (' + s2 + ')
' + body += 'User(' + s3 + ') complaint post Post (' + s2 + ')
' body += 'Reason: ' + i1 + '
' _p.body = encodeURIComponent(body) @@ -769,7 +769,7 @@ Application = function (p) { _p.TemplateID = '2000' var body = '' - body += 'User(' + address1 + ') complaint another user(' + address2 + ')
' + body += 'User(' + address1 + ') complaint another user(' + address2 + ')
' body += 'Reason: ' + reason + '
' _p.body = encodeURIComponent(body) @@ -852,7 +852,7 @@ Application = function (p) { _p.TemplateID = '2000' var body = '' - body += 'User(' + address1 + ') complaint room (' + roomid + ')
' + body += 'User(' + address1 + ') complaint room (' + roomid + ')
' body += 'Reason: ' + reason + '
' diff --git a/js/functions.js b/js/functions.js index e0c15de271..f230e9a184 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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]; @@ -7000,9 +7009,7 @@ AJAX = function(p) { } - xmlHttp.onerror = function(e) { - if (p.fail) p.fail({}, 'network'); }; diff --git a/localization/en.js b/localization/en.js index 2506e229ad..f60526cdd4 100644 --- a/localization/en.js +++ b/localization/en.js @@ -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?' \ No newline at end of file +_l.notificationsTurnOffQ = 'Are you sure you want to turn off notifications from this user?' +_l.showblockedusers = "Show blocked users"; diff --git a/localization/ru.js b/localization/ru.js index f3844b9a85..ff6f3c37bb 100644 --- a/localization/ru.js +++ b/localization/ru.js @@ -295,6 +295,7 @@ _l.anofollowing = "этот пользователь еще ни на кого _l.aynofollowing = "Вы еще ни на кого не подписаны"; _l.blockedusers = "Заблокированные"; +_l.showblockedusers = "Показать заблокированных пользователей"; _l.anoblocked = "Этот пользователь еще никого не заблокировал"; _l.aynoblocked = "Вы еще никого не заблокировали"; diff --git a/tpls/index_el.html.tpl b/tpls/index_el.html.tpl index e633e4f977..d124042f53 100644 --- a/tpls/index_el.html.tpl +++ b/tpls/index_el.html.tpl @@ -214,7 +214,8 @@ - + + __JSENV__