diff --git a/cordova/config.xml b/cordova/config.xml index 55502a2e3..d38127030 100644 --- a/cordova/config.xml +++ b/cordova/config.xml @@ -1,8 +1,8 @@ + version="2.6.0" + android-versionCode="1073" + ios-CFBundleVersion="2.6.0" xmlns:android="http://schemas.android.com/apk/res/android"> Byteball TN Byteball wallet for testnet. diff --git a/i18n/po/template.pot b/i18n/po/template.pot index 20890254d..1ccac42db 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -63,8 +63,8 @@ msgstr "" msgid "Add a new device" msgstr "" -#: public/views/modals/destination-address.html:106 -#: public/views/modals/destination-address.html:99 +#: public/views/modals/destination-address.html:100 +#: public/views/modals/destination-address.html:107 msgid "Add a new entry" msgstr "" @@ -85,7 +85,7 @@ msgid "Added" msgstr "" #: public/views/modals/customized-amount.html:32 -#: public/views/modals/destination-address.html:118 +#: public/views/modals/destination-address.html:119 #: public/views/paymentUri.html:15 msgid "Address" msgstr "" @@ -99,7 +99,7 @@ msgstr "" msgid "Addressbook" msgstr "" -#: public/views/preferences.html:59 +#: public/views/preferences.html:66 msgid "Advanced" msgstr "" @@ -127,7 +127,7 @@ msgstr "" msgid "Already Paid" msgstr "" -#: src/js/controllers/correspondentDevice.js:1267 +#: src/js/controllers/correspondentDevice.js:1271 msgid "Already saved" msgstr "" @@ -239,7 +239,7 @@ msgstr "" msgid "Backups" msgstr "" -#: src/js/controllers/correspondentDevice.js:1252 +#: src/js/controllers/correspondentDevice.js:1256 msgid "Bad profile" msgstr "" @@ -285,7 +285,7 @@ msgstr "" msgid "Byteball — smart payments" msgstr "" -#: public/views/modals/destination-address.html:119 +#: public/views/modals/destination-address.html:120 msgid "Byteball address" msgstr "" @@ -298,7 +298,7 @@ msgstr "" msgid "CONTINUE" msgstr "" -#: public/views/modals/destination-address.html:127 +#: public/views/modals/destination-address.html:128 #: public/views/walletHome.html:494 #: src/js/controllers/copayers.js:9 #: src/js/controllers/preferencesDelete.js:10 @@ -315,7 +315,7 @@ msgstr "" msgid "Changing wallet alias only affects the local wallet name." msgstr "" -#: src/js/controllers/index.js:680 +#: src/js/controllers/index.js:681 msgid "Chat" msgstr "" @@ -335,7 +335,7 @@ msgstr "" msgid "Choose which fields to send:" msgstr "" -#: src/js/controllers/walletHome.js:491 +#: src/js/controllers/walletHome.js:494 msgid "Claim funds" msgstr "" @@ -412,11 +412,11 @@ msgid "Compress the file? (Slower)" msgstr "" #: src/js/controllers/copayers.js:10 -#: src/js/controllers/index.js:519 +#: src/js/controllers/index.js:520 #: src/js/controllers/preferencesDelete.js:11 #: src/js/controllers/walletHome.js:125 -#: src/js/controllers/walletHome.js:1742 -#: src/js/controllers/walletHome.js:1746 +#: src/js/controllers/walletHome.js:1759 +#: src/js/controllers/walletHome.js:1763 #: src/js/services/confirmDialog.js:10 msgid "Confirm" msgstr "" @@ -442,7 +442,7 @@ msgid "Contacts" msgstr "" #: src/js/controllers/inviteCorrespondentDevice.js:32 -#: src/js/controllers/walletHome.js:392 +#: src/js/controllers/walletHome.js:395 msgid "Copied to clipboard" msgstr "" @@ -454,7 +454,7 @@ msgstr "" msgid "Correspondents are not restored." msgstr "" -#: src/js/controllers/walletHome.js:700 +#: src/js/controllers/walletHome.js:705 msgid "Could not create payment proposal" msgstr "" @@ -488,11 +488,11 @@ msgstr "" msgid "Could not import. Check input file and password" msgstr "" -#: src/js/controllers/walletHome.js:700 +#: src/js/controllers/walletHome.js:705 msgid "Could not send payment" msgstr "" -#: src/js/controllers/correspondentDevice.js:1223 +#: src/js/controllers/correspondentDevice.js:1227 msgid "Country" msgstr "" @@ -506,13 +506,10 @@ msgstr "" #: public/views/add.html:15 #: public/views/create.html:175 +#: src/js/controllers/index.js:311 msgid "Create new wallet" msgstr "" -#: src/js/controllers/index.js:310 -msgid "Create new wallet together with ?" -msgstr "" - #: public/views/create.html:171 msgid "Create {{requiredCosigners}}-of-{{totalCosigners}} wallet" msgstr "" @@ -553,18 +550,14 @@ msgstr "" msgid "Date" msgstr "" -#: src/js/controllers/correspondentDevice.js:1222 +#: src/js/controllers/correspondentDevice.js:1226 msgid "Date of birth" msgstr "" -#: src/js/controllers/index.js:276 +#: src/js/controllers/index.js:277 msgid "Declined" msgstr "" -#: public/views/paperWallet.html:40 -msgid "Decrypting a paper wallet could take around 5 minutes on this device. please be patient and keep the app open." -msgstr "" - #: public/views/walletHome.html:194 msgid "Definition" msgstr "" @@ -585,7 +578,7 @@ msgstr "" msgid "Delete wallet" msgstr "" -#: src/js/controllers/walletHome.js:1739 +#: src/js/controllers/walletHome.js:1756 msgid "Deleting the textcoin will remove the ability to claim it back or resend" msgstr "" @@ -667,8 +660,8 @@ msgstr "" msgid "Export" msgstr "" -#: src/js/controllers/export.js:141 -#: src/js/controllers/export.js:166 +#: src/js/controllers/export.js:142 +#: src/js/controllers/export.js:167 msgid "Export completed successfully" msgstr "" @@ -696,7 +689,7 @@ msgstr "" msgid "Finality" msgstr "" -#: src/js/controllers/correspondentDevice.js:1220 +#: src/js/controllers/correspondentDevice.js:1224 msgid "First name" msgstr "" @@ -712,19 +705,11 @@ msgstr "" msgid "Full backup" msgstr "" -#: public/views/paperWallet.html:58 -msgid "Funds found" -msgstr "" - -#: public/views/paperWallet.html:74 -msgid "Funds will be transferred to" -msgstr "" - #: public/views/splash.html:92 msgid "GET STARTED" msgstr "" -#: src/js/controllers/walletHome.js:421 +#: src/js/controllers/walletHome.js:424 msgid "Generate QR Code" msgstr "" @@ -752,16 +737,20 @@ msgstr "" msgid "Hardware wallet" msgstr "" +#: public/views/preferences.html:59 +msgid "Hidden assets" +msgstr "" + #: public/views/backup.html:45 msgid "Hide the Wallet Seed" msgstr "" #: public/views/modals/share.html:43 -#: src/js/controllers/index.js:676 +#: src/js/controllers/index.js:677 msgid "History" msgstr "" -#: src/js/controllers/index.js:664 +#: src/js/controllers/index.js:665 msgid "Home" msgstr "" @@ -789,15 +778,19 @@ msgstr "" msgid "I receive another payment of" msgstr "" -#: src/js/controllers/correspondentDevice.js:1225 +#: public/views/modals/tx-details.html:102 +msgid "ID" +msgstr "" + +#: src/js/controllers/correspondentDevice.js:1229 msgid "ID number" msgstr "" -#: src/js/controllers/correspondentDevice.js:1227 +#: src/js/controllers/correspondentDevice.js:1231 msgid "ID subtype" msgstr "" -#: src/js/controllers/correspondentDevice.js:1226 +#: src/js/controllers/correspondentDevice.js:1230 msgid "ID type" msgstr "" @@ -860,7 +853,7 @@ msgstr "" msgid "Invalid" msgstr "" -#: src/js/controllers/index.js:1630 +#: src/js/controllers/index.js:1658 msgid "Invalid Touch ID" msgstr "" @@ -876,7 +869,7 @@ msgstr "" msgid "Keep only data relevant to you" msgstr "" -#: public/views/modals/destination-address.html:120 +#: public/views/modals/destination-address.html:121 msgid "Label" msgstr "" @@ -884,7 +877,7 @@ msgstr "" msgid "Language" msgstr "" -#: src/js/controllers/correspondentDevice.js:1221 +#: src/js/controllers/correspondentDevice.js:1225 msgid "Last name" msgstr "" @@ -943,7 +936,7 @@ msgstr "" msgid "My recording preference" msgstr "" -#: public/views/modals/destination-address.html:121 +#: public/views/modals/destination-address.html:122 msgid "Name of the contact" msgstr "" @@ -964,8 +957,8 @@ msgid "New witnesses" msgstr "" #: public/views/authConfirmation.html:22 -#: src/js/controllers/index.js:518 -#: src/js/controllers/walletHome.js:1754 +#: src/js/controllers/index.js:519 +#: src/js/controllers/walletHome.js:1771 msgid "No" msgstr "" @@ -987,7 +980,7 @@ msgstr "" #: public/views/modals/claim-textcoin.html:21 #: public/views/modals/customized-amount.html:51 -#: public/views/modals/destination-address.html:112 +#: public/views/modals/destination-address.html:113 #: public/views/walletHome.html:371 #: public/views/walletHome.html:408 #: public/views/walletHome.html:417 @@ -1003,12 +996,12 @@ msgstr "" msgid "Note" msgstr "" -#: src/js/controllers/export.js:88 +#: src/js/controllers/export.js:89 msgid "Now you have to send this file somewhere to restore from it later (\"Save to Files\", send to yourself using chat apps, etc.)" msgstr "" #: public/views/modals/offer-contract.html:33 -#: src/js/services/correspondentListService.js:113 +#: src/js/services/correspondentListService.js:117 msgid "Offer a contract" msgstr "" @@ -1044,11 +1037,10 @@ msgstr "" msgid "Pairing code" msgstr "" -#: public/views/paperWallet.html:30 -msgid "Paper Wallet Private Key" +#: public/views/paperWallet.html:79 +msgid "Paper wallets are just textcoins. Scan the paper wallet's QR code using the camera icon in the upper right corner or input the 12 words of the textcoin manually on the \"Receive\" tab." msgstr "" -#: public/views/paperWallet.html:37 #: public/views/paperWallet.html:39 msgid "Passphrase" msgstr "" @@ -1069,7 +1061,7 @@ msgstr "" msgid "Pay and offer" msgstr "" -#: src/js/services/correspondentListService.js:113 +#: src/js/services/correspondentListService.js:117 msgid "Pay to this address" msgstr "" @@ -1158,8 +1150,8 @@ msgstr "" msgid "Private assets (such as blackbytes) are not recovered." msgstr "" -#: src/js/controllers/walletHome.js:1813 -#: src/js/controllers/walletHome.js:1889 +#: src/js/controllers/walletHome.js:1825 +#: src/js/controllers/walletHome.js:1901 msgid "Private payloads sent" msgstr "" @@ -1195,7 +1187,7 @@ msgstr "" msgid "Question:" msgstr "" -#: src/js/controllers/index.js:668 +#: src/js/controllers/index.js:669 msgid "Receive" msgstr "" @@ -1224,7 +1216,7 @@ msgstr "" msgid "Recreating Wallet..." msgstr "" -#: src/js/controllers/index.js:228 +#: src/js/controllers/index.js:229 msgid "Refused" msgstr "" @@ -1232,7 +1224,7 @@ msgstr "" msgid "Release Information" msgstr "" -#: public/views/modals/destination-address.html:84 +#: public/views/modals/destination-address.html:85 msgid "Remove" msgstr "" @@ -1287,7 +1279,7 @@ msgid "SET" msgstr "" #: public/views/editCorrespondentDevice.html:41 -#: public/views/modals/destination-address.html:132 +#: public/views/modals/destination-address.html:133 #: public/views/preferencesAlias.html:14 #: public/views/preferencesDeviceName.html:14 #: public/views/preferencesEditAttestorAddress.html:14 @@ -1302,14 +1294,10 @@ msgstr "" msgid "Saving preferences..." msgstr "" -#: public/views/preferences.html:69 +#: public/views/preferences.html:76 msgid "Scan Fingerprint" msgstr "" -#: public/views/paperWallet.html:44 -msgid "Scan Wallet Funds" -msgstr "" - #: public/views/walletHome.html:121 msgid "Scan status finished with error" msgstr "" @@ -1318,7 +1306,7 @@ msgstr "" msgid "Scan the above QR code using the other device, or send this pairing code to the other device:" msgstr "" -#: src/js/controllers/index.js:1623 +#: src/js/controllers/index.js:1651 msgid "Scan your fingerprint please" msgstr "" @@ -1330,10 +1318,6 @@ msgstr "" msgid "Scanning for addresses..." msgstr "" -#: public/views/paperWallet.html:18 -msgid "Scanning wallet funds..." -msgstr "" - #: public/views/paymentUri.html:30 msgid "Select a wallet" msgstr "" @@ -1342,6 +1326,10 @@ msgstr "" msgid "Select subwallet" msgstr "" +#: public/views/preferencesHiddenAssets.html:29 +msgid "Select the assets to hide in the wallet" +msgstr "" + #: public/views/authConfirmation.html:10 msgid "Select your identity" msgstr "" @@ -1349,7 +1337,7 @@ msgstr "" #: public/views/includes/transaction.html:10 #: public/views/walletHome.html:497 #: public/views/walletHome.html:596 -#: src/js/controllers/index.js:672 +#: src/js/controllers/index.js:673 msgid "Send" msgstr "" @@ -1377,10 +1365,6 @@ msgstr "" msgid "Send this profile" msgstr "" -#: public/views/paperWallet.html:19 -msgid "Sending funds..." -msgstr "" - #: public/views/walletHome.html:84 msgid "Sending..." msgstr "" @@ -1440,13 +1424,10 @@ msgid "Sign" msgstr "" #: public/views/modals/sign-message.html:8 +#: src/js/controllers/index.js:408 msgid "Sign message" msgstr "" -#: src/js/controllers/index.js:407 -msgid "Sign message \"\" by address ?" -msgstr "" - #: public/views/modals/signed-message.html:8 msgid "Signed message" msgstr "" @@ -1474,7 +1455,7 @@ msgstr "" msgid "Specify Seed..." msgstr "" -#: public/views/preferences.html:63 +#: public/views/preferences.html:70 #: public/views/preferencesGlobal.html:86 msgid "Spending Restrictions" msgstr "" @@ -1483,25 +1464,21 @@ msgstr "" msgid "Still not done" msgstr "" -#: src/js/controllers/correspondentDevice.js:1269 +#: src/js/controllers/correspondentDevice.js:1273 msgid "Store" msgstr "" #: src/js/controllers/copayers.js:76 -#: src/js/controllers/export.js:141 -#: src/js/controllers/export.js:166 -#: src/js/controllers/index.js:265 -#: src/js/controllers/index.js:293 +#: src/js/controllers/export.js:142 +#: src/js/controllers/export.js:167 +#: src/js/controllers/index.js:266 +#: src/js/controllers/index.js:294 #: src/js/controllers/preferencesDelete.js:56 -#: src/js/controllers/walletHome.js:1813 -#: src/js/controllers/walletHome.js:1889 +#: src/js/controllers/walletHome.js:1825 +#: src/js/controllers/walletHome.js:1901 msgid "Success" msgstr "" -#: public/views/paperWallet.html:64 -msgid "Sweep Wallet" -msgstr "" - #: public/views/preferencesAdvanced.html:19 msgid "Sweep paper wallet" msgstr "" @@ -1518,6 +1495,10 @@ msgstr "" msgid "TOR" msgstr "" +#: public/views/preferencesTor.html:12 +msgid "TOR enabled" +msgstr "" + #: public/views/walletHome.html:117 #: public/views/walletHome.html:122 #: public/views/walletHome.html:632 @@ -1632,7 +1613,7 @@ msgstr "" #: public/views/modals/tx-details.html:36 #: public/views/modals/tx-details.html:71 #: public/views/walletHome.html:699 -#: src/js/controllers/index.js:1430 +#: src/js/controllers/index.js:1458 msgid "To" msgstr "" @@ -1652,7 +1633,7 @@ msgstr "" msgid "To byteball address" msgstr "" -#: src/js/controllers/index.js:1433 +#: src/js/controllers/index.js:1461 msgid "To email" msgstr "" @@ -1692,11 +1673,11 @@ msgstr "" msgid "Trusted nodes" msgstr "" -#: src/js/controllers/correspondentDevice.js:1224 +#: src/js/controllers/correspondentDevice.js:1228 msgid "US state" msgstr "" -#: src/js/controllers/walletHome.js:846 +#: src/js/controllers/walletHome.js:851 msgid "Unable to send transaction proposal" msgstr "" @@ -1737,7 +1718,7 @@ msgstr "" msgid "Values" msgstr "" -#: src/js/controllers/correspondentDevice.js:1246 +#: src/js/controllers/correspondentDevice.js:1250 msgid "Verifying the profile..." msgstr "" @@ -1859,7 +1840,7 @@ msgid "Wrong password" msgstr "" #: public/views/authConfirmation.html:17 -#: src/js/controllers/index.js:517 +#: src/js/controllers/index.js:518 msgid "Yes" msgstr "" @@ -1926,6 +1907,10 @@ msgstr "" msgid "available" msgstr "" +#: src/js/controllers/index.js:408 +msgid "by address" +msgstr "" + #: public/views/modals/offer-contract.html:77 msgid "can unlock the contract" msgstr "" @@ -2049,19 +2034,19 @@ msgstr "" msgid "send" msgstr "" -#: src/js/controllers/walletHome.js:777 +#: src/js/controllers/walletHome.js:782 msgid "send email" msgstr "" -#: src/js/controllers/walletHome.js:1002 -#: src/js/controllers/walletHome.js:1098 -#: src/js/controllers/walletHome.js:1153 -#: src/js/controllers/walletHome.js:1299 -#: src/js/controllers/walletHome.js:1336 -#: src/js/controllers/walletHome.js:1343 -#: src/js/controllers/walletHome.js:919 -#: src/js/controllers/walletHome.js:954 -#: src/js/controllers/walletHome.js:989 +#: src/js/controllers/walletHome.js:1010 +#: src/js/controllers/walletHome.js:1106 +#: src/js/controllers/walletHome.js:1161 +#: src/js/controllers/walletHome.js:1307 +#: src/js/controllers/walletHome.js:1344 +#: src/js/controllers/walletHome.js:1351 +#: src/js/controllers/walletHome.js:927 +#: src/js/controllers/walletHome.js:962 +#: src/js/controllers/walletHome.js:997 msgid "sending" msgstr "" @@ -2085,6 +2070,10 @@ msgstr "" msgid "to" msgstr "" +#: src/js/controllers/index.js:311 +msgid "together with" +msgstr "" + #: public/views/walletHome.html:462 #: public/views/walletHome.html:473 msgid "too long!" @@ -2094,6 +2083,10 @@ msgstr "" msgid "valid" msgstr "" +#: src/js/controllers/walletHome.js:879 +msgid "wait for sync to complete before sending payments" +msgstr "" + #: public/views/modals/select-subwallet.html:37 msgid "with" msgstr "" @@ -2116,15 +2109,7 @@ msgstr "" msgid "{{buttonLabel}}" msgstr "" -#: public/views/modals/confirmation.html:11 -msgid "{{cancel_label || 'Cancel'}}" -msgstr "" - -#: public/views/modals/confirmation.html:6 -msgid "{{confirm_label || 'Yes'}}" -msgstr "" - -#: src/js/controllers/walletHome.js:1930 +#: src/js/controllers/walletHome.js:1942 msgid "{{fee}} will be deducted for bitcoin networking fees" msgstr "" @@ -2132,10 +2117,6 @@ msgstr "" msgid "{{hrd.destinationAddress}} can be spent if:" msgstr "" -#: public/views/walletHome.html:395 -msgid "{{index.arrBalances[index.assetIndex].is_private ? 'To my other wallet' : 'To byteball address or email or username'}}" -msgstr "" - #: public/views/copayers.html:26 #: public/views/includes/walletInfo.html:2 msgid "{{index.m}}-of-{{index.n}}" @@ -2145,6 +2126,6 @@ msgstr "" msgid "{{item.m}}-of-{{item.n}}" msgstr "" -#: public/views/preferencesGlobal.html:29 -msgid "{{prefGlobal.torEnabled?'On':'Off'}}" +#: public/views/modals/destination-address.html:73 +msgid "{{w.m}} of {{w.n}}" msgstr "" diff --git a/package.json b/package.json index 9a820527e..f48405f88 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "byteball-tn", "description": "Smart payments made simple", "author": "Byteball", - "version": "2.5.0t", + "version": "2.6.0t", "keywords": [ "wallet", "byteball", diff --git a/public/views/export.html b/public/views/export.html index 7eb0a086b..c57b78659 100644 --- a/public/views/export.html +++ b/public/views/export.html @@ -44,7 +44,7 @@

Compress the file? (Slower)
- +
diff --git a/public/views/modals/destination-address.html b/public/views/modals/destination-address.html index 66e95c566..aca1eaeb2 100644 --- a/public/views/modals/destination-address.html +++ b/public/views/modals/destination-address.html @@ -69,7 +69,8 @@

{{(w.name || w.id) | limitTo: 1}}
{{w.name || w.id}}
-
{{w.m}} of {{w.n}} +
+ {{w.m}} of {{w.n}} [Testnet]
diff --git a/public/views/modals/tx-details.html b/public/views/modals/tx-details.html index c6ceab0f2..6539fbc77 100644 --- a/public/views/modals/tx-details.html +++ b/public/views/modals/tx-details.html @@ -99,7 +99,7 @@

Details

{{btx.feeStr + (exchangeRates.GBYTE_USD ? ' (≈ $'+(btx.fee * exchangeRates.GBYTE_USD / 1e9).toLocaleString([], {maximumFractionDigits: 5})+')' : '') }}
  • -
    Unit:
    +
    ID:
  • diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index 8c1c31901..a4d277e4f 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -1,11 +1,11 @@
    + ng-init="titleSection='Sweep paper wallet'; goBackToState = true; showCamera = true;">
    -

    + + +
    + Paper wallets are just textcoins. Scan the paper wallet's QR code using the camera icon in the upper right corner or input the 12 words of the textcoin manually on the "Receive" tab.
    diff --git a/public/views/preferences.html b/public/views/preferences.html index a59e94dae..5e226531a 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -53,6 +53,13 @@

    + +
  • + +
    Hidden assets
    +
  • + +

  • diff --git a/public/views/preferencesBbUnit.html b/public/views/preferencesBbUnit.html index 9da81c181..1d55e3470 100644 --- a/public/views/preferencesBbUnit.html +++ b/public/views/preferencesBbUnit.html @@ -1,7 +1,7 @@
    + ng-init="titleSection='Unit for blackbytes'; goBackToState = true; noColor = true">
    diff --git a/public/views/preferencesGlobal.html b/public/views/preferencesGlobal.html index 0e28c4b24..3ece56ba1 100644 --- a/public/views/preferencesGlobal.html +++ b/public/views/preferencesGlobal.html @@ -26,7 +26,7 @@

  • - {{prefGlobal.torEnabled?'On':'Off'}} + {{(prefGlobal.torEnabled?'On':'Off')|translate}}
    TOR
    diff --git a/public/views/preferencesHiddenAssets.html b/public/views/preferencesHiddenAssets.html new file mode 100644 index 000000000..0b01875d4 --- /dev/null +++ b/public/views/preferencesHiddenAssets.html @@ -0,0 +1,47 @@ +
    +
    + +
    + + + +

    Select the assets to hide in the wallet

    + + + + + + +
    + {{assetData.name}} + + +
    + +
    +
    diff --git a/public/views/preferencesTor.html b/public/views/preferencesTor.html index b08a1523f..acce43f09 100644 --- a/public/views/preferencesTor.html +++ b/public/views/preferencesTor.html @@ -9,7 +9,7 @@

    -
    TOR enabled
    +
    TOR enabled
    diff --git a/public/views/preferencesUnit.html b/public/views/preferencesUnit.html index 9a3655771..aca4b087f 100644 --- a/public/views/preferencesUnit.html +++ b/public/views/preferencesUnit.html @@ -1,7 +1,7 @@
    + ng-init="titleSection='Unit for bytes'; goBackToState = true; noColor = true">
    diff --git a/public/views/walletHome.html b/public/views/walletHome.html index dc5b0bae6..c0c232934 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -308,7 +308,7 @@

  • -
    {{index.arrBalances[index.assetIndex].is_private ? 'To my other wallet' : 'To byteball address or email or username'}}
    +
    {{(index.arrBalances[index.assetIndex].is_private ? 'To my other wallet' : 'To byteball address or email or username')|translate}}
    Share via message
    @@ -424,7 +424,7 @@

    - + diff --git a/src/css/main.css b/src/css/main.css index db2b80915..8fcf27c06 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1595,4 +1595,7 @@ input.ng-invalid-match, input.ng-invalid-match:focus { form[name="chatForm"] .f-dropdown.drop-top > *:last-child { margin-bottom: -2px; +} +a.suggest-command { + border-bottom: 1px dotted #3498DB; } \ No newline at end of file diff --git a/src/js/controllers/correspondentDevice.js b/src/js/controllers/correspondentDevice.js index 2b63804f4..1639d136b 100644 --- a/src/js/controllers/correspondentDevice.js +++ b/src/js/controllers/correspondentDevice.js @@ -1038,6 +1038,10 @@ angular.module('copayApp.controllers').controller('correspondentDeviceController $scope.message = command; $scope.send(); }; + + $scope.suggestCommand = function(command){ + $scope.message = command; + }; $scope.openExternalLink = function(url){ if (typeof nw !== 'undefined') diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js index d9d89ed17..6b78e75d8 100644 --- a/src/js/controllers/export.js +++ b/src/js/controllers/export.js @@ -24,6 +24,7 @@ angular.module('copayApp.controllers').controller('exportController', self.isCordova = isCordova; self.bCompression = false; self.connection = null; + $scope.downloadsDir = (process.env.HOME || process.env.USERPROFILE || '~') + require('path').sep +'Downloads'; function addDBAndConfToZip(cb) { var dbDirPath = fileSystemService.getDatabaseDirPath() + '/'; diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index c0a79a0cd..100b214a5 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -20,6 +20,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.historyShowLimit = 10; self.updatingTxHistory = {}; self.bSwipeSuspended = false; + self.assetsSet = {}; self.arrBalances = []; self.assetIndex = 0; self.$state = $state; @@ -307,7 +308,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r // my own address is not included in arrCorrespondentInfos because I'm not my correspondent var arrNames = arrCorrespondentInfos.map(function(correspondent){ return correspondent.name; }); var name_list = arrNames.join(", "); - var question = gettextCatalog.getString('Create new wallet '+walletName+' together with '+name_list+' ?'); + var question = gettextCatalog.getString('Create new wallet') + ' ' + walletName + ' ' + gettextCatalog.getString('together with') + ' ' + name_list + ' ?'; requestApproval(question, { ifYes: function(){ console.log("===== YES CLICKED") @@ -404,7 +405,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r } if (objUnit.signed_message){ - var question = gettextCatalog.getString('Sign message "'+objUnit.signed_message+'" by address '+objAddress.address+'?'); + var question = gettextCatalog.getString('Sign message') + ' ' + objUnit.signed_message + ' ' + gettextCatalog.getString('by address') + ' ' + objAddress.address+'?'; requestApproval(question, { ifYes: function(){ createAndSendSignature(); @@ -726,6 +727,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.availableBalanceStr = null; self.lockedBalanceStr = null; + self.assetsSet = {}; self.arrBalances = []; self.assetIndex = 0; self.shared_address = null; @@ -1002,16 +1004,38 @@ angular.module('copayApp.controllers').controller('indexController', function($r var fc = profileService.focusedClient; fc.isSingleAddress = self.isSingleAddress; }; + + self.getCurrentWalletHiddenAssets = function () { + var hiddenAssets = configService.getSync().hiddenAssets; + var fc = profileService.focusedClient; + var walletId = fc.credentials.walletId; + if (hiddenAssets.hasOwnProperty(walletId)) { + return hiddenAssets[walletId]; + } else { + return {}; + } + }; + + self.isAssetHidden = function (asset, assetsSet) { + if (!assetsSet) { + assetsSet = self.getCurrentWalletHiddenAssets(); + } + return assetsSet[asset]; + }; self.setBalance = function(assocBalances, assocSharedBalances) { if (!assocBalances) return; var config = configService.getSync().wallet.settings; + var fc = profileService.focusedClient; + var hiddenAssets = self.getCurrentWalletHiddenAssets(); + console.log('setBalance hiddenAssets:', hiddenAssets); // Selected unit self.unitValue = config.unitValue; self.unitName = config.unitName; self.bbUnitName = config.bbUnitName; - + + self.assetsSet = {}; self.arrBalances = []; for (var asset in assocBalances){ var balanceInfo = assocBalances[asset]; @@ -1048,6 +1072,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r } } } + self.assetsSet[asset] = balanceInfo; + if (self.isAssetHidden(asset, hiddenAssets)) { + continue; + } self.arrBalances.push(balanceInfo); } self.assetIndex = self.assetIndex || 0; diff --git a/src/js/controllers/preferencesBbUnit.js b/src/js/controllers/preferencesBbUnit.js index 2b191bd04..884f567ff 100644 --- a/src/js/controllers/preferencesBbUnit.js +++ b/src/js/controllers/preferencesBbUnit.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesBbUnitController', - function($rootScope, $scope, $log, configService, go) { + function($rootScope, $scope, $log, configService, go, $deepStateRedirect) { var config = configService.getSync(); this.bbUnitName = config.wallet.settings.bbUnitName; this.unitOpts = [ @@ -81,7 +81,15 @@ angular.module('copayApp.controllers').controller('preferencesBbUnitController', configService.set(opts, function(err) { if (err) $log.warn(err); $scope.$emit('Local/UnitSettingUpdated'); - go.preferencesGlobal(); + if ($rootScope.tab === 'send') { + $deepStateRedirect.reset('walletHome'); + go.path('walletHome', function() { + $rootScope.$emit('Local/SetTab', 'send'); + }); + } + else { + go.preferencesGlobal(); + } }); }; diff --git a/src/js/controllers/preferencesHiddenAssets.js b/src/js/controllers/preferencesHiddenAssets.js new file mode 100644 index 000000000..f2ae62a36 --- /dev/null +++ b/src/js/controllers/preferencesHiddenAssets.js @@ -0,0 +1,91 @@ +'use strict'; + +angular.module('copayApp.controllers') + .controller('preferencesHiddenAssetsCtrl', PreferencesHiddenAssetsCtrl); + +PreferencesHiddenAssetsCtrl.$inject = ['$scope','configService']; +function PreferencesHiddenAssetsCtrl($scope, configService) { + var ctrl = this; + var configHiddenAssets = configService.getSync().hiddenAssets; + var indexScope = $scope.index; + var walletId = indexScope.walletId; + var hiddenAssetsSet = {}; + if (configHiddenAssets.hasOwnProperty(walletId)) { + hiddenAssetsSet = Object.assign({}, configHiddenAssets[walletId]); + } + + var assetsSet = indexScope.assetsSet; + var resAssetsData = []; + + Object.keys(assetsSet).forEach(function (asset) { + var balanceInfo = assetsSet[asset]; + resAssetsData.push({ + key: asset, + name: balanceInfo.name || asset, + value: isAssetHidden(asset), + }); + }); + + ctrl.arrAssetsData = resAssetsData; + ctrl.isChanged = false; + ctrl.isOneAssetLeft = false; + + checkOneAssetLeft(); + + ctrl.hanldeAssetChangeVisibility = function (assetData) { + var prevValue = hiddenAssetsSet[assetData.key]; + if (prevValue === assetData.value) { + return; + } + + hiddenAssetsSet[assetData.key] = assetData.value; + checkOneAssetLeft(); + saveConfig(); + ctrl.isChanged = true; + }; + + ctrl.isSwitchAssetDisabled = function (assetData) { + return !assetData.value && ctrl.isOneAssetLeft; + }; + + $scope.$on("$destroy", function() { + if (ctrl.isChanged) { + indexScope.updateBalance(); + } + }); + + function checkOneAssetLeft() { + var countAssetLeft = 0; + ctrl.arrAssetsData.forEach(function (assetData) { + if (!assetData.value) { + countAssetLeft++; + } + }); + ctrl.isOneAssetLeft = countAssetLeft <= 1; + } + + function isAssetHidden(asset) { + return indexScope.isAssetHidden(asset, hiddenAssetsSet); + } + + function saveConfig() { + var data = {}; + data[walletId] = hiddenAssetsSet; + Object.keys(configHiddenAssets).forEach(function (wId) { + if (wId === walletId) { + return; + } + data[wId] = configHiddenAssets[wId]; + }); + + configService.set( + { + hiddenAssets: data + }, + function (err) { + if (err) + return $scope.$emit('Local/DeviceError', err); + } + ); + } +} diff --git a/src/js/controllers/preferencesUnit.js b/src/js/controllers/preferencesUnit.js index 77f885b5a..ceaf6a9dc 100644 --- a/src/js/controllers/preferencesUnit.js +++ b/src/js/controllers/preferencesUnit.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesUnitController', - function($rootScope, $scope, $log, configService, go) { + function($rootScope, $scope, $log, configService, go, $deepStateRedirect) { var config = configService.getSync(); this.unitName = config.wallet.settings.unitName; this.unitOpts = [ @@ -81,7 +81,15 @@ angular.module('copayApp.controllers').controller('preferencesUnitController', configService.set(opts, function(err) { if (err) $log.warn(err); $scope.$emit('Local/UnitSettingUpdated'); - go.preferencesGlobal(); + if ($rootScope.tab === 'send') { + $deepStateRedirect.reset('walletHome'); + go.path('walletHome', function() { + $rootScope.$emit('Local/SetTab', 'send'); + }); + } + else { + go.preferencesGlobal(); + } }); }; diff --git a/src/js/controllers/recoveryFromSeed.js b/src/js/controllers/recoveryFromSeed.js index 75011849e..dd4031753 100644 --- a/src/js/controllers/recoveryFromSeed.js +++ b/src/js/controllers/recoveryFromSeed.js @@ -140,7 +140,8 @@ angular.module('copayApp.controllers').controller('recoveryFromSeed', (currentAccount < accounts.length) ? startAddToNewWallet(0) : cb(); } } else { - addAddress(self.assocIndexesToWallets[accounts[currentAccount]], 0, 0, assocMaxAddressIndexes[accounts[currentAccount]].main + 20); + var maxIndex = assocMaxAddressIndexes[accounts[currentAccount]].main ? (assocMaxAddressIndexes[accounts[currentAccount]].main + 20) : 0; + addAddress(self.assocIndexesToWallets[accounts[currentAccount]], 0, 0, maxIndex); } } @@ -148,7 +149,7 @@ angular.module('copayApp.controllers').controller('recoveryFromSeed', startAddToNewWallet(0); } - function createWallets(arrWalletIndexes, cb) { + function createWallets(arrWalletIndexes, assocMaxAddressIndexes, cb) { function createWallet(n) { var account = parseInt(arrWalletIndexes[n]); @@ -161,8 +162,11 @@ angular.module('copayApp.controllers').controller('recoveryFromSeed', opts.extendedPrivateKey = self.xPrivKey; opts.mnemonic = self.inputMnemonic; opts.account = account; + opts.isSingleAddress = assocMaxAddressIndexes[account].main === 0 && assocMaxAddressIndexes[account].change === undefined; profileService.createWallet(opts, function(err, walletId) { + if (opts.isSingleAddress) + profileService.setSingleAddressFlag(true); self.assocIndexesToWallets[account] = walletId; n++; (n < arrWalletIndexes.length) ? createWallet(n) : cb(); @@ -180,13 +184,14 @@ angular.module('copayApp.controllers').controller('recoveryFromSeed', var assocMaxAddressIndexes = {}; function checkAndAddCurrentAddresses(is_change) { - if (!assocMaxAddressIndexes[currentWalletIndex]) assocMaxAddressIndexes[currentWalletIndex] = { - main: 0, - change: 0 - }; + var type = is_change ? 'change' : 'main'; + var batchSize = assocMaxAddressIndexes[currentWalletIndex] ? 20 : 1; // first invocation checks only 1 address to detect single-address wallets + if (!assocMaxAddressIndexes[currentWalletIndex]) + assocMaxAddressIndexes[currentWalletIndex] = {}; var arrTmpAddresses = []; - for (var i = 0; i < 20; i++) { - var index = (is_change ? assocMaxAddressIndexes[currentWalletIndex].change : assocMaxAddressIndexes[currentWalletIndex].main) + i; + var startIndex = (assocMaxAddressIndexes[currentWalletIndex][type] === undefined) ? 0 : (assocMaxAddressIndexes[currentWalletIndex][type] + 1); + for (var i = 0; i < batchSize; i++) { + var index = startIndex + i; arrTmpAddresses.push(objectHash.getChash160(["sig", {"pubkey": wallet_defined_by_keys.derivePubkey(xPubKey, 'm/' + is_change + '/' + index)}])); } myWitnesses.readMyWitnesses(function (arrWitnesses) { @@ -206,15 +211,12 @@ angular.module('copayApp.controllers').controller('recoveryFromSeed', } if (Object.keys(response).length) { lastUsedWalletIndex = currentWalletIndex; - if (is_change) { - assocMaxAddressIndexes[currentWalletIndex].change += 20; - } else { - assocMaxAddressIndexes[currentWalletIndex].main += 20; - } + assocMaxAddressIndexes[currentWalletIndex][type] = startIndex + batchSize - 1; checkAndAddCurrentAddresses(is_change); } else { if (is_change) { - if(assocMaxAddressIndexes[currentWalletIndex].change === 0 && assocMaxAddressIndexes[currentWalletIndex].main === 0) delete assocMaxAddressIndexes[currentWalletIndex]; + if(assocMaxAddressIndexes[currentWalletIndex].change === undefined && assocMaxAddressIndexes[currentWalletIndex].main === undefined) + delete assocMaxAddressIndexes[currentWalletIndex]; currentWalletIndex++; if(currentWalletIndex - lastUsedWalletIndex > 3){ cb(assocMaxAddressIndexes); @@ -245,7 +247,7 @@ angular.module('copayApp.controllers').controller('recoveryFromSeed', var myDeviceAddress = objectHash.getDeviceAddress(ecdsa.publicKeyCreate(self.xPrivKey.derive("m/1'").privateKey.bn.toBuffer({size: 32}), true).toString('base64')); profileService.replaceProfile(self.xPrivKey.toString(), self.inputMnemonic, myDeviceAddress, function () { device.setDevicePrivateKey(self.xPrivKey.derive("m/1'").privateKey.bn.toBuffer({size: 32})); - createWallets(arrWalletIndexes, function () { + createWallets(arrWalletIndexes, assocMaxAddressIndexes, function () { createAddresses(assocMaxAddressIndexes, function () { self.scanning = false; $rootScope.$emit('Local/ShowAlert', arrWalletIndexes.length + " wallets recovered, please restart the application to finish.", 'fi-check', function () { diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index aa81abf4a..14c1565ff 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -193,6 +193,9 @@ angular.module('copayApp.controllers') return; } $scope.list = ab; + $timeout(function() { + $scope.$digest(); + }); }); }; @@ -614,7 +617,9 @@ angular.module('copayApp.controllers') } catch (e) {}; $timeout(function(){ - angular.element(e).triggerHandler('click'); + try { + angular.element(e).triggerHandler('click'); + } catch (e) {}; }); }, true); }); @@ -870,6 +875,9 @@ angular.module('copayApp.controllers') var asset = assetInfo.asset; console.log("asset " + asset); + if (conf.bLight && indexScope.copayers.length > 1 && indexScope.onGoingProcess['Syncing']) //wait for sync before sending + return self.setSendError(gettext("wait for sync to complete before sending payments")); + if (isMultipleSend) { if (assetInfo.is_private) return self.setSendError("private assets can not be sent to multiple addresses"); @@ -1172,7 +1180,7 @@ angular.module('copayApp.controllers') } var binding = self.binding; self.resetForm(); - $rootScope.$emit("NewOutgoingTx"); + // $rootScope.$emit("NewOutgoingTx"); // we are already updating UI in response to new_my_transactions event which is triggered by broadcast if (original_address){ var db = require('byteballcore/db.js'); db.query("INSERT INTO original_addresses (unit, address, original_address) VALUES(?,?,?)", @@ -1514,16 +1522,14 @@ angular.module('copayApp.controllers') // form.amount.$setViewValue("" + amount); // form.amount.$isValid = true; this.lockAmount = true; - $timeout(function() { - form.amount.$setViewValue("" + profileService.getAmountInDisplayUnits(amount, asset)); - form.amount.$isValid = true; - form.amount.$render(); - }); + form.amount.$setViewValue("" + profileService.getAmountInDisplayUnits(amount, asset)); + form.amount.$isValid = true; + form.amount.$render(); } - else { + else { this.lockAmount = false; + form.amount.$setViewValue(""); form.amount.$pristine = true; - form.amount.$setViewValue(''); form.amount.$render(); } // form.amount.$render(); @@ -1572,10 +1578,12 @@ angular.module('copayApp.controllers') $timeout(function() { if (form && form.amount) { + if (!$scope.$root) $scope.$root = {}; form.amount.$pristine = true; - form.amount.$setViewValue(''); - if (form.amount) + if (form.amount) { + form.amount.$setViewValue(''); form.amount.$render(); + } if (form.merkle_proof) { form.merkle_proof.$setViewValue(''); @@ -1696,6 +1704,15 @@ angular.module('copayApp.controllers') } }; + this.openInExplorer = function(unit) { + var testnet = home.isTestnet ? 'testnet' : ''; + var url = 'https://' + testnet + 'explorer.byteball.org/#' + unit; + if (typeof nw !== 'undefined') + nw.Shell.openExternal(url); + else if (isCordova) + cordova.InAppBrowser.open(url, '_system'); + }; + this.openTxModal = function(btx) { $rootScope.modalOpened = true; var self = this; @@ -1778,12 +1795,7 @@ angular.module('copayApp.controllers') }; $scope.openInExplorer = function() { - var testnet = home.isTestnet ? 'testnet' : ''; - var url = 'https://' + testnet + 'explorer.byteball.org/#' + btx.unit; - if (typeof nw !== 'undefined') - nw.Shell.openExternal(url); - else if (isCordova) - cordova.InAppBrowser.open(url, '_system'); + return self.openInExplorer(btx.unit); }; $scope.copyAddress = function(addr) { diff --git a/src/js/routes.js b/src/js/routes.js index ec79bffe4..d1b58997c 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -247,6 +247,17 @@ angular } }) + .state('preferences.preferencesHiddenAssets', { + url: '/hiddenAssets', + templateUrl: 'views/preferencesHiddenAssets.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main@': { + templateUrl: 'views/preferencesHiddenAssets.html' + }, + } + }) .state('preferences.preferencesAdvanced', { url: '/advanced', templateUrl: 'views/preferencesAdvanced.html', @@ -362,6 +373,17 @@ angular } }) .state('preferencesGlobal.preferencesUnit', { + url: '/preferencesGlobal/unit', + templateUrl: 'views/preferencesUnit.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main@': { + templateUrl: 'views/preferencesUnit.html' + }, + } + }) + .state('walletHome.preferencesUnit', { url: '/unit', templateUrl: 'views/preferencesUnit.html', walletShouldBeComplete: true, @@ -373,6 +395,17 @@ angular } }) .state('preferencesGlobal.preferencesBbUnit', { + url: '/preferencesGlobal/bbUnit', + templateUrl: 'views/preferencesBbUnit.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main@': { + templateUrl: 'views/preferencesBbUnit.html' + }, + } + }) + .state('walletHome.preferencesBbUnit', { url: '/bbUnit', templateUrl: 'views/preferencesBbUnit.html', walletShouldBeComplete: true, diff --git a/src/js/services/animationService.js b/src/js/services/animationService.js index bffdc0cc0..56158bc2a 100644 --- a/src/js/services/animationService.js +++ b/src/js/services/animationService.js @@ -28,6 +28,9 @@ angular.module('copayApp.services').factory('animationService', function(isCordo "preferencesGlobal.preferencesDeviceName": 12, "preferencesGlobal.preferencesLanguage": 12, "preferencesGlobal.preferencesUnit": 12, + "preferencesGlobal.preferencesBbUnit": 12, + "walletHome.preferencesUnit": 12, + "walletHome.preferencesBbUnit": 12, preferencesFee: 12, preferencesAltCurrency: 12, "preferences.preferencesAlias": 12, diff --git a/src/js/services/configService.js b/src/js/services/configService.js index 7bd5f9ea1..5d4994afb 100644 --- a/src/js/services/configService.js +++ b/src/js/services/configService.js @@ -92,9 +92,11 @@ angular.module('copayApp.services').factory('configService', function(storageSer bbUnitCode: 'one', alternativeName: 'US Dollar', alternativeIsoCode: 'USD', - } + }, }, + // hidden assets: key = wallet id, value = set of assets (string: boolean) + hiddenAssets: {}, rates: { url: 'https://insight.bitpay.com:443/api/rates', @@ -214,6 +216,9 @@ angular.module('copayApp.services').factory('configService', function(storageSer if (!(attestorKey in _config.attestorAddresses)) _config.attestorAddresses[attestorKey] = defaultConfig.attestorAddresses[attestorKey]; } + if (!_config.hiddenAssets) { + _config.hiddenAssets = defaultConfig.hiddenAssets; + } if (!_config.deviceName) _config.deviceName = defaultConfig.getDeviceName(); diff --git a/src/js/services/correspondentListService.js b/src/js/services/correspondentListService.js index 0e77be6bb..7546d9b69 100644 --- a/src/js/services/correspondentListService.js +++ b/src/js/services/correspondentListService.js @@ -104,9 +104,13 @@ angular.module('copayApp.services').factory('correspondentListService', function function highlightActions(text, arrMyAddresses){ // return text.replace(/\b[2-7A-Z]{32}\b(?!(\?(amount|asset|device_address|single_address)|"))/g, function(address){ - return text.replace(/(\s|^)([2-7A-Z]{32})([\s.,;!:]|$)/g, function(str, pre, address, post){ + return text.replace(/(.*?\b)([2-7A-Z]{32})(\b.*?)/g, function(str, pre, address, post){ if (!ValidationUtils.isValidAddress(address)) return str; + if (pre.lastIndexOf(')') < pre.lastIndexOf('](')) + return str; + if (post.indexOf('](') < post.indexOf('[') || (post.indexOf('](') > -1) && (post.indexOf('[') == -1)) + return str; // if (arrMyAddresses.indexOf(address) >= 0) // return address; //return ''+address+''; @@ -124,6 +128,8 @@ angular.module('copayApp.services').factory('correspondentListService', function if (!objPaymentRequest) return str; return ''+objPaymentRequest.amountStr+''; + }).replace(/\[(.+?)\]\(suggest-command:(.+?)\)/g, function(str, description, command){ + return ''+description+''; }).replace(/\[(.+?)\]\(command:(.+?)\)/g, function(str, description, command){ return ''+description+''; }).replace(/\[(.+?)\]\(payment:(.+?)\)/g, function(str, description, paymentJsonBase64){ @@ -143,10 +149,9 @@ angular.module('copayApp.services').factory('correspondentListService', function return '[invalid profile]'; return '[Profile of '+objPrivateProfile._label+']'; }).replace(/\[(.+?)\]\(profile-request:([\w,]+?)\)/g, function(str, description, fields_list){ - var arrFields = fields_list.split(','); - return '[Request for profile]'; + return '[Request for profile]'; }).replace(/\[(.+?)\]\(sign-message-request:(.+?)\)/g, function(str, description, message_to_sign){ - return '[Request to sign message: '+message_to_sign+']'; + return '[Request to sign message: '+message_to_sign+']'; }).replace(/\[(.+?)\]\(signed-message:(.+?)\)/g, function(str, description, signedMessageBase64){ var info = getSignedMessageInfoFromJsonBase64(signedMessageBase64); if (!info) @@ -291,7 +296,6 @@ angular.module('copayApp.services').factory('correspondentListService', function return '[invalid profile]'; return '[Profile of '+objPrivateProfile._label+']'; }).replace(/\[(.+?)\]\(profile-request:([\w,]+?)\)/g, function(str, description, fields_list){ - var arrFields = fields_list.split(','); return '[Request for profile fields '+fields_list+']'; }).replace(/\[(.+?)\]\(sign-message-request:(.+?)\)/g, function(str, description, message_to_sign){ return '[Request to sign message: '+message_to_sign+']'; diff --git a/src/js/services/go.js b/src/js/services/go.js index aee06666e..824ce027f 100644 --- a/src/js/services/go.js +++ b/src/js/services/go.js @@ -194,7 +194,26 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope, var conf = require('byteballcore/conf.js'); var url = new RegExp('^'+conf.program+':', 'i'); var file = new RegExp("\\."+configService.privateTextcoinExt+'$', 'i'); - var arrParts = commandLine.split(' '); // on windows includes exe and all args, on mac just our arg + var tokenize = function(str) { + var tokens = []; + var start = -1; // opening quote index + var lastSpace = -1; + for (var i = 0; i < str.length; i++) { + if (str[i] == '"' || str[i] == '\'') + if (start != -1) { + tokens.push(str.substring(start+1, i)); + start = -1; + } else + start = i; + if (str[i] == ' ' && start == -1) { + if (str.substring(lastSpace+1, i).length) + tokens.push(str.substring(lastSpace+1, i)); + lastSpace = i; + } + } + return (tokens.length > 0) ? tokens : [str]; + } + var arrParts = tokenize(commandLine); // on windows commandLine includes exe and all args, on mac just our arg for (var i=0; i