Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

[TASK] Trade: Order flow eliminates unnecessary step (RT-3279) #2362

Open
wants to merge 192 commits into
base: release
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
40297f1
[TEST] make Sauce Labs tests work
darkdarkdragon Feb 28, 2015
f89b96e
Merge pull request #2271 from darkdarkdragon/develop-sauce-9
Mar 2, 2015
bd9d3b1
Merge pull request #2272 from rht/dropcash
Mar 2, 2015
6301c20
Merge pull request #2269 from mariatabach/develop
Mar 2, 2015
50aa05c
Merge pull request #2244 from rht/cur
vhpoet Mar 2, 2015
df7ad41
Merge pull request #2268 from rht/develop
mrajvanshy Mar 2, 2015
7ffcc27
Merge pull request #2228 from rht/errormsg
mrajvanshy Mar 2, 2015
cf7a9d6
[TEST] split tests to public and private
darkdarkdragon Mar 3, 2015
2b72d84
Merge pull request #2219 from darkdarkdragon/develop-RT-3104
yongsoo Mar 3, 2015
e48edf4
[TASK] gitignore: add angular-messages
vhpoet Mar 4, 2015
c3cb006
[TASK] Remove cache bust
vhpoet Mar 4, 2015
4388ebd
Merge pull request #2275 from vhpoet/pr/150302171911
mrajvanshy Mar 4, 2015
9050a7d
Merge pull request #2276 from vhpoet/pr/150303170954
mrajvanshy Mar 4, 2015
8aad65b
[FIX] Gruntfile: fix the watch
vhpoet Mar 4, 2015
8713011
[FIX] optimize rpAddressPopover
darkdarkdragon Feb 4, 2015
8e6ee8c
[FIX] fix hover state (RT-3209)
darkdarkdragon Mar 4, 2015
4e2c43b
Merge pull request #2277 from vhpoet/pr/150303175029
Mar 4, 2015
43c6cd6
[FIX] Lock username after submit (RT-3084)
mrajvanshy Mar 4, 2015
767020c
Merge pull request #2278 from mrajvanshy/fix/pp
vhpoet Mar 4, 2015
dfd89bf
[TASK] Landing: Remove ticker
vhpoet Mar 4, 2015
e1d4741
[TASK] Landing: Set background-attachment to scroll
vhpoet Mar 4, 2015
a05b787
[TASK] Landing: Same background position for login/signup
vhpoet Mar 4, 2015
8a218b2
[TASK] Login: Simplify error messages
vhpoet Mar 4, 2015
8c9de3e
[TASK] Register: Add tabindexes for register form
vhpoet Mar 4, 2015
7f7d615
[FIX] Landing: Padding fixes
vhpoet Mar 4, 2015
c01eb17
[FIX] Show partial payments correctly (RT-1974)
mrajvanshy Mar 4, 2015
b9c5590
Merge pull request #2281 from mrajvanshy/pp
vhpoet Mar 4, 2015
64fcd1d
Merge pull request #2279 from vhpoet/pr/150304131252
mrajvanshy Mar 5, 2015
1aaebfe
[FIX] Remove ticker wrapper on landing page
mrajvanshy Mar 5, 2015
a12c124
Merge pull request #2282 from mrajvanshy/removeTicker
vhpoet Mar 5, 2015
4a3d91e
[FIX] UI: Input loading spinner
vhpoet Mar 5, 2015
5b70f8b
[FIX] Advanced: Server settings validators
vhpoet Mar 5, 2015
42ada68
Merge pull request #2283 from vhpoet/pr/150304142947
Mar 5, 2015
949f419
Merge pull request #2274 from darkdarkdragon/develop-sauce-secure
Mar 5, 2015
92cbe64
[TASK] Advanced: Default ports for server settings
vhpoet Mar 5, 2015
c281d65
[TASK] Navbar: Add a server status icon
vhpoet Mar 5, 2015
3e9f92f
[FIX] use $validate to force model re-validation
darkdarkdragon Mar 5, 2015
abbf5cc
Merge pull request #2285 from vhpoet/pr/150304175739
mrajvanshy Mar 5, 2015
ee3e30c
Merge pull request #2287 from darkdarkdragon/develop-js-fix-010
mrajvanshy Mar 5, 2015
ad95d9d
Merge pull request #2284 from vhpoet/pr/150304173734
Mar 5, 2015
1c2f69e
[TASK] Settings: Server should be secure by default
vhpoet Mar 5, 2015
18e4292
Merge pull request #2288 from vhpoet/develop
Mar 5, 2015
8092c46
[FIX] Trade: Check on empty book spread
vhpoet Mar 5, 2015
514d251
[TASK] Better loading experience when logging into RT (RT-3223)
mrajvanshy Mar 5, 2015
6414ac8
Merge pull request #2203 from darkdarkdragon/develop-addresspopoverop…
Mar 5, 2015
ebecc96
[TASK] Use price currency2 per currency1 convention (RT-2730)
mrajvanshy Mar 6, 2015
1c85a7d
[FIX] LoginRT Test
mrajvanshy Mar 6, 2015
9c1a169
Merge pull request #2292 from mrajvanshy/fix/test
vhpoet Mar 6, 2015
455b8d6
[TASK] Landing page: Secret key spinner (RT-3230)
Mesrop Mar 9, 2015
4a9fcff
Merge pull request #2289 from mrajvanshy/fix/loading
vhpoet Mar 9, 2015
2ce5b7d
[FIX] Change fees
Mar 10, 2015
6a96237
[TEXT] update SnapSwap USD fees
Mar 10, 2015
fa2d32d
[FIX] fixed bug in chart on resize
shekenahglory Mar 10, 2015
a895db3
Merge pull request #2296 from ripple/annatonger-patch-1
mrajvanshy Mar 11, 2015
d9ec6dd
[TASK] Separate tabs.less to its own tab files (RT-3016)
Mesrop Mar 11, 2015
3fa9ef1
Merge pull request #2295 from Mesrop/develop-RT-3230-09-03-15
yongsoo Mar 11, 2015
e43f527
Merge pull request #2290 from vhpoet/pr/150305150402
mrajvanshy Mar 11, 2015
e3cc475
[TASK] Remove cssmin (RT-3235)
Mar 11, 2015
0097133
Merge pull request #2300 from shekenahglory/develop
vhpoet Mar 11, 2015
2ee8ca5
Merge pull request #2301 from rht/uncssmin
yongsoo Mar 11, 2015
e30c775
Merge pull request #2302 from Mesrop/develop-RT-3016-11-03-15
yongsoo Mar 11, 2015
50fd6c7
[TASK] Display fees and load in RT (RT-3228)
mrajvanshy Mar 10, 2015
729a8fc
Merge pull request #2291 from mrajvanshy/develop
yongsoo Mar 11, 2015
5801abf
Merge pull request #2298 from mrajvanshy/develop2
vhpoet Mar 11, 2015
57fc7c5
Update usd.jade
Mar 11, 2015
3b5ded4
Merge pull request #2297 from ripple/annatonger-patch-2
mrajvanshy Mar 11, 2015
ee137b0
[TASK] Remove demurraging GBI (RM-3225)
mrajvanshy Mar 12, 2015
07cafd1
Merge pull request #2307 from mrajvanshy/fix/gbi
vhpoet Mar 12, 2015
8af59ee
[TASK] History: UI improvements
vhpoet Mar 6, 2015
1f5befe
[TASK] History: Remove complicated popovers
vhpoet Mar 6, 2015
152cd9d
[TASK] Add rprange filter
vhpoet Mar 7, 2015
69a5718
[TASK] rpHistory: callbacks -> promises, add getCount
vhpoet Mar 7, 2015
bc54658
[TASK] History: Add pagination
vhpoet Mar 7, 2015
524d0a3
[TASK] History effects: Remove complicated popovers
vhpoet Mar 9, 2015
b855688
[TASK] History: Add transaction type filter
vhpoet Mar 10, 2015
5c23f77
[TASK] History: Add date filter
vhpoet Mar 11, 2015
ec7c8a8
[TASK] History: style changes
vhpoet Mar 11, 2015
91f2b07
[FIX] History: Remove the redundant historyApi call
vhpoet Mar 11, 2015
30963d4
[TASK] History: UX for date filter
vhpoet Mar 12, 2015
a8d0fd4
[TASK] History: Make filters uncollapsable
vhpoet Mar 12, 2015
360b7ac
[TASK] History: Convert export button to a link
vhpoet Mar 12, 2015
45b446a
[TASK] History: Use Angular UI pagination
vhpoet Mar 12, 2015
92c302b
[TASK] History: Add empty history message
vhpoet Mar 12, 2015
f4dc066
[TASK] Tx: Switch to historyApi
vhpoet Mar 12, 2015
309e74b
[TASK] Balance: Remove balance trend code
vhpoet Mar 12, 2015
41d47d0
[TASK] Better XRP reserve messaging on fund tabs and always show rese…
mrajvanshy Mar 12, 2015
5d71734
Merge pull request #2309 from mrajvanshy/reserve
vhpoet Mar 12, 2015
c0b2d48
[FIX] Slide for XRP reserve on balances
mrajvanshy Mar 12, 2015
50b5967
Merge pull request #2310 from mrajvanshy/develop
vhpoet Mar 12, 2015
f197de2
Merge pull request #2308 from vhpoet/pr/150306150835
yongsoo Mar 12, 2015
4c0fc11
[TASK] renaming tabs controllers (RT-3014)
Mesrop Mar 11, 2015
68176a0
[TASK] renaming services, directives, filters (RT-3014)
Mesrop Mar 12, 2015
25ec363
[TASK] renaming tests filenames (RT-3014)
Mesrop Mar 13, 2015
532ea36
Merge pull request #2303 from Mesrop/develop-RT-3014-11-03-15
vhpoet Mar 13, 2015
6e7249b
[TASK] Gateways: If the number in the "Min" column is 0, do not show …
Mesrop Mar 13, 2015
1a67fd3
[TASK] Triskelion spinning endlessly on chart (only with not activate…
Mesrop Feb 12, 2015
2eb11b0
[TASK] Rewrite server-side validators in $asyncValidators (RT-3217)
Mar 6, 2015
5dc0dfe
Merge pull request #2311 from Mesrop/develop-RT-3241-13-03-15
vhpoet Mar 13, 2015
53390e7
[TASK] Performance: use ng-bind (RT-3155)
mrajvanshy Mar 13, 2015
587c3f0
[TASK] Update existing localizations
mynetx Mar 13, 2015
4d1d71b
[FEATURE] Add French localization
mynetx Mar 13, 2015
9a79356
[TASK] Language chooser: Sort languages
mynetx Mar 13, 2015
aa23c9a
[FIX] Fix French language code
mynetx Mar 13, 2015
1f47a05
Merge pull request #2313 from mrajvanshy/bind
yongsoo Mar 13, 2015
c4a989c
[FIX] Send: better show input errors (RT-2975)
darkdarkdragon Jan 17, 2015
b8f0761
[TEST] Exchange: fix unit tests (RT-2975)
darkdarkdragon Jan 23, 2015
799a4ae
[FIx] fix js styles (RT-2975)
darkdarkdragon Jan 26, 2015
0c4bd48
[FIX] use $validate (RT-2975)
darkdarkdragon Mar 5, 2015
d9c0cc6
[TEST] cleanup old commented code (RT-2975)
darkdarkdragon Mar 12, 2015
5f338ef
[FIX] initialize pf var (RT-2975)
darkdarkdragon Mar 13, 2015
74dd679
Merge pull request #2314 from jublonet/issue/update-l10n
Mar 13, 2015
58f6c7a
Merge pull request #2293 from rht/servervalidator
mrajvanshy Mar 13, 2015
1e96a1a
[FIX] Update "Net Worth" drop down (RT-3091)
darkdarkdragon Mar 9, 2015
5e893a1
[TASK] Save server settings in blob (RT-3224)
darkdarkdragon Mar 5, 2015
8e6351a
[FIX] refactor some code (RT-3224)
darkdarkdragon Mar 6, 2015
8be79dc
[FIX] add some code comment (RT-3224)
darkdarkdragon Mar 12, 2015
54ae8d7
Merge branch 'develop' into release
vhpoet Mar 13, 2015
51d183f
Merge branch 'master' into release
vhpoet Mar 14, 2015
c7c6332
Merge branch 'master' into develop
vhpoet Mar 14, 2015
c1b1287
[FIX] Trust: Modify table UI breakpoints
mynetx Nov 15, 2014
0f8b325
[FIX] Gateways table xs view: Connect btn spacing
mynetx Nov 25, 2014
11b0187
[FIX] Trust: Transposed layout for xs, sm screens (RT-2585)
mynetx Mar 13, 2015
1ec4d94
[FIX] Trust: Fix transposed layout for xs, sm
mynetx Mar 14, 2015
08f4464
[FIX] Better loading experience on balances page (RT-3223)
mrajvanshy Mar 16, 2015
f4815f4
[FIX] Price convention on send, trade, exchange (RT-2730)
mrajvanshy Mar 16, 2015
dffe793
[FIX] Remove button on trust page (RT-3261)
mrajvanshy Mar 16, 2015
32f4b47
[FIX] Don't show exchange rate if currencies are the same (RT-3261)
mrajvanshy Mar 16, 2015
d3bd31c
Merge pull request #2294 from darkdarkdragon/develop-RT-3091
yongsoo Mar 16, 2015
23ced96
[TASK] add period to the end of "Deposit BTC." (RT-3115)
Mesrop Mar 16, 2015
a21c280
Merge pull request #2323 from Mesrop/release-RT-3115-05-02-15
mrajvanshy Mar 16, 2015
eef3a70
[TASK] [STAGING] clicking out of account recovery success banner brin…
Mesrop Mar 16, 2015
6aefb38
[TASK] Move some settings to the bottom of the Advanced settings page…
Mesrop Mar 16, 2015
56115c2
[FIX] History: Bring back the pagination (RT-3255)
vhpoet Mar 16, 2015
c4cd8db
[TASK] Update ripple-lib
vhpoet Mar 16, 2015
27bb03c
Merge pull request #1843 from jublonet/issue/2585-gateway-col-overflow
vhpoet Mar 16, 2015
4635aae
Merge pull request #2317 from vhpoet/release
mrajvanshy Mar 16, 2015
f66032a
Merge pull request #2320 from mrajvanshy/fix/send
vhpoet Mar 16, 2015
89d579d
Merge pull request #2319 from mrajvanshy/fix/button
vhpoet Mar 16, 2015
fdad283
Merge pull request #2326 from Mesrop/develop-RT-3245-16-05-15
mrajvanshy Mar 16, 2015
a33fd45
Merge pull request #2316 from mrajvanshy/release2
vhpoet Mar 16, 2015
2325946
Merge pull request #2318 from mrajvanshy/fix/div
vhpoet Mar 16, 2015
9c9f347
Merge pull request #2324 from Mesrop/release-RT-3263-17-03-15
mrajvanshy Mar 16, 2015
b0f9d80
Merge pull request #2280 from darkdarkdragon/develop-RT-2975
vhpoet Mar 16, 2015
925b152
Merge pull request #2286 from darkdarkdragon/develop-RT-3224
mrajvanshy Mar 16, 2015
6806d42
Merge pull request #2208 from Mesrop/develop-RT-3164-12-02-15
mrajvanshy Mar 16, 2015
04ff58f
[TASK] Gateways: "Saving" should be "Removing" when trying to remove …
Mesrop Mar 13, 2015
aff3b57
Merge pull request #2325 from Mesrop/develop-RT-3243-13-03-15
vhpoet Mar 16, 2015
f97cd1e
Merge branch 'develop' into release
vhpoet Mar 16, 2015
fd38e54
[FIX] Server status when RT loading
mrajvanshy Mar 16, 2015
01c825d
Merge pull request #2327 from mrajvanshy/fix/history
vhpoet Mar 16, 2015
c5b1e4f
[FIX] Link 'add gateway' to fund page (RT-3285)
mrajvanshy Mar 17, 2015
97f1b74
[FIX] fix Amount use
darkdarkdragon Mar 17, 2015
9a1bb49
[FIX] Change wording on My Orders (RT-3290)
mrajvanshy Mar 17, 2015
70302a5
Merge pull request #2330 from darkdarkdragon/release-js-fix-001
yongsoo Mar 17, 2015
a6d72e0
[FIX] Trust: use Amount's public api
darkdarkdragon Mar 17, 2015
ec9f059
[TASK] Trust UI: popover shows -0.00 (RT-3267)
Mesrop Mar 17, 2015
b396f91
[TASK] register page ripple name popup (RT-3194)
Mesrop Mar 17, 2015
b9b61d8
Merge pull request #2331 from mrajvanshy/fix/limit
Mar 17, 2015
b93b8bc
[TASK] Update ripple-lib
vhpoet Mar 17, 2015
6a3a861
[FIX] Remove cancel button on advanced settings option (RT-3249)
mrajvanshy Mar 17, 2015
1da274e
[FIX] Trust: Show minimum limit (RT-3293)
yongsoo Mar 17, 2015
8162c39
[TASK] Fix network status popup (RT-3297)
mrajvanshy Mar 17, 2015
a18c299
Merge pull request #2338 from yongsoo/fix/trust
MatthewPhinney Mar 17, 2015
874f496
Merge pull request #2337 from mrajvanshy/fix/advanced
MatthewPhinney Mar 17, 2015
f3e1d7b
Merge pull request #2339 from mrajvanshy/fix/max
MatthewPhinney Mar 17, 2015
c875e27
Merge pull request #2335 from Mesrop/release-RT-3267-17-03-15
yongsoo Mar 18, 2015
f250aec
Merge pull request #2334 from darkdarkdragon/release-trust-jade-fix
yongsoo Mar 18, 2015
cf71f0b
Merge pull request #2336 from Mesrop/release-RT-3194-17-03-15
vhpoet Mar 18, 2015
568e1a6
[TASK] Advanced: Add defaultripple flag option on settings (RT-3264)
yongsoo Mar 18, 2015
74d6f07
[FIX] Fund BTC: update the connected status (RT-3296)
vhpoet Mar 18, 2015
103e9b7
Merge pull request #2329 from yongsoo/task/defaultrippleflag
vhpoet Mar 18, 2015
8908135
[FIX] History: Remove trailing slash from historyApi url (RT-3268)
vhpoet Mar 18, 2015
14779e8
Merge pull request #2346 from vhpoet/pr/150318113049
mrajvanshy Mar 18, 2015
3be780a
Merge pull request #2343 from vhpoet/pr/150318102911
mrajvanshy Mar 18, 2015
f5bf63a
[FIX] maxFee: save settings to userBlob (RT-3289)
Mar 18, 2015
d4b95f3
[FIX] Calculate reserve in client
vhpoet Mar 18, 2015
accf156
Merge pull request #2347 from rht/release-3289
vhpoet Mar 18, 2015
ae46460
[TASK] Trade: Remove hide function from orderbook (RT-3276)
yongsoo Mar 18, 2015
89da08a
Merge pull request #2352 from yongsoo/rt-3276
vhpoet Mar 18, 2015
13962e1
Merge pull request #2351 from vhpoet/pr/150318143414
mrajvanshy Mar 18, 2015
571b61c
[TASK] Adapt to ripple-lib Amount changes
vhpoet Mar 18, 2015
3bd6a86
[TASK] Update ripple-lib
vhpoet Mar 19, 2015
203874c
Merge pull request #2355 from vhpoet/release
yongsoo Mar 19, 2015
5eb612b
Merge pull request #2353 from vhpoet/pr/150318162931
yongsoo Mar 19, 2015
3f57117
[TASK] Send: disallowXRP flag should only be notice (RT-3284)
mrajvanshy Mar 19, 2015
2fb113d
Merge pull request #2358 from mrajvanshy/fix/disallow
yongsoo Mar 19, 2015
6b7c27b
Merge pull request #2328 from mrajvanshy/fix/link
yongsoo Mar 19, 2015
d4160c1
[FEATURE] Trust: Allow edit incoming trustline (RT-3246), enable limi…
yongsoo Mar 19, 2015
5b15bef
Merge pull request #2360 from yongsoo/rt-3246
vhpoet Mar 19, 2015
5c6b93d
[FIX] Server status icon
mrajvanshy Mar 18, 2015
a6b4142
Merge pull request #2350 from mrajvanshy/fix/status
vhpoet Mar 19, 2015
fe5a4a1
[TASK] Trade: Order flow eliminates unnecessary step (RT-3279)
yongsoo Mar 19, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FIX] optimize rpAddressPopover
if popover is not used, do not create popover,
and make only one interaction
with dom - add one 'mouseenter' handler
  • Loading branch information
darkdarkdragon committed Mar 4, 2015
commit 8713011fb21daa11bd04396ebcdebade583c9814
11 changes: 3 additions & 8 deletions src/jade/directives/addresspopover.jade
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
div
div(ng-show="summ") {{ summ }}
span(l10n, ng-show="type==1 && identity") Ripple address {{ identity }}
div(ng-show="type==2")
div(ng-show="rippleName") {{ rippleName }}
span {{ identity }}
br
a(l10n, target="_blank", href="http://www.ripplecharts.com/#/graph/{{ identity }}") Show in graph
span(l10n) Ripple address
br
span(l10n) Show in graph
18 changes: 10 additions & 8 deletions src/jade/tabs/trade.jade
Original file line number Diff line number Diff line change
@@ -455,7 +455,8 @@ section.col-xs-12.content(ng-controller="TradeCtrl")
.col-md-1.type(l10n-data-label="Type")
span.rp-hidden-md.rp-hidden-lg {{entry.type | rpucfirst}}
span.rp-hidden-xs.rp-hidden-sm {{entry.type | rptruncate:1}}
.col-md-2.amount.rpamount(l10n-data-label="QTY",
.col-md-2.amount.rpamount(l10n-data-label="QTY"
rp-address-popover, rp-address-popover-sum="entry.first"
ng-hide="editOrder.seq == entry.seq") {{entry.first | rpamount:{hard_precision: true, precision: 6, tiny_precision: 6} }}
.col-md-2(l10n-data-label="BASE", ng-hide="editOrder.seq == entry.seq")
a(href="",ng-click="goto_order_currency()")
@@ -475,7 +476,8 @@ section.col-xs-12.content(ng-controller="TradeCtrl")
rp-pretty-issuer="entry.second.issuer().to_json()"
rp-pretty-issuer-contacts="userBlob.data.contacts"
) ???
.col-md-2.price.rpamount(l10n-data-label="Limit",
.col-md-2.price.rpamount(l10n-data-label="Limit"
rp-address-popover, rp-address-popover-sum="entry.second | rpamountratio:entry.first"
ng-hide="editOrder.seq == entry.seq") {{entry.second | rpamountratio:entry.first | rpamount:{hard_precision: true, precision: 6, tiny_precision: 6} }}
//- .col-md-2.action(l10n-data-label="Time placed(UTC)", ng-hide="editOrder.seq == entry.seq") ...
.col-md-3.action(ng-hide="editOrder.seq == entry.seq")
@@ -631,11 +633,11 @@ section.col-xs-12.content(ng-controller="TradeCtrl")

.row(ng-repeat='order in bookShow.bids track by order.index'
ng-class="{my: order.my, cancelling: cancelling}")
.col-xs-4.rpamount.sum
.col-xs-4.rpamount.sum(rp-address-popover="order.Account", rp-address-popover-link-to-charts)
a(href="", ng-click="fill_widget('sell', order, true)")
span(rp-bind-color-amount="order.showSum")
.col-xs-4.rpamount.size(rp-bind-color-amount="order.showTakerPays")
.col-xs-4.rpamount.price
.col-xs-4.rpamount.size(rp-bind-color-amount="order.showTakerPays", rp-address-popover="order.Account", rp-address-popover-link-to-charts)
.col-xs-4.rpamount.price(rp-address-popover="order.Account", rp-address-popover-link-to-charts)
a(href="", ng-click="fill_widget('sell', order, true)", ng-bind="order.showPrice")

.message(ng-show='!bookShow.bids.length', l10n) There are currently no bids for this pair.
@@ -667,10 +669,10 @@ section.col-xs-12.content(ng-controller="TradeCtrl")

.row(ng-repeat='order in bookShow.asks track by order.index'
ng-class="{my: order.my, cancelling: cancelling}")
.col-xs-4.rpamount.price
.col-xs-4.rpamount.price(rp-address-popover="order.Account", rp-address-popover-link-to-charts)
a(href="", ng-click="fill_widget('buy', order, true)", ng-bind="order.showPrice")
.col-xs-4.rpamount.size(rp-bind-color-amount="order.showTakerGets")
.col-xs-4.rpamount.sum
.col-xs-4.rpamount.size(rp-bind-color-amount="order.showTakerGets", rp-address-popover="order.Account", rp-address-popover-link-to-charts)
.col-xs-4.rpamount.sum(rp-address-popover="order.Account", rp-address-popover-link-to-charts)
a(href=""
ng-click="fill_widget('buy', order, true)")
span(rp-bind-color-amount="order.showSum")
228 changes: 228 additions & 0 deletions src/js/directives/addressPopover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@

(function() {
// 'use strict';

/* global ripple: false, angular: false, _: false, jQuery: false, store: false, Options: false */

function AddressPopover($timeout, id, $filter, $parse, scope, element, attr) {
this.$timeout = $timeout;
this.$parse = $parse;
this.scope = scope;
this.element = element;

this.cancelHidePopoverTimeout = null;
this.cancelShowPopoverTimeout = null;
this.tip = null;
this.shown = false;
this.identity = '';
this.summ = '';
this.rippleName = '';
this.rpamountFilter = $filter('rpamount');
this.popoverCreated = false;
this.rpAddressPopoverSum = attr.rpAddressPopoverSum;
this.rpAddressPopoverSumMinus = attr.rpAddressPopoverSumMinus;

if (attr.rpAddressPopover && attr.rpAddressPopover != 'rp-address-popover') {
this.identity = $parse(attr.rpAddressPopover)(scope);
}

this.onPopoverEnterBound = null;
this.onPopoverLeaveBound = null;
this.onElemLeaveBound = null;
this.onElemEnterBound = this.onElemEnter.bind(this);
element.bind('mouseenter', this.onElemEnterBound);

var _this = this;
if (attr.rpAddressPopoverLinkToCharts) {
id.resolveName(this.identity, { tilde: true }).then(function(name) {
_this.rippleName = name;
if (_this.popoverCreated) {
var data = element.data('popover');
if (data) {
data.options.content = _this.makeContent();
data.setContent();
}
}
});
}

// Make sure popover is destroyed and removed.
scope.$on('$destroy', function onDestroyPopover() {
$timeout.cancel(_this.cancelHidePopoverTimeout);
_this.cancelHidePopoverTimeout = null;
$timeout.cancel(_this.cancelShowPopoverTimeout);
_this.cancelShowPopoverTimeout = null;
_this.unbindHanlders();
if (_this.tip) {
_this.tip.remove();
_this.tip = null;
}
this.scope = null;
this.element = null;
this.onPopoverEnterBound = null;
this.onPopoverLeaveBound = null;
this.onElemLeaveBound = null;
this.onElemEnterBound = null;
});
}

AddressPopover.popupDelay = 800;
AddressPopover.hideDelay = 700;
AddressPopover.summFilterOpts = { force_precision: 100, min_precision: 2 };

AddressPopover.prototype.create = function() {
if (this.rpAddressPopoverSum) {
var nowSumm = this.$parse(this.rpAddressPopoverSum)(this.scope);
nowSumm = this.rpamountFilter(nowSumm, AddressPopover.summFilterOpts);
if (nowSumm != this.summ) {
if (this.rpAddressPopoverSumMinus && nowSumm != 'n/a') {
nowSumm = '-' + nowSumm;
}
this.summ = nowSumm;
}
}

var options = {
content: this.makeContent(),
html: true,
trigger: 'manual', placement: 'top',
container: 'body',
template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><div class="popover-content"></div></div></div>'
};

var popover = this.element.popover(options);
this.tip = this.element.data('popover').tip();
this.onPopoverEnterBound = this.onPopoverEnter.bind(this);
this.tip.bind('mouseenter', this.onPopoverEnterBound);
this.onPopoverLeaveBound = this.onPopoverLeave.bind(this);
this.tip.bind('mouseleave', this.onPopoverLeaveBound);
this.popoverCreated = true;
}

AddressPopover.prototype.makeContent = function() {
var htmlContent = ['<div>'];
if (this.summ) {
htmlContent.push('<div>', String(this.summ), '</div>');
}

if (this.rippleName) {
if (this.rippleName !== this.identity) {
htmlContent.push('<div>', this.rippleName, '</div>');
}
htmlContent.push('<span>', this.identity, '</span>', '<br/>');
htmlContent.push('<a target="_blank", href="http://www.ripplecharts.com/#/graph/', this.identity, '" >', AddressPopover.textShowInGraph, '</a>');
} else if (this.identity) {
htmlContent.push(AddressPopover.textRippleAddress, ' ', this.identity);
}
htmlContent.push('</div>');
return htmlContent.join('');
}

AddressPopover.prototype.showPopover = function() {
if (!this.popoverCreated) {
this.create();
}

var _this = this;
// allow $compile to bind values to template
this.$timeout(function() {
_this.element.popover('show');
_this.shown = true;
}, 10, false);
}

AddressPopover.prototype.hidePopover = function() {
if (!this.cancelHidePopoverTimeout) {
var _this = this;
this.cancelHidePopoverTimeout = this.$timeout(function() {
_this.element.popover('hide');
_this.shown = false;
}, AddressPopover.hideDelay, false);
this.cancelHidePopoverTimeout['finally'](function() {
_this.cancelHidePopoverTimeout = null;
});
}
}

AddressPopover.prototype.onPopoverEnter = function() {
if (this.cancelShowPopoverTimeout) {
this.$timeout.cancel(this.cancelShowPopoverTimeout);
this.cancelShowPopoverTimeout = null;
}
if (this.cancelHidePopoverTimeout) {
this.$timeout.cancel(this.cancelHidePopoverTimeout);
this.cancelHidePopoverTimeout = null;
}
}

AddressPopover.prototype.onPopoverLeave = function() {
this.hidePopover();
}

AddressPopover.prototype.onElemEnter = function() {
if (!this.onElemLeaveBound) {
this.onElemLeaveBound = this.onElemLeave.bind(this)
this.element.bind('mouseleave', this.onElemLeaveBound);
}

if (this.cancelHidePopoverTimeout) {
this.$timeout.cancel(this.cancelHidePopoverTimeout);
this.cancelHidePopoverTimeout = null;
} else if (!this.cancelShowPopoverTimeout) {
this.cancelShowPopoverTimeout = this.$timeout(this.showPopover.bind(this), AddressPopover.popupDelay, false);
this.cancelShowPopoverTimeout['finally'](this.onCancelShowPopoverTimeoutFinally.bind(this));
}
}

AddressPopover.prototype.onCancelShowPopoverTimeoutFinally = function() {
this.cancelShowPopoverTimeout = null;
}

AddressPopover.prototype.onElemLeave = function() {
if (this.cancelShowPopoverTimeout) {
this.$timeout.cancel(this.cancelShowPopoverTimeout);
this.cancelShowPopoverTimeout = null;
} else if (this.shown) {
this.hidePopover();
}
}

AddressPopover.prototype.unbindHanlders = function() {
this.element.unbind('mouseenter', this.onElemEnterBound);
this.element.unbind('mouseleave', this.onElemLeaveBound);

if (this.tip) {
this.tip.unbind('mouseenter', this.onPopoverEnterBound);
this.tip.unbind('mouseleave', this.onPopoverLeaveBound);
}
}

var myTemplate = require('../../jade/directives/addresspopover.jade')();
var texts = myTemplate.split('<br/>');

AddressPopover.textRippleAddress = texts[0];
AddressPopover.textShowInGraph = texts.length > 1 ? texts[1] : 'Show in graph';

/**
* Special popover to show ripple address with ability to double click on address to select.
* Also can link to www.ripplecharts.com.
* rp-address-popover-link-to-charts - show ling to ripple charts
* rp-address-popover-sum - show full sum of according model in popover
* rp-address-popover-sum-minus - put minus sign before sum
*/
angular.module('directives').directive('rpAddressPopover', rpAddressPopover);

rpAddressPopover.$inject = ['$timeout', 'rpId', '$filter', '$parse'];

function rpAddressPopover($timeout, id, $filter, $parse) {
return {
restrict: 'A',
replace: false,
compile: function (element, attr, linker) {
return function (scope, element, attr) {
var p = new AddressPopover($timeout, id, $filter, $parse, scope, element, attr);
};
}
};
}
})();
Loading