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

Commit

Permalink
Merge branch 'release/0.2.31'
Browse files Browse the repository at this point in the history
  • Loading branch information
justmoon committed Sep 25, 2013
2 parents cfea2c9 + bbe4941 commit 83a6f72
Show file tree
Hide file tree
Showing 19 changed files with 1,304 additions and 241 deletions.
32 changes: 16 additions & 16 deletions deps/js/ripple.js

Large diffs are not rendered by default.

1,055 changes: 1,055 additions & 0 deletions livereload.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ripple-client",
"version": "0.2.30",
"version": "0.2.31",
"description": "Client for the Ripple payment network",
"author": {
"name": "OpenCoin, Inc.",
Expand Down
26 changes: 9 additions & 17 deletions src/jade/tabs/balance.jade
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ section.panel.content(ng-controller="BalanceCtrl")
p.title Welcome to Ripple.
p You currently don't have any ripples (XRP). To get started you can:
.actions
a.bitcoin(href="https://bitcointalk.org/index.php?topic=145506", target="_blank")
a.receive(href="#receive")
a.nexus(href="http://www.xrpga.org/ripple-giveaways.html", target="_blank")
.currency-summary.positive(ng-show='account.Balance')
Expand All @@ -34,11 +33,11 @@ section.panel.content(ng-controller="BalanceCtrl")
caption Activity
thead
//- Loading screen
tr(ng-hide="loadState.transactions")
tr(ng-show="tx_load_status == 'loading' && transactions.length")
td(colspan=2) Loading activity...

//- Entries
tr(ng-show="loadState.transactions")
tr(ng-show="transactions.length")
th.date Date
th.desc Event
tbody(ng-class="{passive: loading}")
Expand Down Expand Up @@ -82,21 +81,14 @@ section.panel.content(ng-controller="BalanceCtrl")
| for 
strong {{entry.transaction.gets | rpamount}} {{entry.transaction.gets | rpcurrency}}
include balance/effects
.transaction(ng-switch-when="accountset") Account details have been changed
.transaction(ng-switch-default)
include balance/effects

tfoot(ng-show="pages_count")
tfoot
tr
td(colspan=2, class="pagination")
ul
li(ng-class="{disabled: !prev_page}")
a(ng-click="goToPage(prev_page)") «
li(ng-repeat="i in [1,pages_count] | rprange",ng-class="{active: current_page==i}")
a(ng-click="goToPage(i)", ng-hide="current_page==i") {{i}}
span(ng-show="current_page==i") {{i}}
li(ng-class="{disabled: !next_page}")
a(ng-click="goToPage(next_page)") »
span.spinner(
ng-show="loading"
rp-spinner="4",
)
td(colspan=2)
a(ng-click="loadMore()", ng-show="!tx_load_status && has_more") Load more
span(ng-show="tx_load_status == 'loading'") Loading...
span(ng-show="tx_load_status == 'error'") Error
span(ng-show="!transaction.length && !tx_load_status") No past transactions found
4 changes: 2 additions & 2 deletions src/jade/tabs/contacts.jade
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ section.panel.content(ng-controller="ContactsCtrl")
form(name="addForm", id="addForm")
label(for='Name') Name
input.name#contact_name(
name='name', type='text', step='any'
name='name', type='text', step='any', maxlength="70"
ng-model='contact.name'
rp-unique='userBlob.data.contacts'
rp-unique-field='name'
Expand Down Expand Up @@ -54,7 +54,7 @@ section.panel.content(ng-controller="ContactsCtrl")
td.name
div(ng-show='editing')
ng-form(name='inlineName')
input(name='editname', type="text", class="inline"
input(name='editname', type="text", class="inline", maxlength="70"
ng-model='editname'
rp-unique='userBlob.data.contacts'
rp-unique-field='name'
Expand Down
2 changes: 1 addition & 1 deletion src/jade/tabs/login.jade
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ section.single.content(ng-controller="LoginCtrl")
div(ng-show="'trust' == $routeParams.tab")
h1 Grant Trust
.info
p.literal {{$routeParams.label}}
p.label {{$routeParams.label}}
p.label you will trust
.amount(ng-show="$routeParams.amount")
span.number {{$routeParams.amount | rpamount:{xrp_human: true} }}
Expand Down
4 changes: 3 additions & 1 deletion src/jade/tabs/register.jade
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
section.single.content(ng-controller="RegisterCtrl")
.mode-form(ng-show='mode=="form"')
h1 Create a ripple Wallet
p.literal Ripple is an open source p2p payment network — a fast, easy way to send any kind of money to
p.literal Ripple is a global open payments system — a fast, easy way to send any kind of money to
| anyone in the world.
p.literal.hint
| Your Wallet is only as safe as your Wallet Name and Passphrase, used to encrypt your Wallet data.
Expand Down Expand Up @@ -97,6 +97,8 @@ section.single.content(ng-controller="RegisterCtrl")
a Show
a(ng-click="showPassword=false", ng-show="showPassword==true") Hide
.secret
p.important Ripple Address
p.key {{address}}
p.important Secret Account key:
p.key(ng-show="showSecret==true") {{keyOpen}}
p.key(ng-hide="showSecret==true") {{key}}
Expand Down
36 changes: 11 additions & 25 deletions src/jade/tabs/send.jade
Original file line number Diff line number Diff line change
Expand Up @@ -55,52 +55,38 @@ section#t-send.single.content(ng-controller='SendCtrl')
.error(rp-error-on='rpStdt')
| Invalid destination tag
label(for='send_amount') Recipient will receive
.amount(ng-if="!send.currency_force")
.amount(ng-class="{'input-append': send.currency_force}")
input.value#send_amount(
name='send_amount', type='text'
ng-model='send.amount'
required
rp-autofill='$routeParams.amount'
rp-autofill-amount
rp-max-amount
rp-max-amount-currency='{{send.currency}}'
rp-amount
rp-amount-positive
rp-amount-xrp-limit
rp-amount-xrp-limit-currency='{{send.currency}}')
input.currency#send_amount_currency(
name='send_amount_currency', type='text'
rp-combobox="{{send.currency_choices}}", rp-combobox-select
ng-model='send.currency'
rp-autofill='$routeParams.amount'
rp-autofill-currency)
.input-append(ng-if="send.currency_force")
input.value#send_amount(
name='send_amount', type='text'
ng-model='send.amount'
required
rp-autofill='$routeParams.amount'
rp-autofill-amount
rp-max-amount
rp-max-amount-currency='{{send.currency}}'
rp-amount
rp-amount-positive
rp-amount-xrp-limit
rp-amount-xrp-limit-currency='{{send.currency}}')
span.add-on(ng-bind="send.currency_force")
span(ng-if="!send.currency_force")
input.currency#send_amount_currency(
name='send_amount_currency', type='text'
rp-combobox="{{send.currency_choices}}", rp-combobox-select
ng-model='send.currency'
rp-autofill='$routeParams.amount'
rp-autofill-currency)
span.add-on(ng-if="send.currency_force", ng-bind="send.currency_force")
.errorGroup(rp-errors='send_amount')
.error(rp-error-on='required')
| Please enter an amount.
.error(rp-error-on='rpAmount')
| Not a valid amount.
.error(rp-error-on='rpAmountPositive')
| Amount must be greater than zero.
.error(rp-error-on='rpMaxAmount')
.error(ng-show="send.sender_insufficient_xrp && sendForm.send_amount.$valid")
| This transaction exceeds your balance, you can send a max. of {{account.max_spend | rpamount:{rel_precision: 0} }} XRP
.error(ng-show="disallowXrp") Recipient does not allow XRP payments. Are you sure you want to send XRP anyway?
.notice(ng-show="send.trust_limit") {{send.recipient | rpcontactname}} trusts you for {{send.trust_limit | rpamount}} {{send.trust_limit | rpcurrency}}.
.submitsection(ng-show="send.currency_code == 'XRP'")
button.btn.btn-success.submit(type='submit', ng-disabled='sendForm.$invalid || send.self || !send.recipient_resolved') Send XRP
button.btn.btn-success.submit(type='submit', ng-disabled='sendForm.$invalid || send.self || !send.recipient_resolved || send.sender_insufficient_xrp') Send XRP
p.literal(ng-show="send.fund_status == 'insufficient-xrp'") Destination account is unfunded; send at least {{send.xrp_deficiency | rpamount}} XRP to initialize it. 
a(href="https://ripple.com/wiki/Reserves", target="_blank") More information
p.literal(ng-show="send.path_status == 'waiting'") Please enter the transaction details.
Expand Down
11 changes: 6 additions & 5 deletions src/jade/tabs/trust.jade
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ section.panel.content(ng-controller="TrustCtrl")
thead
tr
th.account Name/Address
th.currency Currency
th.balance Balance
th.currency
a(href="", ng-click="sorting.predicate = 'currency'; sorting.reverse=!sorting.reverse") Currency
th.balance
a(href="", ng-click="sorting.predicate = 'balance'; sorting.reverse=!sorting.reverse") Balance
th.trust Trust Limit
th.action
a.btn.btn-success.sign(ng-click='toggle_form()')
Expand Down Expand Up @@ -59,7 +61,7 @@ section.panel.content(ng-controller="TrustCtrl")
label(for='trust_amount') Amount
.amount
input.value#trust_amount(name='trust_amount', type='number', step='any', ng-model='amount'
ng-pattern='validation_pattern', required
ng-pattern='validation_pattern'
rp-autofill='$routeParams.amount'
rp-autofill-amount
rp-autofill-on='addform_visible = true'
Expand All @@ -85,13 +87,12 @@ section.panel.content(ng-controller="TrustCtrl")
tr(ng-show='addform_visible && !can_add_trust')
td(colspan=4) You must have at least {{account.reserve_to_add_trust | rpamount:0}} XRP to add a trust line. 

tr(ng-repeat='(key, line) in lines')
tr(ng-repeat='(key, line) in linesArray | orderBy:sorting.sort:sorting.reverse')
td.account {{line.account | rpcontactnamefull}}
td.currency {{line.currency}}
td.balance: span(rp-tooltip="{{line.balance | rpamount }}")
| {{line.balance | rpamount:{rel_precision: 0} }}
td.trust
//{{line.limit_peer | rpamount}} --- {{line.balance | rpamount:{signed: true} }} --- {{line.limit | rpamount}}
rp-trust-line(rp-line-data='line')
td.action
a(ng-click="edit_line()") edit
Expand Down
52 changes: 1 addition & 51 deletions src/js/directives/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.directive('rpMasterKey', function () {
* will succeed.
*/
module.directive('rpDest', function () {
var emailRegex = /^\S+@\S+\.\S+$/;
var emailRegex = /^\S+@\S+\.[^\s.]+$/;
return {
restrict: 'A',
require: '?ngModel',
Expand Down Expand Up @@ -428,56 +428,6 @@ module.directive('rpStrongPassword', function () {
};
});

/**
* Maximum amount of money user can send
*/
module.directive('rpMaxAmount', function () {
return {
restrict: 'A',
require: '?ngModel',
link: function (scope, elm, attr, ctrl) {
if (!ctrl) return;

var validator = function(value) {
var input = Amount.from_human(+value);

var currency = attr.rpMaxAmountCurrency ? attr.rpMaxAmountCurrency.slice(0, 3).toUpperCase() : 'XRP';

// Check for XRP only
if (currency != 'XRP') {
ctrl.$setValidity('rpMaxAmount', true);
return value;
}

if (input.is_valid()
&& scope.account.max_spend
&& scope.account.max_spend.to_number() > 1
&& scope.account.max_spend.compareTo(input) >= 0) {
ctrl.$setValidity('rpMaxAmount', true);
return value;
} else {
ctrl.$setValidity('rpMaxAmount', false);
return value;
}
};

ctrl.$formatters.push(validator);
ctrl.$parsers.unshift(validator);

scope.$watch('account.max_spend', function () {
validator(ctrl.$viewValue);
}, true);

attr.$observe('rpMaxAmount', function() {
validator(ctrl.$viewValue);
});

attr.$observe('rpMaxAmountCurrency', function() {
validator(ctrl.$viewValue);
});
}
};
});

/**
* Amount validator
Expand Down
2 changes: 1 addition & 1 deletion src/js/entry/desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require('../directives/directives');
require('../directives/datalinks');
require('../filters/filters');
require('../services/id');
require('../services/blob');
require('../services/oldblob');
require('../services/network');
require('../services/books');
require('../services/transactions');
Expand Down
17 changes: 9 additions & 8 deletions src/js/services/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ var util = require('util'),

var module = angular.module('id', ['blob']);

module.factory('rpId', ['$rootScope', '$location', '$route', '$routeParams', 'rpBlob',
function($scope, $location, $route, $routeParams, $blob)
module.factory('rpId', ['$rootScope', '$location', '$route', '$routeParams', 'rpOldBlob',
function($scope, $location, $route, $routeParams, $oldblob)
{
/**
* Identity manager
Expand Down Expand Up @@ -102,7 +102,7 @@ module.factory('rpId', ['$rootScope', '$location', '$route', '$routeParams', 'rp
$scope.$broadcast('$blobUpdate');

if (self.username && self.password) {
$blob.set(self.blobBackends,
$oldblob.set(self.blobBackends,
self.username.toLowerCase(), self.password,
$scope.userBlob,function(){
$scope.$broadcast('$blobSave');
Expand Down Expand Up @@ -204,7 +204,7 @@ module.factory('rpId', ['$rootScope', '$location', '$route', '$routeParams', 'rp
};

// Add user to blob
$blob.set(self.blobBackends, username.toLowerCase(), password, data, function () {
$oldblob.set(self.blobBackends, username.toLowerCase(), password, data, function () {
$scope.userBlob = data;
self.setUsername(username);
self.setPassword(password);
Expand All @@ -224,7 +224,7 @@ module.factory('rpId', ['$rootScope', '$location', '$route', '$routeParams', 'rp
username = Id.normalizeUsername(username);
password = Id.normalizePassword(password);

$blob.get(self.blobBackends, username.toLowerCase(), password, function (err, data) {
$oldblob.get(self.blobBackends, username.toLowerCase(), password, function (err, data) {
if (!err && data) {
callback(null, true);
} else {
Expand All @@ -243,13 +243,13 @@ module.factory('rpId', ['$rootScope', '$location', '$route', '$routeParams', 'rp
username = Id.normalizeUsername(username);
password = Id.normalizePassword(password);

$blob.get(self.blobBackends, username.toLowerCase(), password, function (err, data) {
$oldblob.get(self.blobBackends, username.toLowerCase(), password, function (err, data) {
if (err) {
callback(err);
return;
}

var blob = $blob.decrypt(username.toLowerCase(), password, data);
var blob = $oldblob.decrypt(username.toLowerCase(), password, data);
if (!blob) {
// Unable to decrypt blob
var msg = 'Unable to decrypt blob (Username / Password is wrong)';
Expand Down Expand Up @@ -295,7 +295,8 @@ module.factory('rpId', ['$rootScope', '$location', '$route', '$routeParams', 'rp
// reload will not work, as some pages are also available for guests.
// Logout will show the same page instead of showing login page.
// This line redirects user to root (login) page
location.href = location.protocol + '//' + location.hostname + location.pathname;
var port = location.port.length > 0 ? ":" + location.port : "";
location.href = location.protocol + '//' + location.hostname + port + location.pathname;
};

/**
Expand Down
6 changes: 3 additions & 3 deletions src/js/services/blob.js → src/js/services/oldblob.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
* BLOB
* OLD BLOB
*
* The blob service manages the user's private information.
* The old blob service that used to manage the user's private information.
*/

var webutil = require("../util/web"),
log = require("../util/log");

var module = angular.module('blob', []);

module.factory('rpBlob', ['$rootScope', function ($scope)
module.factory('rpOldBlob', ['$rootScope', function ($scope)
{
var BlobObj = function ()
{
Expand Down
Loading

0 comments on commit 83a6f72

Please sign in to comment.