Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Cesium-grp
Cesium
Commits
d0bf2a94
Commit
d0bf2a94
authored
2 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
Fix lint
parent
3b68b1a8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
www/js/controllers/wot-controllers.js
+26
-18
26 additions, 18 deletions
www/js/controllers/wot-controllers.js
with
26 additions
and
18 deletions
www/js/controllers/wot-controllers.js
+
26
−
18
View file @
d0bf2a94
...
...
@@ -297,14 +297,15 @@ function WotLookupController($scope, $state, $q, $timeout, $focus, $location, $i
$scope
.
search
.
type
=
'
text
'
;
// If checksum is correct, search on simple pubkey
let
pubkeyWithCk
;
var
pubkeyWithCk
;
if
(
BMA
.
regexp
.
PUBKEY_WITH_CHECKSUM
.
test
(
text
))
{
console
.
debug
(
"
[wot] Validating pubkey checksum...
"
);
let
matches
=
BMA
.
regexp
.
PUBKEY_WITH_CHECKSUM
.
exec
(
text
);
console
.
log
(
matches
)
var
matches
=
BMA
.
regexp
.
PUBKEY_WITH_CHECKSUM
.
exec
(
text
);
//console.log(matches)
pubkey
=
matches
[
1
];
let
checksum
=
matches
[
2
];
let
expectedChecksum
=
csCrypto
.
util
.
pkChecksum
(
pubkey
);
var
checksum
=
matches
[
2
];
var
expectedChecksum
=
csCrypto
.
util
.
pkChecksum
(
pubkey
);
if
(
checksum
===
expectedChecksum
)
{
console
.
debug
(
"
[wot] checksum {
"
+
checksum
+
"
} valid for pubkey {
"
+
pubkey
+
"
}
"
)
text
=
pubkey
...
...
@@ -441,7 +442,7 @@ function WotLookupController($scope, $state, $q, $timeout, $focus, $location, $i
var
offset
=
$scope
.
search
.
results
?
$scope
.
search
.
results
.
length
:
0
;
$scope
.
search
.
loadingMore
=
true
;
var
searchFunction
=
(
$scope
.
search
.
type
==
'
newcomers
'
)
?
var
searchFunction
=
(
$scope
.
search
.
type
==
=
'
newcomers
'
)
?
$scope
.
doGetNewcomers
:
$scope
.
doGetPending
;
...
...
@@ -691,11 +692,16 @@ function WotLookupModalController($scope, $controller, $focus, csWallet, paramet
/**
* Abtract controller that load identity, that expose some useful methods in $scope, like 'certify()'
* @param $scope
* @param $rootScope
* @param $state
* @param $timeout
* @param $translate
* @param $ionicHistory
* @param $q
* @param UIUtils
* @param Modals
* @param csConfig
* @param csSettings
* @param csCurrency
* @param csWot
* @param csWallet
* @constructor
...
...
@@ -780,7 +786,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
}
// Prepare actions after user confirmation
let
answers_are_right
=
$q
.
defer
();
var
answers_are_right
=
$q
.
defer
();
answers_are_right
.
promise
.
then
(
function
(
cert_status
)
{
return
$scope
.
showLicenseReminderIfNewCert
(
cert_status
)
})
...
...
@@ -860,7 +866,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
}
$scope
.
showLicenseReminderIfNewCert
=
function
(
cert_status
)
{
if
(
cert_status
==
"
new_cert
"
)
{
if
(
cert_status
==
=
"
new_cert
"
)
{
return
UIUtils
.
alert
.
confirm
(
'
ACCOUNT.CERTIFICATION_MODAL.SHORT_LICENSE_REMINDER
'
,
'
ACCOUNT.CERTIFICATION_MODAL.REMINDER_TITLE
'
,
...
...
@@ -947,7 +953,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
}
// Prepare actions after user confirmation
let
answers_are_right
=
$q
.
defer
();
var
answers_are_right
=
$q
.
defer
();
answers_are_right
.
promise
.
then
(
function
(
cert_status
)
{
return
$scope
.
showLicenseReminderIfNewCert
(
cert_status
)
})
...
...
@@ -1093,7 +1099,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
/**
* Identity view controller - should extend WotIdentityAbstractCtrl
*/
function
WotIdentityViewController
(
$scope
,
$rootScope
,
$controller
,
$timeout
,
$state
,
UIUtils
,
Modals
,
csWallet
)
{
function
WotIdentityViewController
(
$scope
,
$rootScope
,
$controller
,
$timeout
,
$state
,
UIUtils
,
Modals
)
{
'
ngInject
'
;
// Initialize the super class and extend it.
angular
.
extend
(
this
,
$controller
(
'
WotIdentityAbstractCtrl
'
,
{
$scope
:
$scope
}));
...
...
@@ -1340,8 +1346,8 @@ function WotCertificationsViewController($scope, $rootScope, $controller, csSett
$scope
.
$on
(
'
$ionicView.enter
'
,
function
(
e
,
state
)
{
if
(
state
.
stateParams
&&
state
.
stateParams
.
type
)
{
$scope
.
motions
.
receivedCertifications
.
enable
=
(
state
.
stateParams
.
type
!=
'
given
'
);
$scope
.
motions
.
givenCertifications
.
enable
=
(
state
.
stateParams
.
type
==
'
given
'
);
$scope
.
motions
.
receivedCertifications
.
enable
=
(
state
.
stateParams
.
type
!=
=
'
given
'
);
$scope
.
motions
.
givenCertifications
.
enable
=
(
state
.
stateParams
.
type
==
=
'
given
'
);
$scope
.
motions
.
avatar
.
enable
=
false
;
}
...
...
@@ -1491,14 +1497,16 @@ function WotCertificationsViewController($scope, $rootScope, $controller, csSett
/**
* Certification checklist controller
* @param $scope
* @param $controller
* @param parameters
*/
function
WotCertificationChecklistController
(
$scope
,
$controller
,
parameters
){
// allow to display license
$controller
(
'
CurrencyViewCtrl
'
,
{
$scope
:
$scope
});
let
answers_are_right
=
parameters
.
answers_are_right
;
var
answers_are_right
=
parameters
.
answers_are_right
;
$scope
.
identity
=
parameters
.
identity
;
$scope
.
prepare_cert_checklist
=
function
()
{
...
...
@@ -1548,9 +1556,9 @@ function WotCertificationsViewController($scope, $rootScope, $controller, csSett
// Fisher-Yates shuffle
function
shuffle
(
array
)
{
for
(
let
i
=
array
.
length
-
1
;
i
>
0
;
i
--
)
{
let
j
=
Math
.
floor
(
Math
.
random
()
*
(
i
+
1
));
// random index from 0 to i
let
t
=
array
[
i
];
array
[
i
]
=
array
[
j
];
array
[
j
]
=
t
for
(
var
i
=
array
.
length
-
1
;
i
>
0
;
i
--
)
{
var
j
=
Math
.
floor
(
Math
.
random
()
*
(
i
+
1
));
// random index from 0 to i
var
t
=
array
[
i
];
array
[
i
]
=
array
[
j
];
array
[
j
]
=
t
}
return
array
;
}
...
...
@@ -1618,6 +1626,6 @@ function WotSelectPubkeyIdentityModalController($scope, $q, csWot, parameters) {
function
isCertificationRenewal
(
identity_current_certs
,
certifier_pubkey
)
{
return
_
.
find
(
identity_current_certs
,
function
(
certification
)
{
return
certification
.
pubkey
==
certifier_pubkey
;
return
certification
.
pubkey
==
=
certifier_pubkey
;
})
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment