From ae5ec0dc27fd299a376fd6d84a8be9e499c4ffdb Mon Sep 17 00:00:00 2001 From: Pander Date: Sun, 9 Feb 2025 15:53:38 +0100 Subject: [PATCH] improved spelling GitHub, upgraded URLs, enabled translation NL --- README.md | 8 ++++---- po/de_DE.po | 8 ++++---- po/es.po | 8 ++++---- po/fr_FR.po | 8 ++++---- po/ja.po | 8 ++++---- po/nl.po | 8 ++++---- po/pt_BR.po | 4 ++-- po/zh.po | 6 +++--- public/js/main.min.js | 2 +- public/src/js/controllers/footer.js | 3 +++ public/src/js/translations.js | 14 +++++++------- public/views/index.html | 2 +- 12 files changed, 41 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index c6eb77776..f3646910f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Insight UI -A Dash blockchain explorer web application service for [Dashcore Node](https://github.com/dashevo/dashcore-node) using [Insight API](https://github.com/dashevo/insight-api). +A Dash blockchain explorer web application service for [Dashcore Node](https://github.com/dashpay/dashcore-node) using [Insight API](https://github.com/dashpay/insight-api). ## Quick Start -Please see the guide at [https://bitcore.io/guides/full-node](https://bitcore.io/guides/full-node) for information about getting a block explorer running. This is only the front-end component of the block explorer, and is packaged together with all of the necessary components in [Dashcore](https://github.com/dashevo/dashcore). +Please see the guide at [https://bitcore.io/guides/full-node](https://bitcore.io/guides/full-node) for information about getting a block explorer running. This is only the front-end component of the block explorer, and is packaged together with all of the necessary components in [Dashcore](https://github.com/dashpay/dash). ## Getting Started @@ -70,11 +70,11 @@ compile***. ## Note -For more details about the [Insight API](https://github.com/dashevo/insight-api) configuration and end-points, go to [Insight API GitHub repository](https://github.com/dashevo/insight-api). +For more details about the [Insight API](https://github.com/dashpay/insight-api) configuration and end-points, go to [Insight API GitHub repository](https://github.com/dashpay/insight-api). ## Contribute -Contributions and suggestions are welcomed at the [Insight UI Dash GitHub repository](https://github.com/dashevo/insight-ui). +Contributions and suggestions are welcomed at the [Insight UI Dash GitHub repository](https://github.com/dashpay/insight-ui). ## License diff --git a/po/de_DE.po b/po/de_DE.po index 1289917dd..0051d0686 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -26,7 +26,7 @@ msgid "" "\"_blank\">open-source Dash blockchain explorer with complete REST " "and websocket APIs that can be used for writing web wallets and other apps " "that need more advanced blockchain queries than provided by dashd RPC. " -"Check out the source code." msgstr "" "insight ist ein Quellcode ist auf GitHub zu finden." #: public/views/index.html msgid "" "insight is still in development, so be sure to report any " "bugs and provide feedback for improvement at our github issue tracker." +"com/dashpay/insight/issues\" target=\"_blank\">GitHub issue tracker." msgstr "" "insight befindet sich aktuell noch in der Entwicklung. " "Bitte sende alle gefundenen Fehler (Bugs) und Feedback zur weiteren " -"Verbesserung an unseren GitHub Issue Tracker." #: public/views/index.html diff --git a/po/es.po b/po/es.po index b51093063..a5c16e7e1 100644 --- a/po/es.po +++ b/po/es.po @@ -26,7 +26,7 @@ msgid "" "\"_blank\">open-source Dash blockchain explorer with complete REST " "and websocket APIs that can be used for writing web wallets and other apps " "that need more advanced blockchain queries than provided by dashd RPC. " -"Check out the source code." msgstr "" "insight es un el repositorio abierto de GitHub." +"dashpay/insight-ui\" target=\"_blank\">el repositorio abierto de GitHub." #: public/views/index.html msgid "" "insight is still in development, so be sure to report any " "bugs and provide feedback for improvement at our github issue tracker." +"com/dashpay/insight/issues\" target=\"_blank\">GitHub issue tracker." msgstr "" "insight esta en desarrollo aún, por ello agradecemos que " "nos reporten errores o sugerencias para mejorar el software. GitHub issue " +"\"https://github.com/dashpay/insight-ui/issues\" target=\"_blank\">GitHub issue " "tracker." #: public/views/index.html diff --git a/po/fr_FR.po b/po/fr_FR.po index 43540a84e..a818d36e9 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -26,23 +26,23 @@ msgid "" "\">open-source Dash blockchain explorer with complete REST and websocket APIs " "that can be used for writing web wallets and other apps that need more advanced " "blockchain queries than provided by dashd RPC. Check out the source code." +"github.com/dashpay/insight-ui\" target=\"_blank\">source code." msgstr "" "insight est un explorateur open-source de blocs avec un ensemble complet d'API REST et " "websockets qui peuvent être utilisées pour écrire portefeuille et autres " "applications nécéssitant des requêtes plus complète que celles proposés par les " -"commandes RPC de dashd. Consultez le code source sur GitHub." #: public/views/index.html msgid "" "insight is still in development, so be sure to report any bugs and " "provide feedback for improvement at our github issue tracker." +"issues\" target=\"_blank\">GitHub issue tracker." msgstr "" "insight est toujours en développement, hésitez pas à remonter tout " -"bugs et proposer des améliorations sur notre GitHub issue tracker." #: public/views/index.html diff --git a/po/ja.po b/po/ja.po index 4763f084c..35ad0b2ef 100644 --- a/po/ja.po +++ b/po/ja.po @@ -25,24 +25,24 @@ msgid "" "\"_blank\">open-source Dash blockchain explorer with complete REST " "and websocket APIs that can be used for writing web wallets and other apps " "that need more advanced blockchain queries than provided by dashd RPC. " -"Check out the source code." msgstr "" "insightは、dashd RPCの提供するものよりも詳細なブロック" "チェインへの問い合わせを必要とするウェブウォレットやその他のアプリを書くのに" "使える、完全なRESTおよびwebsocket APIを備えたオープンソースのビットコインブロックエクスプローラです。ソース" +"a>です。ソース" "コードを確認" #: public/views/index.html msgid "" "insight is still in development, so be sure to report any " "bugs and provide feedback for improvement at our github issue tracker." +"com/dashpay/insight/issues\" target=\"_blank\">GitHub issue tracker." msgstr "" "insightは現在開発中です。githubのissueトラッカにてバグの" +"dashpay/insight-ui/issues\" target=\"_blank\">GitHubのissueトラッカにてバグの" "報告や改善案の提案をお願いします。" #: public/views/index.html diff --git a/po/nl.po b/po/nl.po index 62dde4ec9..9651b98a0 100644 --- a/po/nl.po +++ b/po/nl.po @@ -26,7 +26,7 @@ msgid "" "\"_blank\">open-source Dash blockchain explorer with complete REST " "and websocket APIs that can be used for writing web wallets and other apps " "that need more advanced blockchain queries than provided by dashd RPC. " -"Check out the source code." msgstr "" "insight is een broncode is op GitHub te vinden." #: public/views/index.html msgid "" "insight is still in development, so be sure to report any " "bugs and provide feedback for improvement at our github issue tracker." +"com/dashpay/insight/issues\" target=\"_blank\">GitHub issue tracker." msgstr "" "insight is nog steeds in ontwikkeling. Dus rapporteer " "fouten (bugs) en geef terugkoppeling voor verbeteringen via onze " -"issuetracker op GitHub." #: public/views/index.html diff --git a/po/pt_BR.po b/po/pt_BR.po index 56ee24dff..fe192f228 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -29,7 +29,7 @@ msgstr "" "\">explorador de blocos Bitcoin de código aberto com um conjunto " "completo de APIs de websocket e REST que podem ser usadas para programar " "carteiras online e outros aplicativos que necessitam consultar um explorador " -"de blocos. Confira o código-fonte." #: public/views/index.html @@ -40,7 +40,7 @@ msgid "" msgstr "" "insight ainda está em desenvolvimento, portanto agradecemos " "que postem erros e sugestões para melhorias em nosso rastreador de " +"github.com/dashpay/insight-ui/issues\" target=\"_blank\">rastreador de " "problemas no GitHub." #: public/views/404.html diff --git a/po/zh.po b/po/zh.po index b414fa4c3..e723a0905 100644 --- a/po/zh.po +++ b/po/zh.po @@ -31,15 +31,15 @@ msgstr "" "insight是一个开源的比特币区块链浏览器。支持完整的REST和Web Socket API 调用,可用于编" "写Web钱包和其他需要比bitcoind RPC提供的更高级区块链查询的应用程序。查看源代码" -"" +"" #: public/views/index.html msgid "" "insight is still in development, so be sure to report any " "bugs and provide feedback for improvement at our github issue tracker." +"bitpay/insight/issues\" target=\"_blank\">GitHub issue tracker." msgstr "" -"该系统仍在开发中该系统仍在开发中详情发现问题或提供反馈请报告给我们的开发人员" #: public/views/index.html diff --git a/public/js/main.min.js b/public/js/main.min.js index d476c1eaf..5983f550a 100644 --- a/public/js/main.min.js +++ b/public/js/main.min.js @@ -1,2 +1,2 @@ /*! @dashevo/insight-ui 4.0.10 */ -var defaultLanguage=localStorage.getItem("insight-language")||"en",defaultCurrency=localStorage.getItem("insight-currency")||"DASH",TRANSACTION_DISPLAYED=(angular.module("insight",["ngAnimate","ngResource","ngRoute","ngProgress","ui.bootstrap","ui.route","monospaced.qrcode","gettext","angularMoment","insight.system","insight.socket","insight.hash","insight.blocks","insight.transactions","insight.address","insight.search","insight.status","insight.connection","insight.currency","insight.messages"]),angular.module("insight.system",[]),angular.module("insight.socket",[]),angular.module("insight.hash",[]),angular.module("insight.blocks",[]),angular.module("insight.transactions",[]),angular.module("insight.address",[]),angular.module("insight.search",[]),angular.module("insight.status",[]),angular.module("insight.connection",[]),angular.module("insight.currency",[]),angular.module("insight.messages",[]),angular.module("insight.address").controller("AddressController",function($scope,$rootScope,$routeParams,$location,Global,Address,getSocket){$scope.global=Global;function _startSocket(){socket.on("dashd/addresstxid",function(data){data.address===addrStr&&($rootScope.$broadcast("tx",data.txid),data=document.querySelector("base"),new Audio(data.href+"/sound/transaction.mp3").play())}),socket.emit("subscribe","dashd/addresstxid",[addrStr])}var socket=getSocket($scope),addrStr=$routeParams.addrStr;socket.on("connect",function(){_startSocket()}),$scope.$on("$destroy",function(){socket.emit("unsubscribe","dashd/addresstxid",[addrStr])}),$scope.params=$routeParams,$scope.findOne=function(){$rootScope.currentAddr=$routeParams.addrStr,_startSocket(),Address.get({addrStr:$routeParams.addrStr},function(address){$rootScope.titleDetail=address.addrStr.substring(0,7)+"...",$rootScope.flashMessage=null,$scope.address=address},function(e){400===e.status?$rootScope.flashMessage="Invalid Address: "+$routeParams.addrStr:503===e.status?$rootScope.flashMessage="Backend Error. "+e.data:$rootScope.flashMessage="Address Not Found",$location.path("/")})}}),angular.module("insight.blocks").controller("BlocksController",function($scope,$rootScope,$routeParams,$location,Global,Block,Blocks,BlockByHeight){$scope.global=Global,$scope.loading=!1,$routeParams.blockHeight&&BlockByHeight.get({blockHeight:$routeParams.blockHeight},function(hash){$location.path("/block/"+hash.blockHash)},function(){$rootScope.flashMessage="Bad Request",$location.path("/")});function toUTCDate(date){return new Date(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds())}$scope.toUTCDate=toUTCDate,$scope.millisToUTCDate=function(millis){return toUTCDate(new Date(1e3*millis))};$scope.$watch("dt",function(newValue,oldValue){var mm;newValue!==oldValue&&$location.path("/blocks-date/"+(newValue=(oldValue=newValue).getUTCFullYear().toString(),mm=(oldValue.getUTCMonth()+1).toString(),oldValue=oldValue.getUTCDate().toString(),newValue)+"-"+(mm[1]?mm:"0"+mm[0])+"-"+(oldValue[1]?oldValue:"0"+oldValue[0]))}),$scope.openCalendar=function($event){$scope.opened=!0,setTimeout(function(){angular.element(document.querySelector(".uib-datepicker-popup"))[0].style.display="block"},100)},$scope.humanSince=function(time){var time=moment.unix(time).startOf("day"),b=moment().startOf("day");return time.max().from(b)},$scope.list=function(){var d,m;$scope.loading=!0,$routeParams.blockDate&&($scope.detail="On "+$routeParams.blockDate),$routeParams.startTimestamp&&((m=(d=new Date(1e3*$routeParams.startTimestamp)).getMinutes())<10&&(m="0"+m),$scope.before=" before "+d.getHours()+":"+m),$rootScope.titleDetail=$scope.detail,Blocks.get({blockDate:$routeParams.blockDate,startTimestamp:$routeParams.startTimestamp},function(res){for(var key in $scope.loading=!1,$scope.blocks=res.blocks,$scope.pagination=res.pagination,$scope.pagination.olderBlocks=$scope.pagination.moreTs,$scope.blocks)$scope.blocks[key].time<$scope.pagination.olderBlocks&&($scope.pagination.olderBlocks=$scope.blocks[key].time)})},$scope.findOne=function(){$scope.loading=!0,Block.get({blockHash:$routeParams.blockHash},function(block){$rootScope.titleDetail=block.height,$rootScope.flashMessage=null,$scope.loading=!1,$scope.block=block},function(e){400===e.status?$rootScope.flashMessage="Invalid Transaction ID: "+$routeParams.txId:503===e.status?$rootScope.flashMessage="Backend Error. "+e.data:$rootScope.flashMessage="Block Not Found",$location.path("/")})},$scope.params=$routeParams}),angular.module("insight.connection").controller("ConnectionController",function($scope,$window,Status,getSocket,PeerSync){$scope.apiOnline=!0,$scope.serverOnline=!0,$scope.clienteOnline=!0;var socket=getSocket($scope);socket.on("connect",function(){$scope.serverOnline=!0,socket.on("disconnect",function(){$scope.serverOnline=!1})}),$scope.getConnStatus=function(){PeerSync.get({},function(peer){$scope.apiOnline=peer.connected,$scope.host=peer.host,$scope.port=peer.port},function(){$scope.apiOnline=!1})},socket.emit("subscribe","sync"),socket.on("status",function(sync){$scope.sync=sync,$scope.apiOnline="aborted"!==sync.status&&"error"!==sync.status}),$window.addEventListener("offline",function(){$scope.$apply(function(){$scope.clienteOnline=!1})},!0),$window.addEventListener("online",function(){$scope.$apply(function(){$scope.clienteOnline=!0})},!0)}),angular.module("insight.currency",["ui.router","ui.bootstrap"]).controller("CurrencyController",function($scope,$rootScope,Currency){$rootScope.currency.symbol=defaultCurrency;function _roundFloat(x,n){return parseInt(n,10)&&parseFloat(x)||(n=0),Math.round(x*Math.pow(10,n))/Math.pow(10,n)}$rootScope.currency.getConvertion=function(value){return value=+value,isNaN(value)||null==value?"value error":0===value?"0 "+this.symbol:(value=(value="USD"===this.symbol?_roundFloat(value*this.factor,2):"mDASH"===this.symbol?(this.factor=1e3,_roundFloat(value*this.factor,5)):"uDASH"===this.symbol?(this.factor=1e6,_roundFloat(value*this.factor,2)):(this.factor=1,value))<1e-7?value.toFixed(8):value)+" "+this.symbol},$scope.setCurrency=function(currency){$rootScope.currency.symbol=currency,localStorage.setItem("insight-currency",currency),"USD"===currency?Currency.get({},function(res){$rootScope.currency.factor=$rootScope.currency.bitstamp=res.data.bitstamp}):$rootScope.currency.factor="mDASH"===currency?1e3:"uDASH"===currency?1e6:1},Currency.get({},function(res){$rootScope.currency.factor=$rootScope.currency.bitstamp=res.data.bitstamp})}),angular.module("insight.system").controller("FooterController",function($scope,$route,$templateCache,gettextCatalog,amMoment,Version){$scope.defaultLanguage=defaultLanguage;$scope.version=void Version.get({},function(res){$scope.version=res.version}),$scope.availableLanguages=[{name:"Deutsch",isoCode:"de_DE"},{name:"English",isoCode:"en"},{name:"French",isoCode:"fr_FR"},{name:"Spanish",isoCode:"es"},{name:"Portuguese",isoCode:"pt_BR"},{name:"Japanese",isoCode:"ja"},{name:"Chinese",isoCode:"zh"}],$scope.setLanguage=function(isoCode){gettextCatalog.currentLanguage=$scope.defaultLanguage=defaultLanguage=isoCode,amMoment.changeLocale(isoCode),localStorage.setItem("insight-language",isoCode);isoCode=$route.current.templateUrl;$templateCache.remove(isoCode),$route.reload()}}),angular.module("insight.system").controller("HeaderController",function($scope,$rootScope,$uibModal,getSocket,Global,Block,Status){$scope.global=Global,$rootScope.network="testnet",Status.get({},function(status){$rootScope.network=status.info&&status.info.network||"testnet"}),$rootScope.currency={factor:1,bitstamp:0,symbol:"DASH"},$scope.menu=[{title:"Blocks",link:"blocks"},{title:"Status",link:"status"}],$scope.openScannerModal=function(){$uibModal.open({templateUrl:"scannerModal.html",controller:"ScannerController"})};var socket=getSocket($scope);socket.on("connect",function(){socket.emit("subscribe","inv"),socket.on("block",function(block){block=block.toString();Block.get({blockHash:block},function(res){$scope.totalBlocks=res.height})})}),$rootScope.isCollapsed=!0}),10),BLOCKS_DISPLAYED=5,ScopedSocket=(angular.module("insight.system").controller("IndexController",function($scope,Global,getSocket,Blocks){$scope.global=Global;function _getBlocks(){Blocks.get({limit:BLOCKS_DISPLAYED},function(res){$scope.blocks=res.blocks,$scope.blocksLength=res.length})}function _startSocket(){socket.emit("subscribe","inv"),socket.on("tx",function(tx){$scope.txs.unshift(tx),parseInt($scope.txs.length,10)>=parseInt(TRANSACTION_DISPLAYED,10)&&($scope.txs=$scope.txs.splice(0,TRANSACTION_DISPLAYED))}),socket.on("block",function(){_getBlocks()})}var socket=getSocket($scope);socket.on("connect",function(){_startSocket()}),$scope.humanSince=function(time){return moment.unix(time).max().fromNow()},$scope.index=function(){_getBlocks(),_startSocket()},$scope.txs=[],$scope.blocks=[]}),angular.module("insight.messages").controller("VerifyMessageController",function($scope,$http){$scope.message={address:"",signature:"",message:""},$scope.verification={status:"unverified",result:null,error:null,address:""},$scope.verifiable=function(){return $scope.message.address&&$scope.message.signature&&$scope.message.message},$scope.verify=function(){$scope.verification.status="loading",$scope.verification.address=$scope.message.address;$http.post(window.apiPrefix+"/messages/verify",$scope.message).then(function(data){"boolean"==typeof data.data.result?data.data.result?($scope.verification.status="verified",$scope.verification.result=data.data.result):($scope.verification.status="verified",$scope.verification.result=!1):($scope.verification.status="error",$scope.verification.error=null)}).catch(function(data){console.log("c",data)})};function unverify(){$scope.verification.status="unverified"}$scope.$watch("message.address",unverify),$scope.$watch("message.signature",unverify),$scope.$watch("message.message",unverify)}),angular.module("insight.system").controller("ScannerController",function($scope,$rootScope,$uibModalInstance,Global){$scope.global=Global;function _scan(evt){if($scope.isMobile){$scope.scannerLoading=!0;var file,evt=evt.target.files;1===evt.length&&0===evt[0].type.indexOf("image/")&&(file=evt[0],(evt=new FileReader).onload=function(e){new MegaPixImage(file).render(canvas,{maxWidth:200,maxHeight:200,orientation:6}),setTimeout(function(){qrcode.width=canvas.width,qrcode.height=canvas.height,qrcode.imagedata=context.getImageData(0,0,qrcode.width,qrcode.height);try{qrcode.decode()}catch(e){alert(e)}},1500)},evt.readAsDataURL(file))}else{if(localMediaStream){context.drawImage(video,0,0,300,225);try{qrcode.decode()}catch(e){}}setTimeout(_scan,500)}}function _successCallback(stream){video.src=window.URL&&window.URL.createObjectURL(stream)||stream,localMediaStream=stream,video.play(),setTimeout(_scan,1e3)}function _scanStop(){$scope.scannerLoading=!1,$uibModalInstance.close(),$scope.isMobile||(localMediaStream.stop&&localMediaStream.stop(),localMediaStream=null,video.src="")}function _videoError(err){console.log("Video Error: "+JSON.stringify(err)),_scanStop()}var video,canvas,context,localMediaStream,isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}},$searchInput=(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,$scope.isMobile=isMobile.any(),$scope.scannerLoading=!1,angular.element(document.getElementById("search")));qrcode.callback=function(data){_scanStop();data=0===data.indexOf("dash:")?data.substring(8):data;console.log("QR code detected: "+data),$searchInput.val(data).triggerHandler("change").triggerHandler("submit")},$scope.cancel=function(){_scanStop()},$uibModalInstance.opened.then(function(){$rootScope.isCollapsed=!0,setTimeout(function(){canvas=document.getElementById("qr-canvas"),context=canvas.getContext("2d"),$scope.isMobile?document.getElementById("qrcode-camera").addEventListener("change",_scan,!1):(video=document.getElementById("qrcode-scanner-video"),angular.element(video),canvas.width=300,canvas.height=225,context.clearRect(0,0,300,225),navigator.getUserMedia({video:!0},_successCallback,_videoError))},500)})}),angular.module("insight.search").controller("SearchController",function($scope,$rootScope,$routeParams,$location,$timeout,Global,Block,Transaction,Address,BlockHashValidator,TransactionHashValidator,AddressValidator,BlockByHeight){$scope.global=Global,$scope.loading=!1;function _resetSearch(){$scope.q="",$scope.loading=!1}var currentNetwork=$rootScope.network;$scope.search=function(){function fetchAndRedirectTransactionSearch(){return Transaction.get({txId:q},function(){_resetSearch(),$location.path("/tx/"+q)},badQueryLoadHandler)}var q=$scope.q,isBlockHeight=($scope.badQuery=!1,$scope.loading=!0,isFinite(q)),isBlockHash=BlockHashValidator.test(q,currentNetwork),isTransactionHash=TransactionHashValidator.test(q),isAddress=AddressValidator.test(q),badQueryLoadHandler=function(){$scope.loading=!1,$scope.badQuery=!0,$timeout(function(){$scope.badQuery=!1},2e3)};isBlockHeight?BlockByHeight.get({blockHeight:q},function(hash){_resetSearch(),$location.path("/block/"+hash.blockHash)},badQueryLoadHandler):isAddress?Address.get({addrStr:q},function(){_resetSearch(),$location.path("address/"+q)},badQueryLoadHandler):isBlockHash?Block.get({blockHash:q},function(res){if(404===res.status)return fetchAndRedirectTransactionSearch();_resetSearch(),$location.path("/block/"+q)},badQueryLoadHandler):(isTransactionHash?fetchAndRedirectTransactionSearch:badQueryLoadHandler)()}}),angular.module("insight.status").controller("StatusController",function($scope,$routeParams,$location,Global,Status,Sync,getSocket){$scope.global=Global,$scope.getStatus=function(q){Status.get({q:"get"+q},function(d){$scope.loaded=1,angular.extend($scope,d)},function(e){$scope.error="API ERROR: "+e.data})},$scope.humanSince=function(time){return moment.unix(time/1e3).max().fromNow()};function _onSyncUpdate(sync){$scope.sync=sync}function _startSocket(){socket.emit("subscribe","sync"),socket.on("status",function(sync){_onSyncUpdate(sync)})}var socket=getSocket($scope);socket.on("connect",function(){_startSocket()}),$scope.getSync=function(){_startSocket(),Sync.get({},function(sync){_onSyncUpdate(sync)},function(e){e="Could not get sync information"+e.toString();$scope.sync={error:e}})}}),angular.module("insight.transactions").controller("transactionsController",function($scope,$rootScope,$routeParams,$location,Global,Transaction,TransactionsByBlock,TransactionsByAddress){$scope.global=Global,$scope.loading=!1,$scope.loadedBy=null;function _paginate(data){$scope.loading=!1,pagesTotal=data.pagesTotal,pageNum+=1,data.txs.forEach(function(tx){_processTX(tx),$scope.txs.push(tx)})}function _findTx(txid){Transaction.get({txId:txid},function(tx){tx.txid&&($rootScope.titleDetail=tx.txid.substring(0,7)+"..."),$rootScope.flashMessage=null,$scope.tx=tx,_processTX(tx),$scope.txs.unshift(tx)},function(e){400===e.status?$rootScope.flashMessage="Invalid Transaction ID: "+$routeParams.txId:503===e.status?$rootScope.flashMessage="Backend Error. "+e.data:$rootScope.flashMessage="Transaction Not Found",$location.path("/")})}var pageNum=0,pagesTotal=1,_aggregateItems=function(items){if(!items)return[];for(var l=items.length,ret=[],tmp={},u=0,i=0;i"!=$routeParams.v_type&&"<"!=$routeParams.v_type||($scope.from_vin="<"==$routeParams.v_type,$scope.from_vout=">"==$routeParams.v_type,$scope.v_index=parseInt($routeParams.v_index),$scope.itemsExpanded=!0),$scope.txs=[],$scope.$on("tx",function(event,txid){_findTx(txid)})}),angular.module("insight.transactions").controller("SendRawTransactionController",function($scope,$http){$scope.transaction="",$scope.status="ready",$scope.txid="",$scope.error=null,$scope.formValid=function(){return!!$scope.transaction},$scope.send=function(){var postData={rawtx:$scope.transaction};$scope.status="loading",$http.post(window.apiPrefix+"/tx/send",postData).then(function(response){response=response.data;"string"!=typeof response.txid?($scope.status="error",$scope.error="The transaction was sent but no transaction id was got back"):($scope.status="sent",$scope.txid=response.txid)}).catch(function(response){response=response.data;$scope.status="error",$scope.error=response||"No error message given (connection error?)"})}}),angular.module("insight.address").factory("Address",function($resource){return $resource(window.apiPrefix+"/addr/:addrStr/?noTxList=1",{addrStr:"@addStr"},{get:{method:"GET",interceptor:{response:function(res){return res.data},responseError:function(res){if(404===res.status)return res}}}})}).factory("AddressValidator",function(){return{test:function(addressStr){return/^[Xy789][1-9A-Za-z][^OIl]{20,40}/.test(addressStr)}}}),angular.module("insight.blocks").factory("Block",function($resource){return $resource(window.apiPrefix+"/block/:blockHash",{blockHash:"@blockHash"},{get:{method:"GET",interceptor:{response:function(res){return res.data},responseError:function(res){if(404===res.status)return res}}}})}).factory("Blocks",function($resource){return $resource(window.apiPrefix+"/blocks")}).factory("BlockHashValidator",function(HashValidator){return{test:function(blockHashStr,network){return HashValidator.test64(blockHashStr)||HashValidator.test66(blockHashStr)&&blockHashStr.startsWith("0x")}}}).factory("BlockByHeight",function($resource){return $resource(window.apiPrefix+"/block-index/:blockHeight")}),angular.module("insight.currency").factory("Currency",function($resource){return $resource(window.apiPrefix+"/currency")}),angular.module("insight.system").factory("Global",[function(){return{get:function(){return null}}}]).factory("Version",function($resource){return $resource(window.apiPrefix+"/version")}),angular.module("insight.hash").factory("HashValidator",function(){return{test64:function(hashStr){return"string"==typeof hashStr&&/^(0x)?[0-9a-f]{64}$/i.test(hashStr)},test66:function(hashStr){return"string"==typeof hashStr&&/^(0x)?[0-9a-f]{66}$/i.test(hashStr)}}}),function(socket,$rootScope){this.socket=socket,this.$rootScope=$rootScope,this.listeners=[]});ScopedSocket.prototype.removeAllListeners=function(opts){opts=opts||{};for(var i=0;i