Skip to content

Commit

Permalink
amazing map directive and ios fix sendtransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
inzhoop committed Oct 5, 2017
1 parent f9b2512 commit 354ad57
Show file tree
Hide file tree
Showing 28 changed files with 129,548 additions and 12 deletions.
8 changes: 7 additions & 1 deletion bower.json
Expand Up @@ -7,5 +7,11 @@
"platform": "~1.3.0",
"ngCordova": "~0.1.23-alpha"
},
"dependencies": {}
"dependencies": {
"angular-openlayers-directive": "^1.20.0"
},
"resolutions": {
"angular": "1.4.3",
"angular-sanitize": "1.4.3"
}
}
16 changes: 15 additions & 1 deletion www/DappLETHs/Store.json
Expand Up @@ -4,7 +4,7 @@
"Name": "Factory - self service",
"Description": "Issue and deploy your Dappleth",
"Network" : "Ropsten",
"List":["F01","F02","F03"]
"List":["F01","F02","F03","F04"]
},
{
"Name": "Generic",
Expand Down Expand Up @@ -98,6 +98,20 @@
"TemplateUrl" : "/dapp_21/index.html",
"ScriptUrl" : "/dapp_21/index.js"
},
{
"GUID" : "F04",
"Name" : "Helbiz",
"Network" : "Ropsten",
"Company" : "Inzhoop",
"Address" : "0x",
"ABI" : [],
"Chatboard" : false,
"Logo" : "dappleths/dapp_22/logo.png",
"Description" : "Share your drive",
"InstallUrl" : "/dapp_22/index.html",
"TemplateUrl" : "/dapp_22/index.html",
"ScriptUrl" : "/dapp_22/index.js"
},
{
"GUID" : "T01",
"Name" : "Greeting",
Expand Down
6 changes: 6 additions & 0 deletions www/index.html
Expand Up @@ -37,6 +37,12 @@
<script src="lib/thirdparty/angular-translate.min.js"></script>
<script src="lib/thirdparty/tmhDynamicLocale.js"></script>
<script src="lib/thirdparty/angular-translate-loader-static-files.min.js"></script>
<!-- openlayers -->
<script src="lib/openlayers/ol.js"></script>
<script src="lib/openlayers/angular-openlayers-directive.js"></script>
<link href="lib/openlayers/ol.css" rel="stylesheet"></link>


<!--script src="lib/phaser/phaser.min.js"></script-->
<script src="lib/phaser/phaser.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion www/js/app.js
Expand Up @@ -7,7 +7,7 @@ var app = angular.module('leth', [
'ionic', 'nfcFilters', 'ngTagsInput', 'angularLoad',
'ionic.contrib.ui.cards', 'ngSanitize', 'ionic.service.core',
'ngCordova', 'ja.qr', 'leth.controllers', 'leth.services',
'ionic-lock-screen', 'pascalprecht.translate', 'tmh.dynamicLocale'])
'ionic-lock-screen', 'pascalprecht.translate', 'tmh.dynamicLocale', 'openlayers-directive'])
.constant('$ionicLoadingConfig', {
template: 'Loading...'
})
Expand Down
8 changes: 8 additions & 0 deletions www/js/controllers/controllers.js
Expand Up @@ -6,6 +6,14 @@ angular.module('leth.controllers', [])
$cordovaBadge,$translate,tmhDynamicLocale,$ionicScrollDelegate, $ionicListDelegate, $cordovaClipboard, $cordovaVibration,
UIService, ENSService, AppService, Chat, PasswordPopup, Transactions, Friends, ExchangeService, Geolocation, nfcService, SwarmService) {

angular.extend($scope, {
center: {
lat: 51.505,
lon: -0.09,
zoom: 8
}
});

window.refresh = function () {
$ionicLoading.show();

Expand Down
3 changes: 1 addition & 2 deletions www/js/services/services.js
Expand Up @@ -318,10 +318,9 @@ angular.module('leth.services', [])
var gas = web3.eth.estimateGas({});
var gasPrice = web3.eth.gasPrice;
console.log("fee: " + fee);
var gPrice = web3.toBigNumber(fee).dividedBy(gas).round();
var gPrice = web3.toBigNumber(fee/gas).round();
console.log(gPrice.toNumber());

//web3.toBigNumber(web3.toWei(fee)/gas);
return $q(function (resolve, reject) {
try {
web3.eth.sendTransaction({
Expand Down
9 changes: 6 additions & 3 deletions www/js/services/svcChat.js
Expand Up @@ -296,6 +296,10 @@ angular.module('leth.services')
});
},
sendTransactionNote: function (transaction) {
var toKey = Friends.get(transaction.to);
//sesinamiku
if(typeof toKey == "undefined") return;

var msg = this.envelop('transaction');
msg.text = 'I sent ' + transaction.symbol + " " + (transaction.value / transaction.unit).toFixed(6) + '&#x1F4B8;';
msg.attach = transaction;
Expand All @@ -308,12 +312,11 @@ angular.module('leth.services')
message: msg
});

var toKey = Friends.get(transaction.to).idkey;

lightwallet.keystore.deriveKeyFromPassword(JSON.parse(localStorage.AppCode).code, function (err, pwDerivedKey) {
var encNote = angular.copy(msg);
encNote.text = lightwallet.encryption.multiEncryptString(local_keystore,pwDerivedKey,msg.text,AppService.idkey(),[toKey.replace("0x",""),AppService.idkey()],hdPath);
encNote.attach = lightwallet.encryption.multiEncryptString(local_keystore,pwDerivedKey,JSON.stringify(transaction),AppService.idkey(),[toKey.replace("0x",""),AppService.idkey()],hdPath);
encNote.text = lightwallet.encryption.multiEncryptString(local_keystore,pwDerivedKey,msg.text,AppService.idkey(),[toKey.idkey.replace("0x",""),AppService.idkey()],hdPath);
encNote.attach = lightwallet.encryption.multiEncryptString(local_keystore,pwDerivedKey,JSON.stringify(transaction),AppService.idkey(),[toKey.idkey.replace("0x",""),AppService.idkey()],hdPath);

var payload = web3.fromUtf8(JSON.stringify(encNote));
var message = svc.wrap(payload);
Expand Down
50 changes: 50 additions & 0 deletions www/lib/angular-openlayers-directive/.bower.json
@@ -0,0 +1,50 @@
{
"name": "angular-openlayers-directive",
"description": "AngularJS directive to embed an interact with maps managed by OpenLayers library",
"keywords": [
"angularjs",
"javascript",
"directive",
"openlayers"
],
"main": [
"dist/angular-openlayers-directive.min.js"
],
"dependencies": {
"angular": "1.4.9",
"angular-sanitize": "1.4.9",
"openlayers": "https://github.com/openlayers/ol3/releases/download/v3.16.0/v3.16.0-dist.zip"
},
"devDependencies": {
"jquery": "*",
"angular-route": "1.4.9",
"angular-mocks": "1.4.9",
"js-polyfills": "^0.1.20"
},
"ignore": [
"**/.*",
"src",
"doc",
"grunt",
"examples",
"test",
"*.md",
"Gruntfile.js",
"package.json",
"bower.json",
"node_modules",
"bower_components"
],
"homepage": "https://github.com/tombatossals/angular-openlayers-directive",
"version": "1.20.0",
"_release": "1.20.0",
"_resolution": {
"type": "version",
"tag": "v1.20.0",
"commit": "108592150325db41b75d5c387210d7a78ef9e17a"
},
"_source": "https://github.com/tombatossals/angular-openlayers-directive.git",
"_target": "^1.20.0",
"_originalSource": "angular-openlayers-directive",
"_direct": true
}
22 changes: 22 additions & 0 deletions www/lib/angular-openlayers-directive/LICENSE
@@ -0,0 +1,22 @@
The MIT License

Copyright (c) 2012-2013 https://github.com/tombatossals/angular-openlayers-directive

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

38 changes: 38 additions & 0 deletions www/lib/angular-openlayers-directive/bower.json
@@ -0,0 +1,38 @@
{
"name": "angular-openlayers-directive",
"description": "AngularJS directive to embed an interact with maps managed by OpenLayers library",
"keywords": [
"angularjs",
"javascript",
"directive",
"openlayers"
],
"main": [
"dist/angular-openlayers-directive.min.js"
],
"dependencies": {
"angular": "1.4.9",
"angular-sanitize": "1.4.9",
"openlayers": "https://github.com/openlayers/ol3/releases/download/v3.16.0/v3.16.0-dist.zip"
},
"devDependencies": {
"jquery": "*",
"angular-route": "1.4.9",
"angular-mocks": "1.4.9",
"js-polyfills": "^0.1.20"
},
"ignore": [
"**/.*",
"src",
"doc",
"grunt",
"examples",
"test",
"*.md",
"Gruntfile.js",
"package.json",
"bower.json",
"node_modules",
"bower_components"
]
}
32 changes: 32 additions & 0 deletions www/lib/angular-openlayers-directive/css/markers.css
@@ -0,0 +1,32 @@
.popup-label {
background-color: #fff;
border: 2px #444 solid;
border-radius: 7px;
-webkit-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75);
-moz-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75);
box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75);
color: #111;
font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
font-weight: bold;
padding: 3px 6px;
position: absolute;
white-space: nowrap;
top: -35px;
left: 20px;
display: none;
}

.popup-label img {
vertical-align: middle;
}

.popup-label.marker:before {
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
content: "";
border-right: 6px solid black;
border-right-color: inherit;
position: absolute;
left: -8px;
top: 5px;
}
25 changes: 25 additions & 0 deletions www/lib/angular-openlayers-directive/css/openlayers.css
@@ -0,0 +1,25 @@
.angular-openlayers-map:-moz-full-screen {
height: 100%;
}
.angular-openlayers-map:-webkit-full-screen {
height: 100%;
}
.angular-openlayers-map:full-screen {
height: 100%;
}

.angular-openlayers-map:not(-moz-full-screen) {
height: 400px;
}

.angular-openlayers-map:not(-webkit-full-screen) {
height: 400px;
}

.angular-openlayers-map:not(full-screen) {
height: 400px;
}
.ol-full-screen {
position: absolute;
top: 50%;
}
@@ -0,0 +1,58 @@
.popup-label {
background-color: #fff;
border: 2px #444 solid;
border-radius: 7px;
-webkit-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75);
-moz-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75);
box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75);
color: #111;
font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
font-weight: bold;
padding: 3px 6px;
position: absolute;
white-space: nowrap;
top: -35px;
left: 20px;
display: none;
}

.popup-label img {
vertical-align: middle;
}

.popup-label.marker:before {
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
content: "";
border-right: 6px solid black;
border-right-color: inherit;
position: absolute;
left: -8px;
top: 5px;
}

.angular-openlayers-map:-moz-full-screen {
height: 100%;
}
.angular-openlayers-map:-webkit-full-screen {
height: 100%;
}
.angular-openlayers-map:full-screen {
height: 100%;
}

.angular-openlayers-map:not(-moz-full-screen) {
height: 400px;
}

.angular-openlayers-map:not(-webkit-full-screen) {
height: 400px;
}

.angular-openlayers-map:not(full-screen) {
height: 400px;
}
.ol-full-screen {
position: absolute;
top: 50%;
}

0 comments on commit 354ad57

Please sign in to comment.