Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
token-market
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
token-market
Commits
60a56ead
Unverified
Commit
60a56ead
authored
Jul 17, 2018
by
bitsoko
Committed by
GitHub
Jul 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create open-orders.js
parent
86686d64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
open-orders.js
js/open-orders.js
+78
-0
No files found.
js/open-orders.js
0 → 100644
View file @
60a56ead
function
myOpenOrders
(
oDs
,
deci
)
{
$
(
"#myOrders"
).
html
(
''
);
// $("#myOrders").append('<tr style="background-color: #dad8d8;height: 40px;">' +
// '<th></th>' +
// '<th></th>' +
// '<th class="hidden-xs">AMOUNT</th>' +
// '<th class="hidden-xs">PRICE ' + baseCd.toUpperCase() + '</th>' +
// '<th>TOTAL</th>' +
// '<th></th>' +
// '</tr>');
for
(
var
ii
in
oDs
)
{
try
{
var
deci
=
allTokens
[
oDs
[
ii
].
coin
].
decimals
?
allTokens
[
oDs
[
ii
].
coin
].
decimals
:
5
;
}
catch
(
err
)
{
//TO-DO
//this should not be happening!!
console
.
log
(
err
);
var
deci
=
5
;
}
if
(
oDs
[
ii
].
state
==
'pending'
)
{
var
icon
=
'edit'
;
}
else
{
var
icon
=
'attach_money'
;
}
if
(
parseInt
(
oDs
[
ii
].
tranTo
.
uid
)
==
parseInt
(
localStorage
.
getItem
(
'bits-user-name'
)))
{
console
.
log
(
"++++++++++++++++"
+
oDs
[
ii
])
//--------------------------------- collection BUY code ---------------------------------------------------------
$
(
"#myOrders"
).
append
(
'<ul class="collection">'
+
' <li class="collection-item avatar">'
+
'<div class="row"> <div class="col s3"><img style="margin-top:5px;" src="/bitsAssets/images/currencies/'
+
oDs
[
ii
].
coin
.
replace
(
'-kovan'
,
''
)
+
'.png" class="circle" style="height:75px;width: 75px;"></div><div class="col s7"><div style="font-size: 12px; line-height: 1.4;margin-top: 7px;"> <span class="title">BUY</span>'
+
'<p class="hidden-xs">Amount: '
+
Math
.
round10
(
parseFloat
(
oDs
[
ii
].
amount
),
(
deci
/
-
1
))
+
'</p>'
+
'<p class="hidden-xs">Price:'
+
parseFloat
(
oDs
[
ii
].
rate
).
toFixed
(
5
)
+
'</p>'
+
'<p>Total: '
+
(
parseFloat
(
oDs
[
ii
].
amount
)
*
parseFloat
(
oDs
[
ii
].
rate
)).
toFixed
(
2
)
+
''
+
'</p></div></div><div class="col s2"><a class=" modal-trigger" href="#tradeOrder" style="padding:0 1rem" oid="'
+
oDs
[
ii
].
id
+
'" act="manage"><i class="material-icons right editOrderBtn" style="margin-top: 25px;margin-right: 20px; border: solid 1px; border-radius: 3px; padding: 5px;">'
+
icon
+
'</i></a></div></div>'
+
//'<a href="#!" class="secondary-content"><i class="material-icons"></i></a>'+
' </li>'
);
//---------------------------------------- collection code end -------------------------------------------------
// $("#myOrders").append('<tr class="">' +
// '<td><img src="/bitsAssets/images/currencies/' + oDs[ii].coin.replace('-kovan', '') + '.png" style="height:32px"></td>' +
// '<td>BUY</td>' +
// '<td class="hidden-xs">' + Math.round10(parseFloat(oDs[ii].amount), (deci / -1)) + '</td>' +
// '<td class="hidden-xs">' + parseFloat(oDs[ii].rate).toFixed(5) + '</td>' +
// '<td>' + (parseFloat(oDs[ii].amount) * parseFloat(oDs[ii].rate)).toFixed(2) + '</td>' +
// '<td><a class="waves-effect waves-light btn modal-trigger" href="#tradeOrder" style="padding:0 1rem" oid="' + oDs[ii].id + '" act="manage"><i class="material-icons right" style="margin: 0px;">' + icon + '</i></a></td>' +
// '</tr>');
}
else
if
(
parseInt
(
oDs
[
ii
].
tranFrom
.
uid
)
==
parseInt
(
localStorage
.
getItem
(
'bits-user-name'
)))
{
//--------------------------------- collection SELL code ---------------------------------------------------------
$
(
"#myOrders"
).
append
(
'<ul class="collection">'
+
' <li class="collection-item avatar">'
+
'<div class="row"> <div class="col s3"><img style="margin-top:5px;" src="/bitsAssets/images/currencies/'
+
oDs
[
ii
].
coin
.
replace
(
'-kovan'
,
''
)
+
'.png" class="circle" style="height:75px;width: 75px;"></div><div class="col s7"><div style="font-size: 12px; line-height: 1.4;margin-top: 7px;"> <span class="title">BUY</span>'
+
'<p class="hidden-xs">Amount: '
+
Math
.
round10
(
parseFloat
(
oDs
[
ii
].
amount
),
(
deci
/
-
1
))
+
'</p>'
+
'<p class="hidden-xs">Price:'
+
parseFloat
(
oDs
[
ii
].
rate
).
toFixed
(
5
)
+
'</p>'
+
'<p>Total: '
+
(
parseFloat
(
oDs
[
ii
].
amount
)
*
parseFloat
(
oDs
[
ii
].
rate
)).
toFixed
(
2
)
+
''
+
'</p></div></div><div class="col s2"><a class=" modal-trigger" href="#tradeOrder" style="padding:0 1rem" oid="'
+
oDs
[
ii
].
id
+
'" act="manage"><i class="material-icons right editOrderBtn" style="margin-top: 25px;margin-right: 20px; border: solid 1px; border-radius: 3px; padding: 5px;"">'
+
icon
+
'</i></a></div></div>'
+
//'<a href="#!" class="secondary-content"><i class="material-icons"></i></a>'+
' </li>'
);
//---------------------------------------- collection code end -------------------------------------------------
// $("#myOrders").append('<tr class="">' +
// '<td><img src="/bitsAssets/images/currencies/' + oDs[ii].coin.replace('-kovan', '') + '.png" style="height:32px"></td>' +
// '<td>SELL</td>' +
// '<td class="hidden-xs">' + Math.round10(parseFloat(oDs[ii].amount), (deci / -1)) + '</td>' +
// '<td class="hidden-xs">' + parseFloat(oDs[ii].rate).toFixed(5) + '</td>' +
// '<td>' + (parseFloat(oDs[ii].amount) * parseFloat(oDs[ii].rate)).toFixed(2) + '</td>' +
// '<td><a class="waves-effect waves-light btn modal-trigger" href="#tradeOrder" style="padding:0 1rem" oid="' + oDs[ii].id + '" act="manage"><i class="material-icons right" style="margin: 0px;">' + icon + '</i></a></td>' +
// '</tr>');
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment