+ basic address book support

+ notify of new transactions
+ refresh transactions
! fixed a lot of transactions bugs
This commit is contained in:
Taegus
2018-12-26 10:12:42 +01:00
parent 655cd441b7
commit 3315677ede
13 changed files with 382 additions and 46 deletions

View File

@@ -4,10 +4,10 @@
*
* To rebuild or modify this file with the latest versions of the included
* software please visit:
* https://datatables.net/download/#dt/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.18/b-1.5.4/b-html5-1.5.4/fc-3.2.5/fh-3.1.4/r-2.2.2/sc-1.5.0/sl-1.2.6
* https://datatables.net/download/#dt/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.18/b-1.5.4/b-colvis-1.5.4/b-html5-1.5.4/fc-3.2.5/fh-3.1.4/r-2.2.2/sc-1.5.0/sl-1.2.6
*
* Included libraries:
* JSZip 2.5.0, pdfmake 0.1.36, DataTables 1.10.18, Buttons 1.5.4, HTML5 export 1.5.4, FixedColumns 3.2.5, FixedHeader 3.1.4, Responsive 2.2.2, Scroller 1.5.0, Select 1.2.6
* JSZip 2.5.0, pdfmake 0.1.36, DataTables 1.10.18, Buttons 1.5.4, Column visibility 1.5.4, HTML5 export 1.5.4, FixedColumns 3.2.5, FixedHeader 3.1.4, Responsive 2.2.2, Scroller 1.5.0, Select 1.2.6
*/
/*!
@@ -187,7 +187,7 @@ Z(n.defaults.column);n.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender
aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",
iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:
this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};n.ext=x={buttons:{},
classes:{},build:"dt/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.18/b-1.5.4/b-html5-1.5.4/fc-3.2.5/fh-3.1.4/r-2.2.2/sc-1.5.0/sl-1.2.6",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:n.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:n.version};h.extend(x,{afnFiltering:x.search,aTypes:x.type.detect,ofnSearch:x.type.search,oSort:x.type.order,afnSortData:x.order,aoFeatures:x.feature,oApi:x.internal,oStdClasses:x.classes,oPagination:x.pager});
classes:{},build:"dt/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.18/b-1.5.4/b-colvis-1.5.4/b-html5-1.5.4/fc-3.2.5/fh-3.1.4/r-2.2.2/sc-1.5.0/sl-1.2.6",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:n.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:n.version};h.extend(x,{afnFiltering:x.search,aTypes:x.type.detect,ofnSearch:x.type.search,oSort:x.type.order,afnSortData:x.order,aoFeatures:x.feature,oApi:x.internal,oStdClasses:x.classes,oPagination:x.pager});
h.extend(n.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",
sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
sJUIHeader:"",sJUIFooter:""});var Kb=n.ext.pager;h.extend(Kb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ia(a,b)]},simple_numbers:function(a,b){return["previous",ia(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ia(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",ia(a,b),"last"]},_numbers:ia,numbers_length:7});h.extend(!0,n.ext.renderer,{pageButton:{_:function(a,b,c,d,e,
@@ -251,6 +251,18 @@ a.rows(c.rows,d.extend({selected:!0},h)).any()&&d.extend(h,{selected:!0});h=a.ro
a.namespace&&(a=b.oInit.buttons||g.defaults.buttons)&&!b._buttons&&(new r(b,a)).container()});g.ext.feature.push({fnInit:function(a){a=new g.Api(a);var b=a.init().buttons||g.defaults.buttons;return(new r(a,b)).container()},cFeature:"B"});return r});
/*!
Column visibility buttons for Buttons and DataTables.
2016 SpryMedia Ltd - datatables.net/license
*/
(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(c){return f(c,window,document)}):"object"===typeof exports?module.exports=function(c,e){c||(c=window);e&&e.fn.dataTable||(e=require("datatables.net")(c,e).$);e.fn.dataTable.Buttons||require("datatables.net-buttons")(c,e);return f(e,c,c.document)}:f(jQuery,window,document)})(function(f,c,e,h){c=f.fn.dataTable;f.extend(c.ext.buttons,{colvis:function(b,a){return{extend:"collection",
text:function(a){return a.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",buttons:[{extend:"columnsToggle",columns:a.columns,columnText:a.columnText}]}},columnsToggle:function(b,a){return b.columns(a.columns).indexes().map(function(b){return{extend:"columnToggle",columns:b,columnText:a.columnText}}).toArray()},columnToggle:function(b,a){return{extend:"columnVisibility",columns:a.columns,columnText:a.columnText}},columnsVisibility:function(b,a){return b.columns(a.columns).indexes().map(function(b){return{extend:"columnVisibility",
columns:b,visibility:a.visibility,columnText:a.columnText}}).toArray()},columnVisibility:{columns:h,text:function(b,a,d){return d._columnText(b,d)},className:"buttons-columnVisibility",action:function(b,a,d,g){b=a.columns(g.columns);a=b.visible();b.visible(g.visibility!==h?g.visibility:!(a.length&&a[0]))},init:function(b,a,d){var g=this;a.attr("data-cv-idx",d.columns);b.on("column-visibility.dt"+d.namespace,function(a,c){c.bDestroying||c.nTable!=b.settings()[0].nTable||g.active(b.column(d.columns).visible())}).on("column-reorder.dt"+
d.namespace,function(c,g,e){1===b.columns(d.columns).count()&&(d.columns=f.inArray(d.columns,e.mapping),a.attr("data-cv-idx",d.columns),a.parent().children("[data-cv-idx]").sort(function(a,b){return 1*a.getAttribute("data-cv-idx")-1*b.getAttribute("data-cv-idx")}).appendTo(a.parent()))});this.active(b.column(d.columns).visible())},destroy:function(b,a,d){b.off("column-visibility.dt"+d.namespace).off("column-reorder.dt"+d.namespace)},_columnText:function(b,a){var d=b.column(a.columns).index(),c=b.settings()[0].aoColumns[d].sTitle.replace(/\n/g,
" ").replace(/<br\s*\/?>/gi," ").replace(/<select(.*?)<\/select>/g,"").replace(/<!\-\-.*?\-\->/g,"").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,"");return a.columnText?a.columnText(b,d,c):c}},colvisRestore:{className:"buttons-colvisRestore",text:function(b){return b.i18n("buttons.colvisRestore","Restore visibility")},init:function(b,a,d){d._visOriginal=b.columns().indexes().map(function(a){return b.column(a).visible()}).toArray()},action:function(b,a,d,c){a.columns().every(function(b){b=a.colReorder&&
a.colReorder.transpose?a.colReorder.transpose(b,"toOriginal"):b;this.visible(c._visOriginal[b])})}},colvisGroup:{className:"buttons-colvisGroup",action:function(b,a,d,c){a.columns(c.show).visible(!0,!1);a.columns(c.hide).visible(!1,!1);a.columns.adjust()},show:[],hide:[]}});return c.Buttons});
/*!
HTML5 export buttons for Buttons and DataTables.
2016 SpryMedia Ltd - datatables.net/license

File diff suppressed because one or more lines are too long

View File

@@ -103,24 +103,29 @@ body.pg-loaded > .inner {
margin-right: 10px;
}
.modalBodyPassword {
.modalBody {
margin: 20px;
}
#dlgGeneralError .modalBodyPassword {
#dlgGeneralError .modalBody {
height: 100px;
}
#dlgCreateWalletPassword .modalBodyPassword,
#dlgCreateWalletPassword .modalBodyPassword {
#dlgDeleteAddressConfirm .modalBody {
height: 100px;
}
#dlgCreateWalletPassword .modalBody,
#dlgCreateAddressAndName .modalBody {
height: 200px;
}
#dlgSendWalletPassword .modalBodyPassword {
#dlgSendWalletPassword .modalBody {
height: 300px;
}
#dlgChangeWalletName .modalBodyPassword {
#dlgChangeWalletName .modalBody,
#dlgChangeAddressName .modalBody {
height: 150px;
}
@@ -136,6 +141,12 @@ body.pg-loaded > .inner {
right: 20px;
}
.btn-dialog-cancel {
position: absolute;
bottom: 10px;
right: 80px;
}
.modalDialog {
display: none;
border-bottom: 3px solid #7A1336 !important;
@@ -312,11 +323,14 @@ div.sidebar svg {
margin: 10px;
}
#noWalletsPresent {
#noWalletsPresent,
#noAddressPresent {
font-size: 1.3em;
}
div.noWalletsWrapper {
div.noWalletsWrapper,
div.noAddressWrapper {
display: flex;
align-items: center;
justify-content: center;

View File

@@ -1,3 +1,54 @@
/*
* Table button styles
*/
.dt-button {
margin-left: 10px !important;
color: #ffffff !important;
background-color: #7A1336 !important;
border: 1px solid #450118 !important;
background-image: none !important;
}
.dt-button:hover,
.dt-button:focus,
.dt-button.active,
.open .dropdown-toggle.dt-button {
color: #ffffff !important;
background-color: #B01549 !important;
border: 1px solid #450118 !important;
background-image: none !important;
}
.dt-button.active,
.open .dropdown-toggle.dt-button.dt-button {
background-image: none !important;
}
.dt-button.disabled,
.dt-button[disabled],
fieldset[disabled] .dt-button,
.dt-button.disabled:hover,
.dt-button[disabled]:hover,
fieldset[disabled] .dt-button:hover,
.dt-button.disabled:focus,
.dt-button[disabled]:focus,
fieldset[disabled] .dt-button:focus,
.dt-button.disabled:active,
.dt-button[disabled]:active,
fieldset[disabled] .dt-button:active,
.dt-button.disabled.active,
.dt-button[disabled].active,
fieldset[disabled] .dt-button.active {
background-color: #7A1336 !important;
border-color: #450118 !important;
}
.dt-button .badge {
color: #7A1336 !important;
background-color: #ffffff !important;
}
/*
* Table styles
*/

View File

@@ -0,0 +1,67 @@
<div id="walletsToolbar">
<button type="button" class="btn btn-etho" id="btnNewAddress"><i class="fas fa-plus"></i></button>
</div>
<div id="addressList" class="{{#if addressData.length}}addressWrapper{{else}}noAddressWrapper{{/if}}">
{{#if addressData.length}}
<table class="bordered" id="addressTable">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Name</th>
<th scope="col">Address</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{{#addressData}}
<tr>
<th scope="row" class="colEdit"><button type="button" class="btn btn-etho btnChangAddressName" data-address="{{address}}" data-name="{{name}}">Edit</button></th>
<td>{{name}}</td>
<td><span class="textAddress">{{address}}</span></td>
<td><button type="button" class="btn btn-etho btnDeleteAddress" data-wallet="{{address}}"><i class="far fa-trash-alt"></i></button></td>
</tr>
{{/addressData}}
</tbody>
</table>
{{else}}
<div id="noAddressPresent">You don't have any addresses, create a new one</div>
{{/if}}
</div>
<div id="dlgCreateAddressAndName" class="modalDialog" data-iziModal-title="Create new address" data-iziModal-subtitle="Enter the name and the address" data-iziModal-icon="icon-home">
<div class="modalBody">
<div class="form-group">
<label for="addressName">Address Name:</label>
<input type="text" class="form-control" id="addressName">
</div>
<div class="form-group">
<label for="addressHash">Address Hash:</label>
<input type="text" class="form-control" id="addressHash">
</div>
<button type="button" class="btn btn-etho btn-dialog-confirm" id="btnCreateAddressConfirm">Confirm</button>
</div>
</div>
<!-- The modal to change address name -->
<div id="dlgChangeAddressName" class="modalDialog" data-iziModal-title="Address Name" data-iziModal-subtitle="Enter the name for this address" data-iziModal-icon="icon-home">
<div class="modalBody">
<div class="form-group">
<label for="usr">Type Name:</label>
<input type="text" class="form-control" id="inputAddressName">
</div>
<button type="button" class="btn btn-etho btn-dialog-confirm" id="btnChangeAddressNameConfirm">Confirm</button>
</div>
</div>
<!-- The modal for delete confirmation -->
<div id="dlgDeleteAddressConfirm" class="modalDialog" data-iziModal-title="Application Error" data-iziModal-subtitle="Something went wrong, don't kill the fish..." data-iziModal-icon="icon-home">
<div class="modalBody">
<div class="form-group">
<span>Do you really want to delete the address?</span>
</div>
<button type="button" class="btn btn-etho btn-dialog-cancel" id="btnDeleteAddressCancel">No</button>
<button type="button" class="btn btn-etho btn-dialog-confirm" id="btnDeleteAddressConfirm">Yes</button>
</div>
</div>

View File

@@ -60,7 +60,7 @@
<!-- The modal for wallet password -->
<div id="dlgSendWalletPassword" class="modalDialog" data-iziModal-title="Wallet Password" data-iziModal-subtitle="To send from this wallet, please enter the wallet password" data-iziModal-icon="icon-home">
<div class="modalBodyPassword">
<div class="modalBody">
<div class="form-group sendTXInfo">
<i class="fas fa-wallet"></i>
<label>From address:</label><label id="fromAddressInfo"></label>
@@ -88,7 +88,7 @@
<!-- The modal for address list -->
<div id="dlgAddressList" class="modalDialog" data-iziModal-title="AddressList" data-iziModal-subtitle="Please select an address from the list" data-iziModal-icon="icon-home">
<div class="modalBodyPassword" id="dlgAddressListBody">
<div class="modalBody" id="dlgAddressListBody">
</div>
</div>

View File

@@ -12,6 +12,7 @@
<th scope="col"></th>
<th scope="col">Name</th>
<th scope="col">Address</th>
<th scope="col"></th>
<th scope="col">Balance</th>
</tr>
</thead>
@@ -34,7 +35,7 @@
<!-- The modal for new wallet -->
<div id="dlgCreateWalletPassword" class="modalDialog" data-iziModal-title="Wallet Password" data-iziModal-subtitle="Make sure to write it down or remember it!!!" data-iziModal-icon="icon-home">
<div class="modalBodyPassword">
<div class="modalBody">
<div class="form-group">
<label for="usr">Type Password:</label>
<input type="password" class="form-control" id="walletPasswordFirst">
@@ -50,7 +51,7 @@
<!-- The modal to change wallet name -->
<div id="dlgChangeWalletName" class="modalDialog" data-iziModal-title="Wallet Name" data-iziModal-subtitle="Enter the name for this address" data-iziModal-icon="icon-home">
<div class="modalBodyPassword">
<div class="modalBody">
<div class="form-group">
<label for="usr">Type Name:</label>
<input type="text" class="form-control" id="inputWalletName">