1
0
Fork 0
forked from lthn/blockchain

Merge branch 'frontend'

This commit is contained in:
wildkif 2019-01-15 14:17:55 +02:00
commit ec8bc2be9d
13 changed files with 78 additions and 54 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -5497,8 +5497,8 @@ __webpack_require__.r(__webpack_exports__);
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! D:\zano\src\polyfills.ts */"./src/polyfills.ts");
module.exports = __webpack_require__(/*! D:\zano\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
__webpack_require__(/*! D:\zano_zano\src\gui\qt-daemon\html_source\src\polyfills.ts */"./src/polyfills.ts");
module.exports = __webpack_require__(/*! D:\zano_zano\src\gui\qt-daemon\html_source\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
/***/ })

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -89046,7 +89046,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return Inputmask;
});
/***/ }),
/***/ "./node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js":
@ -89609,7 +89608,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return Inputmask;
});
/***/ }),
/***/ "./node_modules/inputmask/index.js":

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,6 @@
import {Directive, ElementRef, Input} from '@angular/core';
import * as Inputmask from 'inputmask';
import {VariablesService} from '../../services/variables.service';
@Directive({
selector: '[appInputValidate]'
@ -16,15 +17,15 @@ export class InputValidateDirective {
// point25: '^\-?[0-9]*(?:\\.25|\\.50|\\.75|)$',
money: {
alias: 'decimal',
digits: 8,
max: 999999999999,
digits: this.variablesService.digits,
max: 99999999.999999999999,
rightAlign: false,
allowMinus: false,
onBeforeMask: (value) => value
}
};
constructor(private el: ElementRef) {
constructor(private el: ElementRef, private variablesService: VariablesService) {
}
@Input('appInputValidate')

View file

@ -1,16 +1,19 @@
import {Pipe, PipeTransform} from '@angular/core';
import {VariablesService} from '../services/variables.service';
@Pipe({
name: 'intToMoney'
})
export class IntToMoneyPipe implements PipeTransform {
constructor(private variablesService: VariablesService) {}
transform(value: any, args?: any): any {
if (value === 0 || value === undefined) {
return '0';
}
const power = Math.pow(10, 8);
let str = (value / power).toFixed(8);
const power = Math.pow(10, this.variablesService.digits);
let str = (value / power).toFixed(this.variablesService.digits);
for (let i = str.length - 1; i >= 0; i--) {
if (str[i] !== '0') {
str = str.substr(0, i + 1);

View file

@ -1,12 +1,15 @@
import {Pipe, PipeTransform} from '@angular/core';
import {VariablesService} from '../services/variables.service';
@Pipe({
name: 'moneyToInt'
})
export class MoneyToIntPipe implements PipeTransform {
constructor(private variablesService: VariablesService) {}
transform(value: any, args?: any): any {
const CURRENCY_DISPLAY_DECIMAL_POINT = 8;
const CURRENCY_DISPLAY_DECIMAL_POINT = this.variablesService.digits;
let result;
if (value) {
let am_str = value.toString().trim();

View file

@ -10,6 +10,7 @@ import {ContextMenuComponent, ContextMenuService} from 'ngx-contextmenu';
})
export class VariablesService {
public digits = 12;
public appPass = '';
public moneyEquivalent = 0;
public defaultTheme = 'dark';

View file

@ -38,7 +38,7 @@
<div class="input-block">
<label for="purchase-amount">{{ 'PURCHASE.AMOUNT' | translate }}</label>
<input type="text" id="purchase-amount" formControlName="amount" appInputValidate="money" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
<input type="text" id="purchase-amount" formControlName="amount" appInputValidate="money" maxlength="20" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
</div>
<div class="error-block" *ngIf="purchaseForm.controls['amount'].invalid && (purchaseForm.controls['amount'].dirty || purchaseForm.controls['amount'].touched)">
<div *ngIf="purchaseForm.controls['amount'].errors['required']">
@ -50,7 +50,7 @@
<div class="input-blocks-row">
<div class="input-block">
<label for="purchase-your-deposit">{{ 'PURCHASE.YOUR_DEPOSIT' | translate }}</label>
<input type="text" id="purchase-your-deposit" formControlName="yourDeposit" appInputValidate="money" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
<input type="text" id="purchase-your-deposit" formControlName="yourDeposit" appInputValidate="money" maxlength="20" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
</div>
<div class="error-block" *ngIf="purchaseForm.controls['yourDeposit'].invalid && (purchaseForm.controls['yourDeposit'].dirty || purchaseForm.controls['yourDeposit'].touched)">
<div *ngIf="purchaseForm.controls['yourDeposit'].errors['required']">
@ -67,7 +67,7 @@
</div>
</div>
<input type="text" readonly *ngIf="purchaseForm.controls['sameAmount'].value" [value]="purchaseForm.controls['amount'].value">
<input type="text" id="purchase-seller-deposit" *ngIf="!purchaseForm.controls['sameAmount'].value" formControlName="sellerDeposit" appInputValidate="money" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
<input type="text" id="purchase-seller-deposit" *ngIf="!purchaseForm.controls['sameAmount'].value" formControlName="sellerDeposit" appInputValidate="money" maxlength="20" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
</div>
<div class="error-block" *ngIf="purchaseForm.controls['sellerDeposit'].invalid && (purchaseForm.controls['sellerDeposit'].dirty || purchaseForm.controls['sellerDeposit'].touched)">
<div *ngIf="purchaseForm.controls['sellerDeposit'].errors['required']">

View file

@ -17,7 +17,7 @@
<div class="input-blocks-row">
<div class="input-block">
<label for="send-amount">{{ 'SEND.AMOUNT' | translate }}</label>
<input type="text" id="send-amount" formControlName="amount" appInputValidate="money" maxlength="21" (contextmenu)="variablesService.onContextMenu($event)">
<input type="text" id="send-amount" formControlName="amount" appInputValidate="money" maxlength="20" (contextmenu)="variablesService.onContextMenu($event)">
</div>
<div class="error-block" *ngIf="sendForm.controls['amount'].invalid && (sendForm.controls['amount'].dirty || sendForm.controls['amount'].touched)">